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
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>(); explicitSingletons->gameController = std::make_unique<GameController>();
auto *gameController = explicitSingletons->gameController.get(); auto *gameController = explicitSingletons->gameController.get();
engine.ShowWindow(gameController->GetView()); engine.ShowWindow(gameController->GetView());
gameController->InitCommandInterface();
auto openArg = arguments["open"]; auto openArg = arguments["open"];
if (openArg.has_value()) if (openArg.has_value())

View File

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

View File

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