fix: exclude Mastermind and Battleship from playfield selection
Prevents the playfield option section from appearing for Mastermind and Battleship games, which do not utilize playfield tiles in the same way as other games.
This commit is contained in:
parent
0bb32359b2
commit
81d3a28195
|
|
@ -102,7 +102,7 @@ export default class OpponentSelectScene extends Phaser.Scene {
|
|||
[opponents[i], opponents[j]] = [opponents[j], opponents[i]];
|
||||
}
|
||||
const hasOptions = isCatan || isGoFish || this.gameDef.slug === 'dominion'
|
||||
|| (!isWordGame && (this.cache.json.get('playfields')?.playfields?.length > 0))
|
||||
|| (!isWordGame && this.gameDef.slug !== 'battleship' && this.gameDef.slug !== 'mastermind' && (this.cache.json.get('playfields')?.playfields?.length > 0))
|
||||
|| this.gameDef.cardGame;
|
||||
const oppScrollH = hasOptions ? OPP_SCROLL_H : 700;
|
||||
this.buildOpponentGrid(opponents, oppScrollH);
|
||||
|
|
@ -131,7 +131,7 @@ export default class OpponentSelectScene extends Phaser.Scene {
|
|||
|
||||
if (this.gameDef.slug === 'mastermind') this.buildSecretRevealTypeSection(340, 1013);
|
||||
|
||||
if (!isWordGame) {
|
||||
if (!isWordGame && this.gameDef.slug !== 'battleship' && this.gameDef.slug !== 'mastermind') {
|
||||
this.buildOptionSection('Playfield', 630, this.cache.json.get('playfields')?.playfields ?? [],
|
||||
'selectedPlayfield', 'playfieldTiles', (pf) => this.selectPlayfield(pf));
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ export default class OpponentSelectScene extends Phaser.Scene {
|
|||
}
|
||||
|
||||
// Apply playfield default; card back is chosen randomly
|
||||
if (!isWordGame) {
|
||||
if (!isWordGame && this.gameDef.slug !== 'battleship' && this.gameDef.slug !== 'mastermind') {
|
||||
const pfd = this.cache.json.get('playfields') ?? {};
|
||||
this.applyDefault('playfields', pfd.default, 'selectedPlayfield', 'playfieldTiles');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue