This commit is contained in:
yuni 2024-04-14 14:57:49 +02:00
parent 86cd3b049e
commit 600f9d5e3e

View file

@ -115,8 +115,7 @@ pub enum ChatEvent {
SpawnMessage(String, hud::LogLevel, String), SpawnMessage(String, hud::LogLevel, String),
SpawnChoice(String, usize, ChatPos, bool), SpawnChoice(String, usize, ChatPos, bool),
RunScript(String), RunScript(String),
Sleep(f64), SleepSeconds(f64),
//Script(String, String, String),
} }
// This is the only place where any YAML interaction should be happening. // This is the only place where any YAML interaction should be happening.
@ -462,7 +461,7 @@ impl ChatDB {
match (key, value) { match (key, value) {
(Some(TOKEN_SLEEP), Value::Number(time)) => { (Some(TOKEN_SLEEP), Value::Number(time)) => {
if let Some(time_f64) = time.as_f64() { if let Some(time_f64) = time.as_f64() {
event.send(ChatEvent::Sleep(time_f64)); event.send(ChatEvent::SleepSeconds(time_f64));
} }
} }
(Some(TOKEN_GOTO), Value::String(label)) => { (Some(TOKEN_GOTO), Value::String(label)) => {
@ -651,7 +650,7 @@ pub fn handle_chat_events(
ChatEvent::RunScript(script) => { ChatEvent::RunScript(script) => {
ew_chatscript.send(ChatScriptEvent(script.clone())); ew_chatscript.send(ChatScriptEvent(script.clone()));
} }
ChatEvent::Sleep(sleep_duration) => { ChatEvent::SleepSeconds(sleep_duration) => {
chat.timer = now + sleep_duration; chat.timer = now + sleep_duration;
} }
} }
@ -663,7 +662,6 @@ fn handle_reply_keys(
settings: ResMut<var::Settings>, settings: ResMut<var::Settings>,
q_choices: Query<&Choice>, q_choices: Query<&Choice>,
mut q_chats: Query<&mut Chat>, mut q_chats: Query<&mut Chat>,
//mut evwriter_sendmsg: EventWriter<SendMessageEvent>,
mut evwriter_sfx: EventWriter<audio::PlaySfxEvent>, mut evwriter_sfx: EventWriter<audio::PlaySfxEvent>,
time: Res<Time>, time: Res<Time>,
) { ) {