load-save: fix for the current title screen interface - #1619
Open
Alistair-Afton wants to merge 2 commits into
Open
Alistair-Afton wants to merge 2 commits into
Alistair-Afton wants to merge 2 commits into
Conversation
The script still drove the old interface: it wrote sel_menu_line (renamed to selected) and fed SELECT, then looked for a standalone viewscreen_loadgamest save picker that no longer exists. The current title screen manages the whole continue-game flow through its mode field (main menu, world list, save list) and only responds to mouse input, so the script now clicks list rows and follows the mode transitions in a gui.script coroutine. Also searches every world in the list instead of only the first, and verifies the save being loaded matches the requested folder name.
Validated on the current title screen interface; also remove the stale reference to the standalone "load game" screen, which no longer exists.
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.
Summary
load-savestill drove the pre-Steam title screen interface: it wrotesel_menu_line(the field is nowselected), fedSELECT, and then looked for a standaloneviewscreen_loadgamestsave picker that no longer exists. The script was effectively dead.The current
viewscreen_titlestmanages the whole continue-game flow through itsmodefield (main menu -> active world list -> save list) and only responds to mouse input. The script now runs in agui.scriptcoroutine, clicks list rows at their pixel positions, and follows the mode transitions:LEAVESCREENbetween missescur_saveheader instead of trusting the row click, so a missed probe errors out instead of silently loading the wrong saveRelated: DFHack/dfhack#978 (enhancement wishlist; this restores basic functionality). This also unblocks the TODO in
test.lua'sensure_fortressthat wants to load a specified save dir viaload-save.Testing
load-save region1from the main menu: enters world list -> save list -> loadsregion1, verified viaworld.cur_savegame.save_dirload-save bogus: reports "Can't find save: bogus" and leaves the screen on the world list