-
Notifications
You must be signed in to change notification settings - Fork 0
/
TaintLess.xml
125 lines (115 loc) · 4.34 KB
/
TaintLess.xml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<Ui><Script><![CDATA[--[[
TaintLess [23-09-09]
https://www.townlong-yak.com/addons/taintless
All rights reserved.
Permission is hereby granted to distribute unmodified copies of this file.
]]
local purgeKey do
local e = {}
function purgeKey(t, k)
e.textures = t
TextureLoadingGroupMixin.RemoveTexture(e, k)
end
end
local patch do
local skips = securecall(function()
local cb, r, _, an = select(4,GetBuildInfo()), {moon="haunted"}
r.moon, _, an = nil, issecurevariable(r, "moon")
for m, v, clo, chi in (C_AddOns.GetAddOnMetadata(an, "X-TaintLess-DisableMitigations") or ""):gmatch("([%a_]+)=(%d+):?(%d*):?(%d*)") do
if (clo == "" or cb >= clo+0) and (chi == "" or chi+0 >= cb) then
r[m] = v + 0
end
end
return r
end)
function patch(name, version, impl)
if not ((tonumber(_G[name]) or 0) >= version or skips and skips[name] == version) then
_G[name] = version
securecall(impl, version)
end
end
end
-- https://www.townlong-yak.com/addons/taintless/fixes/RefreshOverread
patch("UIDD_REFRESH_OVERREAD_PATCH_VERSION", 5, function(V)
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
for i=1, UIDD_REFRESH_OVERREAD_PATCH_VERSION == V and UIDROPDOWNMENU_MAXLEVELS or 0 do
for j=1+_G["DropDownList" .. i].numButtons, UIDROPDOWNMENU_MAXBUTTONS do
local b, _ = _G["DropDownList" .. i .. "Button" .. j]
_ = issecurevariable(b, "checked") or purgeKey(b, "checked")
_ = issecurevariable(b, "notCheckable") or purgeKey(b, "notCheckable")
end
end
end)
end)
-- https://www.townlong-yak.com/addons/taintless/fixes/DisplayModeTaint
patch("UIDROPDOWNMENU_OPEN_PATCH_VERSION", 3, function(V)
hooksecurefunc("UIDropDownMenu_InitializeHelper", function(frame)
if UIDROPDOWNMENU_OPEN_PATCH_VERSION == V
and UIDROPDOWNMENU_OPEN_MENU and UIDROPDOWNMENU_OPEN_MENU ~= frame
and not issecurevariable(UIDROPDOWNMENU_OPEN_MENU, "displayMode") then
purgeKey(_G, "UIDROPDOWNMENU_OPEN_MENU")
end
end)
end)
-- https://www.townlong-yak.com/addons/taintless/fixes/EditModeOpenDrop
patch("EDITMAN_OPENDROP_PATCH_VERSION", 5, function(V)
if not (type(EditModeManagerFrame) == "table" and
type(EditModeManagerFrame.GetAttribute) == "function" and
type(FriendsFrameStatusDropDown) == "table") then
return
end
hooksecurefunc(EditModeManagerFrame, "GetAttribute", function(_, attr)
if attr ~= "UIPanelLayout-checkFit" or EDITMAN_OPENDROP_PATCH_VERSION ~= V
or (issecurevariable(DropDownList1, "maxWidth") and issecurevariable("UIDROPDOWNMENU_MENU_LEVEL"))
or InCombatLockdown() and FriendsFrameStatusDropDown:IsProtected() then
elseif FriendsFrameStatusDropDown:IsVisible() then
FriendsFrameStatusDropDown:Hide()
FriendsFrameStatusDropDown:Show()
else
local op = FriendsFrameStatusDropDown:GetParent()
FriendsFrameStatusDropDown:SetParent(nil)
if not FriendsFrameStatusDropDown:IsShown() then
FriendsFrameStatusDropDown:Show()
FriendsFrameStatusDropDown:Hide()
end
FriendsFrameStatusDropDown:SetParent(op)
end
end)
end)
-- https://www.townlong-yak.com/addons/taintless/fixes/ObjectiveTrackerUpdate
patch("OBJTRACK_DELAYUPDATE_PATCH_VERSION", 5, function(V)
if not (type(ObjectiveTrackerFrame) == "table" and
type(ObjectiveTrackerFrame.HeaderMenu) == "table" and
type(ObjectiveTrackerFrame.HeaderMenu.Title) == "table") then
return
end
local counter, didDelayUpdate, delayFrameCount = (CreateFrame("Frame", nil, ObjectiveTrackerFrame))
counter:Hide()
counter:SetScript("OnUpdate", function()
if OBJTRACK_DELAYUPDATE_PATCH_VERSION == V and delayFrameCount then
delayFrameCount = delayFrameCount + 1
else
counter:Hide()
end
end)
hooksecurefunc("ObjectiveTracker_Update", function()
if OBJTRACK_DELAYUPDATE_PATCH_VERSION == V and didDelayUpdate then
ObjectiveTrackerFrame.isUpdating, didDelayUpdate = nil
end
end)
hooksecurefunc(ObjectiveTrackerFrame.HeaderMenu.Title, "ClearAllPoints", function()
if OBJTRACK_DELAYUPDATE_PATCH_VERSION ~= V or ObjectiveTrackerFrame.isUpdating then
elseif issecurevariable(ObjectiveTrackerFrame, "isOnLeftSideOfScreen") then
if delayFrameCount then
delayFrameCount = nil
counter:Hide()
end
elseif 4 > (delayFrameCount or 0) then
ObjectiveTrackerFrame.isUpdating, didDelayUpdate, delayFrameCount = 86, 1, delayFrameCount or 0
counter:Show()
else
counter:Hide()
end
end)
end)
]]></Script></Ui>