osc: set values in user-data in addition to shared-script-properties

This commit is contained in:
rcombs 2023-01-28 15:26:38 -06:00
parent 048d4d8b75
commit 894f0c28eb
1 changed files with 4 additions and 0 deletions

View File

@ -2195,11 +2195,13 @@ function update_margins()
utils.shared_script_property_set("osc-margins",
string.format("%f,%f,%f,%f", margins.l, margins.r, margins.t, margins.b))
mp.set_property_native("user-data/osc/margins", margins)
end
function shutdown()
reset_margins()
utils.shared_script_property_set("osc-margins", nil)
mp.del_property("user-data/osc")
end
--
@ -2853,6 +2855,7 @@ function visibility_mode(mode, no_osd)
user_opts.visibility = mode
utils.shared_script_property_set("osc-visibility", mode)
mp.set_property_native("user-data/osc/visibility", mode)
if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
mp.osd_message("OSC visibility: " .. mode)
@ -2885,6 +2888,7 @@ function idlescreen_visibility(mode, no_osd)
end
utils.shared_script_property_set("osc-idlescreen", mode)
mp.set_property_native("user-data/osc/idlescreen", user_opts.idlescreen)
if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
mp.osd_message("OSC logo visibility: " .. tostring(mode))