fix(dominion): adjust UI layout and label formatting
- Relocate prompt banner and buttons downward (Y: 500→720, 560→825) - Replace card suit emoji with text 'C' in value labels - Update `promptButton` call to pass label string directly instead of a function placeholder
This commit is contained in:
parent
5a4f8a1204
commit
1fd5855ac7
|
|
@ -448,7 +448,7 @@ export default class DominionGame extends Phaser.Scene {
|
||||||
pill.setStrokeStyle(1, 0x000000, 0.4);
|
pill.setStrokeStyle(1, 0x000000, 0.4);
|
||||||
container.add(pill);
|
container.add(pill);
|
||||||
const label = kind === '$' ? `+${val}$`
|
const label = kind === '$' ? `+${val}$`
|
||||||
: kind === 'cards' ? `+${val}🂠`
|
: kind === 'cards' ? `+${val}C`
|
||||||
: kind === 'action' ? `+${val}A`
|
: kind === 'action' ? `+${val}A`
|
||||||
: `+${val}B`;
|
: `+${val}B`;
|
||||||
container.add(this.add.text(x, cy, label, {
|
container.add(this.add.text(x, cy, label, {
|
||||||
|
|
@ -668,7 +668,7 @@ export default class DominionGame extends Phaser.Scene {
|
||||||
}
|
}
|
||||||
|
|
||||||
promptBanner(text) {
|
promptBanner(text) {
|
||||||
const t = this.add.text(CX, 500, text, {
|
const t = this.add.text(CX, 720, text, {
|
||||||
fontFamily: 'Righteous', fontSize: '24px', color: COLORS.textHex, align: 'center',
|
fontFamily: 'Righteous', fontSize: '24px', color: COLORS.textHex, align: 'center',
|
||||||
backgroundColor: 'rgba(0,0,0,0.78)', padding: { x: 18, y: 10 }, wordWrap: { width: 1000 },
|
backgroundColor: 'rgba(0,0,0,0.78)', padding: { x: 18, y: 10 }, wordWrap: { width: 1000 },
|
||||||
}).setOrigin(0.5).setDepth(D.prompt);
|
}).setOrigin(0.5).setDepth(D.prompt);
|
||||||
|
|
@ -677,7 +677,7 @@ export default class DominionGame extends Phaser.Scene {
|
||||||
}
|
}
|
||||||
|
|
||||||
promptButton(x, label, cb, opts = {}) {
|
promptButton(x, label, cb, opts = {}) {
|
||||||
const b = new Button(this, x, 560, label, cb, { width: 200, height: 46, fontSize: 20, ...opts })
|
const b = new Button(this, x, 825, label, cb, { width: 200, height: 46, fontSize: 20, ...opts })
|
||||||
.setDepth(D.prompt);
|
.setDepth(D.prompt);
|
||||||
this.promptObjs.push(b);
|
this.promptObjs.push(b);
|
||||||
return b;
|
return b;
|
||||||
|
|
@ -732,9 +732,9 @@ export default class DominionGame extends Phaser.Scene {
|
||||||
confirmBtn.setEnabled(n >= min && n <= max);
|
confirmBtn.setEnabled(n >= min && n <= max);
|
||||||
confirmBtn.setLabel(`${confirm} (${n})`);
|
confirmBtn.setLabel(`${confirm} (${n})`);
|
||||||
};
|
};
|
||||||
const confirmBtn = this.promptButton(CX, () => {
|
const confirmBtn = this.promptButton(CX, `${confirm} (0)`, () => {
|
||||||
this.resolveHuman({ iids: [...this.selection] });
|
this.resolveHuman({ iids: [...this.selection] });
|
||||||
}, () => {}, { bg: COLORS.accent, bgHover: COLORS.gold, textColor: COLORS.textDarkHex, textHoverColor: COLORS.textDarkHex });
|
}, { bg: COLORS.accent, bgHover: COLORS.gold, textColor: COLORS.textDarkHex, textHoverColor: COLORS.textDarkHex });
|
||||||
|
|
||||||
for (const hs of this.handSprites) {
|
for (const hs of this.handSprites) {
|
||||||
hs.hit.setInteractive({ useHandCursor: true });
|
hs.hit.setInteractive({ useHandCursor: true });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue