From 2f19df9f953f8d6b0e90190407d4ccd784ddb42d Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 19 Mar 2024 06:07:20 +0100 Subject: [PATCH] prevent multiple chats with the same person --- assets/scenes/conversations.scn.ron | 2 +- src/actor.rs | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/scenes/conversations.scn.ron b/assets/scenes/conversations.scn.ron index 8f91596..352706d 100644 --- a/assets/scenes/conversations.scn.ron +++ b/assets/scenes/conversations.scn.ron @@ -20,7 +20,7 @@ id: "hialien", name: "Icarus", label: "requested", - delay: 5.0, + delay: 8.0, sound: "chat", reply: "Oh hey there, didn't even notice you! Was playing some VR game! What's up?", goto: "reply1", diff --git a/src/actor.rs b/src/actor.rs index 3c80279..cb4f829 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -182,12 +182,24 @@ pub fn handle_input( pub fn handle_new_conversations( mut commands: Commands, mut er_conv: EventReader, + mut ew_sfx: EventWriter, + q_conv: Query<&Chat>, time: Res