From 83f43ee06c33e27b55b3483aff5b0e6303a46271 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 10 May 2024 10:37:40 +0200 Subject: [PATCH] rename effects.rs to visual.rs --- src/actor.rs | 16 ++++++++-------- src/chat.rs | 12 ++++++------ src/main.rs | 4 ++-- src/{effects.rs => visual.rs} | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) rename src/{effects.rs => visual.rs} (99%) diff --git a/src/actor.rs b/src/actor.rs index 8b55da7..9bcad65 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -18,7 +18,7 @@ use bevy::prelude::*; use bevy_xpbd_3d::prelude::*; use bevy::scene::SceneInstance; use bevy::math::DVec3; -use crate::{actor, audio, camera, chat, commands, effects, hud, nature, var, world}; +use crate::{actor, audio, camera, chat, commands, hud, nature, var, visual, world}; use std::collections::HashMap; pub const ENGINE_SPEED_FACTOR: f32 = 30.0; @@ -506,7 +506,7 @@ fn handle_player_death( mut scene_spawner: ResMut, mut active_asteroids: ResMut, mut ew_sfx: EventWriter, - mut ew_effect: EventWriter, + mut ew_effect: EventWriter, mut log: ResMut, mut settings: ResMut, ) { @@ -528,22 +528,22 @@ fn handle_player_death( match death.0 { DamageType::Mental => { - ew_effect.send(effects::SpawnEffectEvent { - class: effects::Effects::FadeIn(Color::BLACK), + ew_effect.send(visual::SpawnEffectEvent { + class: visual::Effects::FadeIn(Color::BLACK), duration: 4.0, }); } DamageType::Asphyxiation => { ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::WakeUp)); - ew_effect.send(effects::SpawnEffectEvent { - class: effects::Effects::FadeIn(Color::BLACK), + ew_effect.send(visual::SpawnEffectEvent { + class: visual::Effects::FadeIn(Color::BLACK), duration: 1.0, }); } DamageType::Trauma | _ => { ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::WakeUp)); - ew_effect.send(effects::SpawnEffectEvent { - class: effects::Effects::FadeIn(Color::MAROON), + ew_effect.send(visual::SpawnEffectEvent { + class: visual::Effects::FadeIn(Color::MAROON), duration: 1.0, }); } diff --git a/src/chat.rs b/src/chat.rs index 09b39b7..2c8861a 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -11,7 +11,7 @@ // This module loads the chat definitions from the YAML files // and manages the flow of conversations. -use crate::{actor, audio, effects, hud, var, world}; +use crate::{actor, audio, hud, var, visual, world}; use bevy::prelude::*; use bevy::math::DVec3; use bevy_xpbd_3d::prelude::*; @@ -791,7 +791,7 @@ pub fn handle_chat_scripts( mut q_player: Query<(&mut actor::Actor, &mut actor::Suit, &mut actor::ExperiencesGForce), With>, mut q_playercam: Query<(&mut Position, &mut LinearVelocity), With>, mut ew_sfx: EventWriter, - mut ew_effect: EventWriter, + mut ew_effect: EventWriter, id2pos: Res, ) { for script in er_chatscript.read() { @@ -871,15 +871,15 @@ pub fn handle_chat_scripts( gforce.ignore_gforce_seconds = 1.0; } ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::WakeUp)); - ew_effect.send(effects::SpawnEffectEvent { - class: effects::Effects::FadeIn(Color::CYAN), + ew_effect.send(visual::SpawnEffectEvent { + class: visual::Effects::FadeIn(Color::CYAN), duration: 1.0, }); } } "cryofadeout" => { - ew_effect.send(effects::SpawnEffectEvent { - class: effects::Effects::FadeOut(Color::CYAN), + ew_effect.send(visual::SpawnEffectEvent { + class: visual::Effects::FadeOut(Color::CYAN), duration: 5.1, }); } diff --git a/src/main.rs b/src/main.rs index 6f8b3f9..6d51bf7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,10 +16,10 @@ mod audio; mod camera; mod chat; mod commands; -mod effects; mod hud; mod load; mod var; +mod visual; mod world; #[allow(dead_code)] @@ -128,7 +128,7 @@ impl Plugin for OutFlyPlugin { camera::CameraPlugin, chat::ChatPlugin, commands::CommandsPlugin, - effects::EffectsPlugin, + visual::VisualPlugin, hud::HudPlugin, load::LoadPlugin, world::WorldPlugin, diff --git a/src/effects.rs b/src/visual.rs similarity index 99% rename from src/effects.rs rename to src/visual.rs index 08e96e7..27d091d 100644 --- a/src/effects.rs +++ b/src/visual.rs @@ -13,9 +13,9 @@ use bevy::prelude::*; use crate::{camera, var}; -pub struct EffectsPlugin; +pub struct VisualPlugin; -impl Plugin for EffectsPlugin { +impl Plugin for VisualPlugin { fn build(&self, app: &mut App) { app.add_systems(Startup, setup); app.add_systems(Startup, spawn_effects.after(setup).after(camera::setup_camera));