From 0a5636116849b8534aab1d78d60812dd3e19bb45 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Tue, 19 Sep 2023 22:22:26 -0700 Subject: [PATCH] monologues and fonts refactor. now I just need to do scenes and animations... --- bin/editor.rs | 2 +- src/editor/font.rs | 45 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/bin/editor.rs b/bin/editor.rs index d8bfaab..40be78d 100644 --- a/bin/editor.rs +++ b/bin/editor.rs @@ -116,7 +116,7 @@ fn main() { sync_monologue_font, ), ) - .add_systems(Update, (fonts_ui, set_active_font)) + .add_systems(Update, (fonts_ui, ui_control_font, sync_font)) .add_systems(Startup, reload_assets) .add_systems( Update, diff --git a/src/editor/font.rs b/src/editor/font.rs index af882b1..38ca43f 100644 --- a/src/editor/font.rs +++ b/src/editor/font.rs @@ -61,11 +61,50 @@ pub fn fonts_ui( }); } -pub fn set_active_font( - events: Query<&ui::TargetAsset, Added>, +pub fn ui_control_font( + events: Query< + (&Interaction, &ui::TargetAsset, Option<&ui::Active>), + (With