summaryrefslogtreecommitdiff
path: root/src/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.rs')
-rw-r--r--src/ui.rs9
1 files changed, 9 insertions, 0 deletions
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;