Expand unified unit sprite style
This commit is contained in:
@@ -921,6 +921,32 @@ const unitTexture: Record<string, string> = {
|
||||
'menghuo-final-leader': 'unit-meng-huo'
|
||||
};
|
||||
|
||||
const canonicalAllyNames: Record<string, string> = {
|
||||
'liu-bei': '유비',
|
||||
'guan-yu': '관우',
|
||||
'zhang-fei': '장비',
|
||||
'jian-yong': '간옹',
|
||||
'mi-zhu': '미축',
|
||||
'sun-qian': '손건',
|
||||
'zhao-yun': '조운',
|
||||
'zhuge-liang': '제갈량',
|
||||
'ma-liang': '마량',
|
||||
'yi-ji': '이적',
|
||||
'gong-zhi': '공지',
|
||||
'huang-zhong': '황충',
|
||||
'wei-yan': '위연',
|
||||
'pang-tong': '방통',
|
||||
'fa-zheng': '법정',
|
||||
'wu-yi': '오의',
|
||||
'yan-yan': '엄안',
|
||||
'li-yan': '이엄',
|
||||
'huang-quan': '황권',
|
||||
'ma-chao': '마초',
|
||||
'ma-dai': '마대',
|
||||
'wang-ping': '왕평',
|
||||
'jiang-wei': '강유'
|
||||
};
|
||||
|
||||
const unitTextureByClass: Partial<Record<UnitClassKey, string>> = {
|
||||
lord: 'unit-liu-bei',
|
||||
infantry: 'unit-guan-yu',
|
||||
@@ -9744,7 +9770,17 @@ export class BattleScene extends Phaser.Scene {
|
||||
}
|
||||
|
||||
private unitName(unitId: string) {
|
||||
return battleUnits.find((unit) => unit.id === unitId)?.name ?? unitId;
|
||||
const battleName = battleUnits.find((unit) => unit.id === unitId)?.name;
|
||||
if (battleName) {
|
||||
return battleName;
|
||||
}
|
||||
|
||||
const canonicalName = canonicalAllyNames[unitId];
|
||||
if (canonicalName) {
|
||||
return canonicalName;
|
||||
}
|
||||
|
||||
return getCampaignState().roster.find((unit) => unit.id === unitId)?.name ?? unitId;
|
||||
}
|
||||
|
||||
private renderRosterPanel(tab: RosterTab = this.rosterTab, message?: string) {
|
||||
|
||||
Reference in New Issue
Block a user