check if method exists for scene

upate Gemfile
This commit is contained in:
onyx-and-iris 2023-07-26 14:55:09 +01:00
parent bee166f354
commit ec43297b2d
2 changed files with 4 additions and 2 deletions

View File

@ -2,4 +2,4 @@
source "https://rubygems.org"
gem "obsws", "~> 0.1.3"
gem "obsws", "~> 0.3.0"

View File

@ -44,8 +44,10 @@ class Main
def on_current_program_scene_changed(data)
scene = data.scene_name
puts "Switched to scene #{scene}"
if respond_to?("on_#{scene.downcase}")
send("on_#{scene.downcase}")
end
end
def on_exit_started
puts "OBS closing!"