도시정보 적국 NPC 소속을 표시

This commit is contained in:
2026-08-31 05:07:47 +00:00
parent 99a477b47e
commit 29014e9c2d
3 changed files with 53 additions and 23 deletions
+49 -22
View File
@@ -419,28 +419,52 @@ const install = async (
: [{ action: 'che_징병', args: { crewType: 1, amount: 300 } }], : [{ action: 'che_징병', args: { crewType: 1, amount: 300 } }],
}, },
...(denseCurrentCity ...(denseCurrentCity
? Array.from({ length: 12 }, (_, index) => ({ ? [
id: index + 2, ...Array.from({ length: 12 }, (_, index) => ({
name: `NPC장수이름이긴${index + 1}`, id: index + 2,
npcState: 2, name: `NPC장수이름이긴${index + 1}`,
picture: null, npcState: 2,
imageServer: 0, picture: null,
nationId: 1, imageServer: 0,
nationName: '아국', nationId: 1,
leadership: 60, nationName: '아국',
strength: 60, leadership: 60,
intelligence: 60, strength: 60,
injury: 0, intelligence: 60,
officerLevel: 1, injury: 0,
leadershipBonus: 0, officerLevel: 1,
defenceTrain: 80, leadershipBonus: 0,
crewTypeId: 1, defenceTrain: 80,
crewTypeName: '보병', crewTypeId: 1,
crew: 500, crewTypeName: '보병',
train: 90, crew: 500,
atmos: 90, train: 90,
turns: [], atmos: 90,
})) turns: [],
})),
{
id: 14,
name: '적국NPC',
npcState: 2,
picture: null,
imageServer: 0,
nationId: 2,
nationName: '적국',
leadership: 60,
strength: 60,
intelligence: 60,
injury: 0,
officerLevel: 1,
leadershipBonus: 0,
defenceTrain: null,
crewTypeId: null,
crewTypeName: null,
crew: 500,
train: null,
atmos: null,
turns: [],
},
]
: []), : []),
], ],
forceSummary: { forceSummary: {
@@ -1213,6 +1237,7 @@ test('current-city wraps dense general names and only shrinks reserved turns', a
const rows = page.locator('.generals tbody tr'); const rows = page.locator('.generals tbody tr');
const reservedTurns = rows.nth(0).locator('.turns'); const reservedTurns = rows.nth(0).locator('.turns');
const npcTurns = rows.nth(1).locator('.turns'); const npcTurns = rows.nth(1).locator('.turns');
const enemyNpcTurns = rows.nth(13).locator('.turns');
await expect(reservedTurns).toContainText('1 : 【보병】 300명 징병'); await expect(reservedTurns).toContainText('1 : 【보병】 300명 징병');
await expect(reservedTurns).toContainText('2 : 【업】에 화계실행'); await expect(reservedTurns).toContainText('2 : 【업】에 화계실행');
await expect(reservedTurns.locator('.turn-line').nth(0)).toHaveAttribute('title', '【보병】 300명 징병'); await expect(reservedTurns.locator('.turn-line').nth(0)).toHaveAttribute('title', '【보병】 300명 징병');
@@ -1220,6 +1245,8 @@ test('current-city wraps dense general names and only shrinks reserved turns', a
await expect(reservedTurns).toHaveClass(/turns--reserved/); await expect(reservedTurns).toHaveClass(/turns--reserved/);
await expect(npcTurns).toHaveText('NPC 장수'); await expect(npcTurns).toHaveText('NPC 장수');
await expect(npcTurns).not.toHaveClass(/turns--reserved/); await expect(npcTurns).not.toHaveClass(/turns--reserved/);
await expect(enemyNpcTurns).toHaveText('【적국】 장수');
await expect(enemyNpcTurns).not.toHaveClass(/turns--reserved/);
const turnFontSizes = await Promise.all([ const turnFontSizes = await Promise.all([
reservedTurns.evaluate((element) => getComputedStyle(element).fontSize), reservedTurns.evaluate((element) => getComputedStyle(element).fontSize),
@@ -310,10 +310,10 @@ const commandBrief = (command: ReservedCommand): string =>
>{{ index + 1 }} : {{ commandBrief(turn) }}</span >{{ index + 1 }} : {{ commandBrief(turn) }}</span
> >
</template> </template>
<template v-else-if="general.npcState > 1">NPC 장수</template>
<template v-else-if="general.nationId !== data.me.nationId"> <template v-else-if="general.nationId !== data.me.nationId">
{{ general.nationId === 0 ? ' ' : `${general.nationName} 장수` }} {{ general.nationId === 0 ? ' ' : `${general.nationName} 장수` }}
</template> </template>
<template v-else-if="general.npcState > 1">NPC 장수</template>
</td> </td>
</tr> </tr>
</tbody> </tbody>
+3
View File
@@ -221,6 +221,9 @@ instead. The Ref row contract still applies to commands: only a non-NPC
general's reserved turns use `general_turn_text`/`x-small`; `NPC 장수`, foreign general's reserved turns use `general_turn_text`/`x-small`; `NPC 장수`, foreign
nation, and wanderer labels stay at the table's normal font size. The summary nation, and wanderer labels stay at the table's normal font size. The summary
general-name cell must remain wrappable when many generals share a city. general-name cell must remain wrappable when many generals share a city.
The row ownership check precedes the NPC check: an NPC belonging to the viewer's
nation is labeled `NPC 장수`, while a foreign NPC is labeled with its nation as
`【국가명】 장수` so its allegiance is not hidden.
징병·모병의 Ref 화면은 다음 collector로 1000/500px DOM, 이미지 natural size, 징병·모병의 Ref 화면은 다음 collector로 1000/500px DOM, 이미지 natural size,
불가능 병종 toggle과 hover/focus를 수집합니다. 기본 모드는 현재 Ref session을 불가능 병종 toggle과 hover/focus를 수집합니다. 기본 모드는 현재 Ref session을