vendored bevy_egui and removed legacy code :/
Signed-off-by: Sienna Meridian Satterwhite <sienna@r3t.io>
This commit is contained in:
@@ -169,6 +169,11 @@ impl InputController {
|
||||
let mut actions = Vec::new();
|
||||
|
||||
match event {
|
||||
InputEvent::MouseMove { pos: _ } => {
|
||||
// Mouse hover - no game actions, just UI tracking
|
||||
// This is handled by egui's custom_input_system
|
||||
}
|
||||
|
||||
InputEvent::Mouse { pos, button, phase } => {
|
||||
self.process_mouse(*pos, *button, *phase, &mut actions);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,15 @@ pub struct Modifiers {
|
||||
pub meta: bool, // Command on macOS, Windows key on Windows
|
||||
}
|
||||
|
||||
/// Input event buffer for Bevy ECS integration
|
||||
///
|
||||
/// The executor fills this buffer each frame with input events from winit,
|
||||
/// and Bevy systems (like egui) consume these events.
|
||||
#[derive(bevy::prelude::Resource, Default, Clone)]
|
||||
pub struct InputEventBuffer {
|
||||
pub events: Vec<InputEvent>,
|
||||
}
|
||||
|
||||
/// Abstract input event that the engine processes
|
||||
///
|
||||
/// Platform-specific code converts native input (UITouch, winit events)
|
||||
@@ -72,6 +81,13 @@ pub enum InputEvent {
|
||||
phase: TouchPhase,
|
||||
},
|
||||
|
||||
/// Mouse cursor movement (no button pressed)
|
||||
/// This is separate from Mouse to distinguish hover from drag
|
||||
MouseMove {
|
||||
/// Screen position in pixels
|
||||
pos: Vec2,
|
||||
},
|
||||
|
||||
/// Touch input (fingers on touchscreen)
|
||||
Touch {
|
||||
/// Screen position in pixels
|
||||
@@ -107,6 +123,7 @@ impl InputEvent {
|
||||
match self {
|
||||
InputEvent::Stylus { pos, .. } => Some(*pos),
|
||||
InputEvent::Mouse { pos, .. } => Some(*pos),
|
||||
InputEvent::MouseMove { pos } => Some(*pos),
|
||||
InputEvent::Touch { pos, .. } => Some(*pos),
|
||||
InputEvent::MouseWheel { pos, .. } => Some(*pos),
|
||||
InputEvent::Keyboard { .. } => None,
|
||||
@@ -119,7 +136,7 @@ impl InputEvent {
|
||||
InputEvent::Stylus { phase, .. } => Some(*phase),
|
||||
InputEvent::Mouse { phase, .. } => Some(*phase),
|
||||
InputEvent::Touch { phase, .. } => Some(*phase),
|
||||
InputEvent::Keyboard { .. } | InputEvent::MouseWheel { .. } => None,
|
||||
InputEvent::Keyboard { .. } | InputEvent::MouseWheel { .. } | InputEvent::MouseMove { .. } => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ pub use core::EngineCore;
|
||||
pub use events::EngineEvent;
|
||||
pub use game_actions::GameAction;
|
||||
pub use input_controller::{AccessibilitySettings, InputContext, InputController};
|
||||
pub use input_events::{InputEvent, KeyCode, Modifiers, MouseButton, TouchPhase};
|
||||
pub use input_events::{InputEvent, InputEventBuffer, KeyCode, Modifiers, MouseButton, TouchPhase};
|
||||
pub use networking::NetworkingManager;
|
||||
pub use persistence::PersistenceManager;
|
||||
|
||||
Reference in New Issue
Block a user