Skip to content

Commit

Permalink
Merge pull request #9 from cyl0/cyl0-patch-1
Browse files Browse the repository at this point in the history
Re-merge #7
  • Loading branch information
cyl0 authored Feb 28, 2022
2 parents 1e4d81e + 504dd40 commit b1ff8b5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions mordenx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,16 @@ end
-- mode can be auto/always/never/cycle
-- the modes only affect internal variables and not stored on its own.
function visibility_mode(mode, no_osd)
if mode == "cycle" then
if not state.enabled then
mode = "auto"
elseif user_opts.visibility ~= "always" then
mode = "always"
else
mode = "never"
end
end

if mode == 'auto' then
always_on(false)
enable_osc(true)
Expand All @@ -2286,9 +2296,10 @@ function visibility_mode(mode, no_osd)
msg.warn('Ignoring unknown visibility mode \"' .. mode .. '\"')
return
end

user_opts.visibility = mode

utils.shared_script_property_set("osc-visibility", mode)

if not no_osd and tonumber(mp.get_property('osd-level')) >= 1 then
mp.osd_message('OSC visibility: ' .. mode)
end
Expand Down

0 comments on commit b1ff8b5

Please sign in to comment.