mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-07-31 05:30:23 +02:00
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:
@@ -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())
|
||||||
|
@@ -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())
|
||||||
|
@@ -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();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user