Closed bendyer closed 5 days ago
The test I haven't ticked off is this one:
Setup: Open Nova Data 2 and Nova Graphics 2. Open sÿst ID 130 in Nova Data 2. Copy and paste all stellars 4 times. Result: All stellars are duplicated, to the limit of 16 NavDefaults but further pastes have no effect.
The actual result is that the underlying stellars are duplicated but the duplicates are not added as NavDefault
s.
The most obvious way to fix this would be to replace the paste
action with one that calls the EditorManager
's document.add
method in the same way that the underlying document paste action does, and then use the returned resources from add
to update the NavDefaults
.
However this would require exposing the ResourceDocument
to plugins, which is not currently done.
I don't think the extra functionality on paste is worth the implementation effort on this one.
Nice work! I agree the extra functionality on paste is not of great importance, though just as a quick thought perhaps you could read the pasteboard to check the number of resources and then forward the call to the document only if there's enough free slots.
I'll try to find time to review...
Thanks for the feedback! Will work through the stylistic stuff, as you can tell I'm new to this whole Swift thing!
Thanks again for your work here, it's really great to have this feature!
A couple of notes on some further changes I made:
I think I initially misunderstood your comment about pasting. When I realised what you meant I decided it's probably best to just remove copy/paste for now.
I also realise you may be on macOS 13 where clipsToBounds
defaults to true, meaning the stellar highlight box may appear differently when you build it than when I build it. I made some tweaks here that may make it look worse to you, but don't worry - the release build will look the same for everyone.
Overview
This change adds a system map reference next to the existing galaxy map reference in the
sÿst
resource template; this refers to a dummysÿsm
resource type for which 2048 entries are provided in Templates.rsrc (one per availablesÿst
resource ID):The editor for this
sÿsm
resource type is based on theGalaxyView
editor, with large-scale modifications made to constrain the set of displayed stellars to the single selected system, and support graphical previews of each stellar object based on the linkedspïn
resource. The system's 16 availableNavDefaults
are shown in a table view on the left of the window, includingNavDefault
index (# 1–4 are hotkeyed in EV), resource ID and name:Interface functionality is essentially the same as the existing galaxy editor; selection is synchronized between the table and the graphical views, multiple objects can be clicked, dragging objects moves them, and double-clicking empty space in the map view creates a new stellar object at that position in the first available
NavDefault
slot.As with the galaxy view, dragging to move existing resources results in the template edit panel for those resources updating immediately; editing the
xPos
/yPos
/Type
fields commits the change to the map view upon closing the template edit panel.Note that the maximum zoom level is fairly zoomed out (displaying smaller than in-game); this is because EVN wraps the player around at ±15,000 pixels from the system origin, so you can reasonably put
spöb
s out to around that range, while the maximum size of anNSView
is 10,000 pixels (i.e. ±5,000). It would of course be possible to implement a different approach to scrolling etc to remove this limitation but I don't think it's worth the effort.Testing
Cases tested:
sÿst
. Open system map editor, double click in empty space to createspöb
. Namespöb
and save. Result: Valid resources are created as expected, system map displays placeholder symbol forspöb
(blue circle).sÿst
ID 130 in Nova Data 2. Result: System displays withspöb
s laid out correctly as in game, with the expected graphics.spöb
template edit panel for that resource. Drag Earth to a new position. Result: "Position in System" fields update to reflect the new position when the object is released.sÿst
ID 130. Result: System displays as it did at end of previous test.sÿst
. Open system map editor. Double-click emptyNavDefault
(s) in table view. Should create newspöb
(s) at 0, 0 (one per selected emptyNavDefault
) and add its/their ID(s) to the selectedNavDefault
(s).sÿst
ID 130 in Nova Data 2. Select both Jupiter and Europa in the map view. Drag them to a new location, then double-click to open the template edit panel for both stellars. Result: The "Position in System" field for both stellars shows their new locations.sÿst
. Open system map editor, double click in empty space to createspöb
. Namespöb
and save. Do this 16 further times. Result: On the last double-click, there is no effect (spöb
creation panel does not appear) because allNavDefault
s for the system are occupied.sÿst
ID 130 in Nova Data 2. Delete ID of Earthspöb
from NavDefault in system edit panel, and close system edit panel. Result: Earth is removed from system map view.sÿst
ID 130 in Nova Data 2. Delete Earthspöb
from thespöb
resource list. Result: Earth is removed from system map view.sÿst
ID 130 in Nova Data 2, and open system map view. Deletespïn
ID 1000 andrlëD
ID 2005. Result: Earth and Jupiter revert to placeholder graphics (blue circle) upon closing and re-opening map view.sÿst
ID 130 in Nova Data 2. Copy and paste all stellars 4 times. Result: All stellars are duplicated, to the limit of 16NavDefault
s but further pastes have no effect.spïn
resources from Nova Graphics 2 into Nova Data 2 and save. Exit, re-launch, and re-open Nova Data 2. Opensÿst
ID 130 in Nova Data 2, and open system map view. Result: Should see placeholder graphics (blue circle) for allspöb
s in map view.PICT
resource ID 6305 from Nova Graphics 1 into Nova Data 2; updatespïn
resource ID 1000 to use resource ID 6305 for both sprite and mask, then set the frame size to 200 x 200. Opensÿst
ID 130 in Nova Data 2 and view the system map. Verify that Earth now shows with the system map graphic.Possible future work
spöb
s in this view, and ofsÿst
s in the galaxy map view, perhaps by hitting the delete key with items selected.sÿst
template edit window could potentially be embedded in this view somehow.