From e6ca1c5b509cc46fddc4c663a10e852e0004cf50 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 20 Apr 2024 02:48:55 +0200 Subject: [PATCH] =?UTF-8?q?make=20pronouns=20optional=20(t=C4=81=20t=C4=81?= =?UTF-8?q?=C4=81=C4=81!)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands.rs | 9 +++++---- src/hud.rs | 2 ++ src/world.rs | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 9494572..35174d9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -44,7 +44,7 @@ struct ParserState { rotation: Quat, velocity: DVec3, angular_momentum: DVec3, - pronoun: String, + pronoun: Option, is_sphere: bool, is_player: bool, is_lifeform: bool, @@ -93,7 +93,7 @@ impl Default for ParserState { rotation: Quat::IDENTITY, velocity: DVec3::splat(0.0), angular_momentum: DVec3::new(0.03, 0.3, 0.09), - pronoun: "they/them".to_string(), + pronoun: None, is_sphere: false, is_player: false, is_lifeform: false, @@ -264,7 +264,7 @@ pub fn load_defs( } } ["pronoun", pronoun] => { - state.pronoun = pronoun.to_string(); + state.pronoun = Some(pronoun.to_string()); } ["chatid", chat] => { state.chat = chat.to_string(); @@ -602,6 +602,7 @@ fn spawn_entities( if state.is_clickable { actor.insert(hud::IsClickable { name: state.name.clone(), + pronoun: state.pronoun.clone(), ..default() }); } @@ -632,7 +633,7 @@ fn spawn_entities( actor_id: state.id.clone(), chat_name: state.chat.clone(), name: state.name.clone(), - pronoun: Some(state.pronoun.clone()), + pronoun: state.pronoun.clone(), talking_speed: 1.0, }); } diff --git a/src/hud.rs b/src/hud.rs index a80c169..1ab1cd4 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -111,10 +111,12 @@ impl Message { #[derive(Component)] pub struct IsClickable { pub name: Option, + pub pronoun: Option, pub distance: Option, } impl Default for IsClickable { fn default() -> Self { Self { name: None, + pronoun: None, distance: None, }}} diff --git a/src/world.rs b/src/world.rs index f786980..63856e3 100644 --- a/src/world.rs +++ b/src/world.rs @@ -161,6 +161,7 @@ pub fn setup( hud::IsClickable { name: Some(name), distance, + ..default() }, PbrBundle { mesh: sphere_handle.clone(),