should fix double sending for single thing

This commit is contained in:
Nickiel12 2021-12-30 23:02:41 -08:00
parent ba33ffc063
commit 1770a04e43
2 changed files with 14 additions and 3 deletions

View file

@ -77,9 +77,9 @@ impl Hotkeys {
}; };
} }
pub fn change_scene(&self, _scene: Scenes, sub_scene: Option<SubScenes>) { pub fn change_scene(&self, scene: Scenes, sub_scene: Option<SubScenes>) {
let hotkey: &str; let hotkey: &str;
if sub_scene.is_none() { if scene == Scenes::Augmented {
hotkey = self.hotkeys["hotkeys"]["obs"]["camera_scene_augmented"].as_str().unwrap() hotkey = self.hotkeys["hotkeys"]["obs"]["camera_scene_augmented"].as_str().unwrap()
} else { } else {
hotkey = self.get_hotkey_from_scene(sub_scene.unwrap()) hotkey = self.get_hotkey_from_scene(sub_scene.unwrap())

View file

@ -88,7 +88,6 @@ impl MessageHandler for StreamState {
} }
}, },
StateUpdate::Scene(value) => { StateUpdate::Scene(value) => {
hotkey_handler.change_scene(value, None);
self.current_scene = value; self.current_scene = value;
if value == Scenes::Screen { if value == Scenes::Screen {
@ -98,6 +97,18 @@ impl MessageHandler for StreamState {
self.timer_finished = true; self.timer_finished = true;
} }
match self.current_scene {
Scenes::Camera => {
hotkey_handler.change_scene(Scenes::Camera, Some(self.camera_sub_scene));
},
Scenes::Screen => {
hotkey_handler.change_scene(Scenes::Screen, Some(self.screen_sub_scene));
},
Scenes::Augmented => {
hotkey_handler.change_scene(Scenes::Augmented, None);
}
}
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)},