diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e9dfb0b..e1ca33c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -86,8 +86,8 @@ importers:
viewer:
dependencies:
'@boardgamers/protocol':
- specifier: 0.8.1
- version: 0.8.1
+ specifier: 0.9.0
+ version: 0.9.0
container-engine:
specifier: workspace:../engine
version: link:../engine
@@ -1042,10 +1042,10 @@ packages:
}
engines: { node: '>=6.9.0' }
- '@boardgamers/protocol@0.8.1':
+ '@boardgamers/protocol@0.9.0':
resolution:
{
- integrity: sha512-BZNj+wof1aR1nSybRMqmQ+yAVNR3ZZy+mczIz2KbXSLXMLL3Jv21yi50CRbJ2ipdkPiPatcSP0nJj+xJbFgIfQ==,
+ integrity: sha512-xDQMui0xqqRF/ERIJ7Rm79JonMA2+6zn1CrgxpM6Oy3SpFKF6i0Wo6oAyYYqMveqiWJCkC0WvHlePclVfbH/IQ==,
}
'@cspotcode/source-map-support@0.8.1':
@@ -11587,7 +11587,7 @@ snapshots:
'@babel/helper-string-parser': 7.29.7
'@babel/helper-validator-identifier': 7.29.7
- '@boardgamers/protocol@0.8.1':
+ '@boardgamers/protocol@0.9.0':
dependencies:
zod: 4.6.2
diff --git a/viewer/package.json b/viewer/package.json
index cae63c7..c42b36e 100644
--- a/viewer/package.json
+++ b/viewer/package.json
@@ -19,7 +19,7 @@
"preview:tutorial": "node scripts/tutorial-preview.mjs"
},
"dependencies": {
- "@boardgamers/protocol": "0.8.1",
+ "@boardgamers/protocol": "0.9.0",
"container-engine": "workspace:../engine",
"core-js": "^3.6.5",
"lodash": "^4.17.19",
diff --git a/viewer/scripts/protocol-smoke.mjs b/viewer/scripts/protocol-smoke.mjs
index b209ea1..08e83ed 100644
--- a/viewer/scripts/protocol-smoke.mjs
+++ b/viewer/scripts/protocol-smoke.mjs
@@ -118,6 +118,25 @@ try {
'journal uses the same colour symbols'
);
assert.equal(await page.locator('.player-number').count(), 6, 'ships and island rows identify all players');
+ await page.evaluate(() =>
+ host.emit('preferences', {
+ colorBlind: true,
+ bgs: { players: [], playerColors: [], playerSymbols: ['star', 'hexagon', 'cross'] },
+ })
+ );
+ await page.waitForFunction(() => document.querySelector('.player-number')?.textContent.includes('★'));
+ assert.equal(
+ await page.locator('.point-card .color-mark').count(),
+ 5,
+ 'resource symbols keep their own meaning'
+ );
+ await page.evaluate(() =>
+ host.emit('preferences', {
+ colorBlind: true,
+ bgs: { players: [], playerColors: [], playerSymbols: ['diamond', 'hexagon', 'cross'] },
+ })
+ );
+ await page.waitForFunction(() => document.querySelector('.player-number')?.textContent.includes('◆'));
await page.screenshot({ path: `/tmp/container-color-blind-${width}.png`, fullPage: true });
await page.locator('.color-blind-toggle').scrollIntoViewIfNeeded();
await page.locator('.color-blind-toggle').click();
diff --git a/viewer/src/components/Game.vue b/viewer/src/components/Game.vue
index 8c255bf..f75a995 100644
--- a/viewer/src/components/Game.vue
+++ b/viewer/src/components/Game.vue
@@ -39,7 +39,9 @@
width="14"
height="14"
/>
- {{ preferences.colorBlind ? i + 1 : '' }}{{
+ preferences.colorBlind ? ownerSymbol(i) : ''
+ }}{{ i === player ? 'You' : p.name }}
@@ -158,7 +160,7 @@
stroke="#203a45"
/>
- {{ i + 1 }}
+ {{ ownerSymbol(i) }}
@@ -704,7 +706,7 @@ import InlineLog from './InlineLog.vue';
import { islandValue } from '../island-value';
import ColorBlindButton from './buttons/ColorBlindButton.vue';
import { colorBadgeHtml } from '../color-blind';
-import { playerColors, playerTextColor } from '../player-colors';
+import { playerColors, playerTextColor, playerSymbol } from '../player-colors';
import { journalPieces } from '../journal-pieces';
import { Vue, Component, Prop, Watch, Provide, ProvideReactive } from 'vue-property-decorator';
import { MoveName, ended, isLoanReversal, move as engineMove } from 'container-engine';
@@ -793,6 +795,10 @@ export default class Game extends Vue {
loanCards: Piece[] = [];
ships: ShipType[] = [];
+ ownerSymbol(index: number) {
+ return playerSymbol(index, this.preferences);
+ }
+
get playerColors() {
return playerColors(this.preferences);
}
diff --git a/viewer/src/components/PlayerBoard.vue b/viewer/src/components/PlayerBoard.vue
index 14e16c8..f8f6070 100644
--- a/viewer/src/components/PlayerBoard.vue
+++ b/viewer/src/components/PlayerBoard.vue
@@ -10,7 +10,7 @@
font-weight="600"
:fill="playerTextColor(color)"
:text-decoration="isCurrentPlayer ? 'underline' : ''"
- >{{ preferences.colorBlind ? owner + 1 + '. ' : '' }}{{ getPlayerName() }}{{ preferences.colorBlind ? ownerSymbol + ' ' : '' }}{{ getPlayerName() }}