From 02e92b2b582791c49f95fd14ac00388ef5f097d5 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 23 Jun 2025 15:40:23 -0500 Subject: [PATCH] non-mac targets scenario editor must save LastScenario pref --- src/scenedit/scen.actions.cpp | 3 +++ src/scenedit/scen.fileio.cpp | 2 ++ src/scenedit/scen.main.cpp | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 74096acc1..532d1ed4b 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -67,6 +67,8 @@ extern location cur_out; bool small_any_drawn = false; extern bool change_made; +extern void save_prefs(); + rectangle left_buttons[NLS][2]; // 0 - whole, 1 - blue button std::array left_button_status; std::vector right_button_status; @@ -257,6 +259,7 @@ static bool handle_lb_action(int i){ file_to_load = nav_get_scenario(); if(!file_to_load.empty() && load_scenario(file_to_load, scenario)) { set_pref("LastScenario", file_to_load.string()); + save_prefs(); restore_editor_state(); undo_list.clear(); update_edit_menu(); diff --git a/src/scenedit/scen.fileio.cpp b/src/scenedit/scen.fileio.cpp index a3bf1fe1c..ab6ee1feb 100644 --- a/src/scenedit/scen.fileio.cpp +++ b/src/scenedit/scen.fileio.cpp @@ -37,6 +37,7 @@ fs::path temp_file_to_load; std::string last_load_file = "Blades of Exile Scenario"; extern fs::path progDir, tempDir; extern bool cur_scen_is_mac; +extern void save_prefs(); void print_write_position (); void load_spec_graphics(); @@ -1110,6 +1111,7 @@ void save_scenario(bool rename) { } set_pref("LastScenario", toFile.string()); + save_prefs(); extern cUndoList undo_list; undo_list.save(); diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index 67bf12c70..e78b8ce73 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -334,6 +334,8 @@ static void process_args(int argc, char* argv[]) { // On first launch, no need to clear the undo_list set_pref("LastScenario", file); + save_prefs(); + restore_editor_state(); change_made = false; ae_loading = true; @@ -520,6 +522,7 @@ void handle_menu_choice(eMenu item_hit) { undo_list.clear(); update_edit_menu(); set_pref("LastScenario", file_to_load.string()); + save_prefs(); restore_editor_state(); change_made = false; } else if(!file_to_load.empty())