fix config data paths

This commit is contained in:
2026-04-29 21:32:32 +02:00
parent f37ed0507c
commit 7e0104e9b8
22 changed files with 14 additions and 13 deletions

View File

@@ -177,7 +177,7 @@ set_target_properties(${TARGET_APP_NAME} PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${OUTPUT_ROOT_PATH}/$(Configuration)/app/" VS_DEBUGGER_WORKING_DIRECTORY "${OUTPUT_ROOT_PATH}/$(Configuration)/app/"
) )
target_compile_definitions(${TARGET_APP_NAME} PRIVATE target_compile_definitions(${TARGET_APP_NAME} PRIVATE
DOTA_FACTORY_CONFIG_DIR="${CMAKE_SOURCE_DIR}/bin/config" CONFIG_DIR="${CMAKE_SOURCE_DIR}/bin/app/data/config"
) )
target_link_libraries(${TARGET_APP_NAME} ${TARGET_UI_NAME}) target_link_libraries(${TARGET_APP_NAME} ${TARGET_UI_NAME})
@@ -206,7 +206,7 @@ set_property(TARGET ${TARGET_TEST_NAME} PROPERTY INCLUDE_DIRECTORIES
"${LIB_INCLUDE_PATH}" "${LIB_INCLUDE_PATH}"
) )
target_compile_definitions(${TARGET_TEST_NAME} PRIVATE target_compile_definitions(${TARGET_TEST_NAME} PRIVATE
DOTA_FACTORY_CONFIG_DIR="${CMAKE_SOURCE_DIR}/src/test/config" CONFIG_DIR="${CMAKE_SOURCE_DIR}/bin/test/data/config"
) )
target_link_libraries(${TARGET_TEST_NAME} ${TARGET_LIB_NAME}) target_link_libraries(${TARGET_TEST_NAME} ${TARGET_LIB_NAME})

View File

@@ -31,10 +31,10 @@ int main(int argc, char *argv[])
QDir().mkdir(dataDir.dirName()); QDir().mkdir(dataDir.dirName());
} }
GameConfig config = ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); GameConfig config = ConfigLoader::loadFromDirectory(CONFIG_DIR);
std::unique_ptr<Simulation> sim = std::make_unique<Simulation>(std::move(config)); std::unique_ptr<Simulation> sim = std::make_unique<Simulation>(std::move(config));
MainWindow window(sim.get(), std::string(DOTA_FACTORY_CONFIG_DIR)); MainWindow window(sim.get(), std::string(CONFIG_DIR));
window.show(); window.show();
const int ret = application.exec(); const int ret = application.exec();

View File

@@ -22,7 +22,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
struct Fixture struct Fixture

View File

@@ -144,7 +144,7 @@ static void applyRotationCCW(Blueprint& bp, const GameConfig& cfg)
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
// Mirrors BlueprintPanel::createBlueprintFromSelection's player-placeable filter: // Mirrors BlueprintPanel::createBlueprintFromSelection's player-placeable filter:

View File

@@ -24,7 +24,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
static Item makeItem(const std::string& id) static Item makeItem(const std::string& id)

View File

@@ -17,7 +17,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
// Find the first ShipDef with a combat component. // Find the first ShipDef with a combat component.

View File

@@ -64,7 +64,7 @@ private:
TEST_CASE("ConfigLoader loads the committed bin/config/ configs end-to-end", "[config]") TEST_CASE("ConfigLoader loads the committed bin/config/ configs end-to-end", "[config]")
{ {
const std::string configDir = DOTA_FACTORY_CONFIG_DIR; const std::string configDir = CONFIG_DIR;
const GameConfig cfg = ConfigLoader::loadFromDirectory(configDir); const GameConfig cfg = ConfigLoader::loadFromDirectory(configDir);
// world.toml // world.toml

View File

@@ -15,7 +15,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -192,3 +192,4 @@ TEST_CASE("ShipSystem: despawn removes the ship", "[ship]")
ss.despawn(id); ss.despawn(id);
REQUIRE(ss.findShip(id) == nullptr); REQUIRE(ss.findShip(id) == nullptr);
} }

View File

@@ -14,7 +14,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
static const ShipDef* findAvailableSchematic(const GameConfig& cfg) static const ShipDef* findAvailableSchematic(const GameConfig& cfg)

View File

@@ -8,7 +8,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@@ -15,7 +15,7 @@
static GameConfig loadConfig() static GameConfig loadConfig()
{ {
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR); return ConfigLoader::loadFromDirectory(CONFIG_DIR);
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------