From d18e59ff17ba6737b31677f20505e109596dc189 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 12 Sep 2017 00:04:03 +0200 Subject: [PATCH] Move loadsave dialog --- src/openrct2-ui/input/keyboard_shortcut.c | 6 +++- src/openrct2-ui/windows/Error.cpp | 4 --- .../windows/LoadSave.cpp | 25 ++++++++-------- src/openrct2-ui/windows/MapGen.cpp | 8 +++-- src/openrct2-ui/windows/SavePrompt.cpp | 26 +++++++++++++---- src/openrct2-ui/windows/ServerStart.cpp | 6 ++-- src/openrct2-ui/windows/TitleEditor.cpp | 6 ++-- .../windows/TitleScenarioSelect.cpp | 17 ++++------- src/openrct2-ui/windows/Window.h | 7 ++++- src/openrct2/Editor.cpp | 6 ++-- src/openrct2/game.c | 29 +++++++++++++++---- src/openrct2/game.h | 1 + src/openrct2/interface/window.h | 5 ---- src/openrct2/ride/track_design_save.c | 8 +++-- src/openrct2/windows/EditorBottomToolbar.cpp | 5 +++- .../windows/EditorObjectSelection.cpp | 9 ++++-- src/openrct2/windows/Intent.cpp | 19 ++++++++++-- src/openrct2/windows/Intent.h | 10 +++++-- src/openrct2/windows/Staff.cpp | 2 +- src/openrct2/windows/TopToolbar.cpp | 11 +++++-- 20 files changed, 145 insertions(+), 65 deletions(-) rename src/{openrct2 => openrct2-ui}/windows/LoadSave.cpp (98%) diff --git a/src/openrct2-ui/input/keyboard_shortcut.c b/src/openrct2-ui/input/keyboard_shortcut.c index 8f37bfbdfd..192bd815f1 100644 --- a/src/openrct2-ui/input/keyboard_shortcut.c +++ b/src/openrct2-ui/input/keyboard_shortcut.c @@ -530,7 +530,11 @@ static void shortcut_quick_save_game() save_game(); } else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { - window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE, gS6Info.name); + Intent * intent = intent_create(WC_LOADSAVE); + intent_set_uint(intent, INTENT_EXTRA_4, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent_set_string(intent, INTENT_EXTRA_5, gS6Info.name); + context_open_intent(intent); + intent_release(intent); } } diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index d2b8446248..6fc75dd65b 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -69,8 +69,6 @@ static rct_window_event_list window_error_events = { static char _window_error_text[512]; static uint16 _window_error_num_lines; -extern "C" { - /** * * rct2: 0x0066792F @@ -150,8 +148,6 @@ rct_window * window_error_open(rct_string_id title, rct_string_id message) return w; } -} - /** * * rct2: 0x00667BFE diff --git a/src/openrct2/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp similarity index 98% rename from src/openrct2/windows/LoadSave.cpp rename to src/openrct2-ui/windows/LoadSave.cpp index 9a1e5226d6..4a0aa127d7 100644 --- a/src/openrct2/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -14,20 +14,21 @@ *****************************************************************************/ #pragma endregion -#include "../config/Config.h" -#include "../title/TitleScreen.h" -#include "../core/Memory.hpp" -#include "../Context.h" -#include "Intent.h" +#include +#include +#include +#include +#include +#include #include -#include "../core/Guard.hpp" -#include "../Editor.h" -#include "../game.h" -#include "../interface/widget.h" -#include "../localisation/localisation.h" -#include "../platform/platform.h" -#include "../util/util.h" +#include +#include +#include +#include +#include +#include +#include #pragma region Widgets diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 8cc8686771..694161036a 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -1189,9 +1189,13 @@ static void window_mapgen_heightmap_mouseup(rct_window *w, rct_widgetindex widge // Page widgets case WIDX_HEIGHTMAP_SELECT: - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_IMAGE, nullptr); - window_loadsave_set_loadsave_callback(window_mapgen_heightmap_loadsave_callback); + { + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_IMAGE); + intent.putExtra(INTENT_EXTRA_6, (void *) window_mapgen_heightmap_loadsave_callback); + context_open_intent(&intent); return; + } case WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP: _heightmapSmoothMap = !_heightmapSmoothMap; widget_set_checkbox_value(w, WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, _heightmapSmoothMap); diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index df008b620a..5c0b6d49d9 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include @@ -228,16 +230,28 @@ static void window_save_prompt_mouseup(rct_window *w, rct_widgetindex widgetInde } return; } else { - switch (widgetIndex) { + switch (widgetIndex) + { case WIDX_SAVE: - if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) { - window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE, gS6Info.name); - } else { - save_game_as(); + { + Intent * intent; + + if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) + { + intent = intent_create(WC_LOADSAVE); + intent_set_uint(intent, INTENT_EXTRA_4, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent_set_string(intent, INTENT_EXTRA_5, gS6Info.name); + } + else + { + intent = (Intent *) create_save_game_as_intent(); } window_close(w); - window_loadsave_set_loadsave_callback(window_save_prompt_callback); + intent_set_pointer(intent, INTENT_EXTRA_6, (void *) window_save_prompt_callback); + context_open_intent(intent); + intent_release(intent); break; + } case WIDX_DONT_SAVE: game_load_or_quit_no_save_prompt(); return; diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index 6e0d8b7424..e0f3f9d10c 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -224,8 +224,10 @@ static void window_server_start_mouseup(rct_window *w, rct_widgetindex widgetInd break; case WIDX_LOAD_SERVER: network_set_password(_password); - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME, nullptr); - window_loadsave_set_loadsave_callback(window_server_start_loadsave_callback); + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); + intent.putExtra(INTENT_EXTRA_6, (void *) window_server_start_loadsave_callback); + context_open_intent(&intent); break; } } diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index adcc1d33cb..41420a774c 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -330,8 +330,10 @@ static void window_title_editor_mouseup(rct_window *w, rct_widgetindex widgetInd ////////////////////////////////////////////////////////////////////////////////////////////////////// case WIDX_TITLE_EDITOR_ADD_SAVE: if (!_isSequenceReadOnly && !_isSequencePlaying && !commandEditorOpen) { - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME, nullptr); - window_loadsave_set_loadsave_callback(window_title_editor_add_park_callback); + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); + intent.putExtra(INTENT_EXTRA_6, (void *) window_title_editor_add_park_callback); + context_open_intent(&intent); } break; case WIDX_TITLE_EDITOR_REMOVE_SAVE: diff --git a/src/openrct2-ui/windows/TitleScenarioSelect.cpp b/src/openrct2-ui/windows/TitleScenarioSelect.cpp index 52c6e9e3e1..e852263115 100644 --- a/src/openrct2-ui/windows/TitleScenarioSelect.cpp +++ b/src/openrct2-ui/windows/TitleScenarioSelect.cpp @@ -149,7 +149,7 @@ static bool _showLockedInformation = false; * * rct2: 0x006781B5 */ -static void _window_scenarioselect_open(scenarioselect_callback callback) +rct_window * window_scenarioselect_open(scenarioselect_callback callback) { rct_window* window; sint32 windowWidth; @@ -157,8 +157,9 @@ static void _window_scenarioselect_open(scenarioselect_callback callback) _callback = callback; - if (window_bring_to_front_by_class(WC_SCENARIO_SELECT) != nullptr) - return; + window = window_bring_to_front_by_class(WC_SCENARIO_SELECT); + if (window != nullptr) + return window; // Load scenario list scenario_repository_scan(); @@ -188,6 +189,8 @@ static void _window_scenarioselect_open(scenarioselect_callback callback) window_init_scroll_widgets(window); window->viewport_focus_coordinates.var_480 = -1; window->highlighted_scenario = nullptr; + + return window; } /** @@ -700,11 +703,3 @@ static bool is_locking_enabled(rct_window *w) } return true; } - -extern "C" -{ - void window_scenarioselect_open(scenarioselect_callback callback) - { - _window_scenarioselect_open(callback); - } -} diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 3d771f504a..50456b31f6 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -20,6 +20,8 @@ #include +typedef void (*loadsave_callback)(sint32 result, const utf8 * path); + rct_window * window_about_open(); rct_window * window_changelog_open(); rct_window * window_cheats_open(); @@ -79,6 +81,9 @@ rct_window * window_guest_list_open_with_filter(sint32 type, sint32 index); rct_window * window_staff_fire_prompt_open(rct_peep* peep); void window_title_editor_open(sint32 tab); void window_title_command_editor_open(struct TitleSequence * sequence, sint32 command, bool insert); -void window_scenarioselect_open(scenarioselect_callback callback); +rct_window * window_scenarioselect_open(scenarioselect_callback callback); rct_window * window_error_open(rct_string_id title, rct_string_id message); + +rct_window * window_loadsave_open(sint32 type, char *defaultName); +void window_loadsave_set_loadsave_callback(loadsave_callback cb); diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 67c9312ca6..e92828cb20 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -100,8 +100,10 @@ namespace Editor void ConvertSaveToScenario() { tool_cancel(); - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME, NULL); - window_loadsave_set_loadsave_callback(ConvertSaveToScenarioCallback); + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); + intent.putExtra(INTENT_EXTRA_5, (void *) ConvertSaveToScenarioCallback); + context_open_intent(&intent); } static void ConvertSaveToScenarioCallback(sint32 result, const utf8 * path) diff --git a/src/openrct2/game.c b/src/openrct2/game.c index 7b126ebbe4..adb4b36503 100644 --- a/src/openrct2/game.c +++ b/src/openrct2/game.c @@ -918,7 +918,10 @@ static void game_load_or_quit(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx */ static void load_landscape() { - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE, NULL); + Intent * intent = intent_create(WC_LOADSAVE); + intent_set_uint(intent, INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE); + context_open_intent(intent); + intent_release(intent); } static void utf8_to_rct2_self(char *buffer, size_t length) @@ -1216,12 +1219,25 @@ void save_game() save_game_as(); } } -void save_game_as() + +void * create_save_game_as_intent() { char name[MAX_PATH]; safe_strcpy(name, path_get_filename(gScenarioSavePath), MAX_PATH); path_remove_extension(name); - window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME, name); + + Intent * intent = intent_create(WC_LOADSAVE); + intent_set_uint(intent, INTENT_EXTRA_4, LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME); + intent_set_string(intent, INTENT_EXTRA_5, name); + + return intent; +} + +void save_game_as() +{ + Intent * intent = (Intent *) create_save_game_as_intent(); + context_open_intent(intent); + intent_release(intent); } static sint32 compare_autosave_file_paths (const void * a, const void * b ) { @@ -1396,8 +1412,11 @@ void game_load_or_quit_no_save_prompt() if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { load_landscape(); } else { - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME, NULL); - window_loadsave_set_loadsave_callback(game_load_or_quit_no_save_prompt_callback); + Intent * intent = intent_create(WC_LOADSAVE); + intent_set_uint(intent, INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); + intent_set_pointer(intent, INTENT_EXTRA_6, game_load_or_quit_no_save_prompt_callback); + context_open_intent(intent); + intent_release(intent); } break; case PM_SAVE_BEFORE_QUIT: diff --git a/src/openrct2/game.h b/src/openrct2/game.h index 1ecf724cbd..f2d293bbd3 100644 --- a/src/openrct2/game.h +++ b/src/openrct2/game.h @@ -181,6 +181,7 @@ void pause_toggle(); bool game_is_paused(); bool game_is_not_paused(); void save_game(); +void * create_save_game_as_intent(); void save_game_as(); void handle_park_load_failure_with_title_opt(const ParkLoadResult * result, const utf8 * path, bool loadTitleFirst); void handle_park_load_failure(const ParkLoadResult * result, const utf8 * path); diff --git a/src/openrct2/interface/window.h b/src/openrct2/interface/window.h index d64dbed7a9..574232464b 100644 --- a/src/openrct2/interface/window.h +++ b/src/openrct2/interface/window.h @@ -604,7 +604,6 @@ typedef enum { } TOOL_IDX; typedef void (*modal_callback)(sint32 result); -typedef void (*loadsave_callback)(sint32 result, const utf8 * path); typedef void (*scenarioselect_callback)(const utf8 *path); typedef void (*close_callback)(); @@ -746,8 +745,6 @@ void window_tile_inspector_clear_clipboard(); void window_text_input_open(rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, rct_string_id existing_text, uintptr_t existing_args, sint32 maxLength); void window_text_input_raw_open(rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, utf8string existing_text, sint32 maxLength); -rct_window *window_loadsave_open(sint32 type, char *defaultName); - rct_window * window_object_load_error_open(utf8 * path, size_t numMissingObjects, const rct_object_entry * missingObjects); rct_window * window_editor_main_open(); @@ -819,8 +816,6 @@ bool scenery_tool_is_active(); //Cheat: in-game land ownership editor void toggle_ingame_land_ownership_editor(); -void window_loadsave_set_loadsave_callback(loadsave_callback cb); - void window_ride_construction_keyboard_shortcut_turn_left(); void window_ride_construction_keyboard_shortcut_turn_right(); void window_ride_construction_keyboard_shortcut_use_track_default(); diff --git a/src/openrct2/ride/track_design_save.c b/src/openrct2/ride/track_design_save.c index 4cdbd7b0bd..4a7988dcac 100644 --- a/src/openrct2/ride/track_design_save.c +++ b/src/openrct2/ride/track_design_save.c @@ -180,8 +180,12 @@ bool track_design_save(uint8 rideIndex) utf8 track_name[256]; format_string(track_name, sizeof(track_name), ride->name, &ride->name_arguments); - window_loadsave_open(LOADSAVETYPE_TRACK | LOADSAVETYPE_SAVE, track_name); - window_loadsave_set_loadsave_callback(track_design_save_callback); + Intent * intent = intent_create(WC_LOADSAVE); + intent_set_uint(intent, INTENT_EXTRA_4, LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK); + intent_set_string(intent, INTENT_EXTRA_6, track_name); + intent_set_pointer(intent, INTENT_EXTRA_6, track_design_save_callback); + context_open_intent(intent); + intent_release(intent); return true; } diff --git a/src/openrct2/windows/EditorBottomToolbar.cpp b/src/openrct2/windows/EditorBottomToolbar.cpp index de68ff563f..8f67e1d67a 100644 --- a/src/openrct2/windows/EditorBottomToolbar.cpp +++ b/src/openrct2/windows/EditorBottomToolbar.cpp @@ -290,7 +290,10 @@ void window_editor_bottom_toolbar_jump_forward_to_save_scenario() } window_close_all(); - window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO, gS6Info.name); + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); + intent.putExtra(INTENT_EXTRA_5, gS6Info.name); + context_open_intent(&intent); } /** diff --git a/src/openrct2/windows/EditorObjectSelection.cpp b/src/openrct2/windows/EditorObjectSelection.cpp index 4c7cab413c..447d5ae9b1 100644 --- a/src/openrct2/windows/EditorObjectSelection.cpp +++ b/src/openrct2/windows/EditorObjectSelection.cpp @@ -804,13 +804,18 @@ static void window_editor_object_selection_mouseup(rct_window *w, rct_widgetinde break; case WIDX_INSTALL_TRACK: - if (w->selected_list_item != -1) { + { + if (w->selected_list_item != -1) + { w->selected_list_item = -1; } window_invalidate(w); - window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK, nullptr); + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK); + context_open_intent(&intent); break; + } case WIDX_FILTER_STRING_BUTTON: //window_text_input_open(w, widgetIndex, STR_OBJECT_SEARCH, STR_OBJECT_SEARCH_DESC, STR_STRING, (uint32)_filter_string, 40); window_start_textbox(w, widgetIndex, STR_STRING, _filter_string, 40); diff --git a/src/openrct2/windows/Intent.cpp b/src/openrct2/windows/Intent.cpp index 74c48705c4..50eb8c5102 100644 --- a/src/openrct2/windows/Intent.cpp +++ b/src/openrct2/windows/Intent.cpp @@ -13,9 +13,9 @@ Intent::putExtra(uint32 key, uint32 value) return this; } Intent * -Intent::putExtra(uint32 key, uintptr_t value) +Intent::putExtra(uint32 key, void * value) { - _Pointers.insert(std::make_pair(key, value)); + _Pointers.insert(std::make_pair(key, (uintptr_t) value)); return this; } @@ -74,5 +74,20 @@ extern "C" { { intent->putExtra(key, value); } + + void intent_set_string(Intent *intent, uint32 key, utf8string value) + { + intent->putExtra(key, value); + } + + void intent_set_pointer(Intent *intent, uint32 key, void *value) + { + intent->putExtra(key, value); + } + + void intent_set_uint(Intent *intent, uint32 key, uint32 value) + { + intent->putExtra(key, value); + } } diff --git a/src/openrct2/windows/Intent.h b/src/openrct2/windows/Intent.h index b8d09a1bad..f7c70d52e2 100644 --- a/src/openrct2/windows/Intent.h +++ b/src/openrct2/windows/Intent.h @@ -31,7 +31,7 @@ public: uint32 GetUIntExtra(uint32 key); sint32 GetSIntExtra(uint32 key); Intent * putExtra(uint32 key, uint32 value); - Intent * putExtra(uint32 key, uintptr_t value); + Intent * putExtra(uint32 key, void * value); Intent * putExtra(uint32 key, sint32 value); Intent * putExtra(uint32 key, utf8string value); }; @@ -52,12 +52,18 @@ extern "C" { INTENT_EXTRA_2, INTENT_EXTRA_3, + + INTENT_EXTRA_4, + INTENT_EXTRA_5, + INTENT_EXTRA_6, + + INTENT_EXTRA_7, }; Intent *intent_create(rct_windowclass clss); void intent_release(Intent * intent); void intent_set_string(Intent *, uint32 key, utf8string value); - void intent_set_pointer(Intent *, uint32 key, uintptr_t value); + void intent_set_pointer(Intent *, uint32 key, void * value); void intent_set_sint(Intent *, uint32 key, sint32 value); void intent_set_uint(Intent *, uint32 key, uint32 value); #ifdef __cplusplus diff --git a/src/openrct2/windows/Staff.cpp b/src/openrct2/windows/Staff.cpp index 67a529a78d..ca4a6fdd33 100644 --- a/src/openrct2/windows/Staff.cpp +++ b/src/openrct2/windows/Staff.cpp @@ -472,7 +472,7 @@ void window_staff_overview_mouseup(rct_window *w, rct_widgetindex widgetIndex) case WIDX_FIRE: { auto intent = Intent(WC_FIRE_PROMPT); - intent.putExtra(INTENT_EXTRA_3, (uintptr_t) peep); + intent.putExtra(INTENT_EXTRA_3, peep); context_open_intent(&intent); break; } diff --git a/src/openrct2/windows/TopToolbar.cpp b/src/openrct2/windows/TopToolbar.cpp index 9de9f632fc..d52738e7d8 100644 --- a/src/openrct2/windows/TopToolbar.cpp +++ b/src/openrct2/windows/TopToolbar.cpp @@ -543,8 +543,12 @@ static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetInd switch (dropdownIndex) { case DDIDX_NEW_GAME: - window_scenarioselect_open(window_top_toolbar_scenarioselect_callback); + { + auto intent = Intent(WC_SCENARIO_SELECT); + intent.putExtra(INTENT_EXTRA_7, (void *) window_top_toolbar_scenarioselect_callback); + context_open_intent(&intent); break; + } case DDIDX_LOAD_GAME: game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 0, 0); break; @@ -554,7 +558,10 @@ static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetInd break; case DDIDX_SAVE_GAME_AS: if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { - window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE, gS6Info.name); + auto intent = Intent(WC_LOADSAVE); + intent.putExtra(INTENT_EXTRA_4, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent.putExtra(INTENT_EXTRA_5, gS6Info.name); + context_open_intent(&intent); } else { tool_cancel();