From a1311d997ef5ceb4f65e0951985e1d20ba2b975e Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Fri, 20 Mar 2026 21:02:13 +0100 Subject: [PATCH] raidframe fixes --- modules/friends.lua | 4 +-- modules/raid.lua | 51 ++++++++++----------------------------- skins/blizzard/raidui.lua | 29 +++++++++------------- 3 files changed, 27 insertions(+), 57 deletions(-) diff --git a/modules/friends.lua b/modules/friends.lua index f229538c..9c090819 100644 --- a/modules/friends.lua +++ b/modules/friends.lua @@ -455,13 +455,13 @@ pfUI:RegisterSkin("Friends", "vanilla:tbc", function () end end - -- RaidFrameConvertToRaidButton and friends are part of Blizzard_RaidUI in Turtle WoW + -- all RaidFrame buttons are in Blizzard_RaidUI in Turtle WoW HookAddonOrVariable("Blizzard_RaidUI", function() if RaidFrameRaidInfoButton then SkinButton(RaidFrameRaidInfoButton) end if RaidFrameConvertToRaidButton then SkinButton(RaidFrameConvertToRaidButton) end if RaidFrameReadyCheckButton then SkinButton(RaidFrameReadyCheckButton) end if RaidFrameAddMemberButton then SkinButton(RaidFrameAddMemberButton) end - -- RaidGroup frames and buttons are hidden by modules/raid.lua, no skinning needed + -- RaidGroup frames and buttons are hidden by modules/raid.lua end) end end) diff --git a/modules/raid.lua b/modules/raid.lua index f267a7a3..ed503a87 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -2,43 +2,9 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function () -- do not go further on disabled UFs if C.unitframes.disable == "1" then return end - -- hide blizzard raid group frames so they don't overlap pfUI raid frames - local function HideBlizzardRaidFrames() - for i = 1, NUM_RAID_GROUPS do - local frame = _G["RaidGroup"..i] - if frame then - local wasVisible = frame:IsShown() and "visible" or "hidden" - frame:Hide() - frame:UnregisterAllEvents() - frame.Show = function() - return - end - if wasVisible == "visible" then - end - else - end - end - for i = 1, MAX_RAID_MEMBERS do - local button = _G["RaidGroupButton"..i] - if button then - button:Hide() - button:UnregisterAllEvents() - button.Show = function() return end - end - end - GROUP_REPLACE_PARTY = "1" - end - - -- run once when Blizzard_RaidUI loads + -- tell RaidFrame.lua pfUI replaces party frames HookAddonOrVariable("Blizzard_RaidUI", function() - HideBlizzardRaidFrames() - - -- RaidGroupFrame_Update calls :Show() on all RaidGroup frames every update - -- hook it to immediately re-hide them after Blizzard shows them - if RaidGroupFrame_Update then - hooksecurefunc("RaidGroupFrame_Update", HideBlizzardRaidFrames) - else - end + GROUP_REPLACE_PARTY = "1" end) pfUI.uf.raid = CreateFrame("Frame", "pfRaidUpdater", UIParent) @@ -123,12 +89,21 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function () pfUI.uf.raid:Hide() pfUI.uf.raid:RegisterEvent("RAID_ROSTER_UPDATE") + pfUI.uf.raid:RegisterEvent("PARTY_MEMBERS_CHANGED") + pfUI.uf.raid:RegisterEvent("PARTY_LEADER_CHANGED") pfUI.uf.raid:RegisterEvent("VARIABLES_LOADED") - pfUI.uf.raid:SetScript("OnEvent", function() this:Show() end) + pfUI.uf.raid:SetScript("OnEvent", function() + this:Show() + -- Debounce: delay update by 0.5s to batch rapid roster changes (mass swaps) + this.pendingUpdate = GetTime() + 0.5 + end) pfUI.uf.raid:SetScript("OnUpdate", function() - -- Throttle raid roster updates to 1 FPS + -- Wait for debounce: don't update until 0.5s after last event + if this.pendingUpdate and GetTime() < this.pendingUpdate then return end + -- Throttle raid roster updates to 1 FPS max if (this.tick or 0) > GetTime() then return end this.tick = GetTime() + 1.0 + this.pendingUpdate = nil -- don't proceed without raid or during combat if not UnitInRaid("player") or (InCombatLockdown and InCombatLockdown()) then return end diff --git a/skins/blizzard/raidui.lua b/skins/blizzard/raidui.lua index b2c5b287..70d4a240 100644 --- a/skins/blizzard/raidui.lua +++ b/skins/blizzard/raidui.lua @@ -1,39 +1,34 @@ pfUI:RegisterSkin("RaidUI", "vanilla", function () HookAddonOrVariable("Blizzard_RaidUI", function() - -- skin each RaidGroup frame (8 groups, each with a label + 5 slots) for i = 1, NUM_RAID_GROUPS do local group = _G["RaidGroup"..i] if group then StripTextures(group) - CreateBackdrop(group, nil, nil, .75) - local label = _G["RaidGroup"..i.."Label"] - if label then - label:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") + for j = 1, MEMBERS_PER_RAID_GROUP do + local slot = _G["RaidGroup"..i.."Slot"..j] + if slot then + StripTextures(slot) + CreateBackdrop(slot, nil, true) + SetHighlight(slot, 1, 1, 0) + + end end end end - -- skin each RaidGroupButton (40 members) for i = 1, MAX_RAID_MEMBERS do local button = _G["RaidGroupButton"..i] if button then StripTextures(button) - CreateBackdrop(button, nil, nil, .75) - - local name = _G["RaidGroupButton"..i.."Name"] - local level = _G["RaidGroupButton"..i.."Level"] - local class = _G["RaidGroupButton"..i.."Class"] - if name then name:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") end - if level then level:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") end - if class then class:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") end + CreateBackdrop(button, nil, true) + SetHighlight(button, 1, 1, 0) end end - -- skin the Add Member and Ready Check buttons on the RaidFrame panel - SkinButton(RaidFrameAddMemberButton) - SkinButton(RaidFrameReadyCheckButton) + if RaidFrameAddMemberButton then SkinButton(RaidFrameAddMemberButton) end + if RaidFrameReadyCheckButton then SkinButton(RaidFrameReadyCheckButton) end end) end)