From 43f67877a2ba9ee7491927e15e96373448c8955d Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 14 Apr 2024 01:20:22 +0200 Subject: [PATCH] delete src/chat_old.rs (\o/) --- src/chat_old.rs | 406 ------------------------------------------------ 1 file changed, 406 deletions(-) delete mode 100644 src/chat_old.rs diff --git a/src/chat_old.rs b/src/chat_old.rs deleted file mode 100644 index eef5710..0000000 --- a/src/chat_old.rs +++ /dev/null @@ -1,406 +0,0 @@ -use bevy::prelude::*; -use bevy_xpbd_3d::prelude::*; -use bevy::math::DVec3; -use crate::{actor, audio, hud, settings, world, effects}; - -pub struct ChatPlugin; -impl Plugin for ChatPlugin { - fn build(&self, app: &mut App) { - app.register_type::(); - app.add_systems(Update, ( - handle_new_conversations, - handle_reply_keys, - handle_send_messages, - handle_conversations, - handle_chat_scripts, - )); - app.add_systems(PostUpdate, despawn_old_choices); - app.add_event::(); - app.add_event::(); - app.add_event::(); - } -} - -#[derive(Event)] -pub struct StartConversationEvent { - pub talker: Talker, -} - -#[derive(Event)] -pub struct SendMessageEvent { - pub conv_id: String, - pub conv_label: String, - pub text: String, -} - -#[derive(Event)] -pub struct ChatScriptEvent { - name: String, - param: String, - param2: String, -} - -#[derive(Debug)] -#[derive(Component, Reflect, Default)] -#[reflect(Component)] -pub struct ChatBranch { - pub id: String, - pub name: String, - pub label: String, - pub delay: f64, - pub sound: String, - pub level: String, - pub reply: String, - pub goto: String, - pub choice: String, - pub script: String, - pub script_parameter: String, - pub script_parameter2: String, -} - -#[derive(Component)] -pub struct Chat { - pub id: String, - pub label: String, - pub timer: f64, -} - -#[derive(Component)] -pub struct ChoiceAvailable { - pub conv_id: String, - pub conv_label: String, - pub recipient: String, - pub text: String, -} - - -#[derive(Component)] -#[derive(Clone)] -pub struct Talker { - pub pronoun: String, - pub conv_id: String, -} -impl Default for Talker { fn default() -> Self { Self { - pronoun: "they/them".to_string(), - conv_id: "error".to_string(), -}}} - -pub fn handle_new_conversations( - mut commands: Commands, - mut er_conv: EventReader, - mut ew_sfx: EventWriter, - q_conv: Query<&Chat>, - time: Res