diff --git a/src/logic/core/player/hands.rs b/src/logic/core/player/hands.rs index e182c74..0bbfdf3 100644 --- a/src/logic/core/player/hands.rs +++ b/src/logic/core/player/hands.rs @@ -73,7 +73,7 @@ pub fn capture_hand_usage( for (player, mut player_inventory, _player_entity, player_transform, mut player_firing_info) in player_query.iter_mut() { // Equipping gun // Validate player has primary item, and secondary item in inventory - if !resources.game_ui_state.any_window() { + if !resources.game_ui_state.any_window() && !player_firing_info.is_reloading { if resources.keyboard_input.just_pressed(KeyCode::Key1) { if let Some(primary_item) = player_inventory.get_primary() { if let Some(primary_firearm) = primary_item.get_firearm() { @@ -108,14 +108,13 @@ pub fn capture_hand_usage( Some(current_slot) => { player_inventory::drop_slot_in_game_world(&mut commands, player_transform, &mut inventory_changed_events, &mut player_inventory, &resources.assets_gltf, &resources.loaded_gltf_assets, current_slot); equipment_change_event_writer.send(EquipmentChangeEvent(Equipment::Nothing)); + player_inventory.current_slot = None; }, None => {}, } } } - - // Firearm stuff if let Equipment::Firearm(player_firearm) = player.0.equipment.clone() { player_firing_info diff --git a/src/setup/equipment.rs b/src/setup/equipment.rs index a932435..459185b 100644 --- a/src/setup/equipment.rs +++ b/src/setup/equipment.rs @@ -38,6 +38,7 @@ pub fn change_equipment( let Ok((mut player, player_firing_info)) = player_query.get_single_mut() else { return; }; + //if player_firing_info.is_reloading { return; } // Primary firearm change let player_hands = player_hands_query.single_mut(); diff --git a/src/ui/game/inventory/menu.rs b/src/ui/game/inventory/menu.rs index 019f3fe..8b0274d 100644 --- a/src/ui/game/inventory/menu.rs +++ b/src/ui/game/inventory/menu.rs @@ -44,6 +44,7 @@ pub fn setup_inventory_screen(mut commands: Commands) { flex_direction: FlexDirection::Column, ..Default::default() }, + background_color: BackgroundColor(Color::RED), ..Default::default() }) .set_parent(background_id) @@ -65,10 +66,11 @@ pub fn setup_inventory_screen(mut commands: Commands) { }) .set_parent(background_id) .id(); + } pub fn update_inventory_screen( - mut commands: Commands, + //mut commands: Commands, game_ui_state: Res, mut inventory_screen_query: Query<&mut Visibility, With>, ) {