mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-30 02:05:13 +01:00
Load scripts in the scenario editor and track designer (#24090)
* Load scripts in the scenario editor and track designer * Explicitly unload plugins upon saving scenario
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -269,9 +269,20 @@ namespace OpenRCT2::Ui::Windows
|
||||
intent.PutEnumExtra<LoadSaveAction>(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save);
|
||||
intent.PutEnumExtra<LoadSaveType>(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::scenario);
|
||||
intent.PutExtra(INTENT_EXTRA_PATH, gameState.scenarioName);
|
||||
intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast<CloseCallback>(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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user