Refactor systems to use EventBus for communication

- Removed direct dependencies on GameState in multiple systems, replacing them with EventBus for event-driven architecture.
- Updated CameraShakeSystem to handle focus changes and trauma through EventBus.
- Modified DeadliftSystem to manage lift efforts and hazards using EventBus.
- Refactored GameManager to handle lift results and day transitions via EventBus.
- Adjusted HazardController and HazardSystem to publish and respond to hazard events through EventBus.
- Enhanced PlayerInputSystem to publish lift efforts and focus releases using EventBus.
- Updated SoundManager to handle various audio events through EventBus, improving sound management.
- Refined TunnelSystem to manage focus changes and lift efforts using EventBus.
- Adjusted LiftProgressBar to update progress based on events from EventBus.
- Enhanced LiftSyncController to synchronize animations based on lift efforts and focus events via EventBus.
This commit is contained in:
2026-01-24 18:15:34 +01:00
parent 140e0f1cff
commit 266fa4ac1d
24 changed files with 738 additions and 540 deletions

14
rust/src/consts.rs Normal file
View File

@@ -0,0 +1,14 @@
pub const EVENT_BUS_PATH: &str = "/root/GlobalEventBus";
pub const LIFT_ACTION: &str = "lift_action";
pub const LIFT_EFFORT_APPLIED: &str = "lift_effort_applied";
pub const FOCUS_RELEASED: &str = "focus_released";
pub const FOCUS_CHANGED: &str = "focus_changed";
pub const LIFT_COMPLETED: &str = "lift_completed";
pub const LIFT_PROGRESS: &str = "lift_progress";
pub const LIFT_VISUAL_HEIGHT: &str = "lift_visual_height";
pub const CAMERA_TRAUMA: &str = "camera_trauma";
pub const HAZARD_SPAWNED: &str = "hazard_spawned";
pub const HAZARD_RESOLVED: &str = "hazard_resolved";
pub const VIGNETTE_INTENSITY_PARAM: &str = "vignette_intensity";