diff --git a/hwe/ts/components/GeneralBasicCard.vue b/hwe/ts/components/GeneralBasicCard.vue
index 55a650b8..3567b1c9 100644
--- a/hwe/ts/components/GeneralBasicCard.vue
+++ b/hwe/ts/components/GeneralBasicCard.vue
@@ -14,7 +14,10 @@
backgroundColor: nation.color,
}"
>
- {{ general.name }} 【{{ general.officerLevelText }} | {{ generalTypeCall }} |
+ {{ general.name }} 【
+ {{ formatCityName(general.officer_city, gameConstStore) }}
+
+ {{ general.officerLevelText }} | {{ generalTypeCall }} |
{{ injuryInfo.text }}
】 {{ general.turntime.substring(11, 19) }}
@@ -132,7 +135,7 @@
{{ troopInfo.name }}
- {{ troopInfo.name }}({{ gameConstStore.cityConst[troopInfo.leader.city].name }})
+ {{ troopInfo.name }}({{ formatCityName(troopInfo.leader, gameConstStore) }})
벌점
@@ -157,6 +160,7 @@ import { formatConnectScore } from "@/utilGame/formatConnectScore";
import SammoBar from "@/components/SammoBar.vue";
import { parseTime } from "@/util/parseTime";
import { clamp } from "lodash";
+import { formatCityName } from "@/utilGame/formatCityName";
const imagePath = window.pathConfig.gameImage;
const gameConstStore = unwrap(inject[>("gameConstStore"));
const props = defineProps<{
diff --git a/hwe/ts/utilGame/formatCityName.ts b/hwe/ts/utilGame/formatCityName.ts
new file mode 100644
index 00000000..34bb5455
--- /dev/null
+++ b/hwe/ts/utilGame/formatCityName.ts
@@ -0,0 +1,14 @@
+import type { GameConstStore } from "@/GameConstStore";
+
+interface WithCityID {
+ city: number;
+}
+
+export function formatCityName(target: number | WithCityID, gameConst: GameConstStore): string {
+ const cityID = typeof target === "number" ? target : target.city;
+ const city = gameConst.cityConst[cityID];
+ if (city === undefined) {
+ throw `City ${cityID} not found`;
+ }
+ return city.name;
+}
]