Skip to content

Commit f12eb31

Browse files
make generichighlight slightly more generic
1 parent 01e7bd1 commit f12eb31

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

Themes/Til Death/BGAnimations/ScreenSelectProfile overlay.lua

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@ local function selectprofile(self)
55
end
66
end
77
local function genericHighlight(self, highlight, base, clickaction)
8+
local highlight = highlight or 0.6
9+
local base = base or 1
810
self:SetUpdateFunction(function(self)
9-
self:RunCommandsOnChildren(
10-
function(self)
11-
if isOver(self) then
12-
self:diffusealpha(highlight)
13-
else
14-
self:diffusealpha(base)
11+
if self:IsVisible() then
12+
self:RunCommandsOnChildren(
13+
function(self)
14+
if isOver(self) then
15+
self:diffusealpha(highlight)
16+
else
17+
self:diffusealpha(base)
18+
end
1519
end
20+
)
1621
end
17-
)
18-
end)
19-
self:SetUpdateRate(0.5)
22+
end
23+
)
24+
self:SetUpdateFunctionInterval(0.025)
2025
if clickaction then
2126
self:RunCommandsOnChildren(
2227
function(self)

0 commit comments

Comments
 (0)