-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUIDropDownMenu.lua
38 lines (37 loc) · 1.21 KB
/
UIDropDownMenu.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- https://www.townlong-yak.com/bugs/afKy4k-HonorFrameLoadTaint
if (UIDROPDOWNMENU_VALUE_PATCH_VERSION or 0) < 2 then
UIDROPDOWNMENU_VALUE_PATCH_VERSION = 2
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
if UIDROPDOWNMENU_VALUE_PATCH_VERSION ~= 2 then
return
end
for i=1, UIDROPDOWNMENU_MAXLEVELS do
for j=1, UIDROPDOWNMENU_MAXBUTTONS do
local b = _G["DropDownList" .. i .. "Button" .. j]
if not (issecurevariable(b, "value") or b:IsShown()) then
b.value = nil
repeat
j, b["fx" .. j] = j+1
until issecurevariable(b, "value")
end
end
end
end)
end
-- https://www.townlong-yak.com/bugs/Kjq4hm-DisplayModeCommunitiesTaint
if (UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 1 then
UIDROPDOWNMENU_OPEN_PATCH_VERSION = 1
hooksecurefunc("UIDropDownMenu_InitializeHelper", function(frame)
if UIDROPDOWNMENU_OPEN_PATCH_VERSION ~= 1 then
return
end
if UIDROPDOWNMENU_OPEN_MENU and UIDROPDOWNMENU_OPEN_MENU ~= frame
and not issecurevariable(UIDROPDOWNMENU_OPEN_MENU, "displayMode") then
UIDROPDOWNMENU_OPEN_MENU = nil
local t, f, prefix, i = _G, issecurevariable, " \0", 1
repeat
i, t[prefix .. i] = i + 1
until f("UIDROPDOWNMENU_OPEN_MENU")
end
end)
end