From e7aed2f974e910b9673be79e91ff672f52248275 Mon Sep 17 00:00:00 2001 From: Franklin Date: Thu, 16 Nov 2023 16:05:32 -0400 Subject: [PATCH] AAA --- src/comps/core/markers/magazine.rs | 7 +++++++ src/main.rs | 4 ++-- src/scenes/scene1/init.rs | 2 +- src/ui/game/inventory/controls.rs | 13 +++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/comps/core/markers/magazine.rs create mode 100644 src/ui/game/inventory/controls.rs diff --git a/src/comps/core/markers/magazine.rs b/src/comps/core/markers/magazine.rs new file mode 100644 index 0000000..3298b87 --- /dev/null +++ b/src/comps/core/markers/magazine.rs @@ -0,0 +1,7 @@ +use bevy::prelude::*; + +#[derive(Component, PartialEq, Eq, PartialOrd, Ord, Clone)] +pub struct MagazineMarker { + pub capacity: u32, + pub fired: u32, +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 41a4a9b..7a0ff3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,10 +28,10 @@ fn main() { fn setup_plugins(application: &mut App) { application - .add_plugins(DefaultPlugins) - .add_plugins(ComponentsFromGltfPlugin) + .add_plugins(DefaultPlugins.set(AssetPlugin::default())) //.add_plugins(DefaultInspectorConfigPlugin) .add_plugins(RapierPhysicsPlugin::::default()) + .add_plugins(ComponentsFromGltfPlugin) //.add_plugins(bevy_egui::EguiPlugin) //.add_plugins(WorldInspectorPlugin::new()) .add_plugins(proxy::plugin::ProxyComponentsPlugin) diff --git a/src/scenes/scene1/init.rs b/src/scenes/scene1/init.rs index c50c45d..f3ccd0b 100644 --- a/src/scenes/scene1/init.rs +++ b/src/scenes/scene1/init.rs @@ -39,7 +39,7 @@ pub fn load_scene(application: &mut App) { application.add_plugins(SpawnerPlugin); application.add_plugins(InventoryPlugin); // Startup - application.add_systems(PreStartup, load_all_assets); + application.add_systems(Startup, load_all_assets); application.add_systems(Startup, spawn_ground); application.add_systems(Startup, spawn_obstacles); application.add_systems(Startup, setup_lighting); diff --git a/src/ui/game/inventory/controls.rs b/src/ui/game/inventory/controls.rs new file mode 100644 index 0000000..5e216e1 --- /dev/null +++ b/src/ui/game/inventory/controls.rs @@ -0,0 +1,13 @@ +// This is where you'll create an update system to do things with keybinds in the Inventory System +use bevy::prelude::*; + + +#[allow(unused)] +pub fn inventory_keybinds_system( + mut commands: Commands, + keyboard_input: Res>, +) { + if keyboard_input.just_pressed(KeyCode::G) { + // TODO: Drop item hovered + } +} \ No newline at end of file