From 3c2077f124914eaad6d3bb4abb8272d419c2eff3 Mon Sep 17 00:00:00 2001 From: Caspian Ahlberg Date: Thu, 23 Jan 2025 16:46:13 -0500 Subject: [PATCH] Rename PossibleWindowUpdater to MaybeWindowUpdater --- src/dashboard_defs/spinitron.rs | 4 ++-- src/window_tree.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dashboard_defs/spinitron.rs b/src/dashboard_defs/spinitron.rs index 7a9e19d..7d73a0a 100644 --- a/src/dashboard_defs/spinitron.rs +++ b/src/dashboard_defs/spinitron.rs @@ -25,7 +25,7 @@ use crate::{ ColorSDL, WindowContents, WindowUpdaterParams, - PossibleWindowUpdater + MaybeWindowUpdater }, spinitron::model::{SpinitronModelName, NUM_SPINITRON_MODEL_TYPES} @@ -137,7 +137,7 @@ pub fn make_spinitron_windows( ////////// Making the model windows - let spinitron_model_window_updater: PossibleWindowUpdater = Some((spinitron_model_window_updater_fn, model_update_rate)); + let spinitron_model_window_updater: MaybeWindowUpdater = Some((spinitron_model_window_updater_fn, model_update_rate)); // TODO: perhaps for making multiple model windows, allow for an option to have sub-model-windows all_model_windows_info.iter().flat_map(|general_info| { diff --git a/src/window_tree.rs b/src/window_tree.rs index 12200b8..90c297c 100644 --- a/src/window_tree.rs +++ b/src/window_tree.rs @@ -50,7 +50,7 @@ pub struct WindowUpdaterParams<'a, 'b, 'c, 'd> { pub area_drawn_to_screen: (u32, u32) } -pub type PossibleWindowUpdater = Option<( +pub type MaybeWindowUpdater = Option<( fn(WindowUpdaterParams) -> MaybeError, UpdateRate )>; @@ -134,7 +134,7 @@ impl WindowContents { ////////// pub struct Window { - possible_updater: PossibleWindowUpdater, + maybe_updater: MaybeWindowUpdater, state: DynamicOptional, contents: WindowContents, @@ -181,7 +181,7 @@ pub struct Window { impl Window { pub fn new( - possible_updater: PossibleWindowUpdater, + maybe_updater: MaybeWindowUpdater, state: DynamicOptional, contents: WindowContents, maybe_border_color: Option, @@ -196,7 +196,7 @@ impl Window { }; Self { - possible_updater, state, contents, + maybe_updater, state, contents, skip_drawing: false, skip_aspect_ratio_correction: false, maybe_border_color, @@ -277,7 +277,7 @@ impl Window { - If no updaters are called, don't redraw anything. - For any specific node, if that updater doesn't have an effect, then don't draw for that node. */ - if let Some((updater, update_rate)) = self.possible_updater { + if let Some((updater, update_rate)) = self.maybe_updater { if update_rate.is_time_to_update(rendering_params.frame_counter) { //////////