Browse Source

Update game engine to convert NationID enum to string for UI

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 1 month ago
parent
commit
6e8b3108df
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/core/game_engine.cpp

+ 4 - 1
app/core/game_engine.cpp

@@ -69,6 +69,7 @@
 #include "game/systems/game_state_serializer.h"
 #include "game/systems/global_stats_registry.h"
 #include "game/systems/movement_system.h"
+#include "game/systems/nation_id.h"
 #include "game/systems/nation_registry.h"
 #include "game/systems/owner_registry.h"
 #include "game/systems/patrol_system.h"
@@ -1050,7 +1051,9 @@ auto GameEngine::availableNations() const -> QVariantList {
   ordered.reserve(static_cast<int>(all.size()));
   for (const auto &nation : all) {
     QVariantMap entry;
-    entry.insert(QStringLiteral("id"), QString::fromStdString(nation.id));
+    entry.insert(QStringLiteral("id"),
+                 QString::fromStdString(
+                     Game::Systems::nationIDToString(nation.id)));
     entry.insert(QStringLiteral("name"),
                  QString::fromStdString(nation.displayName));
     ordered.append(entry);