Remove default category selection in favor of a hint prompt
- Drop the `_lastCategory` module-level state and the logic that pre-selected a tab on scene entry. - Show a "Select a category above to see its games" hint instead, destroyed once the user picks a category.
This commit is contained in:
parent
4ecfcaee50
commit
f2108e6258
|
|
@ -6,8 +6,6 @@ import { addFullscreenButton } from '../ui/FullscreenButton.js';
|
||||||
import { playMenuMusic, stopMenuMusic } from '../ui/MenuMusic.js';
|
import { playMenuMusic, stopMenuMusic } from '../ui/MenuMusic.js';
|
||||||
import { TutorialModal } from '../ui/TutorialModal.js';
|
import { TutorialModal } from '../ui/TutorialModal.js';
|
||||||
|
|
||||||
let _lastCategory = null;
|
|
||||||
|
|
||||||
const CATEGORIES = [
|
const CATEGORIES = [
|
||||||
{ key: 'tabletop', label: 'Tabletop' },
|
{ key: 'tabletop', label: 'Tabletop' },
|
||||||
{ key: 'cards', label: 'Cards & Dice' },
|
{ key: 'cards', label: 'Cards & Dice' },
|
||||||
|
|
@ -107,14 +105,16 @@ export default class GameMenuScene extends Phaser.Scene {
|
||||||
this._tabIcons[key] = icon;
|
this._tabIcons[key] = icon;
|
||||||
});
|
});
|
||||||
|
|
||||||
const startKey = allActiveCats.find(c => c.key === _lastCategory) ? _lastCategory : allActiveCats[0].key;
|
// No category is selected by default — the user picks one to see games.
|
||||||
this.showCategory(startKey);
|
this._hintText = this.add.text(cx, 540, 'Select a category above to see its games', {
|
||||||
|
fontSize: '26px', color: COLORS.mutedHex,
|
||||||
|
}).setOrigin(0.5);
|
||||||
|
|
||||||
new Button(this, cx, GAME_HEIGHT - 60, 'Back', () => this.scene.start('Landing'), { variant: 'ghost' });
|
new Button(this, cx, GAME_HEIGHT - 60, 'Back', () => this.scene.start('Landing'), { variant: 'ghost' });
|
||||||
}
|
}
|
||||||
|
|
||||||
showCategory(key) {
|
showCategory(key) {
|
||||||
_lastCategory = key;
|
if (this._hintText) { this._hintText.destroy(); this._hintText = null; }
|
||||||
for (const [k, btn] of Object.entries(this._tabs)) {
|
for (const [k, btn] of Object.entries(this._tabs)) {
|
||||||
btn.setActive(k === key);
|
btn.setActive(k === key);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue