Skip to content

Commit

Permalink
update taintless
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils89 committed Sep 27, 2024
1 parent a438f21 commit 8174cb3
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 47 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3.3.10-Era
- Update for 1.15.4

3.3.9-Era
- Update for 1.15.4

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_NEW_VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3.3.10-Era
- Update for 1.15.4

3.3.9-Era
- Update for 1.15.4

Expand Down
3 changes: 3 additions & 0 deletions GW2_ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,9 @@ local function evPlayerLogin(self)
-- create action bars
if GetSetting("ACTIONBARS_ENABLED") and not IsIncompatibleAddonLoadedOrOverride("Actionbars", true) then
GW.LoadActionBars(lm)
-- to update our bars
SetActionBarToggles(GetSetting("GW_SHOW_MULTI_ACTIONBAR_1"), GetSetting("GW_SHOW_MULTI_ACTIONBAR_2"), GetSetting("GW_SHOW_MULTI_ACTIONBAR_3"), GetSetting("GW_SHOW_MULTI_ACTIONBAR_4"), GetSetting("HIDEACTIONBAR_BACKGROUND_ENABLED"))
MultiActionBar_Update()
end

-- create pet frame
Expand Down
4 changes: 4 additions & 0 deletions changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ local ct = {
}
GW.CHANGELOGS_TYPES = ct

addChange("3.3.10",{
{ct.change,[=[Update for 1.15.4]=]},
})

addChange("3.3.9",{
{ct.change,[=[Update for 1.15.4]=]},
})
Expand Down
124 changes: 77 additions & 47 deletions core/TaintLess.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,93 @@
<Ui><Script><![CDATA[--[[
TaintLess [20-10-19]
TaintLess [24-07-27]
https://www.townlong-yak.com/addons/taintless
All rights reserved.
Permission is hereby granted to distribute unmodified copies of this file.
]]
local function purgeKey(t, k)
t[k] = nil
local c = 42
repeat
if t[c] == nil then
t[c] = nil
end
c = c + 1
until issecurevariable(t, k)
local purgeKey do
local e = {}
function purgeKey(t, k)
e.textures, t[k] = t, 0
TextureLoadingGroupMixin.RemoveTexture(e, k)
end
end
-- https://www.townlong-yak.com/bugs/Mx7CWN-RefreshOverread
if (tonumber(UIDD_REFRESH_OVERREAD_PATCH_VERSION) or 0) < 3 then
UIDD_REFRESH_OVERREAD_PATCH_VERSION = 3
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
if UIDD_REFRESH_OVERREAD_PATCH_VERSION ~= 3 then
return
end
for i=1, UIDROPDOWNMENU_MAXLEVELS 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)
local patch, cbuild do
local skips = securecall(function()
local r, _, an = {moon="haunted"}
cbuild, r.moon, _, an = select(4,GetBuildInfo()), 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 cbuild >= clo+0) and (chi == "" or chi+0 >= cbuild) then
r[m] = v + 0
end
end
return r
end)
function patch(name, version, impl)
if impl and not ((tonumber(_G[name]) or 0) >= version or skips and skips[name] == version) then
_G[name] = version
securecall(impl, version)
end
end
end
local CLASSIC = cbuild and cbuild < 11e4
-- https://www.townlong-yak.com/bugs/Kjq4hm-DisplayModeTaint
if (tonumber(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
purgeKey(_G, "UIDROPDOWNMENU_OPEN_MENU")
end
end)
end
-- https://www.townlong-yak.com/addons/taintless/fixes/RefreshOverread
patch("UIDD_REFRESH_OVERREAD_PATCH_VERSION", 7, CLASSIC and 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/bugs/gXwH4P-IOFrameSelection
if (tonumber(IOFRAME_SELECTION_PATCH_VERSION) or 0) < 1 then
IOFRAME_SELECTION_PATCH_VERSION = 1
InterfaceOptionsFrame:HookScript("OnHide", function()
if IOFRAME_SELECTION_PATCH_VERSION == 1 then
InterfaceOptionsFrameCategories.selection = nil
end
end)
end
-- https://www.townlong-yak.com/addons/taintless/fixes/DisplayModeTaint
patch("UIDROPDOWNMENU_OPEN_PATCH_VERSION", 5, CLASSIC and 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/CUFProfileActivation
patch("CUF_PROFILE_ACTIVATE_PATCH_VERSION", 1, function(V)
if not (type(SetActiveRaidProfile) == "function" and type(CompactUnitFrameProfiles) == "table" and
type(ScriptErrorsFrameMixin) == "table" and type(ScriptErrorsFrameMixin.DisplayMessageInternal) == "function") then
return
end
local o, dd = {}, CreateFrame("Frame") do
local s, sk, sv = 1, {"seen", "order", "order", "count"}, {{}, {}, newproxy(true), _G}
getmetatable(sv[3]).__len = function()
return "UIDROPDOWNMENU_MENU_LEVEL"
end
setmetatable(o, {__index=function(_,k)
s, sv[2][1] = k == sk[s] and s+1 or 1
return sv[s-1]
end})
function dd.initialize() end
dd:Hide()
end
hooksecurefunc("SetActiveRaidProfile", function()
if CUF_PROFILE_ACTIVATE_PATCH_VERSION ~= V or
(issecurevariable("UIDROPDOWNMENU_MENU_LEVEL") and issecurevariable(DropDownList1, "numButtons")) then
return
end
pcall(UIDropDownMenu_InitializeHelper, dd)
purgeKey(_G, "UIDROPDOWNMENU_OPEN_MENU")
purgeKey(_G, "UIDROPDOWNMENU_INIT_MENU")
pcall(ScriptErrorsFrameMixin.DisplayMessageInternal, o, "", 0, 0, 0, "")
end)
end)
]]></Script></Ui>

0 comments on commit 8174cb3

Please sign in to comment.