moved an if statement into the switch statement
This commit is contained in:
parent
b04d93b96a
commit
21c38e275a
1 changed files with 6 additions and 10 deletions
|
@ -106,27 +106,23 @@ impl MessageHandler for StreamState {
|
||||||
StateUpdate::Scene(value) => {
|
StateUpdate::Scene(value) => {
|
||||||
println!("handling scene: {:?}", value);
|
println!("handling scene: {:?}", value);
|
||||||
|
|
||||||
if value.is_screen() {
|
|
||||||
if !self.current_scene.is_screen() {
|
|
||||||
self.timer_start = SystemTime::now();
|
|
||||||
self.timer_finished = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self.timer_finished = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut instruction = None;
|
let mut instruction = None;
|
||||||
if self.current_scene != value {
|
if self.current_scene != value {
|
||||||
match value {
|
match value {
|
||||||
Scenes::Camera => {
|
Scenes::Camera => {
|
||||||
hotkey_handler.change_scene(Scenes::Camera, Some(self.camera_sub_scene));
|
hotkey_handler.change_scene(Scenes::Camera, Some(self.camera_sub_scene));
|
||||||
instruction = Some(vec![StateUpdate::TimerText("0.0".to_string())])
|
instruction = Some(vec![StateUpdate::TimerText("0.0".to_string())]);
|
||||||
|
self.timer_finished = true;
|
||||||
},
|
},
|
||||||
Scenes::Screen => {
|
Scenes::Screen => {
|
||||||
hotkey_handler.change_scene(Scenes::Screen, Some(self.screen_sub_scene));
|
hotkey_handler.change_scene(Scenes::Screen, Some(self.screen_sub_scene));
|
||||||
|
self.timer_start = SystemTime::now();
|
||||||
|
self.timer_finished = false;
|
||||||
},
|
},
|
||||||
Scenes::Augmented => {
|
Scenes::Augmented => {
|
||||||
hotkey_handler.change_scene(Scenes::Augmented, None);
|
hotkey_handler.change_scene(Scenes::Augmented, None);
|
||||||
|
self.timer_finished = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue