diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 583019d472..5f1882e678 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Improved: [#21767] RCT Classic for macOS can now be used as the source game. - Change: [#23803] Lightning strikes and thunder happen at the same frequency independently of the game speed. +- Change: [#24069] [Plugin] Plugins are now available in the scenario editor and track designer. - Change: [#24135] Compress Emscripten js/wasm files. - Fix: [#21919] Non-recolourable cars still show colour picker. - Fix: [#23108] Missing pieces on Hypercoaster and Hyper-Twister, even with the ‘all drawable track pieces’ cheat enabled. diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index f7db8c0b32..57c78d0150 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -269,9 +269,20 @@ namespace OpenRCT2::Ui::Windows intent.PutEnumExtra(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save); intent.PutEnumExtra(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::scenario); intent.PutExtra(INTENT_EXTRA_PATH, gameState.scenarioName); + intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(SaveScenarioCallback)); ContextOpenIntent(&intent); } + static void SaveScenarioCallback(ModalResult result, const utf8* path) + { + if (result != ModalResult::ok) + { + return; + } + + GameUnloadScripts(); + } + void HidePreviousStepButton() { widgets[WIDX_PREVIOUS_STEP_BUTTON].type = WindowWidgetType::Empty; diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index bf41107246..3be27302a8 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -116,6 +116,9 @@ namespace OpenRCT2::Editor LoadPalette(); gScreenAge = 0; gameState.scenarioName = LanguageGetString(STR_MY_NEW_SCENARIO); + + GameLoadScripts(); + GameNotifyMapChanged(); } /** @@ -154,6 +157,9 @@ namespace OpenRCT2::Editor OpenEditorWindows(); FinaliseMainView(); gScreenAge = 0; + + GameLoadScripts(); + GameNotifyMapChanged(); } /** @@ -179,6 +185,9 @@ namespace OpenRCT2::Editor WindowBase* mainWindow = OpenEditorWindows(); mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); LoadPalette(); + + GameLoadScripts(); + GameNotifyMapChanged(); } /** @@ -204,6 +213,9 @@ namespace OpenRCT2::Editor WindowBase* mainWindow = OpenEditorWindows(); mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); LoadPalette(); + + GameLoadScripts(); + GameNotifyMapChanged(); } /** @@ -238,6 +250,9 @@ namespace OpenRCT2::Editor ViewportInitAll(); OpenEditorWindows(); FinaliseMainView(); + + GameLoadScripts(); + GameNotifyMapChanged(); } bool LoadLandscape(const utf8* path)