fix(frontend): drop Change Theme button, stop pre-selecting last theme
- Theme-picker modal always opens with a fixed default highlighted card instead of the last-played theme. - Removed the change-theme-btn entirely; Back to Menu is now the only result-modal button shown while a solo/bot round is active, and does what Change Theme used to (go to the main menu) plus solo cleanup.
This commit is contained in:
parent
6c01d7e4e0
commit
16d36328ec
3 changed files with 5 additions and 12 deletions
|
|
@ -184,7 +184,6 @@
|
|||
</div>
|
||||
<div class="modal-actions">
|
||||
<button id="close-result-btn" class="btn ghost">Keep Comparing</button>
|
||||
<button id="change-theme-btn" class="btn ghost">🔄 Change Theme</button>
|
||||
<button id="back-to-menu-btn" class="btn ghost hidden">🏠 Back to Menu</button>
|
||||
<button id="play-again-btn" class="btn primary">Play Again</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ const matchmakingStatusEl = requireEl<HTMLElement>('matchmaking-status');
|
|||
const helpBtn = requireEl<HTMLButtonElement>('help-btn');
|
||||
const muteBtn = requireEl<HTMLButtonElement>('mute-btn');
|
||||
const themeNameBadge = requireEl<HTMLElement>('theme-name-badge');
|
||||
const changeThemeBtn = requireEl<HTMLButtonElement>('change-theme-btn');
|
||||
const backToMenuBtn = requireEl<HTMLButtonElement>('back-to-menu-btn');
|
||||
const privateRoomMount = requireEl<HTMLElement>('private-room-mount');
|
||||
|
||||
|
|
@ -66,7 +65,6 @@ createSoloConfigFlow(
|
|||
themeNameBadge,
|
||||
preview: previewElements,
|
||||
themePicker: themePickerElements,
|
||||
changeThemeBtn,
|
||||
backToMenuBtn,
|
||||
},
|
||||
{ hideMenu: () => showView(null), showMenu: () => showView('menu') },
|
||||
|
|
@ -88,7 +86,6 @@ createMatchmakingFlow(
|
|||
);
|
||||
|
||||
helpBtn.addEventListener('click', () => showView('menu'));
|
||||
changeThemeBtn.addEventListener('click', () => showView('menu'));
|
||||
|
||||
muteBtn.addEventListener('click', () => {
|
||||
const muted = sound.toggleMute();
|
||||
|
|
|
|||
|
|
@ -53,11 +53,10 @@ export interface SoloConfigFlowElements {
|
|||
gridMount: HTMLElement;
|
||||
cancelBtn: HTMLButtonElement;
|
||||
};
|
||||
/** Result-modal button used by every non-solo match; hidden for as
|
||||
* long as a solo/bot round is active, in favor of `backToMenuBtn`. */
|
||||
changeThemeBtn: HTMLButtonElement;
|
||||
/** Result-modal button shown in `changeThemeBtn`'s place once a
|
||||
* solo/bot round has started. */
|
||||
/** Result-modal button shown for as long as a solo/bot round is
|
||||
* active — does the same "back to the main menu" thing the old
|
||||
* change-theme button used to, plus solo cleanup (stops the bot,
|
||||
* hides the timer HUD). */
|
||||
backToMenuBtn: HTMLButtonElement;
|
||||
}
|
||||
|
||||
|
|
@ -238,7 +237,7 @@ export function createSoloConfigFlow(
|
|||
|
||||
const timerHud = createTimerHud(elements.timerMount, quit);
|
||||
|
||||
const themeGrid = createThemeGrid(elements.themePicker.gridMount, readLastTheme() ?? 'gruvbox', (themeId) => {
|
||||
const themeGrid = createThemeGrid(elements.themePicker.gridMount, 'gruvbox', (themeId) => {
|
||||
sound.playOpen();
|
||||
if (!pendingConfig) return;
|
||||
const config = pendingConfig;
|
||||
|
|
@ -277,7 +276,6 @@ export function createSoloConfigFlow(
|
|||
lastConfig = config;
|
||||
soloActive = true;
|
||||
writeLastTheme(config.themeId);
|
||||
elements.changeThemeBtn.classList.add('hidden');
|
||||
elements.backToMenuBtn.classList.remove('hidden');
|
||||
hooks.hideMenu();
|
||||
runThemePreview(elements.preview, config.themeId, () => {
|
||||
|
|
@ -365,7 +363,6 @@ export function createSoloConfigFlow(
|
|||
soloActive = false;
|
||||
botMatch.stop();
|
||||
timerHud.hide();
|
||||
elements.changeThemeBtn.classList.remove('hidden');
|
||||
elements.backToMenuBtn.classList.add('hidden');
|
||||
hooks.showMenu();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue