From ccf280ea50613889324aeac9bf28987438fec563 Mon Sep 17 00:00:00 2001 From: funman300 Date: Thu, 28 May 2026 15:52:47 -0700 Subject: [PATCH] fix(engine): add missing modal scrim guard to leaderboard panel toggle_leaderboard_screen was missing the other_modal_scrims guard that all other panel-toggle systems have. Pressing L (or the HUD button) while any other modal was open would spawn a second ModalScrim on top of the existing one, breaking z-ordering and leaving the first modal un-dismissable. Adds: other_modal_scrims: Query<(), (With, Without)> and the early-return guard before spawn_leaderboard_screen is called. Closes #77 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- solitaire_engine/src/leaderboard_plugin.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/solitaire_engine/src/leaderboard_plugin.rs b/solitaire_engine/src/leaderboard_plugin.rs index 341ccde..d4cb1ec 100644 --- a/solitaire_engine/src/leaderboard_plugin.rs +++ b/solitaire_engine/src/leaderboard_plugin.rs @@ -191,6 +191,7 @@ fn toggle_leaderboard_screen( keys: Res>, mut requests: MessageReader, screens: Query>, + other_modal_scrims: Query<(), (With, Without)>, data: Res, provider: Option>, settings: Option>, @@ -208,6 +209,11 @@ fn toggle_leaderboard_screen( return; } + // Don't stack a second modal scrim over one that is already open. + if !other_modal_scrims.is_empty() { + return; + } + // Spawn the panel immediately with whatever data we have so far. let remote_available = provider .as_ref()