fix(engine): add missing modal scrim guard to leaderboard panel
Android Release / build-apk (push) Successful in 4m29s
Android Release / build-apk (push) Successful in 4m29s
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<ModalScrim>, Without<LeaderboardScreen>)> and the early-return guard before spawn_leaderboard_screen is called. Closes #77 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -191,6 +191,7 @@ fn toggle_leaderboard_screen(
|
||||
keys: Res<ButtonInput<KeyCode>>,
|
||||
mut requests: MessageReader<ToggleLeaderboardRequestEvent>,
|
||||
screens: Query<Entity, With<LeaderboardScreen>>,
|
||||
other_modal_scrims: Query<(), (With<ModalScrim>, Without<LeaderboardScreen>)>,
|
||||
data: Res<LeaderboardResource>,
|
||||
provider: Option<Res<SyncProviderResource>>,
|
||||
settings: Option<Res<SettingsResource>>,
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user