Skip to content

Commit

Permalink
Fixing some taint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
IrcDirk committed Dec 17, 2023
1 parent 23a171b commit 838e926
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Carbonite.Quests/NxQuest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6857,7 +6857,7 @@ function CarboniteQuest:OnQuestUpdate (event, ...)
end

--hooksecurefunc("QuestWatch_Update", function (...) WatchFrame:Hide(); end);
hooksecurefunc("WatchFrame_Update", function (...) WatchFrame:Hide(); end);
hooksecurefunc("WatchFrame_Update", function (...) pcall(function () WatchFrame:Hide(); end); end);


Nx.Quest.TrackedAchievements = {}
Expand Down
8 changes: 5 additions & 3 deletions Carbonite/NxUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5536,9 +5536,11 @@ function Nx.List:Resize (width, height)
width = max (self.MinW, width)
height = max (self.MinH, height)

f:SetWidth (width)
f:SetHeight (height)

pcall(function()
f:SetWidth (width)
f:SetHeight (height)
end)

local sfrm = self.SelFrm
sfrm:SetWidth (width - 10)

Expand Down
158 changes: 125 additions & 33 deletions Carbonite/Taintless.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,155 @@
<Ui><Script><![CDATA[--[[
TaintLess [20-10-19]
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 function purgeKey(t, k)
t[k] = nil
local c = 42
repeat
if t[c] == nil then
t[c] = nil
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
c = c + 1
until issecurevariable(t, k)
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/bugs/Mx7CWN-RefreshOverread
if (tonumber(UIDD_REFRESH_OVERREAD_PATCH_VERSION) or 0) < 3 then
UIDD_REFRESH_OVERREAD_PATCH_VERSION = 3
-- https://www.townlong-yak.com/addons/taintless/fixes/RefreshOverread
patch("UIDD_REFRESH_OVERREAD_PATCH_VERSION", 5, function(V)
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
if UIDD_REFRESH_OVERREAD_PATCH_VERSION ~= 3 then
return
end
for i=1, UIDROPDOWNMENU_MAXLEVELS do
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
end)
-- https://www.townlong-yak.com/bugs/Kjq4hm-DisplayModeTaint
if (tonumber(UIDROPDOWNMENU_OPEN_PATCH_VERSION) or 0) < 1 then
UIDROPDOWNMENU_OPEN_PATCH_VERSION = 1
-- 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 ~= 1 then
return
end
if UIDROPDOWNMENU_OPEN_MENU and UIDROPDOWNMENU_OPEN_MENU ~= 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")
purgeKey(_G, "UIDROPDOWNMENU_OPEN_MENU")
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
-- 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
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)
-- https://www.townlong-yak.com/addons/taintless/fixes/CUFProfilesSetSelectedValue
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(t,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 838e926

Please sign in to comment.