Show the drives a file can be dropped on - #49
Merged
Conversation
A file dropped on the window went to drive 1 or drive 2 depending on the half it landed on. There was no way to know beforehand which drive was which or what each one had inserted, and no sign afterwards of where the file went. The machines with two Disk II cards have four drives and only the first two could be reached. F8 now shows a screen with one area per removable media drive, each with the name of its drive and the image it has inserted, or EMPTY, and the same screen appears for a moment after a drop with the drive that got the file marked. It is a text screen of 80 columns rendered the same way the help is, so SnapshotMessageGenerator takes the number of columns now. The drives register with a label and tell the media they have, so the frontends ask the machine with GetRemovableMediaDrives instead of assuming two. The name of the media is written by the emulation goroutine and read by the frontends, hence the atomic access. The new frontend/shared package holds what the frontends have in common and the emulator library has no place for: the composition of the screen and the mapping from a position to a drive. a2sdl reads the position of the pointer on the desktop when the file is dropped. The mouse motion events do not arrive while another application drags a file, so the last known position was stale and the file could land on the wrong drive. a2sdl3 shows the areas while the file is being dragged over the window, which is something only SDL3 reports. a2ebiten had no drag and drop at all, although the help it shows said otherwise. Ebitengine hides the paths of the files dropped, but it opens the real files and the handle tells the path back, so the images are loaded like on every other frontend, compressed files included.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A file dropped on the window went to drive 1 or drive 2 depending on the half it landed on. There was no way to know beforehand which drive was which or what each one had inserted, and no sign afterwards of where the file went. The machines with two Disk II cards have four removable media drives and only the first two could be reached.
What it does now
F8 shows a screen with one area per removable media drive, each with the name of its drive and the image it has inserted, or
EMPTY, and the area that would get the file marked with a rule above and below. The same screen appears for a moment after a drop, with the drive that got the file marked, so there is always feedback even without pressing F8.It is a text screen of 80 columns rendered the same way the help is, so
SnapshotMessageGeneratortakes the number of columns now.The drives
They register with a label and tell the media they have, so the frontends ask the machine with
GetRemovableMediaDrivesinstead of assuming two: a machine with two Disk II cards shows its four drives and a file can be dropped on any of them. The name of the media is written by the emulation goroutine and read by the frontends, hence the atomic access.frontend/shared
A new package for what the frontends have in common and the emulator library has no place for: the composition of the screen, on a small text canvas, and the mapping from a position on the window to a drive.
Per frontend
Tests
Unit tests in
frontend/sharedfor the position to drive mapping, the word wrapping of the names and a check that the screen built never exceeds 80x24, for one to four drives and every selection. The help texts of the three frontends were verified to stay within 40 columns and 24 lines.