implement load config on game restart

This commit is contained in:
2026-04-22 22:53:56 +02:00
parent 1b218941bd
commit 78f746d352
6 changed files with 71 additions and 27 deletions

View File

@@ -9,7 +9,6 @@
#include "LogManager.h"
#include "MainWindow.h"
#include "Simulation.h"
#include "VisualsLoader.h"
int main(int argc, char *argv[])
{
@@ -33,10 +32,9 @@ int main(int argc, char *argv[])
}
GameConfig config = ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR);
VisualsConfig visuals = VisualsLoader::load(std::string(DOTA_FACTORY_CONFIG_DIR) + "/visuals.toml");
std::unique_ptr<Simulation> sim = std::make_unique<Simulation>(config);
std::unique_ptr<Simulation> sim = std::make_unique<Simulation>(std::move(config));
MainWindow window(sim.get(), &config, &visuals);
MainWindow window(sim.get(), std::string(DOTA_FACTORY_CONFIG_DIR));
window.show();
const int ret = application.exec();