From 7d253bec8c66aaa2f09601394f8767ff0b814c5d Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Mon, 31 Aug 2026 18:53:42 +0200 Subject: [PATCH] Darken Turtle inspect Arena and Talent frames Add Darkened UI support for Turtle WoW inspect Arena/Talents, reapply darkening after TWTalentFrame refreshes, and clean up redundant/Vanilla-only hooks. --- mods/dark-ui-elements.lua | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/mods/dark-ui-elements.lua b/mods/dark-ui-elements.lua index a16f8c9..15aa064 100644 --- a/mods/dark-ui-elements.lua +++ b/mods/dark-ui-elements.lua @@ -87,14 +87,29 @@ local addonframes = { ["Blizzard_TalentUI"] = { "TalentFrame" }, ["Blizzard_AuctionUI"] = { "AuctionFrame", "AuctionDressUpFrame" }, ["Blizzard_CraftUI"] = { "CraftFrame" }, - ["Blizzard_InspectUI"] = { "InspectPaperDollFrame", "InspectHonorFrame", "InspectFrameTab1", "InspectFrameTab2" }, + ["Blizzard_InspectUI"] = { + "InspectPaperDollFrame", + "InspectHonorFrame", + "InspectFrameTab1", + "InspectFrameTab2", + }, ["Blizzard_MacroUI"] = { "MacroFrame", "MacroPopupFrame" }, ["Blizzard_RaidUI"] = { "ReadyCheckFrame" }, - ["Blizzard_TalentUI"] = { "TalentFrame" }, ["Blizzard_TradeSkillUI"] = { "TradeSkillFrame" }, ["Blizzard_TrainerUI"] = { "ClassTrainerFrame" }, } +-- Turtle WoW exposes these extra inspect pages. Keep them out of the generic +-- Vanilla path so missing Turtle-only frames don't leave compatibility lurkers +-- registered for the whole session. +local isTurtle = TargetHPText and TargetHPPercText +if isTurtle then + table.insert(addonframes["Blizzard_InspectUI"], "InspectArenaFrame") + table.insert(addonframes["Blizzard_InspectUI"], "InspectTalentsFrame") + table.insert(addonframes["Blizzard_InspectUI"], "InspectFrameTab3") + table.insert(addonframes["Blizzard_InspectUI"], "InspectFrameTab4") +end + -- sizing is a bit different on tbc if GetExpansion() == "tbc" then borders["BuffButton"] = 2 @@ -271,6 +286,26 @@ module.enable = function(self) end end + -- Turtle's inspect talent tree is rebuilt by TWTalentFrame_Update(). + -- Its background textures are assigned during that update, so the initial + -- InspectTalentsFrame pass may happen too early. Re-darken the parent after + -- each rebuild; it already contains TWTalentFrame, so one recursive scan is + -- sufficient and avoids traversing the same tree twice. + if isTurtle then + HookAddonOrVariable("TWTalentFrame", function() + if not _G.TWTalentFrame or not _G.TWTalentFrame_Update then return end + + if not _G.TWTalentFrame.ShaguTweaksDarkHook then + _G.TWTalentFrame.ShaguTweaksDarkHook = true + ShaguTweaks.hooksecurefunc("TWTalentFrame_Update", function() + DarkenFrame(_G.InspectTalentsFrame or _G.TWTalentFrame) + end) + end + + DarkenFrame(_G.InspectTalentsFrame or _G.TWTalentFrame) + end) + end + HookAddonOrVariable("Blizzard_TimeManager", function() DarkenFrame(TimeManagerClockButton) end)