From c2d89772336c52cce0b629f6ffc506eb1f221867 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Thu, 21 Nov 2024 12:33:58 -0500 Subject: Thu Nov 21 12:33:58 PM EST 2024 --- src/widgets/mod.rs | 3 +++ src/widgets/systems.rs | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index 46bfa20..7751b2d 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -17,5 +17,8 @@ pub trait TerminalWidget: DowncastSync { /// Called when a terminal input event is invoked to update any state accordingly fn handle_events(&mut self, _event: &TerminalInputEvent, _commands: &mut Commands) {} + + /// Called every frame during the Update schedule + fn update(&mut self, _time: &Time, _commands: &mut Commands) {} } impl_downcast!(sync TerminalWidget); diff --git a/src/widgets/systems.rs b/src/widgets/systems.rs index 2626ec6..0638b01 100644 --- a/src/widgets/systems.rs +++ b/src/widgets/systems.rs @@ -16,3 +16,9 @@ pub fn widget_input_handling( } } } + +pub fn update_widgets(mut widgets: Query<&mut Widget>, time: Res