define ship roles via added modules and allow multiple weapons
This commit is contained in:
@@ -190,17 +190,20 @@ VisualsConfig VisualsLoader::load(const std::string& path)
|
||||
}
|
||||
}
|
||||
|
||||
// Ships
|
||||
// Ships (dynamic keys: each key is a schematic id)
|
||||
{
|
||||
toml::table& ships = requireSubtable(tbl, "ships", "root");
|
||||
cfg.ships[ShipRole::PlayerCombat] = parseShip(
|
||||
requireSubtable(ships, "player_combat", "ships"), "ships.player_combat");
|
||||
cfg.ships[ShipRole::Salvage] = parseShip(
|
||||
requireSubtable(ships, "salvage", "ships"), "ships.salvage");
|
||||
cfg.ships[ShipRole::Repair] = parseShip(
|
||||
requireSubtable(ships, "repair", "ships"), "ships.repair");
|
||||
cfg.ships[ShipRole::Enemy] = parseShip(
|
||||
requireSubtable(ships, "enemy", "ships"), "ships.enemy");
|
||||
for (toml::table::iterator it = ships.begin(); it != ships.end(); ++it)
|
||||
{
|
||||
std::string schematicId = std::string(it->first.str());
|
||||
toml::table* sub = it->second.as_table();
|
||||
if (sub == nullptr)
|
||||
{
|
||||
throw std::runtime_error("visuals.toml: ships." + schematicId
|
||||
+ " is not a table");
|
||||
}
|
||||
cfg.ships[schematicId] = parseShip(*sub, "ships." + schematicId);
|
||||
}
|
||||
}
|
||||
|
||||
// Beams
|
||||
|
||||
Reference in New Issue
Block a user