diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 1 | ||||
| -rw-r--r-- | src/ui.rs | 9 |
2 files changed, 10 insertions, 0 deletions
@@ -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, .. }, .. @@ -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; |
