Solved gun firing on resume button click

This commit is contained in:
Franklin 2023-11-08 13:22:36 -04:00
parent adb9cdbe83
commit 866e8c5ff5
2 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,7 @@ pub fn capture_hand_usage(
} }
// SHOOTING & RECOIL // SHOOTING & RECOIL
if mouse_buttons.pressed(MouseButton::Left) && !settings_screen_config.settings_menu_shown { 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 player_firing_info.full_auto_timer.finished() {
if magazine_data.rounds_shot < magazine_data.max_capacity { if magazine_data.rounds_shot < magazine_data.max_capacity {
// Get recoil numbers from patterns // Get recoil numbers from patterns

View File

@ -93,6 +93,7 @@ pub fn handle_settings_button_click(
query: Query<(&Interaction, &SettingsScreenActions), Changed<Interaction>>, query: Query<(&Interaction, &SettingsScreenActions), Changed<Interaction>>,
mut exit: EventWriter<AppExit>, mut exit: EventWriter<AppExit>,
mut settings: ResMut<SettingsScreenUIConfiguration>, mut settings: ResMut<SettingsScreenUIConfiguration>,
mut mouse_buttons: ResMut<Input<MouseButton>>,
) { ) {
for (interaction, action) in query.iter() { for (interaction, action) in query.iter() {
match interaction { match interaction {
@ -105,6 +106,7 @@ pub fn handle_settings_button_click(
SettingsScreenActions::Resume => { SettingsScreenActions::Resume => {
// RESUME GAME // RESUME GAME
settings.settings_menu_shown = false; settings.settings_menu_shown = false;
mouse_buttons.release(MouseButton::Left);
} }
} }
}, },