summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-06-09 17:28:10 -0400
committerLLLL Colonq <llll@colonq>2024-06-09 17:28:10 -0400
commit6baca14ec9b70f1ffcdd6c456cf798f0f0f1e57b (patch)
treefe4a3e2957bf9f14f7d35072235981260862efbd
parentef27fca1e1041f8eb298d0dab6eed876786b2026 (diff)
Small UI tweaks
-rw-r--r--src/lib.rs1
-rw-r--r--src/ui.rs9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f0aa85d..300f7d1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -66,6 +66,7 @@ pub fn run<F, G>(gnew: F) where G: state::Game + 'static, F: (Fn(&context::Conte
event: winit::event::KeyEvent {
physical_key: winit::keyboard::PhysicalKey::Code(key),
state,
+ repeat: false,
..
},
..
diff --git a/src/ui.rs b/src/ui.rs
index f855625..09afdf9 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -34,6 +34,10 @@ impl Mode {
}
}
+ pub fn is_locked(&self) -> bool {
+ self.locked
+ }
+
/// Has the current transition finished?
pub fn is_ready(&self, tick: u64) -> bool {
let started = match self.toggle {
@@ -56,6 +60,11 @@ impl Mode {
}
}
+ pub fn reset(&mut self) {
+ self.locked = false;
+ self.toggle = ModeToggle::Inactive { start: 0 };
+ }
+
pub fn reverse(&mut self, tick: u64) -> bool {
if !self.locked {
self.locked = true;