Fix ptsave: being handled before autorun.lua

This would leave saves opened this way missing elements, but also not produce a warning in the preview, because by that time that preview is made, autorun.lua has been run.
This commit is contained in:
Tamás Bálint Misius 2025-01-15 00:07:34 +01:00
parent 452849df74
commit a7d73102d6
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
3 changed files with 7 additions and 1 deletions

View File

@ -484,6 +484,7 @@ int Main(int argc, char *argv[])
explicitSingletons->gameController = std::make_unique<GameController>();
auto *gameController = explicitSingletons->gameController.get();
engine.ShowWindow(gameController->GetView());
gameController->InitCommandInterface();
auto openArg = arguments["open"];
if (openArg.has_value())

View File

@ -713,12 +713,16 @@ bool GameController::KeyRelease(int key, int scan, bool repeat, bool shift, bool
return ret;
}
void GameController::InitCommandInterface()
{
commandInterface->Init();
}
void GameController::Tick()
{
gameModel->Tick();
if(firstTick)
{
commandInterface->Init();
if constexpr (INSTALL_CHECK)
{
if (Client::Ref().IsFirstRun())

View File

@ -211,4 +211,5 @@ public:
bool ThreadedRenderingAllowed();
void SetToolIndex(ByteString identifier, std::optional<int> index);
void InitCommandInterface();
};