From 2376e05109f963975a9049cc4c1c8e9c040d37c4 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Fri, 12 Dec 2025 23:07:17 -0800 Subject: [PATCH] Print states in debug menu --- engine/src/debug.rs | 10 +++--- engine/src/lib.rs | 2 +- engine/src/ui.rs | 24 ++++++++++--- tetris/src/debug.rs | 83 ++++++++++++++++++++++++++++++++++----------- tetris/src/main.rs | 47 ++++++++++++++++++------- 5 files changed, 125 insertions(+), 41 deletions(-) diff --git a/engine/src/debug.rs b/engine/src/debug.rs index 793428b..510ab8e 100644 --- a/engine/src/debug.rs +++ b/engine/src/debug.rs @@ -236,7 +236,7 @@ fn toggle_debug_state( #[derive(Default, Resource)] pub struct Notice(pub String); -impl Display for Notice { +impl fmt::Display for Notice { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { writeln!(f, "{}", self.0) } @@ -256,7 +256,7 @@ impl ToolTip { } } -impl Display for ToolTip { +impl fmt::Display for ToolTip { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { for (k, v) in self.0.iter() { writeln!(f, "{k}: {v}")? @@ -474,7 +474,7 @@ fn toggle_aabb_gizmo( #[derive(Resource, Default, Debug)] struct Fps(f32); -impl Display for Fps { +impl fmt::Display for Fps { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { writeln!(f, "FPS: {:0.1}", self.0) } @@ -499,7 +499,7 @@ fn track_fps(time: Res