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>
|
||||||
<div class="modal-actions">
|
<div class="modal-actions">
|
||||||
<button id="close-result-btn" class="btn ghost">Keep Comparing</button>
|
<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="back-to-menu-btn" class="btn ghost hidden">🏠 Back to Menu</button>
|
||||||
<button id="play-again-btn" class="btn primary">Play Again</button>
|
<button id="play-again-btn" class="btn primary">Play Again</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ const matchmakingStatusEl = requireEl<HTMLElement>('matchmaking-status');
|
||||||
const helpBtn = requireEl<HTMLButtonElement>('help-btn');
|
const helpBtn = requireEl<HTMLButtonElement>('help-btn');
|
||||||
const muteBtn = requireEl<HTMLButtonElement>('mute-btn');
|
const muteBtn = requireEl<HTMLButtonElement>('mute-btn');
|
||||||
const themeNameBadge = requireEl<HTMLElement>('theme-name-badge');
|
const themeNameBadge = requireEl<HTMLElement>('theme-name-badge');
|
||||||
const changeThemeBtn = requireEl<HTMLButtonElement>('change-theme-btn');
|
|
||||||
const backToMenuBtn = requireEl<HTMLButtonElement>('back-to-menu-btn');
|
const backToMenuBtn = requireEl<HTMLButtonElement>('back-to-menu-btn');
|
||||||
const privateRoomMount = requireEl<HTMLElement>('private-room-mount');
|
const privateRoomMount = requireEl<HTMLElement>('private-room-mount');
|
||||||
|
|
||||||
|
|
@ -66,7 +65,6 @@ createSoloConfigFlow(
|
||||||
themeNameBadge,
|
themeNameBadge,
|
||||||
preview: previewElements,
|
preview: previewElements,
|
||||||
themePicker: themePickerElements,
|
themePicker: themePickerElements,
|
||||||
changeThemeBtn,
|
|
||||||
backToMenuBtn,
|
backToMenuBtn,
|
||||||
},
|
},
|
||||||
{ hideMenu: () => showView(null), showMenu: () => showView('menu') },
|
{ hideMenu: () => showView(null), showMenu: () => showView('menu') },
|
||||||
|
|
@ -88,7 +86,6 @@ createMatchmakingFlow(
|
||||||
);
|
);
|
||||||
|
|
||||||
helpBtn.addEventListener('click', () => showView('menu'));
|
helpBtn.addEventListener('click', () => showView('menu'));
|
||||||
changeThemeBtn.addEventListener('click', () => showView('menu'));
|
|
||||||
|
|
||||||
muteBtn.addEventListener('click', () => {
|
muteBtn.addEventListener('click', () => {
|
||||||
const muted = sound.toggleMute();
|
const muted = sound.toggleMute();
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,10 @@ export interface SoloConfigFlowElements {
|
||||||
gridMount: HTMLElement;
|
gridMount: HTMLElement;
|
||||||
cancelBtn: HTMLButtonElement;
|
cancelBtn: HTMLButtonElement;
|
||||||
};
|
};
|
||||||
/** Result-modal button used by every non-solo match; hidden for as
|
/** Result-modal button shown for as long as a solo/bot round is
|
||||||
* long as a solo/bot round is active, in favor of `backToMenuBtn`. */
|
* active — does the same "back to the main menu" thing the old
|
||||||
changeThemeBtn: HTMLButtonElement;
|
* change-theme button used to, plus solo cleanup (stops the bot,
|
||||||
/** Result-modal button shown in `changeThemeBtn`'s place once a
|
* hides the timer HUD). */
|
||||||
* solo/bot round has started. */
|
|
||||||
backToMenuBtn: HTMLButtonElement;
|
backToMenuBtn: HTMLButtonElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,7 +237,7 @@ export function createSoloConfigFlow(
|
||||||
|
|
||||||
const timerHud = createTimerHud(elements.timerMount, quit);
|
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();
|
sound.playOpen();
|
||||||
if (!pendingConfig) return;
|
if (!pendingConfig) return;
|
||||||
const config = pendingConfig;
|
const config = pendingConfig;
|
||||||
|
|
@ -277,7 +276,6 @@ export function createSoloConfigFlow(
|
||||||
lastConfig = config;
|
lastConfig = config;
|
||||||
soloActive = true;
|
soloActive = true;
|
||||||
writeLastTheme(config.themeId);
|
writeLastTheme(config.themeId);
|
||||||
elements.changeThemeBtn.classList.add('hidden');
|
|
||||||
elements.backToMenuBtn.classList.remove('hidden');
|
elements.backToMenuBtn.classList.remove('hidden');
|
||||||
hooks.hideMenu();
|
hooks.hideMenu();
|
||||||
runThemePreview(elements.preview, config.themeId, () => {
|
runThemePreview(elements.preview, config.themeId, () => {
|
||||||
|
|
@ -365,7 +363,6 @@ export function createSoloConfigFlow(
|
||||||
soloActive = false;
|
soloActive = false;
|
||||||
botMatch.stop();
|
botMatch.stop();
|
||||||
timerHud.hide();
|
timerHud.hide();
|
||||||
elements.changeThemeBtn.classList.remove('hidden');
|
|
||||||
elements.backToMenuBtn.classList.add('hidden');
|
elements.backToMenuBtn.classList.add('hidden');
|
||||||
hooks.showMenu();
|
hooks.showMenu();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue