diff options
author | Joe <rbo@gmx.us> | 2024-04-22 22:45:24 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-22 22:45:24 +0200 |
commit | 7c8ed4b1bf9d289a5b126e784bbcf645bb578d14 (patch) | |
tree | 8163d9b317195375303e76d90b47a52c4a820791 /.config/mpv/scripts/uosc_shared/elements/Curtain.lua | |
parent | up (diff) | |
download | dotfiles-bsd-7c8ed4b1bf9d289a5b126e784bbcf645bb578d14.tar.gz dotfiles-bsd-7c8ed4b1bf9d289a5b126e784bbcf645bb578d14.tar.bz2 dotfiles-bsd-7c8ed4b1bf9d289a5b126e784bbcf645bb578d14.tar.xz dotfiles-bsd-7c8ed4b1bf9d289a5b126e784bbcf645bb578d14.tar.zst dotfiles-bsd-7c8ed4b1bf9d289a5b126e784bbcf645bb578d14.zip |
up
Diffstat (limited to '.config/mpv/scripts/uosc_shared/elements/Curtain.lua')
-rw-r--r-- | .config/mpv/scripts/uosc_shared/elements/Curtain.lua | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/.config/mpv/scripts/uosc_shared/elements/Curtain.lua b/.config/mpv/scripts/uosc_shared/elements/Curtain.lua deleted file mode 100644 index 99b9f14..0000000 --- a/.config/mpv/scripts/uosc_shared/elements/Curtain.lua +++ /dev/null @@ -1,35 +0,0 @@ -local Element = require('uosc_shared/elements/Element') - ----@class Curtain : Element -local Curtain = class(Element) - -function Curtain:new() return Class.new(self) --[[@as Curtain]] end -function Curtain:init() - Element.init(self, 'curtain', {ignores_menu = true}) - self.opacity = 0 - ---@type string[] - self.dependents = {} -end - ----@param id string -function Curtain:register(id) - self.dependents[#self.dependents + 1] = id - if #self.dependents == 1 then self:tween_property('opacity', self.opacity, 1) end -end - ----@param id string -function Curtain:unregister(id) - self.dependents = itable_filter(self.dependents, function(item) return item ~= id end) - if #self.dependents == 0 then self:tween_property('opacity', self.opacity, 0) end -end - -function Curtain:render() - if self.opacity == 0 or options.curtain_opacity == 0 then return end - local ass = assdraw.ass_new() - ass:rect(0, 0, display.width, display.height, { - color = '000000', opacity = options.curtain_opacity * self.opacity, - }) - return ass -end - -return Curtain |