From 8afa56d306f404ebe16fe5e1073ee94abacbae21 Mon Sep 17 00:00:00 2001 From: Franklin Date: Sun, 12 Nov 2023 11:05:37 -0400 Subject: [PATCH] Interactable hud bug fixes --- src/comps/core/controller.rs | 28 +++- src/comps/core/events/loot_container.rs | 2 +- src/comps/core/events/mod.rs | 2 +- src/comps/core/events/pickup_item.rs | 2 +- src/comps/core/grid.rs | 16 +- src/comps/core/inventory/any_inventory.rs | 29 ++-- src/comps/core/inventory/inventory_item.rs | 16 +- src/comps/core/inventory/item_inventory.rs | 4 +- src/comps/core/inventory/mod.rs | 2 +- src/comps/core/inventory/player_inventory.rs | 10 +- src/comps/core/items/guns/m4a1.rs | 46 ++++++ src/comps/core/items/guns/mod.rs | 1 + src/comps/core/items/item.rs | 88 +++++++++- src/comps/core/items/mod.rs | 3 +- src/comps/core/markers/bullet.rs | 9 +- src/comps/core/markers/firearm.rs | 7 +- src/comps/core/markers/holdable.rs | 7 + src/comps/core/markers/interactable.rs | 2 +- src/comps/core/markers/mod.rs | 6 +- src/comps/core/markers/muzzle_flash.rs | 2 +- src/comps/core/markers/player.rs | 2 +- src/comps/core/mod.rs | 6 +- src/comps/guns/mod.rs | 1 + src/constants/mod.rs | 1 + src/logic/core/guns/caliber.rs | 2 +- src/logic/core/guns/despawn_shots.rs | 139 +++++++++------- src/logic/core/guns/equip_firearm.rs | 2 +- src/logic/core/guns/firearm.rs | 21 ++- src/logic/core/guns/mod.rs | 6 +- src/logic/core/guns/shoot.rs | 117 +++++++------ src/logic/core/guns/spray_pattern.rs | 2 - src/logic/core/mod.rs | 2 +- src/logic/core/player/camera_effects.rs | 1 + src/logic/core/player/camera_player_sync.rs | 91 ++++++++--- src/logic/core/player/hands.rs | 154 +++++++++++++----- src/logic/core/player/mod.rs | 2 +- src/logic/core/player/player_movement.rs | 43 +++-- src/logic/core/player/player_values_state.rs | 14 +- src/logic/core/player/player_vertical_sync.rs | 5 +- src/main.rs | 4 +- src/scenes/scene1/ground.rs | 4 +- src/scenes/scene1/init.rs | 28 +++- src/scenes/scene1/items.rs | 16 ++ src/scenes/scene1/lighting.rs | 23 +-- src/scenes/scene1/mod.rs | 3 +- src/scenes/scene1/obstacles.rs | 37 +++-- src/scenes/scene1/skybox.rs | 7 +- src/scenes/scene1/spawn_points.rs | 20 ++- src/setup/animations.rs | 16 +- src/setup/assets.rs | 31 ++-- src/setup/equipment.rs | 76 ++++++--- src/setup/load_state.rs | 7 +- src/setup/mod.rs | 4 +- src/setup/spawn.rs | 16 +- src/setup/spawners/firearm.rs | 12 -- src/setup/spawners/item.rs | 22 +++ src/setup/spawners/mod.rs | 2 +- src/setup/spawners/player.rs | 25 ++- src/ui/editor/inspector.rs | 25 ++- src/ui/editor/mod.rs | 4 +- src/ui/editor/plugin.rs | 83 ++++++---- src/ui/game/fps_counter.rs | 45 +++-- src/ui/game/hud/hud.rs | 4 +- src/ui/game/hud/interact_clue.rs | 48 +++--- src/ui/game/hud/mod.rs | 2 +- src/ui/game/hud/plugin.rs | 3 +- src/ui/game/inventory/menu.rs | 10 +- src/ui/game/inventory/mod.rs | 2 +- src/ui/game/inventory/plugin.rs | 3 +- src/ui/game/mod.rs | 6 +- src/ui/game/plugin.rs | 32 ++-- src/ui/game/settings.rs | 9 +- src/ui/game/settings_screen.rs | 134 ++++++++------- src/ui/mod.rs | 2 +- 74 files changed, 1097 insertions(+), 561 deletions(-) create mode 100644 src/comps/core/items/guns/m4a1.rs create mode 100644 src/comps/core/items/guns/mod.rs create mode 100644 src/scenes/scene1/items.rs delete mode 100644 src/setup/spawners/firearm.rs create mode 100644 src/setup/spawners/item.rs diff --git a/src/comps/core/controller.rs b/src/comps/core/controller.rs index 8498095..fa853f2 100644 --- a/src/comps/core/controller.rs +++ b/src/comps/core/controller.rs @@ -1,9 +1,15 @@ use bevy::prelude::*; use bevy_rapier3d::prelude::*; -use crate::{logic::core::player::{player_movement::{ - move_player, PlayerLinearXZState, PlayerLinearYState, PlayerMovementInput, -}, player_values_state::PlayerValuesState}, ui::game::settings::SettingsScreenUIConfiguration}; +use crate::{ + logic::core::player::{ + player_movement::{ + move_player, PlayerLinearXZState, PlayerLinearYState, PlayerMovementInput, + }, + player_values_state::PlayerValuesState, + }, + ui::game::settings::SettingsScreenUIConfiguration, +}; use super::markers::player::Player; @@ -23,7 +29,7 @@ pub fn capture_input( >, time: Res