shouldn't try to double send things now

This commit is contained in:
Nickiel12 2021-12-31 10:42:31 -08:00
parent ba59e749d7
commit 39a5b9d6e3

View file

@ -74,29 +74,32 @@ impl MessageHandler for StreamState {
StateUpdate::TimerText(value) => {self.timer_text = value.clone(); return (Some(StateUpdate::TimerText(value)), None)}, StateUpdate::TimerText(value) => {self.timer_text = value.clone(); return (Some(StateUpdate::TimerText(value)), None)},
StateUpdate::SubScene(value) => { StateUpdate::SubScene(value) => {
if value.get_type() == Scenes::Camera { if value.get_type() == Scenes::Camera {
self.camera_sub_scene = value;
if self.current_scene == Scenes::Camera { if self.current_scene == Scenes::Camera {
hotkey_handler.change_scene(Scenes::Camera, Some(self.camera_sub_scene)); hotkey_handler.change_scene(Scenes::Camera, Some(self.camera_sub_scene));
} }
self.camera_sub_scene = value;
return (Some(update), None) return (Some(update), None)
} else if value.get_type() == Scenes::Screen { } else if value.get_type() == Scenes::Screen {
self.screen_sub_scene = value; if self.current_scene == Scenes::Screen{
if self.current_scene == 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.screen_sub_scene = value;
return (Some(update), None) return (Some(update), None)
} }
}, },
StateUpdate::Scene(value) => { StateUpdate::Scene(value) => {
self.current_scene = value;
if value == Scenes::Screen { if value == Scenes::Screen {
if self.current_scene != Scenes::Screen {
self.timer_start = SystemTime::now(); self.timer_start = SystemTime::now();
self.timer_finished = false; self.timer_finished = false;
}
} else { } else {
self.timer_finished = true; self.timer_finished = true;
} }
if self.current_scene != value {
match self.current_scene { match self.current_scene {
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));
@ -108,7 +111,9 @@ impl MessageHandler for StreamState {
hotkey_handler.change_scene(Scenes::Augmented, None); hotkey_handler.change_scene(Scenes::Augmented, None);
} }
} }
}
self.current_scene = value;
return (Some(update), None); return (Some(update), None);
}, },
StateUpdate::StreamSoundToggleOn(value) => {hotkey_handler.toggle_stream_sound(value); return (Some(update), None)}, StateUpdate::StreamSoundToggleOn(value) => {hotkey_handler.toggle_stream_sound(value); return (Some(update), None)},