fix(ui): stop global shortcuts auto-repeating; skip invalid skins

The global keyboard shortcuts tested keys without disabling key-repeat,
so holding one down fired it every frame: the theme cycle, balance and
market layout cycles, the effects and background toggles, the settings
and sidebar-collapse keys all re-triggered on a held key. Cycling themes
also stepped onto skins that had failed to load and wrote the broken
pick into settings.

- Every one-shot shortcut now checks for a fresh key press only, so a
  held key fires once.
- Theme cycling skips over invalid skins and only applies, persists, and
  shows the toast when a skin actually loads; if none can load, settings
  are left untouched and no toast appears.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 17:42:29 -05:00
co-authored by Claude Opus 4.8
parent 96352ce9ad
commit 95605dd7e9
4 changed files with 28 additions and 21 deletions
+1 -1
View File
@@ -774,7 +774,7 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
do { idx++; } while (idx < (int)NavPage::Count_ && !IsNavPageVisible(static_cast<NavPage>(idx)));
if (idx < (int)NavPage::Count_) nav = true;
}
if (ImGui::IsKeyPressed(ImGuiKey_LeftBracket))
if (ImGui::IsKeyPressed(ImGuiKey_LeftBracket, false))
collapsed = !collapsed;
if (nav) { current = static_cast<NavPage>(idx); changed = true; }
}