From 866e8c5ff54aa0cd603958f58f7c19956a8dc599 Mon Sep 17 00:00:00 2001 From: Franklin Date: Wed, 8 Nov 2023 13:22:36 -0400 Subject: [PATCH] Solved gun firing on resume button click --- src/logic/core/player/hands.rs | 1 + src/ui/game/settings_screen.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/logic/core/player/hands.rs b/src/logic/core/player/hands.rs index 1ab5677..9562f42 100644 --- a/src/logic/core/player/hands.rs +++ b/src/logic/core/player/hands.rs @@ -91,6 +91,7 @@ pub fn capture_hand_usage( } // SHOOTING & RECOIL if mouse_buttons.pressed(MouseButton::Left) && !settings_screen_config.settings_menu_shown { + //TODO: make click input not shoot when just clicked after a menu if player_firing_info.full_auto_timer.finished() { if magazine_data.rounds_shot < magazine_data.max_capacity { // Get recoil numbers from patterns diff --git a/src/ui/game/settings_screen.rs b/src/ui/game/settings_screen.rs index 8981a58..c302111 100644 --- a/src/ui/game/settings_screen.rs +++ b/src/ui/game/settings_screen.rs @@ -93,6 +93,7 @@ pub fn handle_settings_button_click( query: Query<(&Interaction, &SettingsScreenActions), Changed>, mut exit: EventWriter, mut settings: ResMut, + mut mouse_buttons: ResMut>, ) { for (interaction, action) in query.iter() { match interaction { @@ -105,6 +106,7 @@ pub fn handle_settings_button_click( SettingsScreenActions::Resume => { // RESUME GAME settings.settings_menu_shown = false; + mouse_buttons.release(MouseButton::Left); } } },