From a4cd49dbfd1a8361b170c72ae93e216d1bfa5272 Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Wed, 31 Dec 2025 12:20:50 +0100
Subject: [PATCH 01/13] performance updates
performance updates
From 6eca163abd6b90256229834abb14134e947f3944 Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Wed, 31 Dec 2025 12:21:44 +0100
Subject: [PATCH 02/13] performance updates
performance updates
---
modules/actionbar.lua | 91 +-
modules/actionbar_nodebug.lua | 1771 +++++++++++++++++++++++++++++++++
modules/bgscore.lua | 60 ++
modules/chat.lua | 2 +
modules/energytick.lua | 22 +-
modules/nameplates.lua | 3 +
modules/skin.lua | 3 +
modules/tooltip.lua | 4 +
8 files changed, 1938 insertions(+), 18 deletions(-)
create mode 100644 modules/actionbar_nodebug.lua
create mode 100644 modules/bgscore.lua
diff --git a/modules/actionbar.lua b/modules/actionbar.lua
index eabebc55..df1eae1a 100644
--- a/modules/actionbar.lua
+++ b/modules/actionbar.lua
@@ -912,24 +912,40 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
local cat, stealth
- local function IsCatStealth()
+ local inCatForm = nil -- cached from buff scan
+ local prowlActive = nil -- tracks if prowl is active
+
+ -- Full scan for cat form and prowl (only on login/reload)
+ local function FullScan()
if class ~= "DRUID" then return nil end
- cat, stealth = nil, nil
-
+
+ local foundCat, foundStealth = nil, nil
+
for i = 0, 31 do
local texture = GetPlayerBuffTexture(i)
if not texture then break end
- -- catform icon detected
if strfind(texture, "Ability_Druid_CatForm") then
- if stealth then return true end
- cat = true
+ foundCat = true
end
- -- stealth icon detected
if strfind(texture, "Ability_Ambush") then
- if cat then return true end
- stealth = true
+ foundStealth = true
+ end
+ end
+
+ inCatForm = foundCat
+ prowlActive = foundCat and foundStealth
+ return prowlActive
+ end
+
+ -- Quick scan only for prowl (when we know we're in cat form)
+ local function HasProwlBuff()
+ for i = 0, 31 do
+ local texture = GetPlayerBuffTexture(i)
+ if not texture then break end
+ if strfind(texture, "Ability_Ambush") then
+ return true
end
end
return nil
@@ -956,7 +972,59 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
-- setup page switch frame
+ local prowling = nil
local pageswitch = CreateFrame("Frame", "pfActionBarPageSwitch", UIParent)
+ pageswitch:RegisterEvent("PLAYER_AURAS_CHANGED")
+ pageswitch:RegisterEvent("PLAYER_ENTERING_WORLD")
+ pageswitch:RegisterEvent("UNIT_CASTEVENT")
+ pageswitch:SetScript("OnEvent", function()
+ if class ~= "DRUID" then return end
+
+ -- UNIT_CASTEVENT: detect Cat Form and Prowl cast instantly
+ -- Cat Form: 768 | Prowl: 5215 (R1), 6783 (R2), 9913 (R3)
+ if event == "UNIT_CASTEVENT" then
+ local guid, target, cEvent, spellId = arg1, arg2, arg3, arg4
+ local _, playerGuid = UnitExists("player")
+ if guid == playerGuid and cEvent == "CAST" then
+ if spellId == 5215 or spellId == 6783 or spellId == 9913 then
+ inCatForm = true
+ prowlActive = true
+ prowling = true
+ elseif spellId == 768 then
+ inCatForm = true
+ end
+ end
+ return
+ end
+
+ -- PLAYER_AURAS_CHANGED: smart scanning
+ if event == "PLAYER_AURAS_CHANGED" then
+ if prowlActive then
+ -- We were prowling, check if still prowling
+ if HasProwlBuff() then
+ prowling = true
+ else
+ -- Prowl ended
+ prowlActive = nil
+ prowling = nil
+ -- Also check if still in cat form
+ inCatForm = nil
+ for i = 0, 31 do
+ local texture = GetPlayerBuffTexture(i)
+ if not texture then break end
+ if strfind(texture, "Ability_Druid_CatForm") then
+ inCatForm = true
+ break
+ end
+ end
+ end
+ elseif not inCatForm then
+ -- Not in cat form, do a full scan (might have just shifted)
+ prowling = FullScan()
+ end
+ -- If inCatForm but not prowlActive, no scan needed (wait for UNIT_CASTEVENT)
+ end
+ end)
pageswitch:SetScript("OnUpdate", function()
-- switch actionbar page depending on meta key that is pressed
if C.bars.pagemastershift == "1" and IsShiftKeyDown() then
@@ -974,10 +1042,9 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
-- switch actionbar page if druid stealth is detected
if C.bars.druidstealth == "1" then
- local stealth = IsCatStealth()
- if stealth and _G.CURRENT_ACTIONBAR_PAGE == 1 then
+ if prowling and _G.CURRENT_ACTIONBAR_PAGE == 1 then
SwitchBar(prowl)
- elseif not stealth and _G.CURRENT_ACTIONBAR_PAGE == 8 then
+ elseif not prowling and _G.CURRENT_ACTIONBAR_PAGE == 8 then
SwitchBar(default)
end
end
diff --git a/modules/actionbar_nodebug.lua b/modules/actionbar_nodebug.lua
new file mode 100644
index 00000000..ca9a91ba
--- /dev/null
+++ b/modules/actionbar_nodebug.lua
@@ -0,0 +1,1771 @@
+pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
+ local _, class = UnitClass("player")
+ local color = RAID_CLASS_COLORS[class]
+ local cr, cg, cb = color.r , color.g, color.b
+ local er, eg, eb, ea = GetStringColor(pfUI_config.appearance.border.color)
+
+ local backdrop_highlight = { edgeFile = pfUI.media["img:glow"], edgeSize = 8 }
+ local showgrid = 0
+ local showgrid_pet = 0
+ local rawborder, border = GetBorderSize("actionbars")
+ local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
+
+ local eventcache = { } -- contains a list of events that shall be processed later -> [event] = true
+ local updatecache = { } -- contains a list of buttons slots that shall be refreshed later -> [slot] = true
+ local buttoncache = { } -- contains a list of all buttons ever created -> [slot] = frame
+
+ local petvisibility = "[pet] show; hide"
+
+ -- try to assume based on the current mouse positions if a button drag
+ -- should happen even if action-on-key-down is used. By that replace the
+ -- cast events by reverting the active buttons to the old mouse-up state.
+ local drag_await
+ local drag_active
+ local function AssumeButtonDrag()
+ -- skip during combat
+ if InCombatLockdown and InCombatLockdown() then return end
+
+ -- skip if keydown press is not enabled
+ if C.bars.keydown ~= "1" then return end
+
+ -- skip if always shift-drag is not enabled
+ if C.bars.shiftdrag ~= "1" then return end
+
+ if drag_await and not drag_active and IsShiftKeyDown() then
+ drag_active = true
+ -- set all buttons to regular on release clicks
+ for id, button in pairs(buttoncache) do
+ button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
+ end
+ elseif drag_active and not IsShiftKeyDown() then
+ drag_active = nil
+ -- set all buttons back to their defaults
+ for id, button in pairs(buttoncache) do
+ button:RegisterForClicks("LeftButtonDown", "RightButtonDown")
+ end
+ end
+ end
+
+ -- hide blizzard bars
+ local function kill(f, killshow)
+ if f.Show and killshow then f.Show = function() return end end
+ if f.UnregisterAllEvents then f:UnregisterAllEvents() end
+ if f.Hide then f:Hide() end
+ end
+
+ -- also abbreviate mouse buttons
+ local OrigGetBindingText = GetBindingText
+ local function GetBindingText(msg, mod, abbrev)
+ local txt = OrigGetBindingText(msg, mod, abbrev)
+ if abbrev then
+ txt = string.gsub(txt, _G[string.format("%s%s", mod, "BUTTON3")], "MB3")
+ txt = string.gsub(txt, _G[string.format("%s%s", mod, "BUTTON4")], "MB4")
+ txt = string.gsub(txt, _G[string.format("%s%s", mod, "BUTTON5")], "MB5")
+ txt = string.gsub(txt, _G[string.format("%s%s", mod, "MOUSEWHEELDOWN")], "MWD")
+ txt = string.gsub(txt, _G[string.format("%s%s", mod, "MOUSEWHEELUP")], "MWU")
+ end
+ return txt
+ end
+
+ kill(MainMenuBar)
+
+ local blizzard_elements = { MultiBarBottomLeft,
+ MultiBarBottomRight, MultiBarLeft, MultiBarRight }
+ for _, f in pairs(blizzard_elements) do
+ kill(f, true)
+ end
+
+ -- enable all possible actionbar pages
+ SetActionBarToggles(0, 0, 0, 0)
+ _G.SHOW_MULTI_ACTIONBAR_1 = nil
+ _G.SHOW_MULTI_ACTIONBAR_2 = nil
+ _G.SHOW_MULTI_ACTIONBAR_3 = nil
+ _G.SHOW_MULTI_ACTIONBAR_4 = nil
+
+ -- events that provide special updater functions
+ local special_events = {
+ ["ACTIONBAR_UPDATE_COOLDOWN"] = true,
+ ["ACTIONBAR_UPDATE_USABLE"] = true,
+ ["ACTIONBAR_UPDATE_STATE"] = true,
+ }
+
+ -- events that are shared across all buttons
+ local global_events = {
+ -- slot/button updates
+ ["PLAYER_ENTERING_WORLD"] = true,
+ ["ACTIONBAR_SLOT_CHANGED"] = true,
+ ["UPDATE_BINDINGS"] = true,
+ ["ACTIONBAR_PAGE_CHANGED"] = true,
+ ["UPDATE_BONUS_ACTIONBAR"] = true,
+ ["CRAFT_SHOW"] = true,
+ ["CRAFT_CLOSE"] = true,
+ ["TRADE_SKILL_SHOW"] = true,
+ ["TRADE_SKILL_CLOSE"] = true,
+ ["PLAYER_ENTER_COMBAT"] = true,
+ ["PLAYER_LEAVE_COMBAT"] = true,
+ -- cooldown updates
+ ["UNIT_INVENTORY_CHANGED"] = true,
+ -- auto repeat action
+ ["START_AUTOREPEAT_SPELL"] = true,
+ ["STOP_AUTOREPEAT_SPELL"] = true,
+ }
+
+ -- events that are used for the aura/shapeshift bar
+ local aura_events = {
+ ["UPDATE_SHAPESHIFT_FORMS"] = true,
+ ["PLAYER_AURAS_CHANGED"] = true,
+ }
+
+ -- events that are used for the pet bar
+ local pet_events = {
+ ["PLAYER_CONTROL_LOST"] = true,
+ ["PLAYER_CONTROL_GAINED"] = true,
+ ["PLAYER_FARSIGHT_FOCUS_CHANGED"] = true,
+ ["UNIT_PET"] = true,
+ ["PET_BAR_UPDATE"] = true,
+ ["PET_BAR_UPDATE_COOLDOWN"] = true,
+ }
+
+ local buttontypes = {
+ -- blizzard keybinds
+ [3] = "MULTIACTIONBAR3BUTTON",
+ [4] = "MULTIACTIONBAR4BUTTON",
+ [5] = "MULTIACTIONBAR2BUTTON",
+ [6] = "MULTIACTIONBAR1BUTTON",
+ [11] = "SHAPESHIFTBUTTON",
+ [12] = "BONUSACTIONBUTTON",
+ -- additional keybinds
+ [2] = "PFPAGING",
+ [7] = "PFSTANCEONE",
+ [8] = "PFSTANCETWO",
+ [9] = "PFSTANCETHREE",
+ [10] = "PFSTANCEFOUR",
+ }
+
+ local blizzbarmapping = {
+ ["MultiBarRight"] = 3,
+ ["MultiBarLeft"] = 4,
+ ["MultiBarBottomRight"] = 5,
+ ["MultiBarBottomLeft"] = 6,
+ ["ShapeShiftBar"] = 11,
+ ["BonusActionBar"] = 12,
+ }
+
+ local barnames = {
+ [1] = "Main",
+ [2] = "Paging",
+ [3] = "Right",
+ [4] = "Vertical",
+ [5] = "Left",
+ [6] = "Top",
+ [7] = "StanceBar1",
+ [8] = "StanceBar2",
+ [9] = "StanceBar3",
+ [10] = "StanceBar4",
+ [11] = "Stances",
+ [12] = "Pet",
+ }
+
+ local button_animations = {
+ ["none"] = function()
+ this.active = nil
+ this:Hide()
+ end,
+ ["zoomfade"] = function()
+ if this.active == 0 then
+ -- init animation
+ this:SetWidth(this.parent:GetWidth())
+ this:SetHeight(this.parent:GetHeight())
+ this:SetScale(this.parent:GetScale())
+ this.tex:SetTexture(this.parent.icon:GetTexture())
+ this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
+ this:SetAlpha(1)
+ this.active = 1
+ return
+ elseif this.active == 1 then
+ -- run animation
+ local fade = 30/GetFramerate()*0.05
+ this:SetAlpha(this:GetAlpha() - fade)
+ this:SetScale(this:GetScale() + fade)
+ if this:GetAlpha() > 0 then return end
+ end
+
+ -- stop animation
+ this.active = nil
+ this:Hide()
+ end,
+ ["shrinkreturn"] = function()
+ if this.active == 0 then
+ -- init animation
+ this:SetWidth(this.parent:GetWidth())
+ this:SetHeight(this.parent:GetHeight())
+ this:SetScale(this.parent:GetScale())
+ this.tex:SetTexture(this.parent.icon:GetTexture())
+ this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
+ this:SetAlpha(1)
+ this.parent.icon:Hide()
+ this.active = 1
+ this.time = 0
+ return
+ elseif this.active == 1 then
+ -- run animation
+ this.time = this.time + 30/GetFramerate()*0.1
+ local fade = 1 -math.exp(-this.time)*math.sin(this.time*math.pi)
+ this:SetAlpha(fade)
+ this:SetScale(fade)
+ if this.time < 1 then return end
+ end
+
+ -- stop animation
+ this.active = nil
+ this:Hide()
+ this.parent.icon:Show()
+ end,
+ ["elasticzoom"] = function()
+ if this.active == 0 then
+ -- init animation
+ this:SetWidth(this.parent:GetWidth())
+ this:SetHeight(this.parent:GetHeight())
+ this:SetScale(this.parent:GetScale())
+ this.tex:SetTexture(this.parent.icon:GetTexture())
+ this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
+ this:SetAlpha(1)
+ this.parent.icon:Hide()
+ this.active = 1
+ this.time = 0
+ return
+ elseif this.active == 1 then
+ -- run animation
+ this.time = this.time + 30/GetFramerate()*0.03
+ local fade = 1 -math.exp(-this.time*6)*math.sin(this.time*4*math.pi)
+ this:SetAlpha(fade)
+ this:SetScale(fade)
+ if this.time < 1 then return end
+ end
+
+ -- stop animation
+ this.active = nil
+ this:Hide()
+ this.parent.icon:Show()
+ end,
+ ["wobblezoom"] = function()
+ if this.active == 0 then
+ -- init animation
+ this:SetWidth(this.parent:GetWidth())
+ this:SetHeight(this.parent:GetHeight())
+ this:SetScale(this.parent:GetScale())
+ this.tex:SetTexture(this.parent.icon:GetTexture())
+ this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
+ this:SetAlpha(1)
+ this.parent.icon:Hide()
+ this.active = 1
+ this.time = 0
+ return
+ elseif this.active == 1 then
+ -- run animation
+ this.time = this.time + 30/GetFramerate()*0.02
+ local fade = 1 -math.exp(-this.time*6)*math.sin(this.time*10*math.pi)
+ this:SetAlpha(fade)
+ this:SetScale(fade)
+ if this.time < 1 then return end
+ end
+
+ -- stop animation
+ this.active = nil
+ this:Hide()
+ this.parent.icon:Show()
+ end,
+ }
+
+ local function GetActiveBar()
+ if CURRENT_ACTIONBAR_PAGE == 1 and GetBonusBarOffset() ~= 0 then
+ return NUM_ACTIONBAR_PAGES + GetBonusBarOffset()
+ else
+ return CURRENT_ACTIONBAR_PAGE
+ end
+ end
+
+ local function ButtonDrag(self)
+ -- skip during combat
+ if InCombatLockdown and InCombatLockdown() then return end
+
+ local self = self or this
+
+ if _G.LOCK_ACTIONBAR == "1" and not (pfUI_config.bars.shiftdrag == "1" and IsShiftKeyDown()) then return end
+
+ if self.bar == 12 then
+ PickupPetAction(self.id)
+ else
+ PickupAction(self.id)
+ end
+ end
+
+ local function ButtonDragStop(self)
+ -- skip during combat
+ if InCombatLockdown and InCombatLockdown() then return end
+
+ local self = self or this
+
+ if MacroFrame_SaveMacro then
+ MacroFrame_SaveMacro()
+ end
+
+ if self.bar == 12 then
+ PickupPetAction(self.id)
+ else
+ PlaceAction(self.id)
+ end
+ end
+
+ local mouse
+ local function ButtonAnimate(self)
+ local self = self or this
+ mouse = arg1 and not keystate
+
+ -- trigger action animation
+ if ( pfUI_config.bars.keydown == "1" and keystate == "down" ) or (pfUI_config.bars.keydown == "0" and keystate == "up" ) or self.bar == 11 or mouse then
+ if C.bars.animmode == "keypress" and ( self:GetAlpha() > .1 or C.bars.animalways == "1" ) then
+ self.animation.active = 0
+ self.animation:Show()
+ end
+ end
+
+ -- handle button highlight
+ if keystate == "down" then
+ self.highlight:Show()
+ elseif not MouseIsOver(self) then
+ self.highlight:Hide()
+ end
+ end
+
+ local function ButtonClick(self)
+ local self = self or this
+
+ local grid = self.bar == 12 and showgrid_pet or showgrid
+ local mouse = arg1 and not keystate
+ local keystate = keystate
+ local slfcast = C.bars.altself == "1" and IsAltKeyDown() and true or self.slfcast
+ slfcast = C.bars.rightself == "1" and arg1 and arg1 == "RightButton" and true or slfcast
+ self.slfcast = nil
+
+ if ( pfUI_config.bars.keydown == "1" and keystate == "down" and not drag_active ) or (pfUI_config.bars.keydown == "0" and keystate == "up" or drag_active ) or self.bar == 11 or mouse then
+ if self.bar == 11 then
+ CastShapeshiftForm(self.id)
+ elseif grid == 1 then
+ if self.bar == 12 then
+ PickupPetAction(self.id)
+ else
+ PickupAction(self.id)
+ end
+ elseif self.bar == 12 then
+ if arg1 == "LeftButton" then
+ if IsPetAttackActive(self.id) then
+ PetStopAttack()
+ else
+ CastPetAction(self.id)
+ end
+ else
+ TogglePetAutocast(self.id)
+ end
+ else
+ if MacroFrame_SaveMacro then
+ MacroFrame_SaveMacro()
+ end
+
+ UseAction(self.id, nil, slfcast)
+ end
+ end
+ end
+
+ local function ButtonMacroScan(self)
+ if self.bar > 10 then return end
+ if not self.scanmacro then return end
+ if pfUI.bars.skip_macro then return end
+
+ local macro = GetActionText(self.id)
+ self.spellslot = nil
+ self.booktype = nil
+ if macro then
+ local slot = GetMacroIndexByName(macro)
+ local name, _, body = GetMacroInfo(slot)
+
+ if name and body then
+ local match
+
+ for line in gfind(body, "[^%\n]+") do
+ _, _, match = string.find(line, '^#showtooltip (.+)')
+
+ -- skip any further manual macro scanning on
+ -- gameclients with native macro spell detection
+ if pfUI.client > 11200 and match then
+ self.spellslot = nil
+ self.booktype = nil
+ return
+ end
+
+ -- allow the user to disable the scan
+ if match and strfind(match, "disable") then
+ return
+ end
+
+ if not match then
+ -- add support to specify custom tooltips via:
+ -- /run --showtooltip SPELLNAME
+ _, _, match = string.find(line, '%-%-showtooltip (.+)')
+ end
+
+ if not match then
+ _, _, match = string.find(line, '^/cast (.+)')
+ end
+
+ if not match then
+ _, _, match = string.find(line, '^/pfcast (.+)')
+ end
+
+ if not match then
+ _, _, match = string.find(line, '^/pfmouse (.+)')
+ end
+
+ if not match then
+ _, _, match = string.find(line, 'CastSpellByName%(%"(.+)%"%)')
+ end
+
+ if match then
+ local _, _, spell, rank = string.find(match, '(.+)%((.+)%)')
+ spell = spell or match
+ self.spellslot, self.booktype = libspell.GetSpellIndex(spell, rank)
+
+ if self.spellslot and self.spellslot > 0 then return end
+ end
+ end
+ end
+ end
+ end
+
+ local function ButtonEnter(self)
+ local self = self or this
+
+ -- indicate that dragging could get enabled
+ drag_await = true
+
+ GameTooltip:ClearLines()
+ GameTooltip_SetDefaultAnchor(GameTooltip, self)
+
+ if self.bar == 11 then
+ GameTooltip:SetShapeshift(self.id)
+ elseif self.bar == 12 then
+ local name, _, _, token = GetPetActionInfo(self.id)
+ if token then
+ GameTooltip:AddLine(_G[name])
+ GameTooltip:Show()
+ else
+ GameTooltip:SetPetAction(self.id)
+ end
+ elseif self.spellslot and self.booktype then
+ GameTooltip:SetSpell(self.spellslot, self.booktype)
+ else
+ GameTooltip:SetAction(self.id)
+ end
+
+ self.highlight:Show()
+ end
+
+ local function ButtonLeave(self)
+ local self = self or this
+
+ -- no longer wait for a drag event
+ drag_await = nil
+
+ self.highlight:Hide()
+ GameTooltip:Hide()
+ end
+
+ local start, duration, enable, castable, autocast, token
+ local grid, sid, id, bar, active, texture, _
+ local function ButtonSlotUpdate(self)
+ if not self then return end
+ local self = self or this
+ sid = self.id -- 1 to 120
+
+ -- reset shared variables
+ castable, autocast, token = nil, nil, nil
+
+ -- set the own ID for compatibility to some vanilla addons
+ if pfUI.client <= 11200 then self:SetID(self.id) end
+
+ grid = self.bar == 12 and showgrid_pet or showgrid
+
+ if self.bar == 11 then
+ -- stance button
+ bar = self.bar
+ id = sid
+ texture, _, active = GetShapeshiftFormInfo(id)
+ elseif self.bar == 12 then
+ -- pet button
+ bar = self.bar
+ id = sid
+ _, _, texture, token, active, castable, autocast = GetPetActionInfo(id)
+ texture = token and _G[texture] or texture
+ else
+ active = IsCurrentAction(sid) or IsAutoRepeatAction(sid)
+ texture = GetActionTexture(sid)
+ bar = GetActiveBar()
+ id = self.bar == 1 and self.slot or sid-((self.bar)-1)*12
+ end
+
+ -- overwrite with spell macro texture where possible
+ if self.spellslot and self.booktype then
+ texture = GetSpellTexture(self.spellslot, self.booktype)
+ end
+
+ if not self.showempty and self.backdrop and not texture and grid == 0 then
+ self.backdrop:Hide()
+ self.hide = true
+ else
+ self.backdrop:Show()
+ self.hide = nil
+ end
+
+ -- active border
+ if active then
+ if C.bars.animmode == "statechange" and not self.active:IsShown() then
+ self.animation.active = 0
+ self.animation:Show()
+ end
+
+ self.backdrop:SetBackdropBorderColor(cr,cg,cb,1)
+ self.active:Show()
+ else
+ self.backdrop:SetBackdropBorderColor(er,eg,eb,ea)
+ self.active:Hide()
+ end
+
+ if self.bar ~= 11 and self.bar ~= 12 then
+ -- update consumables
+ if IsConsumableAction(sid) then
+ self.count:SetText(GetActionCount(sid))
+ elseif IsReagentAction and IsReagentAction(sid) then
+ self.count:SetText(GetReagentCount(sid))
+ else
+ self.count:SetText(nil)
+ end
+
+ -- equipped item
+ if IsEquippedAction(sid) and C.bars.showequipped == "1" then
+ self.equipped:Show()
+ else
+ self.equipped:Hide()
+ end
+
+ -- update macro text
+ if C.bars["bar"..self.bar] and C.bars["bar"..self.bar].showmacro == "1" then
+ self.macro:SetText(GetActionText(sid))
+ else
+ self.macro:SetText("")
+ end
+ end
+
+ -- icon
+ if texture ~= self.texture then
+ self.icon:SetTexture(texture)
+ self.texture = texture
+ end
+
+ -- handle pet bar quirks
+ if self.bar == 12 then
+ -- desaturate disabled petbar
+ self.icon:SetDesaturated(not GetPetActionsUsable())
+
+ -- display autocast
+ if autocast then
+ self.autocast:Show()
+ self.autocast:SetAlpha(self:GetAlpha() * 0.10)
+ else
+ self.autocast:Hide()
+ end
+
+ if castable and C.bars.showcastable == "1" then
+ self.autocastable:Show()
+ else
+ self.autocastable:Hide()
+ end
+ end
+
+ -- keybinds
+ if not self.hide and self.bar == 1 and self.bar ~= 11 and self.bar ~= 12 then
+ self.keybind:SetText(GetBindingText(GetBindingKey("ACTIONBUTTON"..id), "KEY_", 1))
+ elseif not self.hide and buttontypes[self.bar] then
+ self.keybind:SetText(GetBindingText(GetBindingKey(buttontypes[self.bar]..id), "KEY_", 1))
+ else
+ self.keybind:SetText("")
+ end
+ end
+
+ local sid, usable, oom, _
+ local function ButtonUsableUpdate(self)
+ local self = self or this
+ sid = self.id -- 1 to 120
+
+ if self.bar == 11 then
+ _, _, _, usable = GetShapeshiftFormInfo(sid)
+ elseif self.bar == 12 then
+ usable = true
+ else
+ usable, oom = IsUsableAction(sid)
+ end
+
+ -- update usable [out-of-range = 1, oom = 2, not-usable = 3, default = 0]
+ if self.outofrange and C.bars.glowrange == "1" then
+ if self.vertexstate ~= 1 then
+ self.icon:SetVertexColor(self.rangeColor[1], self.rangeColor[2], self.rangeColor[3], self.rangeColor[4])
+ self.vertexstate = 1
+ end
+ elseif oom and C.bars.showoom == "1" then
+ if self.vertexstate ~= 2 then
+ self.icon:SetVertexColor(self.oomColor[1], self.oomColor[2], self.oomColor[3], self.oomColor[4])
+ self.vertexstate = 2
+ end
+ elseif not usable and C.bars.showna == "1" then
+ if self.vertexstate ~= 3 then
+ self.icon:SetVertexColor(self.naColor[1], self.naColor[2], self.naColor[3], self.naColor[4])
+ self.vertexstate = 3
+ end
+ else
+ if self.vertexstate ~= 0 then
+ self.icon:SetVertexColor(1, 1, 1, 1)
+ self.vertexstate = 0
+ end
+ end
+ end
+
+ local function ButtonRangeUpdate(self)
+ local self = self or this
+
+ -- update range display
+ if C.bars.glowrange == "1" and self.bar ~= 11 and self.bar ~= 12 and HasAction(self.id) and ActionHasRange(self.id) and IsActionInRange(self.id) == 0 then
+ if not self.outofrange then
+ self.outofrange = true
+ ButtonUsableUpdate(self)
+ end
+ elseif self.outofrange then
+ self.outofrange = nil
+ ButtonUsableUpdate(self)
+ end
+ end
+
+ local start, duration, enable
+ local function ButtonCooldownUpdate(button)
+ if not button then return end
+
+ if button.bar == 11 then
+ start, duration, enable = GetShapeshiftFormCooldown(button.id)
+ elseif button.bar == 12 then
+ start, duration, enable = GetPetActionCooldown(button.id)
+ elseif button.spellslot and button.booktype then
+ start, duration = GetSpellCooldown(button.spellslot, button.booktype)
+ enable = 1
+ else
+ start, duration, enable = GetActionCooldown(button.id)
+ end
+
+ CooldownFrame_SetTimer(button.cd, start, duration, enable)
+ end
+
+ local _, active
+ local function ButtonIsActiveUpdate(button)
+ if not button then return end
+
+ if button.bar == 11 then
+ _, _, active, _ = GetShapeshiftFormInfo(button.id)
+ elseif button.bar == 12 then
+ _, _, _, _, active, _, _ = GetPetActionInfo(button.id)
+ else
+ active = IsCurrentAction(button.id) or IsAutoRepeatAction(button.id)
+ end
+
+ -- active border
+ if active then
+ if not button.border_active then
+ button.backdrop:SetBackdropBorderColor(cr,cg,cb,1)
+ button.border_active = true
+ end
+
+ button.active:Show()
+ else
+ if button.border_active then
+ button.backdrop:SetBackdropBorderColor(er,eg,eb,ea)
+ button.border_active = nil
+ end
+
+ button.active:Hide()
+ end
+ end
+
+
+ local function ButtonFullUpdate(button)
+ if not button then return end
+
+ ButtonMacroScan(button)
+ ButtonSlotUpdate(button)
+ ButtonRangeUpdate(button)
+ ButtonUsableUpdate(button)
+ ButtonCooldownUpdate(button)
+ ButtonIsActiveUpdate(button)
+ end
+
+ local function BarsEvent(self)
+ local self = self or this
+
+ -- refresh only specific slots
+ if event == "ACTIONBAR_SLOT_CHANGED" and arg1 and arg1 ~= 0 then
+ updatecache[arg1] = true
+ return
+ end
+
+ -- run special refresh functions on next update
+ if special_events[event] then
+ eventcache[event] = true
+ return
+ end
+
+ -- handle aura events
+ if aura_events[event] then
+ for j=1,12 do
+ if self[11] and self[11][j] then
+ updatecache[self[11][j].slot] = true
+ end
+ end
+ return
+ end
+
+ -- handle pet events
+ if pet_events[event] then
+ for j=1,12 do
+ if self[12] and self[12][j] then
+ updatecache[self[12][j].slot] = true
+ end
+ end
+ return
+ end
+
+ -- handle global events
+ for id in pairs(buttoncache) do
+ updatecache[id] = true
+ end
+ end
+
+ local self, button, unlock
+ local function BarsUpdate(self)
+ self = self or this
+
+ -- update buttons whenever a button drag is assumed
+ AssumeButtonDrag()
+
+ if pfUI.unlock then
+ -- update all bars when entering unlock
+ if pfUI.unlock:IsShown() ~= unlock then
+ pfUI.bars:UpdateConfig()
+ unlock = pfUI.unlock:IsShown()
+ end
+ end
+
+ -- run cached usable usable actions
+ if eventcache["ACTIONBAR_UPDATE_USABLE"] then
+ eventcache["ACTIONBAR_UPDATE_USABLE"] = nil
+ for id, button in pairs(buttoncache) do
+ ButtonUsableUpdate(button)
+ end
+ end
+
+ -- run cached cooldown events
+ if eventcache["ACTIONBAR_UPDATE_COOLDOWN"] then
+ eventcache["ACTIONBAR_UPDATE_COOLDOWN"] = nil
+ for id, button in pairs(buttoncache) do
+ ButtonCooldownUpdate(button)
+ end
+ end
+
+ -- run cached action state events
+ if eventcache["ACTIONBAR_UPDATE_STATE"] then
+ eventcache["ACTIONBAR_UPDATE_STATE"] = nil
+ for id, button in pairs(buttoncache) do
+ ButtonIsActiveUpdate(button)
+ end
+ end
+
+ for id in pairs(updatecache) do
+ -- run updates based on slot
+ pfUI.bars.ButtonFullUpdate(buttoncache[id])
+
+ -- run updates on paging actionbar if required
+ for i=1,12 do
+ if pfUI.bars[1][i].id == id then
+ pfUI.bars.ButtonFullUpdate(pfUI.bars[1][i])
+ end
+ end
+
+ -- clear update cache
+ updatecache[id] = nil
+ end
+
+ if ( this.tick or .2) > GetTime() then return else this.tick = GetTime() + .2 end
+
+ for id, button in pairs(buttoncache) do
+ if button:IsShown() then ButtonRangeUpdate(button) end
+ end
+ end
+
+ -- create the main event and update handler for pfUI actionbars
+ local bars = CreateFrame("Frame", "pfActionBar", UIParent)
+ for event in pairs(special_events) do bars:RegisterEvent(event) end
+ for event in pairs(global_events) do bars:RegisterEvent(event) end
+ for event in pairs(aura_events) do bars:RegisterEvent(event) end
+ for event in pairs(pet_events) do bars:RegisterEvent(event) end
+
+ -- refresh actionbar buttons on event
+ bars:SetScript("OnEvent", BarsEvent)
+
+ -- update actionbar buttons
+ bars:SetScript("OnUpdate", BarsUpdate)
+
+ -- enable bar paging via secure functions
+ local function ButtonSwitch(self, att, value)
+ if att == "state-parent" then
+ local action = SecureButton_GetModifiedAttribute(self, "action", SecureStateChild_GetEffectiveButton(self)) or self.id
+ if self.id == action then return end
+ updatecache[self.slot] = true
+ self.id = action
+ end
+ end
+
+ local function EnablePaging(bar)
+ if pfUI.client <= 11200 then
+ if not bar.pager then
+ bar.pager = CreateFrame("Frame")
+ bar.pager:RegisterEvent("PLAYER_ENTERING_WORLD")
+ bar.pager:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
+ bar.pager:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
+ bar.pager:SetScript("OnEvent", function()
+ for i=1, 10 do -- reload pageable bars
+ local pageable = C.bars["bar"..i] and C.bars["bar"..i].pageable == "1" and true or nil
+ _G.VIEWABLE_ACTION_BAR_PAGES[i] = pageable
+ end
+
+ local active = GetActiveBar()
+ for i=1,12 do
+ local id = i + (active-1)*12
+ bar[i].id = id
+ updatecache[i] = true
+ end
+ end)
+ end
+ else
+ -- append paging enabled bars to the filter list
+ for i=1,12 do bar[i]:SetScript("OnAttributeChanged", ButtonSwitch) end
+
+ -- fill all possible page states
+ local page, pages = nil, {}
+ while not pages[6] do
+ for i=1, 6 do
+ page = i == 1 and 1 or C.bars["bar"..i] and C.bars["bar"..i].pageable == "1" and i
+ if page then table.insert(pages, page) end
+ end
+ end
+
+ bar:SetAttribute("statemap-page", "$input")
+ bar:SetAttribute("state", (bar:GetAttribute("state-page") or 1))
+
+ -- prio posses bar
+ bar.filter = "[bonusbar: 5] 11;"
+
+ -- set bar 8 for druid stealth if enabled
+ local prowl = class == "DRUID" and C.bars["druidstealth"] == "1" and "8" or "7"
+
+ -- write default pages
+ for state, page in pairs(pages) do
+ if page ~= 1 then -- skip page 1 as it is supposed to stay dynamic for stances
+ bar.filter = string.format("%s[actionbar: %s] %s; ", bar.filter, state, page)
+ end
+ end
+
+ -- write page driver conditions
+ bar.filter = string.format("%s[bonusbar:1,nostealth] 7; [bonusbar:1,stealth] %s; [bonusbar:2] 10; [bonusbar:3] 9; [bonusbar:4] 10; 1", bar.filter, prowl)
+
+ -- prepend pagemaster states if enabled
+ if C.bars.pagemaster == "1" then
+ for mod, page in pairs({ ["shift"] = "6", ["ctrl"] = "5", ["alt"] = "3" }) do
+ bar.filter = string.format("[modifier:%s] %s;", mod, page) .. bar.filter
+ end
+ end
+
+ -- enable page driver conditions
+ RegisterStateDriver(bar, "page", bar.filter)
+ SecureStateHeader_Refresh(bar)
+ end
+ end
+
+ local function SwitchBar(bar)
+ if _G.CURRENT_ACTIONBAR_PAGE ~= bar then
+ _G.CURRENT_ACTIONBAR_PAGE = bar
+ ChangeActionBarPage(bar)
+ end
+ end
+
+ local cat, stealth
+ local inCatForm = nil -- cached from buff scan
+ local prowlActive = nil -- tracks if prowl is active
+
+ -- Full scan for cat form and prowl (only on login/reload)
+ local function FullScan()
+ if class ~= "DRUID" then return nil end
+
+ local foundCat, foundStealth = nil, nil
+
+ for i = 0, 31 do
+ local texture = GetPlayerBuffTexture(i)
+ if not texture then break end
+
+ if strfind(texture, "Ability_Druid_CatForm") then
+ foundCat = true
+ end
+
+ if strfind(texture, "Ability_Ambush") then
+ foundStealth = true
+ end
+ end
+
+ inCatForm = foundCat
+ prowlActive = foundCat and foundStealth
+ return prowlActive
+ end
+
+ -- Quick scan only for prowl (when we know we're in cat form)
+ local function HasProwlBuff()
+ for i = 0, 31 do
+ local texture = GetPlayerBuffTexture(i)
+ if not texture then break end
+ if strfind(texture, "Ability_Ambush") then
+ return true
+ end
+ end
+ return nil
+ end
+
+ -- pagemaster / meta page switch
+ if pfUI.expansion == "vanilla" then
+ local prowl, shift, ctrl, alt, default = 8, 6, 5, 3, 1
+
+ -- set temporary pagemaster bindings keybinds
+ if C.bars.pagemaster == "1" then
+ local modifier = { "ALT", "SHIFT", "CTRL" }
+ local buttons = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "+", "=", "´" }
+ local current = CURRENT_ACTIONBAR_PAGE
+ bars.pagemaster = bars.pagemaster or CreateFrame("Frame", "pfPageMaster", UIParent)
+ bars.pagemaster:RegisterEvent("PLAYER_ENTERING_WORLD")
+ bars.pagemaster:SetScript("OnEvent", function()
+ for _,mod in pairs(modifier) do
+ for _,but in pairs(buttons) do
+ SetBinding(mod.."-"..but)
+ end
+ end
+ end)
+ end
+
+ -- setup page switch frame
+ local prowling = nil
+ local pageswitch = CreateFrame("Frame", "pfActionBarPageSwitch", UIParent)
+ pageswitch:RegisterEvent("PLAYER_AURAS_CHANGED")
+ pageswitch:RegisterEvent("PLAYER_ENTERING_WORLD")
+ pageswitch:RegisterEvent("UNIT_CASTEVENT")
+ pageswitch:SetScript("OnEvent", function()
+ if class ~= "DRUID" then return end
+
+ -- On login/reload: full scan
+ if event == "PLAYER_ENTERING_WORLD" then
+ prowling = FullScan()
+ return
+ end
+
+ -- UNIT_CASTEVENT: detect Prowl cast instantly
+ -- Prowl Spell IDs: 5215 (Rank 1), 6783 (Rank 2), 9913 (Rank 3)
+ if event == "UNIT_CASTEVENT" then
+ local guid, target, cEvent, spellId = arg1, arg2, arg3, arg4
+ local _, playerGuid = UnitExists("player")
+ if guid == playerGuid and cEvent == "CAST" then
+ if spellId == 5215 or spellId == 6783 or spellId == 9913 then
+ -- Prowl cast detected
+ inCatForm = true
+ prowlActive = true
+ prowling = true
+ elseif spellId == 768 then
+ -- Cat Form cast (Spell ID 768)
+ inCatForm = true
+ end
+ end
+ return
+ end
+
+ -- PLAYER_AURAS_CHANGED: smart scanning
+ if event == "PLAYER_AURAS_CHANGED" then
+ if prowlActive then
+ -- We were prowling, check if still prowling
+ if HasProwlBuff() then
+ prowling = true
+ else
+ -- Prowl ended
+ prowlActive = nil
+ prowling = nil
+ -- Also check if still in cat form
+ inCatForm = nil
+ for i = 0, 31 do
+ local texture = GetPlayerBuffTexture(i)
+ if not texture then break end
+ if strfind(texture, "Ability_Druid_CatForm") then
+ inCatForm = true
+ break
+ end
+ end
+ end
+ elseif not inCatForm then
+ -- Not in cat form, do a full scan (might have just shifted)
+ prowling = FullScan()
+ end
+ -- If inCatForm but not prowlActive, no scan needed (wait for UNIT_CASTEVENT)
+ end
+ end)
+ pageswitch:SetScript("OnUpdate", function()
+ -- switch actionbar page depending on meta key that is pressed
+ if C.bars.pagemastershift == "1" and IsShiftKeyDown() then
+ SwitchBar(shift)
+ return
+ elseif C.bars.pagemasterctrl == "1" and IsControlKeyDown() then
+ SwitchBar(ctrl)
+ return
+ elseif C.bars.pagemasteralt == "1" and IsAltKeyDown() then
+ SwitchBar(alt)
+ return
+ elseif C.bars.pagemasteralt == "1" or C.bars.pagemasterctrl == "1" or C.bars.pagemastershift == "1" then
+ SwitchBar(default)
+ end
+
+ -- switch actionbar page if druid stealth is detected
+ if C.bars.druidstealth == "1" then
+ if prowling and _G.CURRENT_ACTIONBAR_PAGE == 1 then
+ SwitchBar(prowl)
+ elseif not prowling and _G.CURRENT_ACTIONBAR_PAGE == 8 then
+ SwitchBar(default)
+ end
+ end
+ end)
+ end
+
+ local function CreateActionButton(parent, bar, button)
+ -- load config
+ local size = C.bars["bar"..bar].icon_size
+ local font = pfUI.media[C.bars.font]
+ local font_offset = tonumber(C.bars.font_offset)
+
+ local macro_size = tonumber(C.bars.macro_size)
+ local macro_color = { strsplit(",", C.bars.macro_color) }
+
+ local count_size = tonumber(C.bars.count_size)
+ local count_color = { strsplit(",", C.bars.count_color) }
+
+ local bind_size = tonumber(C.bars.bind_size)
+ local bind_color = { strsplit(",", C.bars.bind_color) }
+
+ local cd_size = tonumber(C.bars.cd_size)
+
+ local showempty = C.bars["bar"..bar].showempty
+ local showmacro = C.bars["bar"..bar].showmacro
+ local showkybind = C.bars["bar"..bar].showkeybind
+ local showcount = C.bars["bar"..bar].showcount
+
+ -- sanitize font sizes
+ if macro_size == 0 then macro_size = 1 end
+ if count_size == 0 then macro_size = 1 end
+ if bind_size == 0 then macro_size = 1 end
+ if cd_size == 0 then cd_size = nil end
+
+ local button_name = "pfActionBar" .. barnames[bar] .. "Button" .. button
+
+ local id = (bar-1)*12+button
+ local exists = _G[button_name] and true or nil
+ local f = _G[button_name] or CreateFrame("Button", button_name, parent, ACTIONBAR_SECURE_TEMPLATE_BUTTON)
+
+ -- no button available, create a new one
+ if not exists then
+ -- prepare the button for vanilla
+ if not f.HookScript then
+ f.HookScript = HookScript
+ f:SetScript("OnClick", ButtonClick)
+ end
+
+ if bar ~= 11 then
+ f:RegisterForDrag("LeftButton", "RightButton")
+ f:SetScript("OnDragStart", ButtonDrag)
+ f:SetScript("OnReceiveDrag", ButtonDragStop)
+ end
+
+ -- add mouseovers
+ f:SetScript("OnEnter", ButtonEnter)
+ f:SetScript("OnLeave", ButtonLeave)
+
+ -- add click animation handler
+ f:HookScript("OnClick", ButtonAnimate)
+ f.id = id
+
+ -- set a static slot
+ f.slot = id
+
+ -- cooldown
+ f.cd = CreateFrame(COOLDOWN_FRAME_TYPE, f:GetName() .. "Cooldown", f, "CooldownFrameTemplate")
+ f.cd.pfCooldownStyleAnimation = 1
+ f.cd.pfCooldownType = "NOGCD"
+ f.cd.pfCooldownSize = cd_size
+
+ -- icon
+ f.icon = f:CreateTexture(button_name .. "Icon", "BACKGROUND")
+ f.icon:SetTexCoord(.08, .92, .08, .92)
+ f.icon:SetAllPoints()
+
+ -- animation
+ f.animation = CreateFrame("Frame", button_name .. "Animation", f)
+ f.animation.parent = f
+ f.animation:SetPoint("CENTER", 0, 0)
+ f.animation:Hide()
+ f.animation.tex = f.animation:CreateTexture(button_name .. "AnimationTexture", "BACKGROUND")
+ f.animation.tex:SetTexCoord(.08, .92, .08, .92)
+ f.animation.tex:SetAllPoints()
+
+ if bar ~= 11 and bar ~= 12 then
+ -- equipped item
+ f.equipped = f:CreateTexture(nil, "BORDER")
+ f.equipped:SetAllPoints()
+ f.equipped:Hide()
+ elseif bar == 12 then
+ f.autocast = CreateFrame("Model", nil, f)
+ f.autocast:SetAllPoints()
+ f.autocast:SetModel("Interface\\Buttons\\UI-AutoCastButton.mdx")
+ f.autocast:SetSequence(0)
+ f.autocast:SetSequenceTime(0, 0)
+ f.autocast:Hide()
+
+ f.autocastable = f:CreateTexture(nil, "BORDER")
+ f.autocastable:SetAllPoints()
+ f.autocastable:SetTexture("Interface\\Buttons\\UI-AutoCastableOverlay")
+ f.autocastable:SetTexCoord(.25, .75, .25, .75)
+ end
+
+ -- macro
+ f.macro = f:CreateFontString(button_name .. "Name", "LOW", "GameFontNormal")
+
+ -- keybind
+ f.keybind = f:CreateFontString(nil, "LOW", "GameFontNormal")
+
+ -- itemcount
+ f.count = f:CreateFontString(button_name .. "Count", "LOW", "GameFontNormal")
+
+ -- highlight
+ f.highlight = CreateFrame("Frame", nil, f)
+ f.highlight:SetBackdrop(backdrop_highlight)
+ f.highlight:SetBackdropBorderColor(1,1,1,.8)
+ f.highlight:SetAllPoints()
+ f.highlight:Hide()
+
+ -- active
+ f.active = CreateFrame("Frame", nil, f)
+ f.active:SetBackdrop(backdrop_highlight)
+ f.active:SetBackdropBorderColor(1,1,.5,1)
+ f.active:SetAllPoints()
+ f.active:Hide()
+
+ -- add to buttoncache
+ buttoncache[id] = f
+ end
+
+ -- set required attributes for regular tbc buttons
+ if pfUI.client > 11200 then
+ if bar == 11 then
+ f:SetAttribute("type", "spell")
+ f:SetAttribute('spell', select(2, GetShapeshiftFormInfo(button)))
+ elseif bar == 12 then
+ f:SetAttribute("type1", "pet")
+ f:SetAttribute("action1", button)
+ f:SetAttribute("type2", "macro")
+ f:SetAttribute("macrotext2", "/click PetActionButton".. button .. " RightButton")
+ else
+ bars[bar]:SetAttribute("addchild", f)
+ f:SetAttribute("type", "action")
+ f:SetAttribute("action", id)
+ f:SetAttribute("checkselfcast", true)
+ f:SetAttribute("useparent-unit", true)
+ f:SetAttribute("useparent-statebutton", true)
+
+ for state = 0, 11 do -- add custom states
+ local action = ((state == 0 and bar or state)-1)*12+button
+ f:SetAttribute(string.format("*type-S%d", state), "action")
+ f:SetAttribute(string.format("*type-S%dRight", state), "action")
+ f:SetAttribute(string.format("*action-S%d", state), action)
+ f:SetAttribute(string.format("*action-S%dRight", state), action)
+ if C.bars.rightself == "1" then
+ f:SetAttribute(string.format("*unit-S%dRight", state), "player")
+ else
+ f:SetAttribute(string.format("*unit-S%dRight", state), nil)
+ end
+ end
+ end
+ end
+
+ -- set keydown option
+ if C.bars.keydown == "1" then
+ f:RegisterForClicks("LeftButtonDown", "RightButtonDown")
+ else
+ f:RegisterForClicks("LeftButtonUp", "RightButtonUp")
+ end
+
+ -- set animation
+ f.animation:SetScript("OnUpdate", button_animations[C.bars.animation])
+
+ -- pet autocast
+ if bar == 12 then
+ f.autocast:SetScale(C.bars["bar"..bar].icon_size / 25)
+ f.autocast:SetAlpha(.10)
+ end
+
+ -- macro options
+ if showmacro == "1" then f.macro:Show() else f.macro:Hide() end
+ SetAllPointsOffset(f.macro, f, font_offset, -font_offset)
+ f.macro:SetFont(font, macro_size, "OUTLINE")
+ f.macro:SetTextColor(unpack(macro_color))
+ f.macro:SetJustifyH("LEFT")
+ f.macro:SetJustifyV("BOTTOM")
+
+ -- keybind options
+ if showkybind == "1" then f.keybind:Show() else f.keybind:Hide() end
+ SetAllPointsOffset(f.keybind, f, font_offset, -font_offset)
+ f.keybind:SetFont(font, bind_size, "OUTLINE")
+ f.keybind:SetTextColor(unpack(bind_color))
+ f.keybind:SetJustifyH("RIGHT")
+ f.keybind:SetJustifyV("TOP")
+ f.keybind:SetNonSpaceWrap(false)
+
+ -- item count options
+ if showcount == "1" then f.count:Show() else f.count:Hide() end
+ SetAllPointsOffset(f.count, f, font_offset, -font_offset)
+ f.count:SetFont(font, count_size, "OUTLINE")
+ f.count:SetTextColor(unpack(count_color))
+ f.count:SetJustifyH("RIGHT")
+ f.count:SetJustifyV("BOTTOM")
+
+ -- macro spell scan
+ if C.bars.macroscan == "0" then
+ f.scanmacro, f.spellslot, f.booktype = nil, nil, nil
+ else
+ f.scanmacro = true
+ end
+
+ -- range glow color
+ f.rangeColor = { strsplit(",", C.bars.rangecolor) }
+
+ -- out of mana color
+ f.oomColor = { strsplit(",", C.bars.oomcolor) }
+
+ -- not usable color
+ f.naColor = { strsplit(",", C.bars.nacolor) }
+
+ -- equipped color
+ if f.equipped then
+ f.equipped:SetTexture(strsplit(",", C.bars.eqcolor))
+ end
+
+ -- general appearance
+ f.showempty = showempty == "1" and true or nil
+ f:SetHeight(size)
+ f:SetWidth(size)
+ CreateBackdrop(f, border)
+
+ return f
+ end
+
+ local function CreateActionBar(i)
+ -- load config
+ local buttonbasename = "pfActionBar" .. barnames[i] .. "Button"
+ local enable = C.bars["bar"..i].enable
+ local size = C.bars["bar"..i].icon_size
+ local spacing = C.bars["bar"..i].spacing
+ local background = C.bars["bar"..i].background
+ local formfactor = C.bars["bar"..i].formfactor
+ local autohide = C.bars["bar"..i].autohide
+ local hide_time = C.bars["bar"..i].hide_time
+ local hide_combat = C.bars["bar"..i].hide_combat == "1" and true or nil
+
+ local buttons = tonumber(C.bars["bar"..i].buttons) or 12
+ if i == 11 and bars[i] then -- shapeshift buttons
+ buttons = GetNumShapeshiftForms()
+ elseif i == 12 and bars[i] then -- pet buttons
+ buttons = NUM_PET_ACTION_SLOTS
+ elseif i == 12 or i == 11 then
+ -- Fallback to 10 buttons on shapeshift and petbar during initialization.
+ -- This lets us load bars that aren't yet available for your class or level.
+ buttons = 10
+ end
+
+ -- don't process empty bars
+ if buttons == 0 then
+ bars[i]:Hide()
+ return
+ end
+
+ -- the stored layout is invalid, temporary fallback
+ if not pfGridmath[buttons][BarLayoutFormfactor(formfactor)] then
+ formfactor = BarLayoutOptions(buttons)[1]
+ end
+
+ local font = pfUI.font_unit
+ local font_size = C.global.font_unit_size
+
+ local realsize = size+border*2
+
+ -- create frame
+ local init = not bars[i]
+ bars[i] = bars[i] or CreateFrame("Frame", "pfActionBar" .. barnames[i], UIParent, ACTIONBAR_SECURE_TEMPLATE_BAR)
+ bars[i]:SetID(i)
+
+ -- autohide
+ if autohide == "1" then
+ EnableAutohide(bars[i], tonumber(hide_time), hide_combat)
+ else
+ DisableAutohide(bars[i])
+ end
+
+ -- apply visible settings
+ if enable == "1" then
+ -- handle pet bar
+ if i == 12 then
+ if pfUI.client > 11200 then
+ if InCombatLockdown and InCombatLockdown() then
+ -- don't process those events during combat
+ else
+ -- set state driver for pet bars
+ bars[i]:SetAttribute("unit", "pet")
+ local visibility = pfUI.unlock and pfUI.unlock:IsShown() and "show" or petvisibility
+ if bars[i].visibility ~= visibility then
+ RegisterStateDriver(bars[i], 'visibility', visibility)
+ bars[i].visibility = visibility
+ end
+ end
+ else
+ -- only show when pet actions exists
+ if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
+ bars[i]:Show()
+ else
+ bars[i]:Hide()
+ end
+
+ -- show/hide petbar on petbar updates
+ if init then
+ bars[i]:RegisterEvent("PET_BAR_UPDATE")
+ bars[i]:SetScript("OnEvent", function()
+ -- hide obsolete buttons
+ for i=1, NUM_PET_ACTION_SLOTS do
+ if not PetHasActionBar() and bars[12][i] then
+ bars[12][i]:Hide()
+ end
+ end
+ -- refresh layout
+ CreateActionBar(12)
+ end)
+ end
+ end
+
+ -- handle shapeshift bar
+ elseif i == 11 then
+ -- only show when shapeshifts exist
+ if GetNumShapeshiftForms() > 0 then
+ bars[i]:Show()
+ else
+ bars[i]:Hide()
+ end
+
+ -- update shapeshift bar when amount of spells changes
+ if init then
+ bars[i]:RegisterEvent("PLAYER_ENTERING_WORLD")
+ bars[i]:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
+ bars[i]:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")
+ bars[i]:SetScript("OnEvent", function()
+ local count = GetNumShapeshiftForms()
+ if count ~= this.lastCount then
+ this.lastCount = count
+
+ -- hide obsolete buttons
+ for i=1, NUM_SHAPESHIFT_SLOTS do
+ if i > GetNumShapeshiftForms() and bars[11][i] then
+ bars[11][i]:Hide()
+ end
+ end
+
+ -- create new buttons and refresh layout
+ CreateActionBar(11)
+ end
+ end)
+ end
+
+ -- regular bars
+ else
+ bars[i]:Show()
+ end
+
+ elseif enable == "0" then
+ bars[i]:UnregisterAllEvents()
+ bars[i]:Hide()
+ end
+
+ -- create action buttons
+ local maxbuttons = (i == 11 or i == 12) and 10 or 12
+ for j=1,maxbuttons do
+ bars[i][j] = CreateActionButton(bars[i], i, j)
+ bars[i][j].bar = i
+
+ BarButtonAnchor(bars[i][j], buttonbasename, j, buttons, formfactor, size, border, spacing)
+ bars[i][j]:ClearAllPoints()
+ bars[i][j]:SetPoint(unpack(bars[i][j]._anchor))
+ bars[i][j]:Show()
+
+ if i > 10 then
+ bars[i][j].id = j
+ end
+
+ -- refresh button
+ updatecache[bars[i][j].slot] = true
+ end
+
+ for j=buttons+1,12 do
+ if bars[i][j] then
+ bars[i][j]:Hide()
+ end
+ end
+
+ -- add up to 0-11 button parent states to each bar
+ if i <= 10 and pfUI.client > 11200 then
+ bars[i]:SetAttribute("statebutton", "0:S0;1:S1;2:S2;3:S3;4:S4;5:S5;6:S6;7:S7;8:S8;9:S9;10:S10;11:S11;")
+ bars[i]:SetAttribute("statebutton2", "0:S0Right;1:S1Right;2:S2Right;3:S3Right;4:S4Right;5:S5Right;6:S6Right;7:S7Right;8:S8Right;9:S9Right;10:S10Right;11:S11Right;")
+ end
+
+ -- enable paging for the first actionbar
+ if i == 1 then
+ EnablePaging(bars[i])
+ end
+
+ -- adjust actionbar size
+ BarLayoutSize(bars[i], buttons, formfactor, size, border, spacing)
+ bars[i]:SetWidth(bars[i]._size[1])
+ bars[i]:SetHeight(bars[i]._size[2])
+ bars[i]:ClearAllPoints()
+ if i == 1 then -- main
+ bars[i]:SetPoint("BOTTOM", 0, 2*border)
+ elseif i == 3 then -- left
+ bars[i]:SetPoint("BOTTOMLEFT", bars[1], "BOTTOMRIGHT", 3*border, 0)
+ elseif i == 4 then -- vertical
+ bars[i]:SetPoint("RIGHT", -2*border, 0)
+ elseif i == 5 then -- right
+ bars[i]:SetPoint("BOTTOMRIGHT", bars[1], "BOTTOMLEFT", -3*border, 0)
+ elseif i == 6 then -- top
+ bars[i]:SetPoint("BOTTOM", bars[1], "TOP", 0, -spacing)
+ elseif i == 11 then -- stances
+ bars[i]:SetPoint("BOTTOM", bars[6], "TOP", 0, 3*border)
+ elseif i == 12 then -- pet
+ bars[i]:SetPoint("BOTTOM", bars[6], "TOP", 0, 3*border)
+
+ -- make stance bar dodge by default
+ bars[i]:SetScript("OnShow", function()
+ if bars[11] and bars[11]:IsShown() then
+ bars[11]:ClearAllPoints()
+ bars[11]:SetPoint("BOTTOM", bars[12], "TOP", 0, 3*border)
+ UpdateMovable(bars[11], true)
+ end
+ end)
+
+ -- restore old stance bar position
+ bars[i]:SetScript("OnHide", function()
+ if bars[11] and bars[11]:IsShown() then
+ bars[11]:ClearAllPoints()
+ bars[11]:SetPoint("BOTTOM", bars[6], "TOP", 0, 3*border)
+ UpdateMovable(bars[11], true)
+ end
+ end)
+ else -- others
+ bars[i]:SetPoint("TOP", 0, -i*50)
+ end
+
+ UpdateMovable(bars[i])
+
+ -- apply backdrop settings
+ if background == "1" then
+ CreateBackdrop(bars[i], border)
+ CreateBackdropShadow(bars[i])
+ bars[i].backdrop:Show()
+ elseif bars[i].backdrop then
+ bars[i].backdrop:Hide()
+ end
+
+ -- share backdrop of main and top actionbar
+ if bars[6] and bars[1] then
+ bars[6].OnMove = bars[6].OnMove or function()
+ bars[1].mergedBackdrop = bars[1].mergedBackdrop or CreateFrame("Frame", nil, UIParent)
+ bars[1].mergedBackdrop:SetPoint("TOPLEFT", bars[6], "TOPLEFT", 0, 0)
+ bars[1].mergedBackdrop:SetPoint("BOTTOMRIGHT", bars[1], "BOTTOMRIGHT", 0, 0)
+ CreateBackdrop(bars[1].mergedBackdrop)
+
+ local _, anchor, _ = bars[6]:GetPoint()
+ if anchor == bars[1] and C.bars.bar1.enable == "1"
+ and C.bars.bar1.enable == "1" and C.bars.bar6.enable == "1"
+ and C.bars.bar1.background == "1" and C.bars.bar6.background == "1"
+ and C.bars.bar1.autohide == "0" and C.bars.bar6.autohide == "0"
+ and C.bars.bar1.icon_size == C.bars.bar6.icon_size
+ and C.bars.bar1.spacing == C.bars.bar6.spacing
+ and C.bars.bar1.formfactor == C.bars.bar6.formfactor
+ and C.bars.bar1.buttons == C.bars.bar6.buttons
+ then
+ bars[1].mergedBackdrop:Show()
+
+ if C.bars.bar1.background == "1" and bars[1].backdrop then
+ bars[1].backdrop:Hide()
+ end
+
+ if C.bars.bar6.background == "1" and bars[6].backdrop then
+ bars[6].backdrop:Hide()
+ end
+ else
+ bars[1].mergedBackdrop:Hide()
+
+ if C.bars.bar1.background == "1" and bars[1].backdrop then
+ bars[1].backdrop:Show()
+ end
+
+ if C.bars.bar6.background == "1" and bars[6].backdrop then
+ bars[6].backdrop:Show()
+ end
+ end
+ end
+ bars[6].OnMove()
+ end
+ end
+
+ -- create actionbars
+ pfUI.bars = bars
+ pfUI.bars.update = updatecache
+ pfUI.bars.buttons = buttoncache
+ pfUI.bars.ButtonFullUpdate = ButtonFullUpdate
+ pfUI.bars.ButtonEnter = ButtonEnter
+ pfUI.bars.ButtonLeave = ButtonLeave
+
+ pfUI.bars.UpdateGrid = function(self, state, typ)
+ if not typ then
+ showgrid = state
+
+ for id in pairs(buttoncache) do
+ updatecache[id] = true
+ end
+ elseif typ == "PET" then
+ showgrid_pet = state
+ for slot=133,142 do
+ updatecache[slot] = true
+ end
+ end
+ end
+
+ pfUI.bars.UpdateConfig = function(self)
+ for i=1,12 do
+ CreateActionBar(i)
+ end
+ end
+
+ pfUI.bars:UpdateConfig()
+
+ -- Localize custom keybinds for additional actionbars (see Bindings.xml)
+ local names = {
+ ["PAGING"] = T["Paging Actionbar"],
+ ["STANCEONE"] = T["Stance Bar 1"],
+ ["STANCETWO"] = T["Stance Bar 2"],
+ ["STANCETHREE"] = T["Stance Bar 3"],
+ ["STANCEFOUR"] = T["Stance Bar 4"],
+ }
+
+ for name, loc in pairs(names) do
+ _G["BINDING_HEADER_PFBAR"..name] = T["Action Bar"] .. " " .. loc
+ for i=1,12 do
+ _G["BINDING_NAME_PF" .. name .. i] = loc .. " " .. T["Button"] .. " " .. i
+ end
+ end
+
+ -- Map Keybinds to button clicks
+ function _G.pfActionButton(slot, slfcast, opt)
+ if ChatFrameEditBox:IsShown() then return end
+
+ local bar, button = 1, slot
+
+ -- determine the proper bar and button
+ if opt and blizzbarmapping[opt] then
+ bar = blizzbarmapping[opt]
+ elseif slot > 12 then
+ bar, button = ceil(slot/12), mod(slot, 12)
+ button = button == 0 and 12 or button
+ end
+
+ local frame = bars[bar][button]
+ if frame then
+ frame.slfcast = slfcast
+ frame:Click()
+ end
+ end
+
+ -- Set keybinds to all actionbuttons
+ if pfUI.client <= 11200 then
+ -- In order to be able to reuse already defined keybinds, we need to remap
+ -- existing button functions to pfUI. We need to get rid of the blizzard calls
+ -- to avoid having them call texture changes and errors due to missing buttons
+ _G.ActionButtonDown = pfActionButton
+ _G.ActionButtonUp = pfActionButton
+ _G.BonusActionButtonDown = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
+ _G.BonusActionButtonUp = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
+ _G.MultiActionButtonDown = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
+ _G.MultiActionButtonUp = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
+ _G.ShapeshiftBar_ChangeForm = function(slot) pfActionButton(slot, nil, "ShapeShiftBar") end
+ else
+ local bindwraps = {
+ ["ACTIONBUTTON%d"] = 1,
+ ["SHAPESHIFTBUTTON%d"] = 11, -- ShapeShiftBar
+ ["BONUSACTIONBUTTON%d"] = 12, -- BonusActionBar
+ ["MULTIACTIONBAR1BUTTON%d"] = 6, -- MultiBarBottomLeft
+ ["MULTIACTIONBAR2BUTTON%d"] = 5, -- MultiBarBottomRight
+ ["MULTIACTIONBAR3BUTTON%d"] = 3, -- MultiBarRight
+ ["MULTIACTIONBAR4BUTTON%d"] = 4, -- MultiBarLeft
+ ["PFPAGING%d"] = 2,
+ ["PFSTANCEONE%d"] = 7,
+ ["PFSTANCETWO%d"] = 8,
+ ["PFSTANCETHREE%d"] = 9,
+ ["PFSTANCEFOUR%d"] = 10,
+ }
+
+ -- rebind all existing bindings to our own buttons
+ local keybinder = CreateFrame("Frame")
+ keybinder:RegisterEvent("UPDATE_BINDINGS")
+ keybinder:SetScript("OnEvent", function()
+ for name, bar in pairs(bindwraps) do
+ for i=1,12 do
+ local key = GetBindingKey(format(name, i))
+ local button = bars[bar][i]
+ if key and button then
+ SetOverrideBindingClick(button, false, key, button:GetName(), 'LeftButton')
+ end
+ end
+ end
+ end)
+ end
+
+ -- handle drag-drop grid
+ local grid = CreateFrame("Frame")
+ grid:RegisterEvent("ACTIONBAR_SHOWGRID")
+ grid:RegisterEvent("ACTIONBAR_HIDEGRID")
+ grid:RegisterEvent("PET_BAR_SHOWGRID")
+ grid:RegisterEvent("PET_BAR_HIDEGRID")
+
+ grid:SetScript("OnEvent", function()
+ if event == "ACTIONBAR_SHOWGRID" then
+ pfUI.bars:UpdateGrid(1)
+ elseif event == "ACTIONBAR_HIDEGRID" then
+ pfUI.bars:UpdateGrid(0)
+ elseif event == "PET_BAR_SHOWGRID" then
+ pfUI.bars:UpdateGrid(1, "PET")
+ elseif event == "PET_BAR_HIDEGRID" then
+ pfUI.bars:UpdateGrid(0, "PET")
+ end
+ end)
+
+ -- reagent counter
+ if C.bars.reagents == "1" then
+ local reagent_slots = { }
+ local reagent_counts = { }
+ local reagent_capture = SPELL_REAGENTS.."(.+)"
+ local scanner = libtipscan:GetScanner("actionbar")
+
+ local UpdateSlot = function(slot)
+ local texture = GetActionTexture(slot)
+
+ -- update buttons that previously had an reagent
+ if reagent_slots[slot] and not HasAction(slot) then
+ reagent_slots[slot] = nil
+ updatecache[slot] = true
+ end
+
+ -- search for reagent requirements
+ if HasAction(slot) then
+ scanner:SetAction(slot)
+ local _, reagents = scanner:Find(reagent_capture)
+
+ -- remove reagent counts if existing
+ reagents = reagents and string.gsub(reagents, " %((.+)%)", "")
+
+ -- update on reagent requirement changes
+ if reagents and reagent_slots[slot] ~= reagents then
+ reagent_counts[reagents] = reagent_counts[reagents] or 0
+ reagent_slots[slot] = reagents
+ updatecache[slot] = true
+ end
+ end
+ end
+
+ local reagentcounter = CreateFrame("Frame", "pfReagentCounter", UIParent)
+ reagentcounter:RegisterEvent("PLAYER_ENTERING_WORLD")
+ reagentcounter:RegisterEvent("ACTIONBAR_SLOT_CHANGED")
+ reagentcounter:RegisterEvent("BAG_UPDATE")
+ reagentcounter:SetScript("OnEvent", function()
+ if event == "BAG_UPDATE" then
+ this.event = true
+ else
+ this.scan = 1
+ end
+ end)
+
+ -- limit events to one per second and smoothen action scanning
+ reagentcounter:SetScript("OnUpdate", function()
+ -- scan one action slot per frame
+ if this.scan and this.scan <= 120 then
+ UpdateSlot(this.scan)
+ this.scan = this.scan + 1
+ end
+
+ -- trigger reagent count updates after action scans
+ if this.scan and this.scan >= 120 then
+ this.event = true
+ this.scan = nil
+ end
+
+ -- queue events to fire only once per second
+ if not this.event then return end
+ if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + 1 end
+
+ -- scan for all reagent item counts
+ for item in pairs(reagent_counts) do
+ reagent_counts[item] = GetItemCount(item)
+ end
+
+ -- update all actionbar buttons
+ for slot in pairs(reagent_slots) do
+ updatecache[slot] = true
+ end
+
+ -- remove event trigger
+ this.event = nil
+ end)
+
+ function IsReagentAction(slot)
+ return reagent_slots[slot] and true or nil
+ end
+
+ function GetReagentCount(slot)
+ return reagent_counts[reagent_slots[slot]]
+ end
+ end
+end)
diff --git a/modules/bgscore.lua b/modules/bgscore.lua
new file mode 100644
index 00000000..932f3918
--- /dev/null
+++ b/modules/bgscore.lua
@@ -0,0 +1,60 @@
+pfUI:RegisterModule("bgscore", "vanilla:tbc", function ()
+ local bgframe = WorldStateAlwaysUpFrame
+ if not bgframe then
+ bgframe = CreateFrame("Frame", "WorldStateAlwaysUpFrame", UIParent)
+ bgframe:SetWidth(200)
+ bgframe:SetHeight(25)
+ bgframe:SetPoint("TOP", UIParent, "TOP", 0, -100)
+ end
+
+ local mover = CreateFrame("Frame", "pfUIBGScoreMover", UIParent)
+ mover:SetWidth(220)
+ mover:SetHeight(30)
+ mover:SetPoint("TOP", UIParent, "TOP", 0, -100)
+ mover:SetFrameStrata("DIALOG")
+ mover:SetMovable(true)
+ mover:EnableMouse(true)
+ mover:RegisterForDrag("LeftButton")
+ mover:SetScript("OnDragStart", function() mover:StartMoving() end)
+ mover:SetScript("OnDragStop", function()
+ mover:StopMovingOrSizing()
+ local x = mover:GetLeft()
+ local y = mover:GetTop()
+ pfUI_config = pfUI_config or {}
+ pfUI_config.positions = pfUI_config.positions or {}
+ pfUI_config.positions["WorldStateAlwaysUpFrame"] = { x = x, y = y }
+ bgframe:ClearAllPoints()
+ bgframe:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", x, y)
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccBG Score Frame|r position saved.")
+ end)
+ mover:Hide()
+
+ pfUI.api.CreateBackdrop(mover, nil, nil, .8)
+
+ -- Title label
+ local title = mover:CreateFontString(nil, "OVERLAY")
+ title:SetFont("Fonts\\FRIZQT__.TTF", 14, "OUTLINE")
+ title:SetText("Battleground Frames")
+ title:SetPoint("TOP", mover, "TOP", 0, -2)
+
+ -- BG score preview text
+ local bgscore = mover:CreateFontString(nil, "OVERLAY")
+ bgscore:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
+ bgscore:SetText("|cff3399ffAlliance: 123|r | |cffff4444Horde: 456|r")
+ bgscore:SetPoint("BOTTOM", mover, "BOTTOM", 0, 2)
+
+ mover.label = "BG Score"
+ pfUI.unlock.frames = pfUI.unlock.frames or {}
+ table.insert(pfUI.unlock.frames, mover)
+
+ local pos = pfUI_config and pfUI_config.positions and pfUI_config.positions["WorldStateAlwaysUpFrame"]
+ if pos then
+ bgframe:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", pos.x, pos.y)
+ mover:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", pos.x, pos.y)
+ end
+
+ local origShow = pfUI.unlock.Show
+ local origHide = pfUI.unlock.Hide
+ pfUI.unlock.Show = function(self) origShow(self); mover:Show() end
+ pfUI.unlock.Hide = function(self) origHide(self); mover:Hide(); bgframe:Show() end
+end)
diff --git a/modules/chat.lua b/modules/chat.lua
index ad09a24d..884d027a 100644
--- a/modules/chat.lua
+++ b/modules/chat.lua
@@ -455,6 +455,8 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
if C.chat.global.tabmouse == "1" then
pfUI.chat.mouseovertab = CreateFrame("Frame")
pfUI.chat.mouseovertab:SetScript("OnUpdate", function()
+ -- throttle to 0.1s
+ if ( this.tick or .1) > GetTime() then return else this.tick = GetTime() + .1 end
if pfUI.chat.hideLock then return end
diff --git a/modules/energytick.lua b/modules/energytick.lua
index 8e966afc..d3c8e24d 100644
--- a/modules/energytick.lua
+++ b/modules/energytick.lua
@@ -7,6 +7,9 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
energytick:RegisterEvent("UNIT_DISPLAYPOWER")
energytick:RegisterEvent("UNIT_ENERGY")
energytick:RegisterEvent("UNIT_MANA")
+ energytick:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
+ energytick:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS")
+
energytick:SetScript("OnEvent", function()
if UnitPowerType("player") == 0 and C.unitframes.player.manatick == "1" then
this.mode = "MANA"
@@ -18,6 +21,14 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
this:Hide()
end
+ -- Filter nur eigene Energy-Gewinne von Talents/Buffs
+ if event == "CHAT_MSG_SPELL_SELF_BUFF" or event == "CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS" then
+ if string.find(arg1, "You gain") and string.find(arg1, "Energy from") then
+ this.ignoreNextGain = true
+ end
+ return
+ end
+
if event == "PLAYER_ENTERING_WORLD" then
this.lastMana = UnitMana("player")
end
@@ -38,7 +49,10 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
this.badtick = diff
end
elseif this.mode == "ENERGY" and diff > 0 then
- this.target = 2
+ if not this.ignoreNextGain then
+ this.target = 2
+ end
+ this.ignoreNextGain = false
end
this.lastMana = this.currentMana
end
@@ -69,14 +83,10 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
energytick.spark:SetWidth(C.unitframes.player.pheight + 5)
energytick.spark:SetBlendMode('ADD')
- -- update spark size on player frame changes
local hookUpdateConfig = pfUI.uf.player.UpdateConfig
function pfUI.uf.player.UpdateConfig()
- -- update spark sizes
energytick.spark:SetHeight(C.unitframes.player.pheight + 15)
energytick.spark:SetWidth(C.unitframes.player.pheight + 5)
-
- -- run default unitframe update function
hookUpdateConfig(pfUI.uf.player)
end
-end)
+end)
\ No newline at end of file
diff --git a/modules/nameplates.lua b/modules/nameplates.lua
index d751ec9d..c181418a 100644
--- a/modules/nameplates.lua
+++ b/modules/nameplates.lua
@@ -321,6 +321,9 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
end)
nameplates:SetScript("OnUpdate", function()
+ -- throttle to 10 updates per second instead of every frame
+ if (this.tick or 0.1) > GetTime() then return else this.tick = GetTime() + 0.1 end
+
-- propagate events to all nameplates
if this.eventcache then
this.eventcache = nil
diff --git a/modules/skin.lua b/modules/skin.lua
index dbf64c1a..7c890016 100644
--- a/modules/skin.lua
+++ b/modules/skin.lua
@@ -2,6 +2,9 @@ pfUI:RegisterModule("skin", "vanilla:tbc", function ()
-- align UIParent panels
pfUI.panelalign = CreateFrame("Frame", "pfUIParentPanelAlign", UIParent)
pfUI.panelalign:SetScript("OnUpdate", function()
+ -- throttle to 5 updates per second instead of every frame
+ if (this.tick or 0.2) > GetTime() then return else this.tick = GetTime() + 0.2 end
+
local left = UIParent.left
local center = UIParent.center
local rbpos, ropos
diff --git a/modules/tooltip.lua b/modules/tooltip.lua
index f45159ed..03c51040 100644
--- a/modules/tooltip.lua
+++ b/modules/tooltip.lua
@@ -33,6 +33,10 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
tooltip.cursor:SetWidth(tonumber(C.tooltip.cursoroffset) * 2)
tooltip.cursor:SetHeight(tonumber(C.tooltip.cursoroffset) * 2)
tooltip.cursor:SetScript("OnUpdate", function()
+ -- throttle to 0.1s - cursor following doesn't need to be every frame
+ if (this.tick or 0) > GetTime() then return end
+ this.tick = GetTime() + 0.1
+
local scale = UIParent:GetScale()
local x, y = GetCursorPosition()
this:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x/scale, y/scale)
From 2fe5603e6e655b17d42a0206225078fb9a61a5bb Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Wed, 31 Dec 2025 12:22:09 +0100
Subject: [PATCH 03/13] performance updates
performance updates
---
libs/libpredict.lua | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libs/libpredict.lua b/libs/libpredict.lua
index 448876c8..77701f0b 100644
--- a/libs/libpredict.lua
+++ b/libs/libpredict.lua
@@ -96,6 +96,10 @@ libpredict:SetScript("OnEvent", function()
end)
libpredict:SetScript("OnUpdate", function()
+ -- throttle cleanup to 0.1s - no need to check every frame
+ if (this.tick or 0) > GetTime() then return end
+ this.tick = GetTime() + 0.1
+
-- update on timeout events
for timestamp, targets in pairs(events) do
if GetTime() >= timestamp then
From b8c8214feac175531536f24e0170ff6efca8d2cf Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Wed, 31 Dec 2025 12:28:10 +0100
Subject: [PATCH 04/13] Update README.md
---
README.md | 122 +-----------------------------------------------------
1 file changed, 1 insertion(+), 121 deletions(-)
diff --git a/README.md b/README.md
index 6e556887..0c9fbe83 100644
--- a/README.md
+++ b/README.md
@@ -1,121 +1 @@
-# pfUI
-
-An AddOn for World of Warcraft: Vanilla (1.12.1) and The Burning Crusade (2.4.3), which aims to be a full replacement for the original interface. The design is inspired by several screenshots I've seen from TukUI, ElvUI and others. This addon delivers modern features and a minimalistic style that's easy to use right from the start. It is entirely written from scratch without any inclusion of third-party addons or libraries.
-
-This is **not** an addon-pack like [ShaguUI](http://shagu.org/ShaguUI/), however, there is support for external addons like MobHealth3, DPSMate and others, but they will never be shipped within the package.
-
-**Please do not re-upload or distribute outdated versions of this project. However, you are more than welcome to fork or link to the official github page.**
-
-## Screenshots
-
-
-
-
-
-
-## Installation (Vanilla)
-1. Download **[Latest Version](https://github.com/shagu/pfUI/archive/master.zip)**
-2. Unpack the Zip file
-3. Rename the folder "pfUI-master" to "pfUI"
-4. Copy "pfUI" into Wow-Directory\Interface\AddOns
-5. Restart Wow
-
-## Installation (The Burning Crusade)
-1. Download **[Latest Version](https://github.com/shagu/pfUI/archive/master.zip)**
-2. Unpack the Zip file
-3. Rename the folder "pfUI-master" to "pfUI-tbc"
-4. Copy "pfUI-tbc" into Wow-Directory\Interface\AddOns
-5. Restart Wow
-
-## Commands
-
- /pfui Open the configuration GUI
- /share Open the configuration import/export dialog
- /gm Open the ticket Dialog
- /rl Reload the whole UI
- /farm Toggles the Farm-Mode
- /pfcast Same as /cast but for mouseover units
- /focus Creates a Focus-Frame for the current target
- /castfocus Same as /cast but for focus frame
- /clearfocus Clears the Focus-Frame
- /swapfocus Toggle Focus and Target-Frame
- /pftest Toggle pfUI Unitframe Test Mode
- /abp Addon Button Panel
-
-## Languages
-pfUI supports and contains language specific code for the following gameclients.
-* English (enUS)
-* Korean (koKR)
-* French (frFR)
-* German (deDE)
-* Chinese (zhCN)
-* Spanish (esES)
-* Russian (ruRU)
-
-## Recommended Addons
-* [pfQuest](https://shagu.org/pfQuest) A simple database and quest helper
-* [WIM](http://addons.us.to/addon/wim), [WIM (continued)](https://github.com/shirsig/WIM) Give whispers an instant messenger feel
-
-## Plugins
-* [pfUI-eliteoverlay](https://shagu.org/pfUI-eliteoverlay) Add elite dragons to unitframes
-* [pfUI-fonts](https://shagu.org/pfUI-fonts) Additional fonts for pfUI
-* [pfUI-CustomMedia](https://github.com/mrrosh/pfUI-CustomMedia) Additional textures for pfUI
-* [pfUI-Gryphons](https://github.com/mrrosh/pfUI-Gryphons) Add back the gryphons to your actionbars
-
-## FAQ
-**What does "pfUI" stand for?**
-The term "*pfui!*" is german and simply stands for "*pooh!*", because I'm not a
-big fan of creating configuration UI's, especially not via the Wow-API
-(you might have noticed that in ShaguUI).
-
-**How can I donate?**
-You can donate via [GitHub](https://github.com/sponsors/shagu) or [Ko-fi](https://ko-fi.com/shagu)
-
-**How do I report a Bug?**
-Please provide as much information as possible in the [Bugtracker](https://github.com/shagu/pfUI/issues).
-If there is an error message, provide the full content of it. Just telling that "there is an error" won't help any of us.
-Please consider adding additional information such as: since when did you got the error,
-does it still happen using a clean configuration, what other addons are loaded and which version you're running.
-When playing with a non-english client, the language might be relevant too. If possible, explain how people can reproduce the issue.
-
-**How can I contribute?**
-Report errors and issues in the [Bugtracker](https://github.com/shagu/pfUI/issues).
-Please make sure to have the latest version installed and check for conflicting addons beforehand.
-
-**I have bad performance, what can I do?**
-There's only one known performance issue: that is while using "Frame Shadows". Make sure to disable those
-in the pfUI settings (Settings -> Appearance -> Enable Frame Shadows). If you still have a low performance,
-it's most likely a combination with another addon. Disable all AddOns but pfUI and then enable one-by-one,
-till the performance problem occurs again. Make sure to report the identified AddOn and what you did to reproduce
-via the [Bugtracker](https://github.com/shagu/pfUI/issues).
-
-**Where is the happiness indicator for pets?**
-The pet happiness is shown as the color of your pet's frame. Depending on your skin, this can either be the text or the background color of your pet's healthbar:
-
-- Green = Happy
-- Yellow = Content
-- Red = Unhappy
-
-Since version 4.0.7 there is also an additional icon that can be enabled from the pet unit frame options.
-
-**Can I use Clique with pfUI?**
-This addon already includes support for clickcasting. If you still want to make use of clique, all pfUI's unitframes are already compatible to Clique-TBC. For Vanilla, a pfUI compatible version can be found [Here](https://github.com/shagu/Clique/archive/master.zip). If you want to keep your current version of Clique, you'll have to apply this [Patch](https://github.com/shagu/Clique/commit/a5ee56c3f803afbdda07bae9cd330e0d4a75d75a).
-
-**Where is the Experience Bar?**
-The experience bar shows up on mouseover and whenever you gain experience, next to left chatframe by default. There's also an option to make it stay visible all the time.
-
-**How do I show the Damage- and Threatmeter Dock?**
-If you enabled the "dock"-feature for your external (third-party) meters such as DPSMate or KTM, then you'll be able to toggle between them and the Right Chat by clicking on the ">" symbol on the bottom-right panel.
-
-**Why is my chat always resetting to only 3 lines of text?**
-This happens if "Simple Chat" is enabled in blizzards interface settings (Advanced Options).
-Paste the following command into your chat to disable that option: `/run SIMPLE_CHAT="0"; pfUI.chat.SetupPositions(); ReloadUI()`
-
-**How can I enable mouseover cast?**
-On Vanilla, create a macro with "/pfcast SPELLNAME". If you also want to see the cooldown, You might want to add "/run if nil then CastSpellByName("SPELLNAME") end" on top of the macro. For The Burning Crusade, just use the regular mouseover macros.
-
-**Will there be pfUI for Activision's "Classic" remakes?**
-No, it would require an entire rewrite of the AddOn since the game is now a different one. The AddOn-API has evolved during the last 15 years and the new "Classic" versions are based on a current retail gameclient. I don't plan to play any of those new versions, so I won't be porting any of my addons to it.
-
-**Everything from scratch?! Are you insane?**
-Most probably, yes.
+pfUI performance updates, use on own risk.
From 6be7731d3e1438fa3e9975ca05a63fed847b247c Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Wed, 31 Dec 2025 12:39:25 +0100
Subject: [PATCH 05/13] performance update
performance update
From 6c86d83352a1a2b01545f67fe4360f2bb7aae38f Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Wed, 31 Dec 2025 12:46:04 +0100
Subject: [PATCH 06/13] performance update
performance update
---
api/unitframes.lua | 151 +++++++++++++++++++++++++++++++++++++--------
1 file changed, 125 insertions(+), 26 deletions(-)
diff --git a/api/unitframes.lua b/api/unitframes.lua
index 9c1b9465..36e8eaed 100644
--- a/api/unitframes.lua
+++ b/api/unitframes.lua
@@ -14,6 +14,79 @@ end)
pfUI.uf.frames = {}
pfUI.uf.delayed = {}
+-- =====================================================
+-- ZENTRALER EVENT-HANDLER für Raid/Party Performance
+-- =====================================================
+pfUI.uf.unitmap = {} -- Maps "raid1" -> frame, "party2" -> frame, etc.
+
+pfUI.uf.RebuildUnitmap = function()
+ -- Clear old mappings
+ for k in pairs(pfUI.uf.unitmap) do
+ pfUI.uf.unitmap[k] = nil
+ end
+
+ -- Rebuild raid mappings
+ if pfUI.uf.raid then
+ for i = 1, 40 do
+ local frame = pfUI.uf.raid[i]
+ if frame and frame.id and frame.id ~= 0 then
+ pfUI.uf.unitmap["raid" .. frame.id] = frame
+ end
+ end
+ end
+
+ -- Rebuild party mappings
+ for i = 1, 4 do
+ local frame = _G["pfGroup" .. i]
+ if frame and frame.label == "party" then
+ pfUI.uf.unitmap["party" .. frame.id] = frame
+ end
+ end
+end
+
+pfUI.uf.eventframe = CreateFrame("Frame")
+pfUI.uf.eventframe:RegisterEvent("UNIT_HEALTH")
+pfUI.uf.eventframe:RegisterEvent("UNIT_MAXHEALTH")
+pfUI.uf.eventframe:RegisterEvent("UNIT_MANA")
+pfUI.uf.eventframe:RegisterEvent("UNIT_MAXMANA")
+pfUI.uf.eventframe:RegisterEvent("UNIT_RAGE")
+pfUI.uf.eventframe:RegisterEvent("UNIT_MAXRAGE")
+pfUI.uf.eventframe:RegisterEvent("UNIT_ENERGY")
+pfUI.uf.eventframe:RegisterEvent("UNIT_MAXENERGY")
+pfUI.uf.eventframe:RegisterEvent("UNIT_AURA")
+pfUI.uf.eventframe:RegisterEvent("UNIT_PORTRAIT_UPDATE")
+pfUI.uf.eventframe:RegisterEvent("UNIT_MODEL_CHANGED")
+pfUI.uf.eventframe:RegisterEvent("UNIT_DISPLAYPOWER")
+pfUI.uf.eventframe:RegisterEvent("UNIT_FACTION")
+pfUI.uf.eventframe:RegisterEvent("RAID_ROSTER_UPDATE")
+pfUI.uf.eventframe:RegisterEvent("PARTY_MEMBERS_CHANGED")
+
+pfUI.uf.eventframe:SetScript("OnEvent", function()
+ -- Unitmap neu aufbauen bei Roster-Änderungen
+ if event == "RAID_ROSTER_UPDATE" or event == "PARTY_MEMBERS_CHANGED" then
+ pfUI.uf.RebuildUnitmap()
+ return
+ end
+
+ if not arg1 then return end
+
+ -- Direkt den richtigen Frame finden
+ local frame = pfUI.uf.unitmap[arg1]
+ if not frame then return end
+
+ -- Event verarbeiten (gleiche Logik wie vorher)
+ if event == "UNIT_PORTRAIT_UPDATE" or event == "UNIT_MODEL_CHANGED" then
+ frame.update_portrait = true
+ elseif event == "UNIT_AURA" then
+ frame.update_aura = true
+ elseif event == "UNIT_FACTION" then
+ frame.update_pvp = true
+ else
+ frame.update_full = true
+ end
+end)
+-- =====================================================
+
-- slash command to toggle unitframe test mode
_G.SLASH_PFTEST1, _G.SLASH_PFTEST2 = "/pftest", "/pfuftest"
_G.SlashCmdList.PFTEST = function()
@@ -51,6 +124,9 @@ local function BuffOnUpdate()
end
local function TargetBuffOnUpdate()
+ -- throttle to 0.1s
+ if ( this.tick or .1) > GetTime() then return else this.tick = GetTime() + .1 end
+
local name, rank, icon, count, duration, timeleft = _G.UnitBuff("target", this.id)
if duration and timeleft then
CooldownFrame_SetTimer(this.cd, GetTime() + timeleft - duration, duration, 1)
@@ -921,6 +997,13 @@ function pfUI.uf.OnUpdate()
-- update combat feedback
if this.feedbackText then CombatFeedback_OnUpdate(arg1) end
+ -- Throttle for raid/party frames: only process updates every 0.1s
+ -- This reduces OnUpdate calls from 5760/sec (40 frames * 144fps) to ~400/sec
+ if this.label == "raid" or this.label == "party" then
+ if (this.tick or 0) > GetTime() then return end
+ this.tick = GetTime() + 0.1
+ end
+
-- process indicator update events
if this.update_indicators then
pfUI.uf:RefreshIndicators(this)
@@ -1164,33 +1247,49 @@ end
function pfUI.uf:EnableEvents()
local f = self
+ local unitstr = f.label .. f.id
- f:RegisterEvent("PLAYER_ENTERING_WORLD")
- f:RegisterEvent("UNIT_DISPLAYPOWER")
- f:RegisterEvent("UNIT_HEALTH")
- f:RegisterEvent("UNIT_MAXHEALTH")
- f:RegisterEvent("UNIT_MANA")
- f:RegisterEvent("UNIT_MAXMANA")
- f:RegisterEvent("UNIT_RAGE")
- f:RegisterEvent("UNIT_MAXRAGE")
- f:RegisterEvent("UNIT_ENERGY")
- f:RegisterEvent("UNIT_MAXENERGY")
- f:RegisterEvent("UNIT_FOCUS")
- f:RegisterEvent("UNIT_PORTRAIT_UPDATE")
- f:RegisterEvent("UNIT_MODEL_CHANGED")
- f:RegisterEvent("UNIT_FACTION")
- f:RegisterEvent("UNIT_AURA") -- frame=buff, frame=debuff
- f:RegisterEvent("PLAYER_AURAS_CHANGED") -- label=player && frame=buff
- f:RegisterEvent("UNIT_INVENTORY_CHANGED") -- label=player && frame=buff
- f:RegisterEvent("PARTY_MEMBERS_CHANGED") -- label=party, frame=leaderIcon
- f:RegisterEvent("PARTY_LEADER_CHANGED") -- frame=leaderIcon
- f:RegisterEvent("RAID_ROSTER_UPDATE") -- label=raidIcon
- f:RegisterEvent("PLAYER_UPDATE_RESTING") -- label=restIcon
- f:RegisterEvent("PLAYER_TARGET_CHANGED") -- label=target
- f:RegisterEvent("PARTY_LOOT_METHOD_CHANGED") -- frame=lootIcon
- f:RegisterEvent("RAID_TARGET_UPDATE") -- frame=raidIcon
- f:RegisterEvent("UNIT_PET")
- f:RegisterEvent("UNIT_HAPPINESS")
+ -- Raid/Party Frames: Registriere im zentralen Handler statt selbst
+ if f.label == "raid" or f.label == "party" then
+ -- Nur nicht-UNIT_* Events selbst registrieren
+ f:RegisterEvent("PLAYER_ENTERING_WORLD")
+ f:RegisterEvent("PARTY_MEMBERS_CHANGED")
+ f:RegisterEvent("PARTY_LEADER_CHANGED")
+ f:RegisterEvent("RAID_ROSTER_UPDATE")
+ f:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
+ f:RegisterEvent("RAID_TARGET_UPDATE")
+
+ -- Unitmap aktualisieren
+ pfUI.uf.RebuildUnitmap()
+ else
+ -- Alle anderen Frames: Normale Event-Registrierung
+ f:RegisterEvent("PLAYER_ENTERING_WORLD")
+ f:RegisterEvent("UNIT_DISPLAYPOWER")
+ f:RegisterEvent("UNIT_HEALTH")
+ f:RegisterEvent("UNIT_MAXHEALTH")
+ f:RegisterEvent("UNIT_MANA")
+ f:RegisterEvent("UNIT_MAXMANA")
+ f:RegisterEvent("UNIT_RAGE")
+ f:RegisterEvent("UNIT_MAXRAGE")
+ f:RegisterEvent("UNIT_ENERGY")
+ f:RegisterEvent("UNIT_MAXENERGY")
+ f:RegisterEvent("UNIT_FOCUS")
+ f:RegisterEvent("UNIT_PORTRAIT_UPDATE")
+ f:RegisterEvent("UNIT_MODEL_CHANGED")
+ f:RegisterEvent("UNIT_FACTION")
+ f:RegisterEvent("UNIT_AURA")
+ f:RegisterEvent("PLAYER_AURAS_CHANGED")
+ f:RegisterEvent("UNIT_INVENTORY_CHANGED")
+ f:RegisterEvent("PARTY_MEMBERS_CHANGED")
+ f:RegisterEvent("PARTY_LEADER_CHANGED")
+ f:RegisterEvent("RAID_ROSTER_UPDATE")
+ f:RegisterEvent("PLAYER_UPDATE_RESTING")
+ f:RegisterEvent("PLAYER_TARGET_CHANGED")
+ f:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
+ f:RegisterEvent("RAID_TARGET_UPDATE")
+ f:RegisterEvent("UNIT_PET")
+ f:RegisterEvent("UNIT_HAPPINESS")
+ end
f:RegisterForClicks('LeftButtonUp', 'RightButtonUp',
'MiddleButtonUp', 'Button4Up', 'Button5Up')
From 96c005239db189255682e9d6abaa5ef349441db2 Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 12:33:07 +0100
Subject: [PATCH 07/13] performance update
---
modules/actionbar.lua | 93 +----
modules/actionbar_nodebug.lua | 35 +-
modules/addonbuttons.lua | 2 +-
modules/addons.lua | 2 +-
modules/afkcam.lua | 2 +-
modules/autovendor.lua | 2 +-
modules/bags.lua | 6 +-
modules/bgscore.lua | 2 +-
modules/bubbles.lua | 2 +-
modules/buff.lua | 2 +-
modules/buffwatch.lua | 2 +-
modules/castbar.lua | 21 +-
modules/chat.lua | 26 +-
modules/chatcopy.lua | 2 +-
modules/combopoints.lua | 2 +-
modules/cooldown.lua | 15 +-
modules/easteregg.lua | 2 +-
modules/energytick.lua | 2 +-
modules/farmmode.lua | 2 +-
modules/feigndeath.lua | 2 +-
modules/firstrun.lua | 2 +-
modules/focus.lua | 2 +-
modules/group.lua | 2 +-
modules/gryphons.lua | 2 +-
modules/gui.lua | 64 +--
modules/hoverbind.lua | 2 +-
modules/infight.lua | 2 +-
modules/loot.lua | 2 +-
modules/map.lua | 2 +-
modules/mapreveal.lua | 2 +-
modules/minimap.lua | 4 +-
modules/mirrortimers.lua | 2 +-
modules/nameplates.lua | 3 +-
modules/nampower.lua | 743 +++++++++++++++++++++++++++++++++
modules/panel.lua | 2 +-
modules/pet.lua | 2 +-
modules/pettarget.lua | 2 +-
modules/pixelperfect.lua | 2 +-
modules/player.lua | 2 +-
modules/questitem.lua | 6 +-
modules/raid.lua | 7 +-
modules/roll.lua | 2 +-
modules/screenshot.lua | 2 +-
modules/sellvalue.lua | 2 +-
modules/share.lua | 2 +-
modules/skin.lua | 2 +-
modules/socialmod.lua | 2 +-
modules/superwow.lua | 379 +++++++++++++++--
modules/target.lua | 2 +-
modules/targettarget.lua | 2 +-
modules/targettargettarget.lua | 2 +-
modules/thirdparty.lua | 14 +-
modules/tooltip.lua | 2 +-
modules/totems.lua | 5 +-
modules/uf_tukui.lua | 2 +-
modules/unitxp.lua | 234 +++++++++++
modules/unlock.lua | 2 +-
modules/unusable.lua | 2 +-
modules/updatenotify.lua | 2 +-
modules/xpbar.lua | 2 +-
60 files changed, 1485 insertions(+), 258 deletions(-)
create mode 100644 modules/nampower.lua
create mode 100644 modules/unitxp.lua
diff --git a/modules/actionbar.lua b/modules/actionbar.lua
index df1eae1a..10e542dc 100644
--- a/modules/actionbar.lua
+++ b/modules/actionbar.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
+pfUI:RegisterModule("actionbar", "vanilla", function ()
local _, class = UnitClass("player")
local color = RAID_CLASS_COLORS[class]
local cr, cg, cb = color.r , color.g, color.b
@@ -395,14 +395,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
for line in gfind(body, "[^%\n]+") do
_, _, match = string.find(line, '^#showtooltip (.+)')
- -- skip any further manual macro scanning on
- -- gameclients with native macro spell detection
- if pfUI.client > 11200 and match then
- self.spellslot = nil
- self.booktype = nil
- return
- end
-
-- allow the user to disable the scan
if match and strfind(match, "disable") then
return
@@ -1176,39 +1168,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
buttoncache[id] = f
end
- -- set required attributes for regular tbc buttons
- if pfUI.client > 11200 then
- if bar == 11 then
- f:SetAttribute("type", "spell")
- f:SetAttribute('spell', select(2, GetShapeshiftFormInfo(button)))
- elseif bar == 12 then
- f:SetAttribute("type1", "pet")
- f:SetAttribute("action1", button)
- f:SetAttribute("type2", "macro")
- f:SetAttribute("macrotext2", "/click PetActionButton".. button .. " RightButton")
- else
- bars[bar]:SetAttribute("addchild", f)
- f:SetAttribute("type", "action")
- f:SetAttribute("action", id)
- f:SetAttribute("checkselfcast", true)
- f:SetAttribute("useparent-unit", true)
- f:SetAttribute("useparent-statebutton", true)
-
- for state = 0, 11 do -- add custom states
- local action = ((state == 0 and bar or state)-1)*12+button
- f:SetAttribute(string.format("*type-S%d", state), "action")
- f:SetAttribute(string.format("*type-S%dRight", state), "action")
- f:SetAttribute(string.format("*action-S%d", state), action)
- f:SetAttribute(string.format("*action-S%dRight", state), action)
- if C.bars.rightself == "1" then
- f:SetAttribute(string.format("*unit-S%dRight", state), "player")
- else
- f:SetAttribute(string.format("*unit-S%dRight", state), nil)
- end
- end
- end
- end
-
-- set keydown option
if C.bars.keydown == "1" then
f:RegisterForClicks("LeftButtonDown", "RightButtonDown")
@@ -1335,40 +1294,26 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
if enable == "1" then
-- handle pet bar
if i == 12 then
- if pfUI.client > 11200 then
- if InCombatLockdown and InCombatLockdown() then
- -- don't process those events during combat
- else
- -- set state driver for pet bars
- bars[i]:SetAttribute("unit", "pet")
- local visibility = pfUI.unlock and pfUI.unlock:IsShown() and "show" or petvisibility
- if bars[i].visibility ~= visibility then
- RegisterStateDriver(bars[i], 'visibility', visibility)
- bars[i].visibility = visibility
- end
- end
+ -- only show when pet actions exists
+ if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
+ bars[i]:Show()
else
- -- only show when pet actions exists
- if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
- bars[i]:Show()
- else
- bars[i]:Hide()
- end
+ bars[i]:Hide()
+ end
- -- show/hide petbar on petbar updates
- if init then
- bars[i]:RegisterEvent("PET_BAR_UPDATE")
- bars[i]:SetScript("OnEvent", function()
- -- hide obsolete buttons
- for i=1, NUM_PET_ACTION_SLOTS do
- if not PetHasActionBar() and bars[12][i] then
- bars[12][i]:Hide()
- end
- end
- -- refresh layout
- CreateActionBar(12)
- end)
- end
+ -- show/hide petbar on petbar updates
+ if init then
+ bars[i]:RegisterEvent("PET_BAR_UPDATE")
+ bars[i]:SetScript("OnEvent", function()
+ -- hide obsolete buttons
+ for i=1, NUM_PET_ACTION_SLOTS do
+ if not PetHasActionBar() and bars[12][i] then
+ bars[12][i]:Hide()
+ end
+ end
+ -- refresh layout
+ CreateActionBar(12)
+ end)
end
-- handle shapeshift bar
diff --git a/modules/actionbar_nodebug.lua b/modules/actionbar_nodebug.lua
index ca9a91ba..9edd0469 100644
--- a/modules/actionbar_nodebug.lua
+++ b/modules/actionbar_nodebug.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
+pfUI:RegisterModule("actionbar", "vanilla", function ()
local _, class = UnitClass("player")
local color = RAID_CLASS_COLORS[class]
local cr, cg, cb = color.r , color.g, color.b
@@ -1184,39 +1184,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
buttoncache[id] = f
end
- -- set required attributes for regular tbc buttons
- if pfUI.client > 11200 then
- if bar == 11 then
- f:SetAttribute("type", "spell")
- f:SetAttribute('spell', select(2, GetShapeshiftFormInfo(button)))
- elseif bar == 12 then
- f:SetAttribute("type1", "pet")
- f:SetAttribute("action1", button)
- f:SetAttribute("type2", "macro")
- f:SetAttribute("macrotext2", "/click PetActionButton".. button .. " RightButton")
- else
- bars[bar]:SetAttribute("addchild", f)
- f:SetAttribute("type", "action")
- f:SetAttribute("action", id)
- f:SetAttribute("checkselfcast", true)
- f:SetAttribute("useparent-unit", true)
- f:SetAttribute("useparent-statebutton", true)
-
- for state = 0, 11 do -- add custom states
- local action = ((state == 0 and bar or state)-1)*12+button
- f:SetAttribute(string.format("*type-S%d", state), "action")
- f:SetAttribute(string.format("*type-S%dRight", state), "action")
- f:SetAttribute(string.format("*action-S%d", state), action)
- f:SetAttribute(string.format("*action-S%dRight", state), action)
- if C.bars.rightself == "1" then
- f:SetAttribute(string.format("*unit-S%dRight", state), "player")
- else
- f:SetAttribute(string.format("*unit-S%dRight", state), nil)
- end
- end
- end
- end
-
-- set keydown option
if C.bars.keydown == "1" then
f:RegisterForClicks("LeftButtonDown", "RightButtonDown")
diff --git a/modules/addonbuttons.lua b/modules/addonbuttons.lua
index c083163f..319ebf3d 100644
--- a/modules/addonbuttons.lua
+++ b/modules/addonbuttons.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("addonbuttons", "vanilla:tbc", function ()
+pfUI:RegisterModule("addonbuttons", "vanilla", function ()
if not pfUI.minimap then return end
if C.abuttons.enable == "0" then return end
diff --git a/modules/addons.lua b/modules/addons.lua
index 220035c8..da35d396 100644
--- a/modules/addons.lua
+++ b/modules/addons.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("addons", "vanilla:tbc", function ()
+pfUI:RegisterModule("addons", "vanilla", function ()
local rawborder, border = GetBorderSize()
-- add main menu button
diff --git a/modules/afkcam.lua b/modules/afkcam.lua
index a9d55d0d..504ad036 100644
--- a/modules/afkcam.lua
+++ b/modules/afkcam.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("afkcam", "vanilla:tbc", function ()
+pfUI:RegisterModule("afkcam", "vanilla", function ()
local MARKED_AFK_CAPTURE = SanitizePattern(MARKED_AFK_MESSAGE)
local social_chats = {
"CHAT_MSG_SAY",
diff --git a/modules/autovendor.lua b/modules/autovendor.lua
index 57c259ab..5dc88369 100644
--- a/modules/autovendor.lua
+++ b/modules/autovendor.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("autovendor", "vanilla:tbc", function ()
+pfUI:RegisterModule("autovendor", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
local processed = {}
diff --git a/modules/bags.lua b/modules/bags.lua
index d343d98a..49d5a084 100644
--- a/modules/bags.lua
+++ b/modules/bags.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("bags", "vanilla:tbc", function ()
+pfUI:RegisterModule("bags", "vanilla", function ()
local rawborder, default_border = GetBorderSize("bags")
local knownInventorySpellTextures = {
@@ -573,8 +573,8 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
SlotLeave()
end)
- -- On TBC, the OnEvent function of the template scans for framenames,
- -- and obviously doesn't know the pf-Names. Therefore, triggering
+ -- The OnEvent function of the template scans for framenames,
+ -- and doesn't know the pf-Names. Therefore, triggering
-- the update function on each frame manually
if frame == pfUI.bag.left and BankFrameItemButton_Update then
local SlotUpdate = frame.bagslots.slots[slot].frame:GetScript("OnUpdate")
diff --git a/modules/bgscore.lua b/modules/bgscore.lua
index 932f3918..693c6560 100644
--- a/modules/bgscore.lua
+++ b/modules/bgscore.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("bgscore", "vanilla:tbc", function ()
+pfUI:RegisterModule("bgscore", "vanilla", function ()
local bgframe = WorldStateAlwaysUpFrame
if not bgframe then
bgframe = CreateFrame("Frame", "WorldStateAlwaysUpFrame", UIParent)
diff --git a/modules/bubbles.lua b/modules/bubbles.lua
index 61f9e991..16f4dba6 100644
--- a/modules/bubbles.lua
+++ b/modules/bubbles.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("bubbles", "vanilla:tbc", function ()
+pfUI:RegisterModule("bubbles", "vanilla", function ()
local alpha = tonumber(C.chat.bubbles.alpha)
diff --git a/modules/buff.lua b/modules/buff.lua
index f7114416..7dfbabf6 100644
--- a/modules/buff.lua
+++ b/modules/buff.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("buff", "vanilla:tbc", function ()
+pfUI:RegisterModule("buff", "vanilla", function ()
-- Hide Blizz
BuffFrame:Hide()
BuffFrame:UnregisterAllEvents()
diff --git a/modules/buffwatch.lua b/modules/buffwatch.lua
index e9109b2a..f9c7a154 100644
--- a/modules/buffwatch.lua
+++ b/modules/buffwatch.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
+pfUI:RegisterModule("buffwatch", "vanilla", function ()
local rawborder, border = GetBorderSize("panels")
local scanner = libtipscan:GetScanner("buffwatch")
diff --git a/modules/castbar.lua b/modules/castbar.lua
index bb2b071e..b8ad0df7 100644
--- a/modules/castbar.lua
+++ b/modules/castbar.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
+pfUI:RegisterModule("castbar", "vanilla", function ()
local font = C.castbar.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
local font_size = C.castbar.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local rawborder, default_border = GetBorderSize("unitframes")
@@ -86,11 +86,20 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
local query = this.unitstr ~= "" and this.unitstr or this.unitname
if not query then return end
- -- transform all non player unitstrings to unit guids
- if superwow_active and this.unitstr and not UnitIsUnit(this.unitstr, 'player') then
+ -- transform unitstrings to unit guids when SuperWoW is active
+ -- SuperWoW stores cast data by GUID for all units INCLUDING player
+ -- BUT: For player casts, we need to use libcast data because it handles pushback correctly
+ local useLibcastForPlayer = this.unitstr == "player"
+
+ if superwow_active and this.unitstr and not useLibcastForPlayer then
local _, guid = UnitExists(this.unitstr)
query = guid or query
end
+
+ -- For player: use player name to query libcast.db directly
+ if useLibcastForPlayer then
+ query = UnitName("player")
+ end
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill = UnitCastingInfo(query)
if not cast then
@@ -149,10 +158,10 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
if this.showtimer then
if this.delay and this.delay > 0 then
- local delay = "|cffffaaaa" .. (channel and "-" or "+") .. round(this.delay,1) .. " |r "
- this.bar.right:SetText(delay .. string.format("%.1f",cur) .. " / " .. round(max,1))
+ local delay = "|cffffaaaa" .. (channel and "-" or "+") .. round(this.delay,2) .. " |r "
+ this.bar.right:SetText(delay .. string.format("%.2f",cur) .. " / " .. round(max,2))
else
- this.bar.right:SetText(string.format("%.1f",cur) .. " / " .. round(max,1))
+ this.bar.right:SetText(string.format("%.2f",cur) .. " / " .. round(max,2))
end
end
diff --git a/modules/chat.lua b/modules/chat.lua
index 884d027a..6268bd4f 100644
--- a/modules/chat.lua
+++ b/modules/chat.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("chat", "vanilla:tbc", function ()
+pfUI:RegisterModule("chat", "vanilla", function ()
local panelfont = C.panel.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
local panelfont_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local rawborder, default_border = GetBorderSize("chat")
@@ -727,6 +727,12 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
end
end)
+ local function GetPlayerLevel(name)
+ if not pfUI_playerDB then return nil end
+ if not pfUI_playerDB[name] then return nil end
+ return pfUI_playerDB[name].level
+ end
+
local function ScanWhoName(name)
-- abort if another query is ongoing
if who_query.pending then return end
@@ -747,8 +753,7 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
end
-- Remove prat CLINKs
- text = gsub(text, "{CLINK:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r") -- tbc
- text = gsub(text, "{CLINK:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r") -- vanilla
+ text = gsub(text, "{CLINK:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r")
-- Remove chatter CLINKs
text = gsub(text, "{CLINK:item:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r")
@@ -785,6 +790,21 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
end
end
+ -- display player levels if available
+ if C.chat.text.playerlevel == "1" then
+ for name in gfind(text, "|Hplayer:(.-)|h") do
+ local real, _ = strsplit(":", name)
+ local level = GetPlayerLevel(real)
+
+ if level then
+ local levelcolor = rgbhex(GetDifficultyColor(level))
+ -- Add level after the player name, before the closing bracket
+ text = string.gsub(text, "(|Hplayer:" .. name .. "|h.-|h|r)" .. right,
+ "%1 " .. levelcolor .. level .. "|r" .. right)
+ end
+ end
+ end
+
-- reduce channel name to number
if C.chat.text.channelnumonly == "1" then
local channel = string.gsub(text, ".*%[(.-)%]%s+(.*|Hplayer).+", "%1")
diff --git a/modules/chatcopy.lua b/modules/chatcopy.lua
index 11da75e0..c67b2a01 100644
--- a/modules/chatcopy.lua
+++ b/modules/chatcopy.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("chatcopy", "vanilla:tbc", function ()
+pfUI:RegisterModule("chatcopy", "vanilla", function ()
local limit = 100
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
diff --git a/modules/combopoints.lua b/modules/combopoints.lua
index f874974e..839f50d7 100644
--- a/modules/combopoints.lua
+++ b/modules/combopoints.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("combopoints", "vanilla:tbc", function ()
+pfUI:RegisterModule("combopoints", "vanilla", function ()
local rawborder, border = GetBorderSize()
-- Hide Blizzard combo point frame and unregister all events to prevent it from popping up again
diff --git a/modules/cooldown.lua b/modules/cooldown.lua
index 0a293940..9561cf83 100644
--- a/modules/cooldown.lua
+++ b/modules/cooldown.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
+pfUI:RegisterModule("cooldown", "vanilla", function ()
-- cache values
local lowcolor = {strsplit(",", C.appearance.cd.lowcolor)}
local normalcolor = {strsplit(",", C.appearance.cd.normalcolor)}
@@ -134,14 +134,7 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
end
end
- if pfUI.expansion == "vanilla" then
- -- vanilla does not have a cooldown frame type, so we hook the
- -- regular SetTimer function that each one is calling.
- hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
- else
- -- tbc and later expansion have a cooldown frametype, so we can
- -- hook directly into the frame creation and add our function there.
- local methods = getmetatable(CreateFrame('Cooldown', nil, nil, 'CooldownFrameTemplate')).__index
- hooksecurefunc(methods, 'SetCooldown', SetCooldown)
- end
+ -- vanilla does not have a cooldown frame type, so we hook the
+ -- regular SetTimer function that each one is calling.
+ hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
end)
diff --git a/modules/easteregg.lua b/modules/easteregg.lua
index 35a76c6d..9c5a7512 100644
--- a/modules/easteregg.lua
+++ b/modules/easteregg.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("easteregg", "vanilla:tbc", function ()
+pfUI:RegisterModule("easteregg", "vanilla", function ()
-- merry x-mas!
if date("%m%d") == "1224" or date("%m%d") == "1225" then
local title = (UnitFactionGroup("player") == "Horde") and PVP_RANK_18_0 or PVP_RANK_18_1
diff --git a/modules/energytick.lua b/modules/energytick.lua
index d3c8e24d..cfcffb71 100644
--- a/modules/energytick.lua
+++ b/modules/energytick.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
+pfUI:RegisterModule("energytick", "vanilla", function ()
if not pfUI.uf or not pfUI.uf.player then return end
local energytick = CreateFrame("Frame", nil, pfUI.uf.player.power.bar)
diff --git a/modules/farmmode.lua b/modules/farmmode.lua
index 19478884..0a1e3bad 100644
--- a/modules/farmmode.lua
+++ b/modules/farmmode.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("farmmode", "vanilla:tbc", function ()
+pfUI:RegisterModule("farmmode", "vanilla", function ()
local function ToggleFarmMode()
if pfUI.farmmap:IsShown() then
pfUI.farmmap:Hide()
diff --git a/modules/feigndeath.lua b/modules/feigndeath.lua
index ba4e5fcd..01a5e41f 100644
--- a/modules/feigndeath.lua
+++ b/modules/feigndeath.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("feigndeath", "vanilla:tbc", function ()
+pfUI:RegisterModule("feigndeath", "vanilla", function ()
local cache = { }
local scanner = libtipscan:GetScanner("feigndeath")
local healthbar = scanner:GetChildren()
diff --git a/modules/firstrun.lua b/modules/firstrun.lua
index f27bd7f2..582cbe45 100644
--- a/modules/firstrun.lua
+++ b/modules/firstrun.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
+pfUI:RegisterModule("firstrun", "vanilla", function ()
pfUI.firstrun = CreateFrame("Frame", "pfFirstRunWizard", UIParent)
pfUI.firstrun.steps = {}
diff --git a/modules/focus.lua b/modules/focus.lua
index a2e24582..16f4124a 100644
--- a/modules/focus.lua
+++ b/modules/focus.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("focus", "vanilla:tbc", function ()
+pfUI:RegisterModule("focus", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
diff --git a/modules/group.lua b/modules/group.lua
index 5aa0aaa2..81684f70 100644
--- a/modules/group.lua
+++ b/modules/group.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("group", "vanilla:tbc", function ()
+pfUI:RegisterModule("group", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
diff --git a/modules/gryphons.lua b/modules/gryphons.lua
index 96eba04e..287ae5b8 100644
--- a/modules/gryphons.lua
+++ b/modules/gryphons.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("gryphons", "vanilla:tbc", function ()
+pfUI:RegisterModule("gryphons", "vanilla", function ()
pfUI.gryphons = {
frames = {
left = CreateFrame("Frame"),
diff --git a/modules/gui.lua b/modules/gui.lua
index 2827caa8..64785efe 100644
--- a/modules/gui.lua
+++ b/modules/gui.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("gui", "vanilla:tbc", function ()
+pfUI:RegisterModule("gui", "vanilla", function ()
local Reload, U, CreateConfig, CreateTabFrame, CreateArea, CreateGUIEntry, EntryUpdate
-- "searchDB" gets populated when CreateConfig is called. The table holds
@@ -1657,6 +1657,19 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Show Druid Mana Bar"], C.unitframes, "druidmanabar", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Druid Mana Bar Height"], C.unitframes, "druidmanaheight", nil, nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Druid Mana Bar Text"], C.unitframes, "druidmanatext", "checkbox", nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Track Group on Minimap"], C.unitframes, "track_group", "checkbox", nil, nil, nil, nil, "vanilla" )
+
+ CreateConfig(nil, T["Nampower Settings"], nil, nil, "header")
+ CreateConfig(nil, T["Show Spell Queue Indicator"], C.unitframes, "spellqueue", "checkbox", nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Spell Queue Icon Size"], C.unitframes, "spellqueuesize", nil, nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Show Reactive Spell Indicator"], C.unitframes, "reactive_indicator", "checkbox", nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Reactive Indicator Size"], C.unitframes, "reactive_size", nil, nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Enhanced Buff Tracking"], C.unitframes, "nampower_buffs", "checkbox", nil, nil, nil, nil, "vanilla" )
+
+ CreateConfig(nil, T["UnitXP Settings"], nil, nil, "header")
+ CreateConfig(nil, T["Show Line of Sight Indicator"], C.unitframes, "los_indicator", "checkbox", nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Show Behind Indicator"], C.unitframes, "behind_indicator", "checkbox", nil, nil, nil, nil, "vanilla" )
+ CreateConfig(nil, T["Enable OS Notifications"], C.unitframes, "unitxp_notify", "checkbox", nil, nil, nil, nil, "vanilla" )
end)
-- Shared Unit- and Groupframes
@@ -2263,6 +2276,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Generate Playerlinks"], C.chat.text, "playerlinks", "checkbox")
CreateConfig(nil, T["Enable URL Detection"], C.chat.text, "detecturl", "checkbox")
CreateConfig(nil, T["Enable Class Colors"], C.chat.text, "classcolor", "checkbox")
+ CreateConfig(nil, T["Enable Player Levels"], C.chat.text, "playerlevel", "checkbox")
CreateConfig(nil, T["Who Search Unknown Classes (|cffffaaaaExperimental|r)"], C.chat.text, "whosearchunknown", "checkbox")
CreateConfig(nil, T["Colorize Unknown Classes"], C.chat.text, "tintunknown", "checkbox")
CreateConfig(nil, T["Unknown Class Color"], C.chat.text, "unknowncolor", "color")
@@ -2388,36 +2402,26 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, "ShaguDPS (" .. T["Dock"] .. ")", C.thirdparty.shagudps, "dock", "checkbox")
CreateConfig(nil, "DPSMate (" .. T["Skin"] .. ")", C.thirdparty.dpsmate, "skin", "checkbox")
CreateConfig(nil, "DPSMate (" .. T["Dock"] .. ")", C.thirdparty.dpsmate, "dock", "checkbox")
- CreateConfig(nil, "Recount (" .. T["Skin"] .. ")", C.thirdparty.recount, "skin", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "Recount (" .. T["Dock"] .. ")", C.thirdparty.recount, "dock", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "Omen (" .. T["Skin"] .. ")", C.thirdparty.omen, "skin", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "Omen (" .. T["Dock"] .. ")", C.thirdparty.omen, "dock", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "SWStats (" .. T["Skin"] .. ")", C.thirdparty.swstats, "skin", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "SWStats (" .. T["Dock"] .. ")", C.thirdparty.swstats, "dock", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "KLH Threat Meter (" .. T["Skin"] .. ")", C.thirdparty.ktm, "skin", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "KLH Threat Meter (" .. T["Dock"] .. ")", C.thirdparty.ktm, "dock", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "TW Threatmeter (" .. T["Skin"] .. ")", C.thirdparty.twt, "skin", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "TW Threatmeter (" .. T["Dock"] .. ")", C.thirdparty.twt, "dock", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "WIM", C.thirdparty.wim, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "HealComm", C.thirdparty.healcomm, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "SortBags", C.thirdparty.sortbags, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "Bag_Sort", C.thirdparty.bag_sort, "enable", "checkbox", nil, nil, nil, nil, "tbc")
+ CreateConfig(nil, "SWStats (" .. T["Skin"] .. ")", C.thirdparty.swstats, "skin", "checkbox")
+ CreateConfig(nil, "SWStats (" .. T["Dock"] .. ")", C.thirdparty.swstats, "dock", "checkbox")
+ CreateConfig(nil, "KLH Threat Meter (" .. T["Skin"] .. ")", C.thirdparty.ktm, "skin", "checkbox")
+ CreateConfig(nil, "KLH Threat Meter (" .. T["Dock"] .. ")", C.thirdparty.ktm, "dock", "checkbox")
+ CreateConfig(nil, "TW Threatmeter (" .. T["Skin"] .. ")", C.thirdparty.twt, "skin", "checkbox")
+ CreateConfig(nil, "TW Threatmeter (" .. T["Dock"] .. ")", C.thirdparty.twt, "dock", "checkbox")
+ CreateConfig(nil, "WIM", C.thirdparty.wim, "enable", "checkbox")
+ CreateConfig(nil, "HealComm", C.thirdparty.healcomm, "enable", "checkbox")
+ CreateConfig(nil, "SortBags", C.thirdparty.sortbags, "enable", "checkbox")
CreateConfig(nil, "MrPlow", C.thirdparty.mrplow, "enable", "checkbox")
- CreateConfig(nil, "BetterCharacterStats", C.thirdparty.bcs, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "Crafty", C.thirdparty.crafty, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "CleverMacro", C.thirdparty.clevermacro, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "AckisRecipeList", C.thirdparty.ackis, "enable", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "SheepWatch", C.thirdparty.sheepwatch, "enable", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "TotemTimers", C.thirdparty.totemtimers, "enable", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "DruidBar", C.thirdparty.druidbar, "enable", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "BCEPGP", C.thirdparty.bcepgp, "enable", "checkbox", nil, nil, nil, nil, "tbc")
- CreateConfig(nil, "FlightMap", C.thirdparty.flightmap, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "TheoryCraft", C.thirdparty.theorycraft, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "SuperMacro", C.thirdparty.supermacro, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "AtlasLoot", C.thirdparty.atlasloot, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "MyRolePlay", C.thirdparty.myroleplay, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "DruidManaBar", C.thirdparty.druidmana, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
- CreateConfig(nil, "NoteIt", C.thirdparty.noteit, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
+ CreateConfig(nil, "BetterCharacterStats", C.thirdparty.bcs, "enable", "checkbox")
+ CreateConfig(nil, "Crafty", C.thirdparty.crafty, "enable", "checkbox")
+ CreateConfig(nil, "CleverMacro", C.thirdparty.clevermacro, "enable", "checkbox")
+ CreateConfig(nil, "FlightMap", C.thirdparty.flightmap, "enable", "checkbox")
+ CreateConfig(nil, "TheoryCraft", C.thirdparty.theorycraft, "enable", "checkbox")
+ CreateConfig(nil, "SuperMacro", C.thirdparty.supermacro, "enable", "checkbox")
+ CreateConfig(nil, "AtlasLoot", C.thirdparty.atlasloot, "enable", "checkbox")
+ CreateConfig(nil, "MyRolePlay", C.thirdparty.myroleplay, "enable", "checkbox")
+ CreateConfig(nil, "DruidManaBar", C.thirdparty.druidmana, "enable", "checkbox")
+ CreateConfig(nil, "NoteIt", C.thirdparty.noteit, "enable", "checkbox")
end)
CreateGUIEntry(T["Components"], T["Modules"], function()
diff --git a/modules/hoverbind.lua b/modules/hoverbind.lua
index 00f4a162..a838a5c2 100644
--- a/modules/hoverbind.lua
+++ b/modules/hoverbind.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("hoverbind", "vanilla:tbc", function ()
+pfUI:RegisterModule("hoverbind", "vanilla", function ()
local keymap = {
-- buttons to binding association
["pfActionBarMainButton"] = "ACTIONBUTTON",
diff --git a/modules/infight.lua b/modules/infight.lua
index 95531a8e..b48b4e88 100644
--- a/modules/infight.lua
+++ b/modules/infight.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("infight", "vanilla:tbc", function ()
+pfUI:RegisterModule("infight", "vanilla", function ()
local function OnUpdate()
if not this.infight and not this.aggro and not this.health then return end
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .1 end
diff --git a/modules/loot.lua b/modules/loot.lua
index a2284398..bfa2ab1a 100644
--- a/modules/loot.lua
+++ b/modules/loot.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("loot", "vanilla:tbc", function ()
+pfUI:RegisterModule("loot", "vanilla", function ()
local rawborder, border = GetBorderSize()
pfUI.loot = CreateFrame("Frame", "pfLootFrame", UIParent)
diff --git a/modules/map.lua b/modules/map.lua
index 806f1e17..247e1150 100644
--- a/modules/map.lua
+++ b/modules/map.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("map", "vanilla:tbc", function ()
+pfUI:RegisterModule("map", "vanilla", function ()
table.insert(UISpecialFrames, "WorldMapFrame")
local function UpdateTooltipScale()
diff --git a/modules/mapreveal.lua b/modules/mapreveal.lua
index 594b0ff3..c8120a6c 100644
--- a/modules/mapreveal.lua
+++ b/modules/mapreveal.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("mapreveal", "vanilla:tbc", function ()
+pfUI:RegisterModule("mapreveal", "vanilla", function ()
-- do not load if other map addon is loaded
if Cartographer then return end
if METAMAP_TITLE then return end
diff --git a/modules/minimap.lua b/modules/minimap.lua
index 53bc3374..3ea5f343 100644
--- a/modules/minimap.lua
+++ b/modules/minimap.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("minimap", "vanilla:tbc", function ()
+pfUI:RegisterModule("minimap", "vanilla", function ()
local rawborder, border = GetBorderSize()
local size = tonumber(C.appearance.minimap.size) or 140
@@ -39,7 +39,7 @@ pfUI:RegisterModule("minimap", "vanilla:tbc", function ()
Minimap:SetWidth(size)
Minimap:SetHeight(size)
- -- vanilla+tbc: do the best to detect the minimap arrow
+ -- do the best to detect the minimap arrow
local arrowscale = tonumber(C.appearance.minimap.arrowscale)
local minimaparrow = ({Minimap:GetChildren()})[9]
for k, v in pairs({Minimap:GetChildren()}) do
diff --git a/modules/mirrortimers.lua b/modules/mirrortimers.lua
index 6b08f395..311e6683 100644
--- a/modules/mirrortimers.lua
+++ b/modules/mirrortimers.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("mirrortimers", "vanilla:tbc", function ()
+pfUI:RegisterModule("mirrortimers", "vanilla", function ()
local font = pfUI.font_default
local fontsize = tonumber(C.global.font_size)
local height = fontsize * 1.3
diff --git a/modules/nameplates.lua b/modules/nameplates.lua
index c181418a..ce25a161 100644
--- a/modules/nameplates.lua
+++ b/modules/nameplates.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
+pfUI:RegisterModule("nameplates", "vanilla", function ()
-- disable original castbars
pcall(SetCVar, "ShowVKeyCastbar", 0)
@@ -1115,7 +1115,6 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
if pfUI.client <= 11200 then
-- handle vanilla only settings
- -- due to the secured lua api, those settings can't be applied to TBC and later.
local hookOnConfigChange = nameplates.OnConfigChange
nameplates.OnConfigChange = function(self)
hookOnConfigChange(self)
diff --git a/modules/nampower.lua b/modules/nampower.lua
new file mode 100644
index 00000000..8e71ecc5
--- /dev/null
+++ b/modules/nampower.lua
@@ -0,0 +1,743 @@
+-- Nampower integration module
+-- Provides spell queue indicator and enhanced cast information
+-- Requires Nampower DLL: https://gitea.com/avitasia/nampower
+
+pfUI:RegisterModule("nampower", "vanilla", function ()
+ -- Only load if Nampower is available
+ if not GetNampowerVersion then return end
+
+ local rawborder, border = GetBorderSize()
+
+ -- Spell Queue Indicator
+ -- Shows the currently queued spell icon near the castbar
+ if C.unitframes.spellqueue == "1" then
+ local size = tonumber(C.unitframes.spellqueuesize) or 32
+
+ pfUI.spellqueue = CreateFrame("Frame", "pfSpellQueue", UIParent)
+ pfUI.spellqueue:SetFrameStrata("HIGH")
+ pfUI.spellqueue:SetWidth(size)
+ pfUI.spellqueue:SetHeight(size)
+ pfUI.spellqueue:Hide()
+
+ -- Position near player castbar if available
+ if pfUI.castbar and pfUI.castbar.player then
+ pfUI.spellqueue:SetPoint("LEFT", pfUI.castbar.player, "RIGHT", border*3, 0)
+ else
+ pfUI.spellqueue:SetPoint("CENTER", UIParent, "CENTER", 100, -100)
+ end
+
+ pfUI.spellqueue.icon = pfUI.spellqueue:CreateTexture("OVERLAY")
+ pfUI.spellqueue.icon:SetAllPoints(pfUI.spellqueue)
+ pfUI.spellqueue.icon:SetTexCoord(.08, .92, .08, .92)
+
+ UpdateMovable(pfUI.spellqueue)
+ CreateBackdrop(pfUI.spellqueue)
+ CreateBackdropShadow(pfUI.spellqueue)
+
+ -- Event codes from Nampower
+ local ON_SWING_QUEUED = 0
+ local ON_SWING_QUEUE_POPPED = 1
+ local NORMAL_QUEUED = 2
+ local NORMAL_QUEUE_POPPED = 3
+ local NON_GCD_QUEUED = 4
+ local NON_GCD_QUEUE_POPPED = 5
+
+ local queue = CreateFrame("Frame")
+ queue:RegisterEvent("SPELL_QUEUE_EVENT")
+ queue:SetScript("OnEvent", function()
+ local eventCode = arg1
+ local spellId = arg2
+
+ if eventCode == NORMAL_QUEUED or eventCode == NON_GCD_QUEUED or eventCode == ON_SWING_QUEUED then
+ -- Get spell texture from SpellInfo (SuperWoW) or GetSpellTexture
+ local texture
+ if SpellInfo then
+ local _, _, tex = SpellInfo(spellId)
+ texture = tex
+ end
+
+ if texture then
+ pfUI.spellqueue.icon:SetTexture(texture)
+ pfUI.spellqueue:Show()
+ end
+ elseif eventCode == NORMAL_QUEUE_POPPED or eventCode == NON_GCD_QUEUE_POPPED or eventCode == ON_SWING_QUEUE_POPPED then
+ pfUI.spellqueue:Hide()
+ end
+ end)
+ end
+
+ -- Enhanced Debuff Tracking using Nampower events
+ -- DEBUFF_ADDED_OTHER/DEBUFF_REMOVED_OTHER provide accurate debuff tracking with spellId
+ if libdebuff then
+ -- Storage for GUID-based debuff tracking
+ pfUI.nampower_debuffs = pfUI.nampower_debuffs or {}
+ local debuffdb = pfUI.nampower_debuffs
+
+ -- Get player GUID for tracking own debuffs
+ local playerGuid
+
+ local debuffTracker = CreateFrame("Frame")
+ debuffTracker:RegisterEvent("PLAYER_ENTERING_WORLD")
+ debuffTracker:RegisterEvent("DEBUFF_ADDED_OTHER")
+ debuffTracker:RegisterEvent("DEBUFF_REMOVED_OTHER")
+ debuffTracker:RegisterEvent("DEBUFF_ADDED_SELF")
+ debuffTracker:RegisterEvent("DEBUFF_REMOVED_SELF")
+
+ debuffTracker:SetScript("OnEvent", function()
+ if event == "PLAYER_ENTERING_WORLD" then
+ -- Cache player GUID
+ if UnitExists then
+ local _, guid = UnitExists("player")
+ playerGuid = guid
+ end
+ return
+ end
+
+ -- DEBUFF events: arg1=guid, arg2=slot, arg3=spellId, arg4=stackCount, arg5=auraLevel
+ local guid = arg1
+ local slot = arg2
+ local spellId = arg3
+ local stackCount = arg4
+ local auraLevel = arg5
+
+ if not guid or not spellId then return end
+
+ if event == "DEBUFF_ADDED_OTHER" or event == "DEBUFF_ADDED_SELF" then
+ -- Initialize storage for this GUID
+ if not debuffdb[guid] then debuffdb[guid] = {} end
+
+ -- Get spell info
+ local spellName, spellRank, texture
+ if SpellInfo then
+ spellName, spellRank, texture = SpellInfo(spellId)
+ end
+ if GetSpellNameAndRankForId then
+ spellName, spellRank = GetSpellNameAndRankForId(spellId)
+ end
+
+ if spellName then
+ -- Get duration from libdebuff's duration table or GetSpellRec
+ local duration = 0
+ if libdebuff.GetDuration then
+ duration = libdebuff:GetDuration(spellName, spellRank)
+ end
+
+ -- Try GetSpellRec for duration if libdebuff doesn't have it
+ if duration == 0 and GetSpellRec then
+ local spellRec = GetSpellRec(spellId)
+ if spellRec and spellRec.durationIndex and spellRec.durationIndex > 0 then
+ -- Duration index maps to spell duration - common values:
+ -- This is a rough approximation since we don't have the duration table
+ duration = 30 -- Default fallback
+ end
+ end
+
+ -- Store debuff data
+ debuffdb[guid][spellId] = {
+ spellId = spellId,
+ name = spellName,
+ rank = spellRank,
+ texture = texture,
+ stacks = stackCount or 1,
+ start = GetTime(),
+ duration = duration,
+ slot = slot,
+ auraLevel = auraLevel,
+ caster = (event == "DEBUFF_ADDED_SELF" or guid == playerGuid) and "player" or nil
+ }
+
+ -- Also update libdebuff's internal tracking if we have unit info
+ local unitName = UnitName and guid and UnitName(guid)
+ local unitLevel = UnitLevel and guid and UnitLevel(guid)
+ if unitName and duration > 0 then
+ libdebuff:AddEffect(unitName, unitLevel or 0, spellName, duration, "player")
+ end
+ end
+
+ elseif event == "DEBUFF_REMOVED_OTHER" or event == "DEBUFF_REMOVED_SELF" then
+ -- Remove debuff from tracking
+ if debuffdb[guid] and debuffdb[guid][spellId] then
+ debuffdb[guid][spellId] = nil
+ end
+ end
+ end)
+
+ -- Enhanced UnitDebuff function that uses Nampower data
+ -- This provides more accurate debuff information when available
+ local originalUnitDebuff = libdebuff.UnitDebuff
+ function libdebuff:UnitDebuffNampower(unit, id)
+ -- First try the original method
+ local effect, rank, texture, stacks, dtype, duration, timeleft, caster = originalUnitDebuff(self, unit, id)
+
+ -- If we have Nampower data for this unit, try to enhance it
+ local _, guid = UnitExists(unit)
+ if guid and debuffdb[guid] then
+ -- Find the debuff by slot
+ for spellId, data in pairs(debuffdb[guid]) do
+ if data.slot == id then
+ -- Use Nampower data for more accurate timing
+ if data.duration and data.duration > 0 and data.start then
+ duration = data.duration
+ timeleft = data.duration + data.start - GetTime()
+ if timeleft < 0 then timeleft = 0 end
+ caster = data.caster
+ stacks = data.stacks or stacks
+ end
+ break
+ end
+ end
+ end
+
+ return effect, rank, texture, stacks, dtype, duration, timeleft, caster
+ end
+
+ -- Expose enhanced function
+ pfUI.api.libdebuff_nampower = libdebuff.UnitDebuffNampower
+ end
+
+ -- Enhanced buff tracking using BUFF events
+ if C.unitframes.nampower_buffs == "1" then
+ pfUI.nampower_buffs = pfUI.nampower_buffs or {}
+ local buffdb = pfUI.nampower_buffs
+
+ local buffTracker = CreateFrame("Frame")
+ buffTracker:RegisterEvent("BUFF_ADDED_OTHER")
+ buffTracker:RegisterEvent("BUFF_REMOVED_OTHER")
+ buffTracker:RegisterEvent("BUFF_ADDED_SELF")
+ buffTracker:RegisterEvent("BUFF_REMOVED_SELF")
+
+ buffTracker:SetScript("OnEvent", function()
+ local guid = arg1
+ local slot = arg2
+ local spellId = arg3
+ local stackCount = arg4
+ local auraLevel = arg5
+
+ if not guid or not spellId then return end
+
+ if event == "BUFF_ADDED_OTHER" or event == "BUFF_ADDED_SELF" then
+ if not buffdb[guid] then buffdb[guid] = {} end
+
+ local spellName, spellRank, texture
+ if SpellInfo then
+ spellName, spellRank, texture = SpellInfo(spellId)
+ end
+ if GetSpellNameAndRankForId then
+ spellName, spellRank = GetSpellNameAndRankForId(spellId)
+ end
+
+ buffdb[guid][spellId] = {
+ spellId = spellId,
+ name = spellName,
+ rank = spellRank,
+ texture = texture,
+ stacks = stackCount or 1,
+ start = GetTime(),
+ slot = slot,
+ auraLevel = auraLevel
+ }
+ elseif event == "BUFF_REMOVED_OTHER" or event == "BUFF_REMOVED_SELF" then
+ if buffdb[guid] and buffdb[guid][spellId] then
+ buffdb[guid][spellId] = nil
+ end
+ end
+ end)
+ end
+
+ -- Direct Aura Access API using GetUnitField
+ -- Much faster than tooltip scanning - reads aura arrays directly from unit fields
+ if GetUnitField then
+ pfUI.api.GetUnitAuras = function(unit)
+ local auras = GetUnitField(unit, "aura")
+ local auraLevels = GetUnitField(unit, "auraLevels")
+ local auraStacks = GetUnitField(unit, "auraApplications")
+
+ if not auras then return nil end
+
+ local result = {}
+ for i = 1, 48 do
+ local spellId = auras[i]
+ if spellId and spellId > 0 then
+ local name, rank, texture
+ if SpellInfo then
+ name, rank, texture = SpellInfo(spellId)
+ elseif GetSpellNameAndRankForId then
+ name, rank = GetSpellNameAndRankForId(spellId)
+ end
+
+ result[i] = {
+ spellId = spellId,
+ name = name,
+ rank = rank,
+ texture = texture,
+ level = auraLevels and auraLevels[i] or 0,
+ stacks = auraStacks and auraStacks[i] or 1,
+ isBuff = i <= 32, -- First 32 slots are buffs, rest are debuffs
+ }
+ end
+ end
+ return result
+ end
+
+ -- Quick check if unit has specific aura by spellId
+ pfUI.api.UnitHasAura = function(unit, spellId)
+ local auras = GetUnitField(unit, "aura")
+ if not auras then return false end
+ for i = 1, 48 do
+ if auras[i] == spellId then return true, i end
+ end
+ return false
+ end
+
+ -- Get unit resistances directly
+ pfUI.api.GetUnitResistances = function(unit)
+ local res = GetUnitField(unit, "resistances")
+ if not res then return nil end
+ return {
+ armor = res[1],
+ holy = res[2],
+ fire = res[3],
+ nature = res[4],
+ frost = res[5],
+ shadow = res[6],
+ arcane = res[7]
+ }
+ end
+ end
+
+ -- Reactive Spell Indicator using IsSpellUsable
+ -- Shows when reactive abilities like Overpower, Revenge, Execute are usable
+ if IsSpellUsable and C.unitframes.reactive_indicator == "1" then
+ local size = tonumber(C.unitframes.reactive_size) or 28
+ local _, class = UnitClass("player")
+
+ -- Reactive spells by class
+ local reactiveSpells = {
+ WARRIOR = {
+ { name = "Overpower", texture = "Interface\\Icons\\Ability_MeleeDamage" },
+ { name = "Revenge", texture = "Interface\\Icons\\Ability_Warrior_Revenge" },
+ { name = "Execute", texture = "Interface\\Icons\\INV_Sword_48" },
+ },
+ ROGUE = {
+ { name = "Riposte", texture = "Interface\\Icons\\Ability_Warrior_Challange" },
+ },
+ HUNTER = {
+ { name = "Mongoose Bite", texture = "Interface\\Icons\\Ability_Hunter_SwiftStrike" },
+ { name = "Counterattack", texture = "Interface\\Icons\\Ability_Warrior_Challange" },
+ },
+ }
+
+ local spells = reactiveSpells[class]
+ if spells then
+ pfUI.reactive = CreateFrame("Frame", "pfReactiveIndicator", UIParent)
+ pfUI.reactive:SetFrameStrata("HIGH")
+ local spellCount = table.getn(spells)
+ pfUI.reactive:SetWidth(size * spellCount + 4 * (spellCount - 1))
+ pfUI.reactive:SetHeight(size)
+ pfUI.reactive:SetPoint("CENTER", UIParent, "CENTER", 0, -200)
+ pfUI.reactive:Hide()
+
+ pfUI.reactive.icons = {}
+ for i, spell in ipairs(spells) do
+ local icon = CreateFrame("Frame", nil, pfUI.reactive)
+ icon:SetWidth(size)
+ icon:SetHeight(size)
+ icon:SetPoint("LEFT", pfUI.reactive, "LEFT", (i-1) * (size + 4), 0)
+
+ icon.texture = icon:CreateTexture(nil, "ARTWORK")
+ icon.texture:SetAllPoints(icon)
+ icon.texture:SetTexture(spell.texture)
+ icon.texture:SetTexCoord(.08, .92, .08, .92)
+
+ icon.glow = icon:CreateTexture(nil, "OVERLAY")
+ icon.glow:SetPoint("TOPLEFT", icon, "TOPLEFT", -4, 4)
+ icon.glow:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", 4, -4)
+ icon.glow:SetTexture(pfUI.media["img:glow"])
+ icon.glow:SetVertexColor(1, 1, 0, 0.8)
+
+ CreateBackdrop(icon)
+ icon:Hide()
+ icon.spellName = spell.name
+ pfUI.reactive.icons[i] = icon
+ end
+
+ UpdateMovable(pfUI.reactive)
+
+ pfUI.reactive:SetScript("OnUpdate", function()
+ local anyVisible = false
+ for _, icon in ipairs(this.icons) do
+ local usable = IsSpellUsable(icon.spellName)
+ if usable == 1 then
+ icon:Show()
+ anyVisible = true
+ else
+ icon:Hide()
+ end
+ end
+ if anyVisible then
+ this:Show()
+ else
+ this:Hide()
+ end
+ end)
+ end
+ end
+
+ -- Enhanced Cooldown Tracking API using GetSpellIdCooldown
+ if GetSpellIdCooldown then
+ pfUI.api.GetPreciseCooldown = function(spellId)
+ local cd = GetSpellIdCooldown(spellId)
+ if not cd then return nil end
+ return {
+ onCooldown = cd.isOnCooldown == 1,
+ remaining = cd.cooldownRemainingMs / 1000,
+ remainingMs = cd.cooldownRemainingMs,
+ gcdRemaining = cd.gcdCategoryRemainingMs / 1000,
+ gcdRemainingMs = cd.gcdCategoryRemainingMs,
+ individualRemaining = cd.individualRemainingMs / 1000,
+ categoryRemaining = cd.categoryRemainingMs / 1000,
+ }
+ end
+
+ -- Item cooldown helper
+ pfUI.api.GetPreciseItemCooldown = function(itemId)
+ if not GetItemIdCooldown then return nil end
+ local cd = GetItemIdCooldown(itemId)
+ if not cd then return nil end
+ return {
+ onCooldown = cd.isOnCooldown == 1,
+ remaining = cd.cooldownRemainingMs / 1000,
+ remainingMs = cd.cooldownRemainingMs,
+ }
+ end
+ end
+
+ -- UNIT_DIED event handling
+ -- Can be used to clear tracking data or trigger effects on unit death
+ local deathTracker = CreateFrame("Frame")
+ deathTracker:RegisterEvent("UNIT_DIED")
+ deathTracker:SetScript("OnEvent", function()
+ local guid = arg1
+ if not guid then return end
+
+ -- Clean up debuff tracking for dead units
+ if pfUI.nampower_debuffs and pfUI.nampower_debuffs[guid] then
+ pfUI.nampower_debuffs[guid] = nil
+ end
+ if pfUI.nampower_buffs and pfUI.nampower_buffs[guid] then
+ pfUI.nampower_buffs[guid] = nil
+ end
+ end)
+
+ -- Trinket Management API
+ if GetTrinkets then
+ pfUI.api.GetEquippedTrinkets = function()
+ local trinkets = GetTrinkets()
+ local equipped = {}
+ for _, trinket in pairs(trinkets) do
+ if trinket.bagIndex == nil then -- nil bagIndex = equipped
+ table.insert(equipped, trinket)
+ end
+ end
+ return equipped
+ end
+
+ pfUI.api.GetTrinketCooldown = function(slot)
+ if not GetTrinketCooldown then return nil end
+ local cd = GetTrinketCooldown(slot)
+ if cd == -1 then return nil end
+ return {
+ onCooldown = cd.isOnCooldown == 1,
+ remaining = cd.cooldownRemainingMs / 1000,
+ remainingMs = cd.cooldownRemainingMs,
+ }
+ end
+
+ pfUI.api.UseTrinket = function(slot, target)
+ if not UseTrinket then return false end
+ return UseTrinket(slot, target) == 1
+ end
+ end
+
+ -- Nampower Item Stats API (use distinct name to avoid conflicts)
+ if GetItemStats then
+ pfUI.api.GetNampowerItemStats = function(itemId)
+ local success, stats = pcall(GetItemStats, itemId, true)
+ if not success or not stats then return nil end
+ return stats
+ end
+
+ -- Quick item level lookup
+ pfUI.api.GetNampowerItemLevel = function(itemId)
+ if GetItemLevel then
+ return GetItemLevel(itemId)
+ end
+ local success, stats = pcall(GetItemStats, itemId, true)
+ if success and stats then
+ return stats.itemLevel
+ end
+ return nil
+ end
+ end
+
+ -- Spell Modifiers API for damage/heal predictions
+ if GetSpellModifiers then
+ pfUI.api.GetSpellBonus = function(spellId, modType)
+ -- modType: 0=DAMAGE, 1=DURATION, 6=RADIUS, 7=CRIT, 10=CAST_TIME, 14=COST, etc.
+ local flat, percent, hasmod = GetSpellModifiers(spellId, modType or 0)
+ return {
+ flat = flat or 0,
+ percent = percent or 0,
+ hasModifier = hasmod and hasmod ~= 0,
+ }
+ end
+
+ -- Common spell modifier lookups
+ pfUI.api.GetSpellDamageBonus = function(spellId)
+ return pfUI.api.GetSpellBonus(spellId, 0) -- DAMAGE
+ end
+
+ pfUI.api.GetSpellCritBonus = function(spellId)
+ return pfUI.api.GetSpellBonus(spellId, 7) -- CRITICAL_CHANCE
+ end
+
+ pfUI.api.GetSpellCostReduction = function(spellId)
+ return pfUI.api.GetSpellBonus(spellId, 14) -- COST
+ end
+ end
+
+ -- Inventory/Bag API
+ if GetBagItems then
+ pfUI.api.GetAllBagItems = function()
+ return GetBagItems()
+ end
+
+ pfUI.api.FindItem = function(itemIdOrName)
+ if FindPlayerItemSlot then
+ local bag, slot = FindPlayerItemSlot(itemIdOrName)
+ return bag, slot
+ end
+ return nil, nil
+ end
+
+ pfUI.api.UseItem = function(itemIdOrName, target)
+ if UseItemIdOrName then
+ return UseItemIdOrName(itemIdOrName, target) == 1
+ end
+ return false
+ end
+ end
+
+ -- Equipment Inspection API
+ if GetEquippedItems then
+ pfUI.api.GetPlayerEquipment = function()
+ return GetEquippedItems("player")
+ end
+
+ pfUI.api.GetTargetEquipment = function()
+ return GetEquippedItems("target")
+ end
+
+ pfUI.api.GetEquippedItemInfo = function(unit, slot)
+ if GetEquippedItem then
+ return GetEquippedItem(unit, slot)
+ end
+ return nil
+ end
+ end
+
+ -- Spell Lookup Helpers
+ if GetSpellIdForName then
+ pfUI.api.GetMaxRankSpellId = function(spellName)
+ return GetSpellIdForName(spellName)
+ end
+ end
+
+ if GetSpellSlotTypeIdForName then
+ pfUI.api.GetSpellSlotInfo = function(spellName)
+ local slot, bookType, spellId = GetSpellSlotTypeIdForName(spellName)
+ return {
+ slot = slot,
+ bookType = bookType,
+ spellId = spellId,
+ }
+ end
+ end
+
+ -- Queue Script API for advanced macro functionality
+ if QueueScript then
+ pfUI.api.QueueLuaScript = function(script, priority)
+ QueueScript(script, priority or 1)
+ end
+ end
+
+ if QueueSpellByName then
+ pfUI.api.QueueSpell = function(spellName)
+ QueueSpellByName(spellName)
+ end
+ end
+
+ -- Channel optimization
+ if ChannelStopCastingNextTick then
+ pfUI.api.StopChannelNextTick = function()
+ ChannelStopCastingNextTick()
+ end
+ end
+
+ -- Spell Database Access via GetSpellRec
+ if GetSpellRec then
+ pfUI.api.GetSpellRecord = function(spellId)
+ local rec = GetSpellRec(spellId)
+ if not rec then return nil end
+ return {
+ spellId = spellId,
+ name = rec.name,
+ rank = rec.rank,
+ description = rec.description,
+ manaCost = rec.manaCost,
+ baseLevel = rec.baseLevel,
+ spellLevel = rec.spellLevel,
+ maxLevel = rec.maxLevel,
+ maxTargetLevel = rec.maxTargetLevel,
+ maxTargets = rec.maxTargets,
+ durationIndex = rec.durationIndex,
+ powerType = rec.powerType,
+ rangeIndex = rec.rangeIndex,
+ speed = rec.speed,
+ schoolMask = rec.schoolMask,
+ runeCostID = rec.runeCostID,
+ spellMissileID = rec.spellMissileID,
+ iconID = rec.iconID,
+ activeIconID = rec.activeIconID,
+ nameSubtext = rec.nameSubtext,
+ castingTimeIndex = rec.castingTimeIndex,
+ categoryRecoveryTime = rec.categoryRecoveryTime,
+ recoveryTime = rec.recoveryTime,
+ startRecoveryCategory = rec.startRecoveryCategory,
+ startRecoveryTime = rec.startRecoveryTime,
+ }
+ end
+
+ -- Get spell school (fire, frost, nature, etc.)
+ pfUI.api.GetSpellSchool = function(spellId)
+ local rec = GetSpellRec(spellId)
+ if not rec then return nil end
+ local schools = {
+ [1] = "Physical",
+ [2] = "Holy",
+ [4] = "Fire",
+ [8] = "Nature",
+ [16] = "Frost",
+ [32] = "Shadow",
+ [64] = "Arcane",
+ }
+ return schools[rec.schoolMask] or "Unknown"
+ end
+ end
+
+ -- Disenchant All utility
+ if DisenchantAll then
+ pfUI.api.DisenchantAllItems = function()
+ DisenchantAll()
+ end
+
+ SLASH_PFDISENCHANTALL1 = "/disenchantall"
+ SLASH_PFDISENCHANTALL2 = "/dea"
+ SlashCmdList["PFDISENCHANTALL"] = function()
+ DisenchantAll()
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Disenchanting all eligible items...")
+ end
+ end
+
+ -- Enhanced Heal Prediction with AURA_CAST events
+ -- This helps libpredict detect HoT applications more accurately
+ if libpredict then
+ local auraCastFrame = CreateFrame("Frame")
+ auraCastFrame:RegisterEvent("AURA_CAST_ON_SELF")
+ auraCastFrame:RegisterEvent("AURA_CAST_ON_OTHER")
+
+ auraCastFrame:SetScript("OnEvent", function()
+ local casterGuid = arg1
+ local targetGuid = arg2
+ local spellId = arg3
+
+ if not spellId or not targetGuid then return end
+
+ -- Get spell name
+ local spellName
+ if SpellInfo then
+ spellName = SpellInfo(spellId)
+ elseif GetSpellNameAndRankForId then
+ spellName = GetSpellNameAndRankForId(spellId)
+ end
+
+ if not spellName then return end
+
+ -- Check if this is a HoT spell we care about
+ local hotSpells = {
+ ["Rejuvenation"] = true,
+ ["Renew"] = true,
+ ["Regrowth"] = true,
+ ["Verjüngung"] = true, -- German
+ ["Erneuerung"] = true,
+ ["Nachwachsen"] = true,
+ }
+
+ if hotSpells[spellName] then
+ -- Signal to libpredict that a HoT was applied
+ -- This can be used to update heal predictions
+ if pfUI.api.libpredict and pfUI.api.libpredict.OnHotApplied then
+ pfUI.api.libpredict:OnHotApplied(targetGuid, spellName, spellId)
+ end
+ end
+ end)
+ end
+
+ -- Swing Timer Integration
+ -- Track auto-attack swing timers for melee classes
+ local swingFrame = CreateFrame("Frame")
+ swingFrame.mainHand = { start = 0, speed = 0 }
+ swingFrame.offHand = { start = 0, speed = 0 }
+ swingFrame.ranged = { start = 0, speed = 0 }
+
+ swingFrame:RegisterEvent("PLAYER_ENTER_COMBAT")
+ swingFrame:RegisterEvent("PLAYER_LEAVE_COMBAT")
+ swingFrame:RegisterEvent("CHAT_MSG_COMBAT_SELF_HITS")
+ swingFrame:RegisterEvent("CHAT_MSG_COMBAT_SELF_MISSES")
+
+ swingFrame:SetScript("OnEvent", function()
+ if event == "PLAYER_ENTER_COMBAT" then
+ local mainSpeed, offSpeed = UnitAttackSpeed("player")
+ this.mainHand.speed = mainSpeed or 2
+ this.offHand.speed = offSpeed or 0
+ this.mainHand.start = GetTime()
+ if this.offHand.speed > 0 then
+ this.offHand.start = GetTime()
+ end
+ elseif event == "CHAT_MSG_COMBAT_SELF_HITS" or event == "CHAT_MSG_COMBAT_SELF_MISSES" then
+ -- Reset swing timer on hit/miss
+ local mainSpeed, offSpeed = UnitAttackSpeed("player")
+ this.mainHand.speed = mainSpeed or 2
+ this.mainHand.start = GetTime()
+ end
+ end)
+
+ pfUI.api.GetSwingTimers = function()
+ local now = GetTime()
+ local mainRemaining = swingFrame.mainHand.speed - (now - swingFrame.mainHand.start)
+ local offRemaining = swingFrame.offHand.speed > 0 and (swingFrame.offHand.speed - (now - swingFrame.offHand.start)) or 0
+
+ return {
+ mainHand = {
+ remaining = math.max(0, mainRemaining),
+ speed = swingFrame.mainHand.speed,
+ progress = swingFrame.mainHand.speed > 0 and (1 - math.max(0, mainRemaining) / swingFrame.mainHand.speed) or 0,
+ },
+ offHand = {
+ remaining = math.max(0, offRemaining),
+ speed = swingFrame.offHand.speed,
+ progress = swingFrame.offHand.speed > 0 and (1 - math.max(0, offRemaining) / swingFrame.offHand.speed) or 0,
+ },
+ }
+ end
+end)
diff --git a/modules/panel.lua b/modules/panel.lua
index 755cd079..8f235776 100644
--- a/modules/panel.lua
+++ b/modules/panel.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("panel", "vanilla:tbc", function()
+pfUI:RegisterModule("panel", "vanilla", function()
-- initialize gold cache if not yet happened
pfUI_cache["gold"] = pfUI_cache["gold"] or {}
diff --git a/modules/pet.lua b/modules/pet.lua
index 223c633c..46a45ede 100644
--- a/modules/pet.lua
+++ b/modules/pet.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("pet", "vanilla:tbc", function ()
+pfUI:RegisterModule("pet", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
pfUI.uf.pet = pfUI.uf:CreateUnitFrame("Pet", nil, C.unitframes.pet)
diff --git a/modules/pettarget.lua b/modules/pettarget.lua
index 017c30c4..1fe945df 100644
--- a/modules/pettarget.lua
+++ b/modules/pettarget.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("pettarget", "vanilla:tbc", function ()
+pfUI:RegisterModule("pettarget", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
local rawborder, default_border = GetBorderSize("unitframes")
diff --git a/modules/pixelperfect.lua b/modules/pixelperfect.lua
index ec4166d4..16862787 100644
--- a/modules/pixelperfect.lua
+++ b/modules/pixelperfect.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("pixelperfect", "vanilla:tbc", function ()
+pfUI:RegisterModule("pixelperfect", "vanilla", function ()
-- pre-calculated min values
local statics = {
[4] = 1.4222222222222,
diff --git a/modules/player.lua b/modules/player.lua
index 59979fff..91302d80 100644
--- a/modules/player.lua
+++ b/modules/player.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("player", "vanilla:tbc", function ()
+pfUI:RegisterModule("player", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
diff --git a/modules/questitem.lua b/modules/questitem.lua
index 7a8715c6..290495e2 100644
--- a/modules/questitem.lua
+++ b/modules/questitem.lua
@@ -96,11 +96,7 @@ pfUI:RegisterModule("questitem", function ()
SelectQuestLogEntry(quest)
-- detect and ignore quest headers
- if pfUI.client <= 11200 then -- vanilla
- _, _, _, header = GetQuestLogTitle(quest)
- elseif pfUI.client > 11200 then -- tbc
- _, _, _, _, header = GetQuestLogTitle(quest)
- end
+ _, _, _, header = GetQuestLogTitle(quest)
if not header then
text, objective = GetQuestLogQuestText()
diff --git a/modules/raid.lua b/modules/raid.lua
index 5aaca7c8..6b3577ae 100644
--- a/modules/raid.lua
+++ b/modules/raid.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("raid", "vanilla:tbc", function ()
+pfUI:RegisterModule("raid", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
@@ -109,6 +109,11 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
end
end
+ -- rebuild unitmap after frame IDs are assigned
+ if pfUI.uf.RebuildUnitmap then
+ pfUI.uf.RebuildUnitmap()
+ end
+
this:Hide()
end)
diff --git a/modules/roll.lua b/modules/roll.lua
index 7762774c..8580e514 100644
--- a/modules/roll.lua
+++ b/modules/roll.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("roll", "vanilla:tbc", function ()
+pfUI:RegisterModule("roll", "vanilla", function ()
pfUI.roll = CreateFrame("Frame", "pfLootRoll", UIParent)
pfUI.roll.frames = {}
diff --git a/modules/screenshot.lua b/modules/screenshot.lua
index 54bb3425..d6ac5b8f 100644
--- a/modules/screenshot.lua
+++ b/modules/screenshot.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("screenshot", "vanilla:tbc", function ()
+pfUI:RegisterModule("screenshot", "vanilla", function ()
if C.screenshot.interval == "0"
and C.screenshot.levelup == "0"
and C.screenshot.pvprank == "0"
diff --git a/modules/sellvalue.lua b/modules/sellvalue.lua
index f854d089..a14427f8 100644
--- a/modules/sellvalue.lua
+++ b/modules/sellvalue.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("sellvalue", "vanilla:tbc", function ()
+pfUI:RegisterModule("sellvalue", "vanilla", function ()
local function AddVendorPrices(frame, id, count)
if pfSellData[id] then
local _, _, sell, buy = strfind(pfSellData[id], "(.*),(.*)")
diff --git a/modules/share.lua b/modules/share.lua
index a49841bc..d5cc522e 100644
--- a/modules/share.lua
+++ b/modules/share.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("share", "vanilla:tbc", function ()
+pfUI:RegisterModule("share", "vanilla", function ()
local function serialize(tbl, comp, name, ignored, spacing)
local spacing = spacing or ""
local match = nil
diff --git a/modules/skin.lua b/modules/skin.lua
index 7c890016..390a03f7 100644
--- a/modules/skin.lua
+++ b/modules/skin.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("skin", "vanilla:tbc", function ()
+pfUI:RegisterModule("skin", "vanilla", function ()
-- align UIParent panels
pfUI.panelalign = CreateFrame("Frame", "pfUIParentPanelAlign", UIParent)
pfUI.panelalign:SetScript("OnUpdate", function()
diff --git a/modules/socialmod.lua b/modules/socialmod.lua
index e18fea58..a3da0610 100644
--- a/modules/socialmod.lua
+++ b/modules/socialmod.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("socialmod", "vanilla:tbc", function ()
+pfUI:RegisterModule("socialmod", "vanilla", function ()
local playerdb = _G.pfUI_playerDB
pfUI.socialmod = CreateFrame("Frame", "pfSocialMod", UIParent)
pfUI.socialmod:RegisterEvent("CHAT_MSG_SYSTEM")
diff --git a/modules/superwow.lua b/modules/superwow.lua
index af30210d..0ffdf4c3 100644
--- a/modules/superwow.lua
+++ b/modules/superwow.lua
@@ -1,6 +1,82 @@
-- Compatibility layer to use castbars provided by SuperWoW:
-- https://github.com/balakethelock/SuperWoW
+-- DLL Status Check Command (always available)
+SLASH_PFDLLSTATUS1 = "/pfdll"
+SlashCmdList["PFDLLSTATUS"] = function()
+ local chat = DEFAULT_CHAT_FRAME
+ chat:AddMessage("|cff33ffccpfUI|r: DLL Status Check")
+
+ -- SuperWoW
+ if SUPERWOW_VERSION then
+ chat:AddMessage(" |cff00ff00SuperWoW|r: v" .. tostring(SUPERWOW_VERSION))
+ elseif SpellInfo or SetAutoloot then
+ chat:AddMessage(" |cffffff00SuperWoW|r: Detected (old version)")
+ else
+ chat:AddMessage(" |cffff0000SuperWoW|r: Not detected")
+ end
+
+ -- Nampower
+ if GetNampowerVersion then
+ chat:AddMessage(" |cff00ff00Nampower|r: v" .. tostring(GetNampowerVersion()))
+ else
+ chat:AddMessage(" |cffff0000Nampower|r: Not detected")
+ end
+
+ -- UnitXP
+ local hasUnitXP = pcall(UnitXP, "nop", "nop")
+ if hasUnitXP then
+ chat:AddMessage(" |cff00ff00UnitXP_SP3|r: Detected")
+ else
+ chat:AddMessage(" |cffff0000UnitXP_SP3|r: Not detected")
+ end
+
+ -- Check if castbar exists for indicator positioning
+ if pfUI.castbar and pfUI.castbar.player then
+ chat:AddMessage(" |cff00ff00Castbar|r: Available for indicator anchoring")
+ else
+ chat:AddMessage(" |cffffff00Castbar|r: Not available (indicators use fallback position)")
+ end
+
+ -- Check indicator frames
+ if pfUI.uf and pfUI.uf.target then
+ chat:AddMessage(" |cff00ff00Target frame|r: exists")
+ if pfUI.uf.target.behindIndicator then
+ chat:AddMessage(" |cff00ff00Behind indicator|r: created")
+ else
+ chat:AddMessage(" |cffff0000Behind indicator|r: NOT created")
+ end
+ if pfUI.uf.target.losIndicator then
+ chat:AddMessage(" |cff00ff00LOS indicator|r: created")
+ else
+ chat:AddMessage(" |cffff0000LOS indicator|r: NOT created")
+ end
+ else
+ chat:AddMessage(" |cffff0000Target frame|r: NOT found")
+ end
+end
+
+-- UnitXP Behind/LOS test command
+SLASH_PFBEHIND1 = "/pfbehind"
+SlashCmdList["PFBEHIND"] = function()
+ local chat = DEFAULT_CHAT_FRAME
+ if not UnitExists("target") then
+ chat:AddMessage("|cff33ffccpfUI|r: No target")
+ return
+ end
+
+ local hasUnitXP = pcall(UnitXP, "nop", "nop")
+ if not hasUnitXP then
+ chat:AddMessage("|cff33ffccpfUI|r: UnitXP not available")
+ return
+ end
+
+ local successB, behind = pcall(UnitXP, "behind", "player", "target")
+ local successL, inSight = pcall(UnitXP, "inSight", "player", "target")
+
+ chat:AddMessage("|cff33ffccpfUI|r: Behind=" .. tostring(behind) .. " LOS=" .. tostring(inSight))
+end
+
pfUI:RegisterModule("superwow", "vanilla", function ()
if SetAutoloot and SpellInfo and not SUPERWOW_VERSION then
-- Turn every enchanting link that we create in the enchanting frame,
@@ -248,12 +324,264 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
libdebuff:AddEffect(unit, unitlevel, effect, duration, caster)
end)
- -- Enhance libcast with SuperWoW data
+ -- TrackUnit API for adding group members to minimap
+ -- Tracks friendly units on the minimap for easier group coordination
+ if TrackUnit and C.unitframes.track_group == "1" then
+ local trackFrame = CreateFrame("Frame")
+ trackFrame:RegisterEvent("PARTY_MEMBERS_CHANGED")
+ trackFrame:RegisterEvent("RAID_ROSTER_UPDATE")
+ trackFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
+
+ trackFrame:SetScript("OnEvent", function()
+ -- Track party members
+ for i = 1, 4 do
+ local unit = "party" .. i
+ if UnitExists(unit) and UnitIsConnected(unit) then
+ pcall(TrackUnit, unit)
+ end
+ end
+
+ -- Track raid members
+ for i = 1, 40 do
+ local unit = "raid" .. i
+ if UnitExists(unit) and UnitIsConnected(unit) and not UnitIsUnit(unit, "player") then
+ pcall(TrackUnit, unit)
+ end
+ end
+ end)
+ end
+
+ -- Raid Marker Targeting API
+ -- Allows targeting units by raid marker ("mark1" to "mark8")
+ if SUPERWOW_VERSION then
+ pfUI.api.GetMarkedUnit = function(markIndex)
+ local markUnit = "mark" .. markIndex
+ if UnitExists(markUnit) then
+ return markUnit
+ end
+ return nil
+ end
+
+ pfUI.api.TargetMark = function(markIndex)
+ local markUnit = "mark" .. markIndex
+ if UnitExists(markUnit) then
+ TargetUnit(markUnit)
+ return true
+ end
+ return false
+ end
+
+ -- Get owner of pet/totem using "owner" suffix
+ pfUI.api.GetUnitOwner = function(unit)
+ local ownerUnit = unit .. "owner"
+ if UnitExists(ownerUnit) then
+ return UnitName(ownerUnit), ownerUnit
+ end
+ return nil
+ end
+ end
+
+ -- Enhanced SpellInfo API wrapper
+ if SpellInfo then
+ pfUI.api.GetSpellInfo = function(spellId)
+ local name, rank, texture, minRange, maxRange = SpellInfo(spellId)
+ return {
+ name = name,
+ rank = rank,
+ texture = texture,
+ minRange = minRange,
+ maxRange = maxRange,
+ spellId = spellId
+ }
+ end
+ end
+
+ -- Clickthrough Mode API
+ -- Allows clicking through corpses to loot underneath
+ if Clickthrough then
+ pfUI.api.SetClickthrough = function(enabled)
+ Clickthrough(enabled and 1 or 0)
+ end
+
+ pfUI.api.GetClickthrough = function()
+ return Clickthrough() == 1
+ end
+
+ pfUI.api.ToggleClickthrough = function()
+ local current = Clickthrough()
+ Clickthrough(current == 1 and 0 or 1)
+ return Clickthrough() == 1
+ end
+
+ -- Add slash command for clickthrough toggle
+ SLASH_PFCLICKTHROUGH1 = "/clickthrough"
+ SLASH_PFCLICKTHROUGH2 = "/ct"
+ SlashCmdList["PFCLICKTHROUGH"] = function()
+ local enabled = pfUI.api.ToggleClickthrough()
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Clickthrough mode " .. (enabled and "|cff00ff00enabled|r" or "|cffff0000disabled|r"))
+ end
+ end
+
+ -- Autoloot Control API
+ if SetAutoloot then
+ pfUI.api.SetAutoloot = function(enabled)
+ SetAutoloot(enabled and 1 or 0)
+ end
+
+ pfUI.api.GetAutoloot = function()
+ return SetAutoloot() == 1
+ end
+
+ pfUI.api.ToggleAutoloot = function()
+ local current = SetAutoloot()
+ SetAutoloot(current == 1 and 0 or 1)
+ return SetAutoloot() == 1
+ end
+ end
+
+ -- Config Import/Export API using ImportFile/ExportFile
+ if ImportFile and ExportFile then
+ pfUI.api.ExportConfig = function(filename)
+ filename = filename or "pfUI_config_backup.txt"
+ local configStr = ""
+
+ -- Serialize config to string
+ local function serialize(tbl, indent)
+ indent = indent or ""
+ local result = "{\n"
+ for k, v in pairs(tbl) do
+ local keyStr = type(k) == "string" and '["' .. k .. '"]' or "[" .. tostring(k) .. "]"
+ if type(v) == "table" then
+ result = result .. indent .. " " .. keyStr .. " = " .. serialize(v, indent .. " ") .. ",\n"
+ elseif type(v) == "string" then
+ result = result .. indent .. " " .. keyStr .. ' = "' .. v .. '",\n'
+ else
+ result = result .. indent .. " " .. keyStr .. " = " .. tostring(v) .. ",\n"
+ end
+ end
+ return result .. indent .. "}"
+ end
+
+ if pfUI_config then
+ configStr = "pfUI_config = " .. serialize(pfUI_config)
+ ExportFile(filename, configStr)
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Config exported to imports/" .. filename)
+ return true
+ end
+ return false
+ end
+
+ pfUI.api.ImportConfig = function(filename)
+ filename = filename or "pfUI_config_backup.txt"
+ local content = ImportFile(filename)
+ if content and content ~= "" then
+ -- Load the config string
+ local func, err = loadstring(content)
+ if func then
+ func()
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Config imported from imports/" .. filename)
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Please /reload to apply changes")
+ return true
+ else
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Error parsing config: " .. (err or "unknown"))
+ end
+ else
+ DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Could not read imports/" .. filename)
+ end
+ return false
+ end
+
+ -- Slash commands for config backup
+ SLASH_PFEXPORT1 = "/pfexport"
+ SlashCmdList["PFEXPORT"] = function(msg)
+ pfUI.api.ExportConfig(msg ~= "" and msg or nil)
+ end
+
+ SLASH_PFIMPORT1 = "/pfimport"
+ SlashCmdList["PFIMPORT"] = function(msg)
+ pfUI.api.ImportConfig(msg ~= "" and msg or nil)
+ end
+ end
+
+ -- GetPlayerBuffID wrapper
+ if GetPlayerBuffID then
+ pfUI.api.GetPlayerBuffSpellId = function(buffIndex)
+ return GetPlayerBuffID(buffIndex)
+ end
+ end
+
+ -- CombatLogAdd wrapper for logging
+ if CombatLogAdd then
+ pfUI.api.LogToCombatLog = function(text, raw)
+ CombatLogAdd(text, raw and 1 or nil)
+ end
+ end
+
+ -- Local Raid Markers (marks only visible to self)
+ if SetRaidTarget then
+ local origSetRaidTarget = SetRaidTarget
+ pfUI.api.SetLocalRaidTarget = function(unit, index)
+ origSetRaidTarget(unit, index, "local")
+ end
+ end
+
+ -- Enhanced GetContainerItemInfo for charges
+ -- SuperWoW returns charges as negative numbers
+ pfUI.api.GetItemCharges = function(bag, slot)
+ local texture, count = GetContainerItemInfo(bag, slot)
+ if count and count < 0 then
+ return math.abs(count) -- Return positive charge count
+ end
+ return nil -- Not a charged item
+ end
+
+ -- Weapon Enchant Info on other players
+ if GetWeaponEnchantInfo then
+ local origGetWeaponEnchantInfo = GetWeaponEnchantInfo
+ pfUI.api.GetUnitWeaponEnchants = function(unit)
+ if unit and unit ~= "player" then
+ local mhName, ohName = GetWeaponEnchantInfo(unit)
+ return {
+ mainHand = mhName,
+ offHand = ohName,
+ }
+ else
+ local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = origGetWeaponEnchantInfo()
+ return {
+ mainHand = hasMainHandEnchant and true or false,
+ mainHandExpiration = mainHandExpiration,
+ mainHandCharges = mainHandCharges,
+ offHand = hasOffHandEnchant and true or false,
+ offHandExpiration = offHandExpiration,
+ offHandCharges = offHandCharges,
+ }
+ end
+ end
+ end
+
+ -- Enhance libcast with SuperWoW data for NPCs and other players only
+ -- Player casts use SPELLCAST_* events for proper pushback handling
local supercast = CreateFrame("Frame")
+ local playerGuid = nil
+
+ supercast:RegisterEvent("PLAYER_ENTERING_WORLD")
supercast:RegisterEvent("UNIT_CASTEVENT")
supercast:SetScript("OnEvent", function()
- if not supercast.init then
- -- disable combat parsing events in superwow mode
+ if event == "PLAYER_ENTERING_WORLD" then
+ -- Cache player GUID
+ if UnitExists then
+ local _, guid = UnitExists("player")
+ playerGuid = guid
+ end
+ return
+ end
+
+ local guid = arg1
+ local isPlayer = guid == playerGuid
+
+ -- For non-player units: disable combat parsing events (one-time init)
+ if not isPlayer and not supercast.init then
+ -- disable combat parsing events in superwow mode (for non-player units)
libcast:UnregisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")
libcast:UnregisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE")
libcast:UnregisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF")
@@ -276,13 +604,10 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
end
if arg3 == "START" or arg3 == "CAST" or arg3 == "CHANNEL" then
- -- human readable argument list
- local guid = arg1
local target = arg2
local event_type = arg3
local spell_id = arg4
local timer = arg5
- local start = GetTime()
-- get spell info from spell id
local spell, icon, _
@@ -297,35 +622,31 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
-- skip on buff procs during cast
if event_type == "CAST" then
if not libcast.db[guid] or libcast.db[guid].cast ~= spell then
- -- ignore casts without 'START' event, while there is already another cast.
- -- those events can be for example a frost shield proc while casting frostbolt.
- -- we want to keep the cast itself, so we simply skip those.
return
end
end
+ -- For player: store in libcast.db[playerName] so pushback tracking works
+ -- For others: store by GUID
+ local dbKey = isPlayer and UnitName("player") or guid
+
-- add cast action to the database
- if not libcast.db[guid] then libcast.db[guid] = {} end
- libcast.db[guid].cast = spell
- libcast.db[guid].rank = nil
- libcast.db[guid].start = GetTime()
- libcast.db[guid].casttime = timer
- libcast.db[guid].icon = icon
- libcast.db[guid].channel = event_type == "CHANNEL" or false
-
- -- write state variable
- superwow_active = true
+ if not libcast.db[dbKey] then libcast.db[dbKey] = {} end
+ libcast.db[dbKey].cast = spell
+ libcast.db[dbKey].rank = nil
+ libcast.db[dbKey].start = GetTime()
+ libcast.db[dbKey].casttime = timer or 0
+ libcast.db[dbKey].icon = icon
+ libcast.db[dbKey].channel = event_type == "CHANNEL" or false
elseif arg3 == "FAIL" then
- local guid = arg1
-
- -- delete all cast entries of guid
- if libcast.db[guid] then
- libcast.db[guid].cast = nil
- libcast.db[guid].rank = nil
- libcast.db[guid].start = nil
- libcast.db[guid].casttime = nil
- libcast.db[guid].icon = nil
- libcast.db[guid].channel = nil
+ local dbKey = isPlayer and UnitName("player") or guid
+ if libcast.db[dbKey] then
+ libcast.db[dbKey].cast = nil
+ libcast.db[dbKey].rank = nil
+ libcast.db[dbKey].start = nil
+ libcast.db[dbKey].casttime = nil
+ libcast.db[dbKey].icon = nil
+ libcast.db[dbKey].channel = nil
end
end
end)
diff --git a/modules/target.lua b/modules/target.lua
index 9522b8d0..11104094 100644
--- a/modules/target.lua
+++ b/modules/target.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("target", "vanilla:tbc", function ()
+pfUI:RegisterModule("target", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
diff --git a/modules/targettarget.lua b/modules/targettarget.lua
index 893ad670..e8310065 100644
--- a/modules/targettarget.lua
+++ b/modules/targettarget.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("targettarget", "vanilla:tbc", function ()
+pfUI:RegisterModule("targettarget", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
diff --git a/modules/targettargettarget.lua b/modules/targettargettarget.lua
index 6e912b3b..ec31d90c 100644
--- a/modules/targettargettarget.lua
+++ b/modules/targettargettarget.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("targettargettarget", "vanilla:tbc", function ()
+pfUI:RegisterModule("targettargettarget", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
diff --git a/modules/thirdparty.lua b/modules/thirdparty.lua
index f480df7f..f84037f7 100644
--- a/modules/thirdparty.lua
+++ b/modules/thirdparty.lua
@@ -1,10 +1,7 @@
-pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
+pfUI:RegisterModule("thirdparty", "vanilla", function()
-- This module includes the core logic of thirdparty modules.
-- Right now, in particular the functions to register addons to the
-- dockframe of the chat panel aswell as the thirdparty root-table.
- -- This module is supposed to be loaded on all expansions, so only
- -- addons that can share the same glue code across expansions will go here.
- -- For expansion related code, see: thirdparty-vanilla and thirdparty-tbc.
pfUI.thirdparty = {}
@@ -196,8 +193,7 @@ pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
end
-- MrPlow Bag Sorting Addon.
- -- Vanilla: https://www.wowace.com/projects/mr-plow/files/288059
- -- TBC: https://www.wowace.com/projects/mr-plow/files/136162
+ -- https://www.wowace.com/projects/mr-plow/files/288059
HookAddonOrVariable("MrPlow", function()
if C.thirdparty.mrplow.enable == "0" then return end
@@ -232,8 +228,7 @@ pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
end)
-- ShaguDPS Damage Meter
- -- Vanilla: https://github.com/shagu/ShaguDPS
- -- TBC: https://github.com/shagu/ShaguDPS
+ -- https://github.com/shagu/ShaguDPS
HookAddonOrVariable("ShaguDPS", function()
local docktable = { "shagudps", "ShaguDPS", "ShaguDPSWindow",
function() -- single
@@ -333,8 +328,7 @@ pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
end)
-- DPSMate Damage Meter
- -- Vanilla: https://github.com/Geigerkind/DPSMate
- -- TBC: https://github.com/Geigerkind/DPSMateTBC
+ -- https://github.com/Geigerkind/DPSMate
HookAddonOrVariable("DPSMate_DPSMate", function()
local docktable = { "dpsmate", "DPSMate", "DPSMate_DPSMate",
function() -- single
diff --git a/modules/tooltip.lua b/modules/tooltip.lua
index 03c51040..054b604b 100644
--- a/modules/tooltip.lua
+++ b/modules/tooltip.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
+pfUI:RegisterModule("tooltip", "vanilla", function ()
local rawborder, default_border = GetBorderSize()
pfUI.tooltip = CreateFrame('Frame', "pfTooltip", GameTooltip)
diff --git a/modules/totems.lua b/modules/totems.lua
index 59eab973..56ab9480 100644
--- a/modules/totems.lua
+++ b/modules/totems.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("totems", "vanilla:tbc", function ()
+pfUI:RegisterModule("totems", "vanilla", function ()
local _, class = UnitClass("player")
local slots = {
@@ -42,9 +42,6 @@ pfUI:RegisterModule("totems", "vanilla:tbc", function ()
-- Try to recast totem on left click in vanilla
local active, name, start, duration, icon = GetTotemInfo(this.id)
if name then CastSpellByName(name) end
- elseif pfUI.client > 11200 and this.id and arg1 and arg1 == "RightButton" then
- -- Try to cancel totem on right click in tbc+
- DestroyTotem(this.id)
end
end
diff --git a/modules/uf_tukui.lua b/modules/uf_tukui.lua
index b48e3829..e798043c 100644
--- a/modules/uf_tukui.lua
+++ b/modules/uf_tukui.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("uf_tukui", "vanilla:tbc", function ()
+pfUI:RegisterModule("uf_tukui", "vanilla", function ()
if C.unitframes.disable == "1" or C.unitframes.layout ~= "tukui" then return end
-- update player layout
diff --git a/modules/unitxp.lua b/modules/unitxp.lua
new file mode 100644
index 00000000..bc9b1833
--- /dev/null
+++ b/modules/unitxp.lua
@@ -0,0 +1,234 @@
+-- UnitXP_SP3 integration module
+-- Provides Line of Sight indicator, OS notifications, and enhanced targeting
+-- Requires UnitXP_SP3 DLL: https://github.com/allfoxwy/UnitXP_SP3
+
+pfUI:RegisterModule("unitxp", "vanilla", function ()
+ -- Check if UnitXP is available
+ local hasUnitXP = pcall(UnitXP, "nop", "nop")
+ if not hasUnitXP then return end
+
+ local rawborder, border = GetBorderSize()
+
+ -- Helper to create indicators after target frame exists
+ local function CreateTargetIndicators()
+ if not pfUI.uf or not pfUI.uf.target then return false end
+
+ -- Behind Indicator for all units (TOP)
+ if C.unitframes.behind_indicator == "1" and not pfUI.uf.target.behindIndicator then
+ local behindFrame = CreateFrame("Frame", "pfBehindIndicator", pfUI.uf.target)
+ behindFrame:SetAllPoints(pfUI.uf.target)
+ behindFrame:SetFrameLevel(pfUI.uf.target:GetFrameLevel() + 10)
+
+ behindFrame.text = behindFrame:CreateFontString(nil, "OVERLAY")
+ behindFrame.text:SetFont(pfUI.font_default, 13, "OUTLINE")
+ behindFrame.text:SetPoint("RIGHT", behindFrame, "RIGHT", -1, 7)
+ behindFrame.text:SetTextColor(0.3, 1, 0.3, 1)
+ behindFrame.text:SetText("BEHIND")
+ behindFrame.text:Hide()
+
+ local lastCheck = 0
+ behindFrame:SetScript("OnUpdate", function()
+ if GetTime() - lastCheck < 0.1 then return end
+ lastCheck = GetTime()
+
+ if not UnitExists("target") then
+ this.text:Hide()
+ return
+ end
+
+ local success, behind = pcall(UnitXP, "behind", "player", "target")
+ if success and behind then
+ this.text:Show()
+ else
+ this.text:Hide()
+ end
+ end)
+
+ pfUI.uf.target.behindIndicator = behindFrame
+ end
+
+ -- Line of Sight Indicator on Target Frame (BELOW BEHIND)
+ if C.unitframes.los_indicator == "1" and not pfUI.uf.target.losIndicator then
+ local losFrame = CreateFrame("Frame", "pfLoSIndicator", pfUI.uf.target)
+ losFrame:SetAllPoints(pfUI.uf.target)
+ losFrame:SetFrameLevel(pfUI.uf.target:GetFrameLevel() + 10)
+
+ losFrame.text = losFrame:CreateFontString(nil, "OVERLAY")
+ losFrame.text:SetFont(pfUI.font_default, 13, "OUTLINE")
+ losFrame.text:SetPoint("RIGHT", losFrame, "RIGHT", -1, -7)
+ losFrame.text:SetTextColor(1, 0.3, 0.3, 1)
+ losFrame.text:SetText("NO LOS")
+ losFrame.text:Hide()
+
+ local lastCheck = 0
+ losFrame:SetScript("OnUpdate", function()
+ if GetTime() - lastCheck < 0.2 then return end
+ lastCheck = GetTime()
+
+ if not UnitExists("target") then
+ this.text:Hide()
+ return
+ end
+
+ local success, inSight = pcall(UnitXP, "inSight", "player", "target")
+ if success and inSight == false then
+ this.text:Show()
+ else
+ this.text:Hide()
+ end
+ end)
+
+ pfUI.uf.target.losIndicator = losFrame
+ end
+
+ return true
+ end
+
+ -- Try to create indicators now
+ CreateTargetIndicators()
+
+ -- Also try on PLAYER_ENTERING_WORLD in case target frame wasn't ready
+ local initFrame = CreateFrame("Frame")
+ initFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
+ initFrame:SetScript("OnEvent", function()
+ CreateTargetIndicators()
+ this:UnregisterAllEvents()
+ end)
+
+ -- OS Notification Support
+ if C.unitframes.unitxp_notify == "1" then
+ local notifyFrame = CreateFrame("Frame")
+ notifyFrame:RegisterEvent("CHAT_MSG_WHISPER")
+ notifyFrame:RegisterEvent("CHAT_MSG_BN_WHISPER")
+ notifyFrame:RegisterEvent("READY_CHECK")
+ notifyFrame:RegisterEvent("RAID_INSTANCE_WELCOME")
+
+ notifyFrame:SetScript("OnEvent", function()
+ pcall(UnitXP, "notify", "taskbarIcon")
+ pcall(UnitXP, "notify", "systemSound")
+ end)
+
+ -- Also notify on BG queue pop
+ local origBattlefieldPortShow = BattlefieldFrame_Show
+ if origBattlefieldPortShow then
+ BattlefieldFrame_Show = function()
+ pcall(UnitXP, "notify", "taskbarIcon")
+ pcall(UnitXP, "notify", "systemSound")
+ return origBattlefieldPortShow()
+ end
+ end
+ end
+
+ -- Enhanced Distance API
+ pfUI.api.GetPreciseDistance = function(unit1, unit2)
+ if not unit2 then
+ unit2 = unit1
+ unit1 = "player"
+ end
+ local success, distance = pcall(UnitXP, "distanceBetween", unit1, unit2)
+ if success then return distance end
+ return nil
+ end
+
+ pfUI.api.IsInMeleeRange = function(unit)
+ local success, distance = pcall(UnitXP, "distanceBetween", "player", unit, "meleeAutoAttack")
+ if success and distance then
+ return distance <= 5
+ end
+ return nil
+ end
+
+ pfUI.api.GetAoEDistance = function(unit1, unit2)
+ if not unit2 then
+ unit2 = unit1
+ unit1 = "player"
+ end
+ local success, distance = pcall(UnitXP, "distanceBetween", unit1, unit2, "AoE")
+ if success then return distance end
+ return nil
+ end
+
+ -- Smart Targeting Helpers
+ pfUI.api.TargetNearestEnemy = function()
+ local success, found = pcall(UnitXP, "target", "nearestEnemy")
+ return success and found
+ end
+
+ pfUI.api.TargetHighestHP = function()
+ local success, found = pcall(UnitXP, "target", "mostHP")
+ return success and found
+ end
+
+ pfUI.api.TargetNextEnemy = function()
+ local success, found = pcall(UnitXP, "target", "nextEnemyInCycle")
+ return success and found
+ end
+
+ pfUI.api.TargetPreviousEnemy = function()
+ local success, found = pcall(UnitXP, "target", "previousEnemyInCycle")
+ return success and found
+ end
+
+ pfUI.api.TargetNextMarked = function(order)
+ local success, found = pcall(UnitXP, "target", "nextMarkedEnemyInCycle", order)
+ return success and found
+ end
+
+ pfUI.api.UnitInLineOfSight = function(unit1, unit2)
+ if not unit2 then
+ unit2 = unit1
+ unit1 = "player"
+ end
+ local success, inSight = pcall(UnitXP, "inSight", unit1, unit2)
+ if success then return inSight end
+ return nil
+ end
+
+ pfUI.api.UnitIsBehind = function(unit1, unit2)
+ if not unit2 then
+ unit2 = unit1
+ unit1 = "player"
+ end
+ local success, behind = pcall(UnitXP, "behind", unit1, unit2)
+ if success then return behind end
+ return nil
+ end
+
+ -- Debug command to test UnitXP indicators
+ SLASH_PFUNITXP1 = "/pfunitxp"
+ SlashCmdList["PFUNITXP"] = function()
+ local chat = DEFAULT_CHAT_FRAME
+ chat:AddMessage("|cff33ffccpfUI|r: UnitXP Indicator Debug")
+
+ -- Check if target exists
+ if not UnitExists("target") then
+ chat:AddMessage(" |cffff0000No target selected|r")
+ return
+ end
+
+ -- Test behind
+ local successB, behind = pcall(UnitXP, "behind", "player", "target")
+ chat:AddMessage(" Behind check: success=" .. tostring(successB) .. " value=" .. tostring(behind) .. " type=" .. type(behind))
+
+ -- Test LOS
+ local successL, inSight = pcall(UnitXP, "inSight", "player", "target")
+ chat:AddMessage(" LOS check: success=" .. tostring(successL) .. " value=" .. tostring(inSight) .. " type=" .. type(inSight))
+
+ -- Check if indicator frames exist
+ if pfUI.uf and pfUI.uf.target then
+ chat:AddMessage(" Target frame: |cff00ff00exists|r")
+ if pfUI.uf.target.behindIndicator then
+ chat:AddMessage(" Behind indicator: |cff00ff00created|r, visible=" .. tostring(pfUI.uf.target.behindIndicator:IsVisible()))
+ else
+ chat:AddMessage(" Behind indicator: |cffff0000NOT created|r (check settings)")
+ end
+ if pfUI.uf.target.losIndicator then
+ chat:AddMessage(" LOS indicator: |cff00ff00created|r")
+ else
+ chat:AddMessage(" LOS indicator: |cffff0000NOT created|r (check settings)")
+ end
+ else
+ chat:AddMessage(" Target frame: |cffff0000NOT found|r")
+ end
+ end
+end)
diff --git a/modules/unlock.lua b/modules/unlock.lua
index 59fcd473..629097d4 100644
--- a/modules/unlock.lua
+++ b/modules/unlock.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("unlock", "vanilla:tbc", function ()
+pfUI:RegisterModule("unlock", "vanilla", function ()
local rawborder, default_border = GetBorderSize()
-- grouped frames
diff --git a/modules/unusable.lua b/modules/unusable.lua
index 73a9d992..f51c2b6b 100644
--- a/modules/unusable.lua
+++ b/modules/unusable.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("unusable", "vanilla:tbc", function ()
+pfUI:RegisterModule("unusable", "vanilla", function ()
if not pfUI.bag then return end
if C.appearance.bags.unusable ~= "1" then return end
diff --git a/modules/updatenotify.lua b/modules/updatenotify.lua
index a88730dd..31aa9cdc 100644
--- a/modules/updatenotify.lua
+++ b/modules/updatenotify.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("updatenotify", "vanilla:tbc", function ()
+pfUI:RegisterModule("updatenotify", "vanilla", function ()
local alreadyshown = false
local localversion = tonumber(pfUI.version.major*10000 + pfUI.version.minor*100 + pfUI.version.fix)
local remoteversion = tonumber(pfUI_init.updateavailable) or 0
diff --git a/modules/xpbar.lua b/modules/xpbar.lua
index 7b1ed36f..54ca6a7d 100644
--- a/modules/xpbar.lua
+++ b/modules/xpbar.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
+pfUI:RegisterModule("xpbar", "vanilla", function ()
local rawborder, default_border = GetBorderSize()
local parse_faction = SanitizePattern(FACTION_STANDING_INCREASED)
From b0a0d88a7b608f11ea2fa93e31a5bc295cc79bfd Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 12:33:23 +0100
Subject: [PATCH 08/13] performance update
performance update
---
libs/libcast.lua | 124 +++++++++++++++++++++++++++++++++++++-------
libs/libpredict.lua | 77 ++++++---------------------
libs/librange.lua | 40 +++++++++-----
3 files changed, 151 insertions(+), 90 deletions(-)
diff --git a/libs/libcast.lua b/libs/libcast.lua
index 11cada49..d8fc6c0d 100644
--- a/libs/libcast.lua
+++ b/libs/libcast.lua
@@ -53,14 +53,50 @@ local scanner = libtipscan:GetScanner("libcast")
local libcast = CreateFrame("Frame", "pfEnemyCast")
local player = UnitName("player")
-UnitChannelInfo = _G.UnitChannelInfo or function(unit)
+-- Store original SuperWoW UnitChannelInfo if it exists
+local SuperWoW_UnitChannelInfo = _G.UnitChannelInfo
+
+UnitChannelInfo = function(unit)
-- convert to name if unitstring was given
- unit = pfValidUnits[unit] and UnitName(unit) or unit
+ local unitName = pfValidUnits[unit] and UnitName(unit) or unit
+
+ -- For player: ALWAYS use libcast.db because it handles channel updates correctly
+ local isPlayer = unit == "player" or unitName == player
+
+ if isPlayer then
+ local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
+ local db = libcast.db[player]
+ if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
+ if not db.channel then return end
+ cast = db.cast
+ nameSubtext = db.rank
+ text = ""
+ texture = db.icon
+ startTime = db.start * 1000
+ endTime = startTime + db.casttime
+ isTradeSkill = nil
+ elseif db then
+ db.cast = nil
+ db.rank = nil
+ db.start = nil
+ db.casttime = nil
+ db.icon = nil
+ db.channel = nil
+ end
+
+ return cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
+ end
+
+ -- For non-player units: use SuperWoW if available, otherwise use libcast.db
+ if SuperWoW_UnitChannelInfo then
+ return SuperWoW_UnitChannelInfo(unit)
+ end
+
+ -- Fallback to libcast.db for non-player units
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
- local db = libcast.db[unit]
+ local db = libcast.db[unitName]
- -- clean legacy values
if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
if not db.channel then return end
cast = db.cast
@@ -71,7 +107,6 @@ UnitChannelInfo = _G.UnitChannelInfo or function(unit)
endTime = startTime + db.casttime
isTradeSkill = nil
elseif db then
- -- remove cast action to the database
db.cast = nil
db.rank = nil
db.start = nil
@@ -83,14 +118,51 @@ UnitChannelInfo = _G.UnitChannelInfo or function(unit)
return cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
end
-UnitCastingInfo = _G.UnitCastingInfo or function(unit)
+-- Store original SuperWoW UnitCastingInfo if it exists
+local SuperWoW_UnitCastingInfo = _G.UnitCastingInfo
+
+UnitCastingInfo = function(unit)
-- convert to name if unitstring was given
- unit = pfValidUnits[unit] and UnitName(unit) or unit
+ local unitName = pfValidUnits[unit] and UnitName(unit) or unit
+
+ -- For player: ALWAYS use libcast.db because it handles pushback correctly
+ -- SuperWoW's UnitCastingInfo doesn't track SPELLCAST_DELAYED events
+ local isPlayer = unit == "player" or unitName == player
+
+ if isPlayer then
+ local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
+ local db = libcast.db[player]
+ if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
+ if db.channel then return end
+ cast = db.cast
+ nameSubtext = db.rank or ""
+ text = ""
+ texture = db.icon
+ startTime = db.start * 1000
+ endTime = startTime + db.casttime
+ isTradeSkill = nil
+ elseif db then
+ db.cast = nil
+ db.rank = nil
+ db.start = nil
+ db.casttime = nil
+ db.icon = nil
+ db.channel = nil
+ end
+
+ return cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
+ end
+
+ -- For non-player units: use SuperWoW if available, otherwise use libcast.db
+ if SuperWoW_UnitCastingInfo then
+ return SuperWoW_UnitCastingInfo(unit)
+ end
+
+ -- Fallback to libcast.db for non-player units
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
- local db = libcast.db[unit]
+ local db = libcast.db[unitName]
- -- clean legacy values
if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
if db.channel then return end
cast = db.cast
@@ -101,7 +173,6 @@ UnitCastingInfo = _G.UnitCastingInfo or function(unit)
endTime = startTime + db.casttime
isTradeSkill = nil
elseif db then
- -- remove cast action to the database
db.cast = nil
db.rank = nil
db.start = nil
@@ -182,17 +253,31 @@ libcast:RegisterEvent("SPELLCAST_CHANNEL_STOP")
libcast:RegisterEvent("SPELLCAST_CHANNEL_UPDATE")
local mob, spell, icon, _
+
libcast:SetScript("OnEvent", function()
-- Fill database with player casts
if event == "SPELLCAST_START" then
icon = L["spells"][arg1] and L["spells"][arg1].icon and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg1].icon) or lastcasttex
- -- add cast action to the database
- this.db[player].cast = arg1
- this.db[player].rank = lastrank
- this.db[player].start = GetTime()
- this.db[player].casttime = arg2
- this.db[player].icon = icon
- this.db[player].channel = nil
+
+ -- Check if SuperWoW already set the cast data (with correct haste-adjusted casttime)
+ -- If so, only update icon if needed, don't overwrite casttime
+ local superWowAlreadySet = this.db[player].cast == arg1 and this.db[player].casttime and this.db[player].casttime > 0
+
+ if superWowAlreadySet then
+ -- SuperWoW already set correct casttime, only update icon if better
+ if icon and not this.db[player].icon then
+ this.db[player].icon = icon
+ end
+ else
+ -- No SuperWoW data, use SPELLCAST_START data
+ this.db[player].cast = arg1
+ this.db[player].rank = lastrank
+ this.db[player].start = GetTime()
+ this.db[player].casttime = arg2
+ this.db[player].icon = icon
+ this.db[player].channel = nil
+ end
+
if not L["spells"][arg1] or not L["spells"][arg1].icon or not L["spells"][arg1].t then
L["spells"][arg1] = L["spells"][arg1] or { }
L["spells"][arg1].icon = L["spells"][arg1].icon or icon
@@ -214,7 +299,9 @@ libcast:SetScript("OnEvent", function()
end
elseif event == "SPELLCAST_DELAYED" then
if this.db[player].cast then
- this.db[player].start = this.db[player].start + arg1/1000
+ -- Pushback: increase casttime instead of shifting start
+ -- arg1 is the delay amount in milliseconds
+ this.db[player].casttime = this.db[player].casttime + arg1
end
elseif event == "SPELLCAST_CHANNEL_START" then
-- add cast action to the database
@@ -224,6 +311,7 @@ libcast:SetScript("OnEvent", function()
this.db[player].casttime = arg1
this.db[player].icon = L["spells"][arg2] and L["spells"][arg2].icon and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg2].icon) or lastcasttex
this.db[player].channel = true
+
lastcasttex, lastrank = nil, nil
elseif event == "SPELLCAST_CHANNEL_STOP" then
if this.db[player] and this.db[player].channel then
diff --git a/libs/libpredict.lua b/libs/libpredict.lua
index 77701f0b..83698369 100644
--- a/libs/libpredict.lua
+++ b/libs/libpredict.lua
@@ -9,10 +9,9 @@ setfenv(1, pfUI:GetEnvironment())
-- UnitGetIncomingHeals(unit)
-- UnitHasIncomingResurrection(unit)
--
--- The library is able to receive and send compatible messages to HealComm (vanilla)
--- and HealComm (tbc) including the ressurections of both versions. It has an option
--- to disable the sending of those messages in case one of the mentioned libraries
--- is already active.
+-- The library is able to receive and send compatible messages to HealComm
+-- including resurrections. It has an option to disable the sending of those
+-- messages in case HealComm is already active.
-- return instantly when another libpredict is already active
if pfUI.api.libpredict then return end
@@ -457,15 +456,6 @@ libpredict.sender:SetScript("OnUpdate", function()
end
end)
--- tbc
-libpredict.sender:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
-libpredict.sender:RegisterEvent("UNIT_SPELLCAST_START")
-libpredict.sender:RegisterEvent("UNIT_SPELLCAST_STOP")
-libpredict.sender:RegisterEvent("UNIT_SPELLCAST_FAILED")
-libpredict.sender:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
-libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SENT")
-
--- vanilla
libpredict.sender:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
libpredict.sender:RegisterEvent("SPELLCAST_START")
libpredict.sender:RegisterEvent("SPELLCAST_STOP")
@@ -502,24 +492,9 @@ libpredict.sender:SetScript("OnEvent", function()
if spell == spell_queue[1] then UpdateCache(spell_queue[2], heal, true) end
return
end
- elseif event == "COMBAT_LOG_EVENT_UNFILTERED" and arg2 == "SPELL_HEAL" and arg4 == player then -- tbc
- local spell, heal, crit = arg10, arg12, arg13
- if spell and heal and crit then
- if spell == spell_queue[1] then UpdateCache(spell_queue[2], heal, true) end
- elseif spell and heal then
- if spell == spell_queue[1] then UpdateCache(spell_queue[2], heal) end
- end
- elseif event == "UNIT_SPELLCAST_SENT" and arg4 then -- fix tbc mouseover macros
- senttarget = arg4
- elseif strfind(event, "SPELLCAST_START", 1) then
+ elseif event == "SPELLCAST_START" then
local spell, time = arg1, arg2
- if strfind(event, "UNIT_", 1) then -- tbc
- if arg1 ~= "player" then return end
- local spellname, _, _, _, starttime, endtime = UnitCastingInfo("player")
- spell, time = spellname, endtime - starttime
- end
-
if spell_queue[1] == spell and cache[spell_queue[2]] then
local sender = player
local target = senttarget or spell_queue[3]
@@ -540,22 +515,14 @@ libpredict.sender:SetScript("OnEvent", function()
for i=1,4 do
if CheckInteractDistance("party"..i, 4) then
libpredict:Heal(player, UnitName("party"..i), amount, casttime)
- if pfUI.client < 20000 then -- vanilla
- libpredict.sender:SendHealCommMsg("Heal/" .. UnitName("party"..i) .. "/" .. amount .. "/" .. casttime .. "/")
- else -- tbc
- libpredict.sender:SendHealCommMsg(string.format("002%05d%s", math.min(amount, 99999), UnitName("party"..i)))
- end
+ libpredict.sender:SendHealCommMsg("Heal/" .. UnitName("party"..i) .. "/" .. amount .. "/" .. casttime .. "/")
libpredict.sender.healing = true
end
end
end
libpredict:Heal(player, target, amount, casttime)
- if pfUI.client < 20000 then -- vanilla
- libpredict.sender:SendHealCommMsg("Heal/" .. target .. "/" .. amount .. "/" .. casttime .. "/")
- else -- tbc
- libpredict.sender:SendHealCommMsg(string.format("002%05d%s", math.min(amount, 99999), target))
- end
+ libpredict.sender:SendHealCommMsg("Heal/" .. target .. "/" .. amount .. "/" .. casttime .. "/")
libpredict.sender.healing = true
elseif spell_queue[1] == spell and L["resurrections"][spell] then
@@ -565,15 +532,10 @@ libpredict.sender:SetScript("OnEvent", function()
libpredict.sender:SendResCommMsg("RES " .. target)
libpredict.sender.resurrecting = true
end
- elseif strfind(event, "SPELLCAST_FAILED", 1) or strfind(event, "SPELLCAST_INTERRUPTED", 1) then
- if strfind(event, "UNIT_", 1) and arg1 ~= "player" then return end
+ elseif event == "SPELLCAST_FAILED" or event == "SPELLCAST_INTERRUPTED" then
if libpredict.sender.healing then
libpredict:HealStop(player)
- if pfUI.client < 20000 then -- vanilla
- libpredict.sender:SendHealCommMsg("HealStop")
- else -- tbc
- libpredict.sender:SendHealCommMsg("001F")
- end
+ libpredict.sender:SendHealCommMsg("HealStop")
libpredict.sender.healing = nil
elseif libpredict.sender.resurrecting then
local target = senttarget or spell_queue[3]
@@ -590,21 +552,16 @@ libpredict.sender:SetScript("OnEvent", function()
libpredict:HealDelay(player, arg1)
libpredict.sender:SendHealCommMsg("Healdelay/" .. arg1 .. "/")
end
- elseif strfind(event, "SPELLCAST_STOP", 1) then
- if strfind(event, "UNIT_", 1) and arg1 ~= "player" then return end
+ elseif event == "SPELLCAST_STOP" then
libpredict:HealStop(player)
- if pfUI.client < 20000 then -- vanilla
- if spell_queue[1] == REJUVENATION then
- libpredict:Hot(player, spell_queue[3], "Reju", rejuvDuration)
- libpredict.sender:SendHealCommMsg("Reju/"..spell_queue[3].."/"..rejuvDuration.."/")
- elseif spell_queue[1] == RENEW then
- libpredict:Hot(player, spell_queue[3], "Renew", renewDuration)
- libpredict.sender:SendHealCommMsg("Renew/"..spell_queue[3].."/"..renewDuration.."/")
- elseif spell_queue[1] == REGROWTH then
- this.regrowth_timer = GetTime() + 0.1
- end
- else -- tbc
- --todo
+ if spell_queue[1] == REJUVENATION then
+ libpredict:Hot(player, spell_queue[3], "Reju", rejuvDuration)
+ libpredict.sender:SendHealCommMsg("Reju/"..spell_queue[3].."/"..rejuvDuration.."/")
+ elseif spell_queue[1] == RENEW then
+ libpredict:Hot(player, spell_queue[3], "Renew", renewDuration)
+ libpredict.sender:SendHealCommMsg("Renew/"..spell_queue[3].."/"..renewDuration.."/")
+ elseif spell_queue[1] == REGROWTH then
+ this.regrowth_timer = GetTime() + 0.1
end
end
end)
diff --git a/libs/librange.lua b/libs/librange.lua
index c6e9c1a2..05c06743 100644
--- a/libs/librange.lua
+++ b/libs/librange.lua
@@ -39,10 +39,10 @@ local spells = {
},
}
--- use native IsSpellInRange checker for tbc and skip
--- the whole targeting approach that is required for vanilla
-if pfUI.expansion == "tbc" then
- local spell
+-- Use Nampower's IsSpellInRange if available (vanilla only)
+-- This provides more accurate range checking without needing to find spell slots
+local nampower_spell
+if GetNampowerVersion then
librange:RegisterEvent("LEARNED_SPELL_IN_TAB")
librange:RegisterEvent("PLAYER_ENTERING_WORLD")
librange:SetScript("OnEvent", function()
@@ -53,12 +53,14 @@ if pfUI.expansion == "tbc" then
local _, _, offset, num = GetSpellTabInfo(i)
for id = offset + 1, offset + num do
local name, rank = GetSpellName(id, BOOKTYPE_SPELL)
- local texture = GetSpellTexture(name)
+ local texture = GetSpellTexture(id, BOOKTYPE_SPELL)
- for _, tex in pairs(spells[class]) do
- if tex == texture then
- spell = name
- return
+ if texture then
+ for _, tex in pairs(spells[class]) do
+ if tex == texture then
+ nampower_spell = name
+ return
+ end
end
end
end
@@ -66,8 +68,12 @@ if pfUI.expansion == "tbc" then
end)
function librange:UnitInSpellRange(unit)
- if not spell then return nil end
- return IsSpellInRange(spell, unit) == 1 and true or nil
+ if not nampower_spell then return nil end
+ -- Nampower's IsSpellInRange returns 1 if in range, 0 if not, -1 if invalid
+ local result = IsSpellInRange(nampower_spell, unit)
+ if result == 1 then return 1
+ elseif result == 0 then return nil
+ else return nil end
end
-- add librange to pfUI API
@@ -161,7 +167,17 @@ librange:SetScript("OnUpdate", function()
if this.id <= numunits and librange.slot then
local unit = units[this.id]
if not UnitIsUnit("target", unit) then
- -- try to read distance via superwow first
+ -- Try UnitXP_SP3 first (most accurate distance measurement)
+ local unitxp_success, unitxp_distance = pcall(function()
+ return UnitXP("distanceBetween", "player", unit)
+ end)
+ if unitxp_success and unitxp_distance then
+ unitdata[unit] = unitxp_distance < 45 and 1 or 0
+ this.id = this.id + 1
+ return
+ end
+
+ -- try to read distance via superwow second
if superwow_active then
local x1, y1, z1 = UnitPosition("player")
local x2, y2, z2 = UnitPosition(unit)
From 9e434b515bc01770c0b0cf609f2f3dfb22da7d66 Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 12:33:39 +0100
Subject: [PATCH 09/13] performance update
performance update
---
api/api.lua | 76 ++++++++++++++++++++++++++++++++++++++++++++++
api/config.lua | 13 ++++++++
api/unitframes.lua | 76 ++++++++++++----------------------------------
3 files changed, 109 insertions(+), 56 deletions(-)
diff --git a/api/api.lua b/api/api.lua
index e4a94402..dfa73621 100644
--- a/api/api.lua
+++ b/api/api.lua
@@ -7,6 +7,82 @@ setfenv(1, pfUI:GetEnvironment())
gfind = string.gmatch or string.gfind
mod = math.mod or mod
+-- [ DLL Detection Helpers ]
+-- Detects presence of various DLL extensions for enhanced functionality
+
+-- [ HasSuperWoW ]
+-- Returns true if SuperWoW DLL is active
+-- SuperWoW provides: UNIT_CASTEVENT, UnitPosition, SetMouseoverUnit, SpellInfo, etc.
+function pfUI.api.HasSuperWoW()
+ return SUPERWOW_VERSION or (SetAutoloot and SpellInfo)
+end
+
+-- [ HasUnitXP ]
+-- Returns true if UnitXP_SP3 DLL is active
+-- UnitXP provides: distance, line of sight, behind detection, targeting helpers
+function pfUI.api.HasUnitXP()
+ local success = pcall(UnitXP, "nop", "nop")
+ return success
+end
+
+-- [ HasNampower ]
+-- Returns true if Nampower DLL is active
+-- Nampower provides: spell queuing, GetCastInfo, GetSpellIdCooldown, IsSpellInRange, etc.
+function pfUI.api.HasNampower()
+ return GetNampowerVersion and true or false
+end
+
+-- [ GetUnitDistance ]
+-- Returns distance to unit using best available method
+-- 'unit1' [string] first unit (default: "player")
+-- 'unit2' [string] second unit
+-- returns: [number] distance in yards, or nil if unavailable
+function pfUI.api.GetUnitDistance(unit1, unit2)
+ if not unit2 then
+ unit2 = unit1
+ unit1 = "player"
+ end
+
+ if not UnitExists(unit2) then return nil end
+
+ -- Try UnitXP first (most accurate)
+ if pfUI.api.HasUnitXP() then
+ local success, distance = pcall(UnitXP, "distanceBetween", unit1, unit2)
+ if success and distance then return distance end
+ end
+
+ -- Try SuperWoW UnitPosition
+ if pfUI.api.HasSuperWoW() and UnitPosition then
+ local x1, y1, z1 = UnitPosition(unit1)
+ local x2, y2, z2 = UnitPosition(unit2)
+ if x1 and y1 and z1 and x2 and y2 and z2 then
+ return ((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)^0.5
+ end
+ end
+
+ return nil
+end
+
+-- [ UnitInLineOfSight ]
+-- Returns true if unit1 has line of sight to unit2
+-- Requires UnitXP_SP3
+function pfUI.api.UnitInLineOfSight(unit1, unit2)
+ if not pfUI.api.HasUnitXP() then return nil end
+ local success, inSight = pcall(UnitXP, "inSight", unit1, unit2)
+ if success then return inSight end
+ return nil
+end
+
+-- [ UnitIsBehind ]
+-- Returns true if unit1 is behind unit2
+-- Requires UnitXP_SP3
+function pfUI.api.UnitIsBehind(unit1, unit2)
+ if not pfUI.api.HasUnitXP() then return nil end
+ local success, behind = pcall(UnitXP, "behind", unit1, unit2)
+ if success then return behind end
+ return nil
+end
+
-- [ strsplit ]
-- Splits a string using a delimiter.
-- 'delimiter' [string] characters that will be interpreted as delimiter
diff --git a/api/config.lua b/api/config.lua
index 7dd2114c..b7e3ceee 100644
--- a/api/config.lua
+++ b/api/config.lua
@@ -221,6 +221,18 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", nil, "druidmanabar", "1")
pfUI:UpdateConfig("unitframes", nil, "druidmanaheight", "2")
pfUI:UpdateConfig("unitframes", nil, "druidmanatext", "0")
+ pfUI:UpdateConfig("unitframes", nil, "spellqueue", "1")
+ pfUI:UpdateConfig("unitframes", nil, "spellqueuesize", "24")
+ pfUI:UpdateConfig("unitframes", nil, "gcd_indicator", "0")
+ pfUI:UpdateConfig("unitframes", nil, "gcd_size", "4")
+ pfUI:UpdateConfig("unitframes", nil, "nampower_buffs", "1")
+ pfUI:UpdateConfig("unitframes", nil, "reactive_indicator", "0")
+ pfUI:UpdateConfig("unitframes", nil, "reactive_size", "28")
+ pfUI:UpdateConfig("unitframes", nil, "damage_tracking", "0")
+ pfUI:UpdateConfig("unitframes", nil, "los_indicator", "0")
+ pfUI:UpdateConfig("unitframes", nil, "behind_indicator", "0")
+ pfUI:UpdateConfig("unitframes", nil, "unitxp_notify", "0")
+ pfUI:UpdateConfig("unitframes", nil, "track_group", "0")
pfUI:UpdateConfig("unitframes", nil, "rangechecki", "4")
pfUI:UpdateConfig("unitframes", nil, "combowidth", "6")
pfUI:UpdateConfig("unitframes", nil, "comboheight", "6")
@@ -713,6 +725,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("chat", "text", "playerlinks", "1")
pfUI:UpdateConfig("chat", "text", "detecturl", "1")
pfUI:UpdateConfig("chat", "text", "classcolor", "1")
+ pfUI:UpdateConfig("chat", "text", "playerlevel", "1")
pfUI:UpdateConfig("chat", "text", "whosearchunknown", "0")
pfUI:UpdateConfig("chat", "left", "width", "380")
pfUI:UpdateConfig("chat", "left", "height", "180")
diff --git a/api/unitframes.lua b/api/unitframes.lua
index 36e8eaed..9b590ba3 100644
--- a/api/unitframes.lua
+++ b/api/unitframes.lua
@@ -420,21 +420,7 @@ function pfUI.uf:UpdateVisibility()
self.visible = nil
end
- -- tbc visibility
- if pfUI.client > 11200 then
- self:SetAttribute("unit", unitstr)
-
- -- update visibility condition on change
- if self.visibilitycondition ~= visibility then
- RegisterStateDriver(self, 'visibility', visibility)
- self.visibilitycondition = visibility
- self.visible = true
- end
-
- return
- end
-
- -- vanilla visibility
+ -- visibility
if self.unitname and self.unitname ~= "focus" and self.unitname ~= "focustarget" then
self:Show()
elseif visibility == "hide" then
@@ -866,8 +852,6 @@ function pfUI.uf:UpdateConfig()
if f:GetName() == "pfPlayer" then
f.buffs[i]:SetScript("OnUpdate", BuffOnUpdate)
- elseif f:GetName() == "pfTarget" and pfUI.expansion == "tbc" then
- f.buffs[i]:SetScript("OnUpdate", TargetBuffOnUpdate)
end
f.buffs[i]:SetScript("OnEnter", BuffOnEnter)
@@ -1209,6 +1193,18 @@ end
function pfUI.uf.OnEnter()
if not this.label then return end
+
+ -- SuperWoW: Set native mouseover unit for macro/addon compatibility
+ if SetMouseoverUnit then
+ local unitstr = this.label .. this.id
+ -- For GUID-based frames (focus), use the GUID directly
+ if this.label and string.find(this.label, "^0x") then
+ SetMouseoverUnit(this.label)
+ elseif UnitExists(unitstr) then
+ SetMouseoverUnit(unitstr)
+ end
+ end
+
if this.config.showtooltip == "0" then return end
GameTooltip_SetDefaultAnchor(GameTooltip, this)
GameTooltip:SetUnit(this.label .. this.id)
@@ -1216,6 +1212,11 @@ function pfUI.uf.OnEnter()
end
function pfUI.uf.OnLeave()
+ -- SuperWoW: Clear native mouseover unit
+ if SetMouseoverUnit then
+ SetMouseoverUnit()
+ end
+
GameTooltip:FadeOut()
end
@@ -2139,33 +2140,8 @@ function pfUI.uf:EnableClickCast()
local bconf = bid == 1 and "" or bid
if pfUI_config.unitframes["clickcast"..bconf..mconf] ~= "" then
-- prepare click casting
- if pfUI.client > 11200 then
- -- set attributes for tbc+
- local prefix = modifier == "" and "" or modifier .. "-"
-
- -- check for "/" in the beginning of the string, to detect macros
- if string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^%/(.+)") then
- self:SetAttribute(prefix.."type"..bid, "macro")
- self:SetAttribute(prefix.."macrotext"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
- self:SetAttribute(prefix.."spell"..bid, nil)
- elseif string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^target") then
- self:SetAttribute(prefix.."type"..bid, "target")
- self:SetAttribute(prefix.."macrotext"..bid, nil)
- self:SetAttribute(prefix.."spell"..bid, nil)
- elseif string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^menu") then
- self:SetAttribute(prefix.."type"..bid, "showmenu")
- self:SetAttribute(prefix.."macrotext"..bid, nil)
- self:SetAttribute(prefix.."spell"..bid, nil)
- else
- self:SetAttribute(prefix.."type"..bid, "spell")
- self:SetAttribute(prefix.."spell"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
- self:SetAttribute(prefix.."macro"..bid, nil)
- end
- else
- -- fill clickaction table for vanillla
- self.clickactions = self.clickactions or {}
- self.clickactions[modifier..button] = pfUI_config.unitframes["clickcast"..bconf..mconf]
- end
+ self.clickactions = self.clickactions or {}
+ self.clickactions[modifier..button] = pfUI_config.unitframes["clickcast"..bconf..mconf]
end
end
end
@@ -2427,8 +2403,6 @@ function pfUI.uf:SetupBuffIndicators(config)
if myclass == "WARRIOR" then
-- Battle Shout
table.insert(indicators, "interface\\icons\\ability_warrior_battleshout")
- -- Commanding Shout (TBC)
- table.insert(indicators, "interface\\icons\\ability_warrior_rallyingcry")
end
if myclass == "MAGE" then
@@ -2447,14 +2421,6 @@ function pfUI.uf:SetupBuffIndicators(config)
-- Aspect of the Pack
table.insert(indicators, "interface\\icons\\ability_mount_whitetiger")
-
- -- Misdirection (TBC)
- table.insert(indicators, "interface\\icons\\ability_hunter_misdirection")
- end
-
- if myclass == "SHAMAN" then
- -- Earth Shield (TBC)
- table.insert(indicators, "interface\\icons\\spell_nature_skinofearth")
end
end
@@ -2483,8 +2449,6 @@ function pfUI.uf:SetupBuffIndicators(config)
table.insert(indicators, "interface\\icons\\spell_holy_renew")
-- Power Word: Shield
table.insert(indicators, "interface\\icons\\spell_holy_powerwordshield")
- -- Prayer of Mending (TBC)
- table.insert(indicators, "interface\\icons\\spell_holy_prayerofmendingtga")
end
if myclass == "DRUID" or config.all_hots == "1" then
From 62a53b3c4330e5c8af77d7524df7213b13a3f9db Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 12:34:15 +0100
Subject: [PATCH 10/13] Add files via upload
---
README.md | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
pfUI.lua | 36 +++-----------
2 files changed, 152 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
index 0c9fbe83..f65eb3d7 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,146 @@
pfUI performance updates, use on own risk.
+
+## DLL Integrations
+
+pfUI includes optional integration modules for client DLLs that provide enhanced functionality beyond what the standard WoW 1.12 client supports. These features are only enabled when the corresponding DLL is installed.
+
+---
+
+### SuperWoW
+
+**Repository:** https://github.com/balakethelock/SuperWoW
+
+SuperWoW provides GUID-based unit tracking, spell information APIs, and various client enhancements.
+
+#### Features
+
+- **GUID-Based Focus Frame** - Focus frame uses actual unit GUIDs instead of name-based emulation
+- **Native Mouseover Casting** - `/pfcast` supports true mouseover targeting via `CastSpellByName(spell, unit)`
+- **Druid Mana Bar** - Shows mana while in feral forms (requires `unitframes.druidmanabar` config)
+- **Enhanced Cast Bars** - Uses `UNIT_CASTEVENT` for accurate cast/channel tracking with spell IDs
+- **Enhanced Debuff Tracking** - Accurate debuff application via `UNIT_CASTEVENT` with caster info
+- **Group Minimap Tracking** - Track party/raid members on minimap via `TrackUnit()` API
+- **Raid Marker Targeting** - Target units by raid marker (`mark1` to `mark8`)
+- **Clickthrough Mode** - Click through corpses to loot underneath (`/clickthrough` or `/ct`)
+- **Config Import/Export** - Save and load pfUI configs via `/pfexport` and `/pfimport`
+- **Local Raid Markers** - Set raid markers visible only to yourself
+- **Enchanting Link Fixes** - Converts enchant links for compatibility with non-SuperWoW clients
+
+#### API Functions
+
+| Function | Description |
+|----------|-------------|
+| `pfUI.api.GetMarkedUnit(index)` | Get unit ID for raid marker 1-8 |
+| `pfUI.api.TargetMark(index)` | Target unit with raid marker |
+| `pfUI.api.GetUnitOwner(unit)` | Get owner of pet/totem |
+| `pfUI.api.GetSpellInfo(spellId)` | Get spell name, rank, texture, range |
+| `pfUI.api.SetClickthrough(enabled)` | Enable/disable clickthrough |
+| `pfUI.api.ToggleClickthrough()` | Toggle clickthrough mode |
+| `pfUI.api.SetAutoloot(enabled)` | Enable/disable autoloot |
+| `pfUI.api.ExportConfig(filename)` | Export config to file |
+| `pfUI.api.ImportConfig(filename)` | Import config from file |
+| `pfUI.api.GetPlayerBuffSpellId(index)` | Get spell ID for player buff |
+| `pfUI.api.LogToCombatLog(text)` | Add text to combat log |
+| `pfUI.api.SetLocalRaidTarget(unit, index)` | Set local-only raid marker |
+| `pfUI.api.GetItemCharges(bag, slot)` | Get item charges (returns positive) |
+| `pfUI.api.GetUnitWeaponEnchants(unit)` | Get weapon enchant info |
+
+---
+
+### Nampower
+
+**Repository:** https://gitea.com/avitasia/nampower
+
+Nampower provides spell queuing, precise cooldown tracking, and detailed aura/buff information.
+
+#### Features
+
+- **Spell Queue Indicator** - Shows queued spell icon near castbar (requires `unitframes.spellqueue` config)
+- **Reactive Spell Indicator** - Highlights when Overpower, Revenge, Execute, Riposte, etc. are usable (requires `unitframes.reactive_indicator`)
+- **Enhanced Debuff Tracking** - GUID-based debuff tracking via `DEBUFF_ADDED/REMOVED` events
+- **Enhanced Buff Tracking** - GUID-based buff tracking via `BUFF_ADDED/REMOVED` events (requires `unitframes.nampower_buffs`)
+- **Swing Timer** - Track main-hand and off-hand auto-attack timers
+- **Disenchant All** - `/disenchantall` or `/dea` to disenchant eligible items
+
+#### API Functions
+
+| Function | Description |
+|----------|-------------|
+| `pfUI.api.GetUnitAuras(unit)` | Get all buffs/debuffs with spell IDs via `GetUnitField` |
+| `pfUI.api.UnitHasAura(unit, spellId)` | Check if unit has specific aura |
+| `pfUI.api.GetUnitResistances(unit)` | Get unit's resistances (armor, fire, frost, etc.) |
+| `pfUI.api.GetPreciseCooldown(spellId)` | Get precise cooldown info (remaining ms, GCD state) |
+| `pfUI.api.GetPreciseItemCooldown(itemId)` | Get precise item cooldown |
+| `pfUI.api.GetEquippedTrinkets()` | Get equipped trinket info |
+| `pfUI.api.GetTrinketCooldown(slot)` | Get trinket cooldown |
+| `pfUI.api.UseTrinket(slot, target)` | Use trinket |
+| `pfUI.api.GetNampowerItemStats(itemId)` | Get item stats |
+| `pfUI.api.GetNampowerItemLevel(itemId)` | Get item level |
+| `pfUI.api.GetSpellBonus(spellId, modType)` | Get spell modifiers (damage, crit, cost) |
+| `pfUI.api.GetSpellDamageBonus(spellId)` | Get spell damage bonus |
+| `pfUI.api.GetSpellCritBonus(spellId)` | Get spell crit bonus |
+| `pfUI.api.GetSpellCostReduction(spellId)` | Get spell cost reduction |
+| `pfUI.api.GetAllBagItems()` | Get all bag items |
+| `pfUI.api.FindItem(itemIdOrName)` | Find item in bags |
+| `pfUI.api.UseItem(itemIdOrName, target)` | Use item |
+| `pfUI.api.GetPlayerEquipment()` | Get player's equipped items |
+| `pfUI.api.GetTargetEquipment()` | Get target's equipped items |
+| `pfUI.api.GetMaxRankSpellId(spellName)` | Get spell ID for max rank |
+| `pfUI.api.GetSpellSlotInfo(spellName)` | Get spell slot/book info |
+| `pfUI.api.QueueLuaScript(script, priority)` | Queue Lua script for execution |
+| `pfUI.api.QueueSpell(spellName)` | Queue spell by name |
+| `pfUI.api.StopChannelNextTick()` | Stop channeling next tick |
+| `pfUI.api.GetSpellRecord(spellId)` | Get full spell database record |
+| `pfUI.api.GetSpellSchool(spellId)` | Get spell school (Fire, Frost, etc.) |
+| `pfUI.api.GetSwingTimers()` | Get auto-attack swing timers |
+| `pfUI.api.libdebuff_nampower(unit, id)` | Enhanced UnitDebuff with Nampower data |
+
+---
+
+### UnitXP_SP3
+
+**Repository:** https://github.com/allfoxwy/UnitXP_SP3
+
+UnitXP provides line-of-sight checks, positional information, precise distances, and OS-level notifications.
+
+#### Features
+
+- **Line of Sight Indicator** - Shows "NO LOS" text on target frame when target is obstructed (requires `unitframes.los_indicator`)
+- **Behind Indicator** - Shows "BEHIND" text on target frame when positioned behind target (requires `unitframes.behind_indicator`)
+- **OS Notifications** - Flashes taskbar and plays system sound on whispers, ready checks, BG queue pops (requires `unitframes.unitxp_notify`)
+- **Precise Distance** - Exact yard distance between units
+- **Smart Targeting** - Target nearest enemy, highest HP, cycle through enemies
+
+#### API Functions
+
+| Function | Description |
+|----------|-------------|
+| `pfUI.api.GetPreciseDistance(unit1, unit2)` | Get exact distance in yards |
+| `pfUI.api.IsInMeleeRange(unit)` | Check if unit is in melee range |
+| `pfUI.api.GetAoEDistance(unit1, unit2)` | Get distance for AoE calculations |
+| `pfUI.api.TargetNearestEnemy()` | Target nearest hostile unit |
+| `pfUI.api.TargetHighestHP()` | Target enemy with most HP |
+| `pfUI.api.TargetNextEnemy()` | Cycle to next enemy |
+| `pfUI.api.TargetPreviousEnemy()` | Cycle to previous enemy |
+| `pfUI.api.TargetNextMarked(order)` | Target next marked enemy in order |
+| `pfUI.api.UnitInLineOfSight(unit1, unit2)` | Check line of sight between units |
+| `pfUI.api.UnitIsBehind(unit1, unit2)` | Check if unit1 is behind unit2 |
+
+---
+
+### Configuration Options
+
+These DLL features can be enabled/disabled via `/pfui` settings under Unit Frames:
+
+| Setting | DLL | Description |
+|---------|-----|-------------|
+| `unitframes.druidmanabar` | SuperWoW | Show mana bar while shapeshifted |
+| `unitframes.track_group` | SuperWoW | Track group members on minimap |
+| `unitframes.spellqueue` | Nampower | Show spell queue indicator |
+| `unitframes.spellqueuesize` | Nampower | Spell queue icon size |
+| `unitframes.reactive_indicator` | Nampower | Show reactive ability procs |
+| `unitframes.reactive_size` | Nampower | Reactive indicator icon size |
+| `unitframes.nampower_buffs` | Nampower | Enhanced buff tracking |
+| `unitframes.los_indicator` | UnitXP | Show line of sight indicator |
+| `unitframes.behind_indicator` | UnitXP | Show behind indicator |
+| `unitframes.unitxp_notify` | UnitXP | Enable OS notifications |
diff --git a/pfUI.lua b/pfUI.lua
index 606919f8..b8229436 100644
--- a/pfUI.lua
+++ b/pfUI.lua
@@ -77,17 +77,9 @@ end})
local _, _, _, client = GetBuildInfo()
client = client or 11200
--- detect client expansion
-if client >= 20000 and client <= 20400 then
- pfUI.expansion = "tbc"
- pfUI.client = client
-elseif client >= 30000 and client <= 30300 then
- pfUI.expansion = "wotlk"
- pfUI.client = client
-else
- pfUI.expansion = "vanilla"
- pfUI.client = client
-end
+-- set expansion to vanilla
+pfUI.expansion = "vanilla"
+pfUI.client = client
-- setup pfUI namespace
setmetatable(pfUI.env, {__index = getfenv(0)})
@@ -119,34 +111,20 @@ function pfUI:UpdateFonts()
-- load font configuration
local default, tooltip, unit, unit_name, combat
- if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "vanilla" then
+ if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" then
-- force locale compatible fonts (zhCN 1.12)
default = "Fonts\\FZXHLJW.TTF"
tooltip = "Fonts\\FZXHLJW.TTF"
combat = "Fonts\\FZXHLJW.TTF"
unit = "Fonts\\FZXHLJW.TTF"
unit_name = "Fonts\\FZXHLJW.TTF"
- elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "tbc" then
- -- force locale compatible fonts (zhCN 2.4.3)
- default = "Fonts\\ZYHei.ttf"
- tooltip = "Fonts\\ZYHei.ttf"
- combat = "Fonts\\ZYKai_C.ttf"
- unit = "Fonts\\ZYKai_T.ttf"
- unit_name = "Fonts\\ZYHei.ttf"
- elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" and pfUI.expansion == "vanilla" then
+ elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" then
-- force locale compatible fonts (zhTW 1.12)
default = "Fonts\\FZXHLJW.ttf"
tooltip = "Fonts\\FZXHLJW.ttf"
combat = "Fonts\\FZXHLJW.ttf"
unit = "Fonts\\FZXHLJW.ttf"
unit_name = "Fonts\\FZXHLJW.ttf"
- elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" and pfUI.expansion == "tbc" then
- -- force locale compatible fonts (zhTW 2.4.3)
- default = "Fonts\\bHEI01B.ttf"
- tooltip = "Fonts\\bHEI01B.ttf"
- combat = "Fonts\\bHEI01B.ttf"
- unit = "Fonts\\bHEI01B.ttf"
- unit_name = "Fonts\\bHEI01B.ttf"
elseif pfUI_config.global.force_region == "1" and GetLocale() == "koKR" then
-- force locale compatible fonts (koKR)
default = "Fonts\\2002.TTF"
@@ -244,7 +222,7 @@ end
function pfUI:RegisterModule(name, a2, a3)
if pfUI.module[name] then return end
local hasv = type(a2) == "string"
- local func, version = hasv and a3 or a2, hasv and a2 or "vanilla:tbc:wotlk"
+ local func, version = hasv and a3 or a2, hasv and a2 or "vanilla"
-- check for client compatibility
if not strfind(version, pfUI.expansion) then return end
@@ -259,7 +237,7 @@ end
function pfUI:RegisterSkin(name, a2, a3)
if pfUI.skin[name] then return end
local hasv = type(a2) == "string"
- local func, version = hasv and a3 or a2, hasv and a2 or "vanilla:tbc:wotlk"
+ local func, version = hasv and a3 or a2, hasv and a2 or "vanilla"
-- check for client compatibility
if not strfind(version, pfUI.expansion) then return end
From f5d2f659992c5937586de0fab29f62db886dbb9a Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 12:55:04 +0100
Subject: [PATCH 11/13] performance update
performance update
---
init/compat.xml | 1 -
init/modules.xml | 4 +-
init/skins.xml | 10 ---
pfUI-tbc.toc | 17 ----
skins/blizzard/auction.lua | 15 ++--
skins/blizzard/battlefield.lua | 2 +-
skins/blizzard/battlefield_minimap.lua | 2 +-
skins/blizzard/character.lua | 25 ++----
skins/blizzard/dressup.lua | 2 +-
skins/blizzard/friends.lua | 60 +-------------
skins/blizzard/game_menu.lua | 8 +-
skins/blizzard/gossipquest.lua | 2 +-
skins/blizzard/guild_registrar.lua | 2 +-
skins/blizzard/help.lua | 14 +---
skins/blizzard/inspect.lua | 105 -------------------------
skins/blizzard/itemtext.lua | 2 +-
skins/blizzard/keybindings.lua | 2 +-
skins/blizzard/macro.lua | 2 +-
skins/blizzard/mail.lua | 48 +----------
skins/blizzard/merchant.lua | 18 +----
skins/blizzard/miscellaneous.lua | 12 +--
skins/blizzard/options-sound.lua | 44 +++--------
skins/blizzard/options-video.lua | 48 +++--------
skins/blizzard/popup_dialogs.lua | 9 +--
skins/blizzard/professions.lua | 34 +-------
skins/blizzard/questlog.lua | 21 +----
skins/blizzard/readycheck.lua | 10 +--
skins/blizzard/spellbook.lua | 2 +-
skins/blizzard/stable.lua | 2 +-
skins/blizzard/tabard.lua | 2 +-
skins/blizzard/talents.lua | 12 +--
skins/blizzard/taxi.lua | 2 +-
skins/blizzard/tooltips.lua | 2 +-
skins/blizzard/trade.lua | 2 +-
skins/blizzard/trainer.lua | 2 +-
35 files changed, 77 insertions(+), 468 deletions(-)
delete mode 100644 pfUI-tbc.toc
diff --git a/init/compat.xml b/init/compat.xml
index 7d9f7b2d..173883ce 100644
--- a/init/compat.xml
+++ b/init/compat.xml
@@ -1,4 +1,3 @@
-
diff --git a/init/modules.xml b/init/modules.xml
index 9c17cf52..07f703ff 100644
--- a/init/modules.xml
+++ b/init/modules.xml
@@ -35,7 +35,6 @@
-
@@ -66,10 +65,11 @@
-
+
+
diff --git a/init/skins.xml b/init/skins.xml
index 010e2b96..088c2d55 100644
--- a/init/skins.xml
+++ b/init/skins.xml
@@ -26,7 +26,6 @@
-
@@ -34,13 +33,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/pfUI-tbc.toc b/pfUI-tbc.toc
deleted file mode 100644
index 1686229a..00000000
--- a/pfUI-tbc.toc
+++ /dev/null
@@ -1,17 +0,0 @@
-## Interface: 20400
-## Title: |cff33ffccpf|cffffffffUI
-## Author: Shagu
-## Notes: A complete user interface replacement.
-## Notes-ruRU: Полная замена пользовательского интерфейса.
-## Version: 5.5.4
-## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache
-## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
-
-pfUI.lua
-
-init\env.xml
-init\compat.xml
-init\api.xml
-init\libs.xml
-init\skins.xml
-init\modules.xml
diff --git a/skins/blizzard/auction.lua b/skins/blizzard/auction.lua
index 0cd64855..f94c3e3a 100644
--- a/skins/blizzard/auction.lua
+++ b/skins/blizzard/auction.lua
@@ -1,16 +1,11 @@
-pfUI:RegisterSkin("Auctionhouse", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Auctionhouse", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddonOrVariable("Blizzard_AuctionUI", function()
- -- Compatibility
- if BrowseResetButton then -- tbc
- SkinButton(BrowseResetButton)
- else -- vanilla
- SkinArrowButton(BidPrevPageButton, "left", 18)
- SkinArrowButton(BidNextPageButton, "right", 18)
- SkinArrowButton(AuctionsPrevPageButton, "left", 18)
- SkinArrowButton(AuctionsNextPageButton, "right", 18)
- end
+ SkinArrowButton(BidPrevPageButton, "left", 18)
+ SkinArrowButton(BidNextPageButton, "right", 18)
+ SkinArrowButton(AuctionsPrevPageButton, "left", 18)
+ SkinArrowButton(AuctionsNextPageButton, "right", 18)
hooksecurefunc("AuctionFrame_OnShow", function()
AuctionFrame:ClearAllPoints()
diff --git a/skins/blizzard/battlefield.lua b/skins/blizzard/battlefield.lua
index 7ff50008..f8dcb283 100644
--- a/skins/blizzard/battlefield.lua
+++ b/skins/blizzard/battlefield.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Battlefield", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Battlefield", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/battlefield_minimap.lua b/skins/blizzard/battlefield_minimap.lua
index e0a21d5e..e2eb12b7 100644
--- a/skins/blizzard/battlefield_minimap.lua
+++ b/skins/blizzard/battlefield_minimap.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Battlefield Minimap", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Battlefield Minimap", "vanilla", function ()
local rawborder, border = GetBorderSize()
HookAddonOrVariable("Blizzard_BattlefieldMinimap", function()
diff --git a/skins/blizzard/character.lua b/skins/blizzard/character.lua
index 88d4775f..fea07800 100644
--- a/skins/blizzard/character.lua
+++ b/skins/blizzard/character.lua
@@ -1,26 +1,13 @@
-pfUI:RegisterSkin("Character", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Character", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
- -- Compatibility
- if PlayerTitleDropDown then -- tbc, wotlk
- -- Character Tab
- SkinDropDown(PlayerTitleDropDown)
- PlayerTitleDropDown:SetPoint("TOP", CharacterLevelText, "BOTTOM", 0, -2)
- PlayerTitleDropDownText:SetPoint("LEFT", PlayerTitleDropDown.backdrop, "LEFT", 6, 2)
- SkinDropDown(PlayerStatFrameLeftDropDown)
- SkinDropDown(PlayerStatFrameRightDropDown)
+ -- Honor Tab
+ StripTextures(HonorFrame)
- -- Honor Tab
- StripTextures(PVPFrame)
- else -- vanilla
- -- Honor Tab
- StripTextures(HonorFrame)
-
- HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
- CreateBackdrop(HonorFrameProgressBar)
- HonorFrameProgressBar:SetHeight(24)
- end
+ HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
+ CreateBackdrop(HonorFrameProgressBar)
+ HonorFrameProgressBar:SetHeight(24)
local magicResTextureCords = {
{0.21875, 0.78125, 0.25, 0.3203125},
diff --git a/skins/blizzard/dressup.lua b/skins/blizzard/dressup.lua
index d618a36c..cf5c0ffe 100644
--- a/skins/blizzard/dressup.lua
+++ b/skins/blizzard/dressup.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Dress Up Frame", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Dress Up Frame", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/friends.lua b/skins/blizzard/friends.lua
index fe6080e6..26b21ce3 100644
--- a/skins/blizzard/friends.lua
+++ b/skins/blizzard/friends.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Friends", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
local maxtab = pfUI.expansion == "vanilla" and 4 or 5
@@ -336,24 +336,6 @@ pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
GuildInfoCancelButton:ClearAllPoints()
GuildInfoCancelButton:SetPoint("BOTTOMRIGHT", GuildInfoFrame, "BOTTOMRIGHT", -10, 8)
- if GuildInfoGuildEventButton then -- log button (tbc+)
- SkinButton(GuildInfoGuildEventButton)
- GuildInfoGuildEventButton:ClearAllPoints()
- GuildInfoGuildEventButton:SetPoint("BOTTOM", GuildInfoFrame, "BOTTOM", 0, 8)
- end
-
- if GuildEventLogFrame then -- guild log frame (tbc+)
- StripTextures(GuildEventFrame)
- CreateBackdrop(GuildEventFrame, nil, true, .75)
- StripTextures(GuildEventLogFrame)
- CreateBackdrop(GuildEventLogFrame, nil, true, .75)
- StripTextures(GuildEventLogScrollFrame)
- SkinScrollbar(GuildEventLogScrollFrameScrollBar)
- SkinCloseButton(GuildEventLogCloseButton)
- GuildEventLogCancelButton:SetPoint("BOTTOMRIGHT", -9, 8)
- SkinButton(GuildEventLogCancelButton)
- end
-
-- guild control
StripTextures(GuildControlPopupFrame)
CreateBackdrop(GuildControlPopupFrame, nil, true, .75)
@@ -392,46 +374,6 @@ pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
GuildControlPopupAcceptButton:SetPoint("RIGHT", GuildControlPopupFrameCancelButton, "LEFT", -2*bpad, 0)
end
- if ChannelFrameVerticalBar then -- Channel Tab (TBC+)
- StripTextures(ChannelFrameVerticalBar)
- SkinButton(ChannelFrameNewButton)
- ChannelFrameNewButton:SetPoint("BOTTOMRIGHT", -15, 82)
-
- StripTextures(ChannelListScrollFrame)
- SkinScrollbar(ChannelListScrollFrameScrollBar)
-
- for i = 1, MAX_DISPLAY_CHANNEL_BUTTONS do
- StripTextures(_G["ChannelButton"..i])
- SkinButton(_G["ChannelButton"..i])
- end
-
- for i = 1, 22 do
- StripTextures(_G["ChannelMemberButton"..i])
- end
-
- CreateBackdrop(ChannelMemberButton1)
- ChannelMemberButton1.backdrop:SetPoint("BOTTOMRIGHT", ChannelMemberButton22, "BOTTOMRIGHT", -1, 0)
-
- StripTextures(ChannelRosterScrollFrame)
- SkinScrollbar(ChannelRosterScrollFrameScrollBar)
-
- StripTextures(ChannelFrameDaughterFrame)
- CreateBackdrop(ChannelFrameDaughterFrame)
-
- StripTextures(ChannelFrameDaughterFrameChannelName)
- CreateBackdrop(ChannelFrameDaughterFrameChannelName, nil, true)
- ChannelFrameDaughterFrameChannelName:SetTextInsets(5,5,5,5)
-
- StripTextures(ChannelFrameDaughterFrameChannelPassword)
- CreateBackdrop(ChannelFrameDaughterFrameChannelPassword, nil, true)
- ChannelFrameDaughterFrameChannelPassword:SetTextInsets(5,5,5,5)
-
- SkinCloseButton(ChannelFrameDaughterFrameDetailCloseButton)
-
- SkinButton(ChannelFrameDaughterFrameCancelButton)
- SkinButton(ChannelFrameDaughterFrameOkayButton)
- end
-
do -- Raid Tab
StripTextures(RaidInfoFrame)
CreateBackdrop(RaidInfoFrame, nil, true, .75)
diff --git a/skins/blizzard/game_menu.lua b/skins/blizzard/game_menu.lua
index 9b6d440b..9e202c7a 100644
--- a/skins/blizzard/game_menu.lua
+++ b/skins/blizzard/game_menu.lua
@@ -1,14 +1,10 @@
-pfUI:RegisterSkin("Game Menu", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Game Menu", "vanilla", function ()
StripTextures(GameMenuFrame)
CreateBackdrop(GameMenuFrame, nil, true, .75)
CreateBackdropShadow(GameMenuFrame)
GameMenuFrame:SetWidth(GameMenuFrame:GetWidth() - 30)
- if pfUI.expansion == 'tbc' then
- GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 10)
- elseif pfUI.expansion == 'vanilla' then
- GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
- end
+ GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
local title = GetNoNameObject(GameMenuFrame, "FontString", "ARTWORK", MAIN_MENU)
title:SetTextColor(1,1,1,1)
diff --git a/skins/blizzard/gossipquest.lua b/skins/blizzard/gossipquest.lua
index 183347d7..dec691a6 100644
--- a/skins/blizzard/gossipquest.lua
+++ b/skins/blizzard/gossipquest.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Gossip and Quest", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Gossip and Quest", "vanilla", function ()
local frames = {'Quest', 'Gossip'}
local panels = {'Greeting', 'Detail', 'Progress', 'Reward'}
local buttons = {
diff --git a/skins/blizzard/guild_registrar.lua b/skins/blizzard/guild_registrar.lua
index 44c1459d..62955cf4 100644
--- a/skins/blizzard/guild_registrar.lua
+++ b/skins/blizzard/guild_registrar.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Guild Registrar", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Guild Registrar", "vanilla", function ()
StripTextures(GuildRegistrarFrame)
StripTextures(GuildRegistrarGreetingFrame)
CreateBackdrop(GuildRegistrarFrame, nil, nil, .75)
diff --git a/skins/blizzard/help.lua b/skins/blizzard/help.lua
index 54413aa1..b47060b7 100644
--- a/skins/blizzard/help.lua
+++ b/skins/blizzard/help.lua
@@ -1,19 +1,7 @@
-pfUI:RegisterSkin("Help", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Help", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
- -- not much here for tbc yet
- if pfUI.client > 11200 then
- local ticket, background = TicketStatusFrame:GetChildren()
- CreateBackdrop(background, nil, true, .75)
- TicketStatusFrame:SetHeight(40)
- TicketStatusFrame:ClearAllPoints()
- TicketStatusFrame:SetPoint("TOP", 0, -5)
-
- UpdateMovable(TicketStatusFrame)
- return
- end
-
StripTextures(HelpFrame)
CreateBackdrop(HelpFrame, nil, nil, .75)
CreateBackdropShadow(HelpFrame)
diff --git a/skins/blizzard/inspect.lua b/skins/blizzard/inspect.lua
index b81609c3..cbbc39b4 100644
--- a/skins/blizzard/inspect.lua
+++ b/skins/blizzard/inspect.lua
@@ -20,111 +20,6 @@ local slots = {
"RangedSlot",
}
-pfUI:RegisterSkin("Inspect", "tbc", function ()
- local rawborder, border = GetBorderSize()
- local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-
- HookAddonOrVariable("Blizzard_InspectUI", function()
- CreateBackdrop(InspectFrame, nil, nil, .75)
- CreateBackdropShadow(InspectFrame)
-
- InspectFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
- InspectFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72)
- InspectFrame:SetHitRectInsets(10,30,10,72)
- EnableMovable("InspectFrame", "Blizzard_InspectUI", INSPECTFRAME_SUBFRAMES)
-
- SkinCloseButton(InspectFrameCloseButton, InspectFrame.backdrop, -6, -6)
-
- InspectFrame:DisableDrawLayer("ARTWORK")
-
- InspectNameText:ClearAllPoints()
- InspectNameText:SetPoint("TOP", InspectFrame.backdrop, "TOP", 0, -10)
- InspectGuildText:Show()
- InspectGuildText:ClearAllPoints()
- InspectGuildText:SetPoint("TOP", InspectLevelText, "BOTTOM", 0, -1)
-
- for i = 1, 3 do
- local tab = _G["InspectFrameTab"..i]
- local lastTab = _G["InspectFrameTab"..(i-1)]
- tab:ClearAllPoints()
- if lastTab then
- tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
- else
- tab:SetPoint("TOPLEFT", InspectFrame.backdrop, "BOTTOMLEFT", bpad, -(border + (border == 1 and 1 or 2)))
- end
- SkinTab(tab)
- end
-
- do -- Character Tab
- StripTextures(InspectPaperDollFrame)
-
- EnableClickRotate(InspectModelFrame)
- InspectModelRotateLeftButton:Hide()
- InspectModelRotateRightButton:Hide()
-
- for _, slot in pairs(slots) do
- local frame = _G["Inspect"..slot]
- SkinButton(frame, nil, nil, nil, _G["Inspect"..slot.."IconTexture"], true)
- end
-
- hooksecurefunc("InspectPaperDollFrame_OnShow", function()
- local guild, title = GetGuildInfo(InspectFrame.unit)
- local text = guild and format(TEXT(GUILD_TITLE_TEMPLATE), title, guild) or ""
- InspectGuildText:SetText(text)
- end)
-
- hooksecurefunc("InspectPaperDollItemSlotButton_Update", function(button)
- local unit = InspectFrame.unit
- local link = GetInventoryItemLink(unit, button:GetID())
- if link then
- local quality = select(3, GetItemInfo(link))
- button:SetBackdropBorderColor(GetItemQualityColor(quality))
- else
- button:SetBackdropBorderColor(pfUI.cache.er, pfUI.cache.eg, pfUI.cache.eb, pfUI.cache.ea)
- end
- end)
- end
-
- do -- PVP Tab
- StripTextures(InspectPVPFrame)
- end
-
- do -- Talent Tab
- StripTextures(InspectTalentFrame)
- InspectTalentFrameCancelButton:Hide()
- InspectTalentFrameCloseButton:Hide()
-
- InspectTalentFrameSpentPoints:ClearAllPoints()
- InspectTalentFrameSpentPoints:SetPoint("BOTTOMRIGHT", InspectTalentFrame, "BOTTOMRIGHT", 0, 83)
-
- StripTextures(InspectTalentFrameScrollFrame)
- SkinScrollbar(InspectTalentFrameScrollFrameScrollBar)
-
- for i = 1, MAX_NUM_TALENTS do
- local talent = _G["InspectTalentFrameTalent"..i]
- if talent then
- StripTextures(talent)
- SkinButton(talent, nil, nil, nil, _G["InspectTalentFrameTalent"..i.."IconTexture"])
-
- _G["InspectTalentFrameTalent"..i.."Rank"]:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
- end
- end
-
- for i = 1, 3 do
- local tab = _G["InspectTalentFrameTab"..i]
- local lastTab = _G["InspectTalentFrameTab"..(i-1)]
- tab:ClearAllPoints()
- if lastTab then
- tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
- else
- tab:SetPoint("TOPLEFT", 70, -50)
- end
- SkinTab(tab)
- end
- end
- end)
-end)
-
pfUI:RegisterSkin("Inspect", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/itemtext.lua b/skins/blizzard/itemtext.lua
index 2455919a..568901d9 100644
--- a/skins/blizzard/itemtext.lua
+++ b/skins/blizzard/itemtext.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Books", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Books", "vanilla", function ()
StripTextures(ItemTextFrame)
CreateBackdrop(ItemTextFrame, nil, nil, .75)
CreateBackdropShadow(ItemTextFrame)
diff --git a/skins/blizzard/keybindings.lua b/skins/blizzard/keybindings.lua
index 049aac20..9b570b88 100644
--- a/skins/blizzard/keybindings.lua
+++ b/skins/blizzard/keybindings.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("KeyBindings", "vanilla:tbc", function ()
+pfUI:RegisterSkin("KeyBindings", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/macro.lua b/skins/blizzard/macro.lua
index 890ad6bc..efe4c582 100644
--- a/skins/blizzard/macro.lua
+++ b/skins/blizzard/macro.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Macro", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Macro", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/mail.lua b/skins/blizzard/mail.lua
index 861c7d1f..8830e0fe 100644
--- a/skins/blizzard/mail.lua
+++ b/skins/blizzard/mail.lua
@@ -1,53 +1,10 @@
-pfUI:RegisterSkin("Mailbox", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Mailbox", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
- -- Compatibility
local StationeryBackgroundLeft, StationeryBackgroundRight
- if ATTACHMENTS_MAX_SEND then -- tbc
- do -- SendMailFrame
- for i = 1, ATTACHMENTS_MAX_SEND do
- local btn = _G["SendMailAttachment"..i]
- StripTextures(btn)
- SkinButton(btn, nil, nil, nil, nil, true)
- end
- hooksecurefunc("SendMailFrame_Update", function()
- for i = 1, ATTACHMENTS_MAX_SEND do
- local btn = _G["SendMailAttachment"..i]
- HandleIcon(btn, btn:GetNormalTexture())
-
- local link = GetSendMailItemLink(i)
- if link then
- local r,g,b = GetItemQualityColor(select(3, GetItemInfo(link)))
- btn:SetBackdropBorderColor(r,g,b,1)
- else
- btn:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
- end
- end
- end)
-
- StationeryBackgroundLeft, StationeryBackgroundRight = SendStationeryBackgroundLeft, SendStationeryBackgroundRight
- end
-
- do -- OpenMailFrame
- for i = 1, ATTACHMENTS_MAX_RECEIVE do
- SkinButton(_G["OpenMailAttachmentButton"..i], nil, nil, nil, _G["OpenMailAttachmentButton"..i.."IconTexture"], true)
- end
-
- hooksecurefunc("InboxFrame_OnClick", function(index)
- for i=1, ATTACHMENTS_MAX_RECEIVE do
- local link = GetInboxItemLink(index, i)
- if not link then return end
- local r,g,b = GetItemQualityColor(select(3, GetItemInfo(link)))
- _G["OpenMailAttachmentButton"..i]:SetBackdropBorderColor(r,g,b,1)
- end
- end)
-
- SkinButton(OpenMailReportSpamButton)
- end
- else -- vanilla
- do -- SendMailFrame
+ do -- SendMailFrame
local skin = CreateFrame("Frame")
skin:SetScript("OnEvent", function()
this:UnregisterEvent("MAIL_SHOW")
@@ -122,7 +79,6 @@ pfUI:RegisterSkin("Mailbox", "vanilla:tbc", function ()
end
end)
end
- end
StripTextures(MailFrame, true)
CreateBackdrop(MailFrame, nil, nil, .75)
diff --git a/skins/blizzard/merchant.lua b/skins/blizzard/merchant.lua
index ccceba7e..084285cf 100644
--- a/skins/blizzard/merchant.lua
+++ b/skins/blizzard/merchant.lua
@@ -1,21 +1,9 @@
-pfUI:RegisterSkin("Merchant", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Merchant", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
- -- Compatibility
- if MerchantGuildBankRepairButton then -- tbc
- SkinButton(MerchantGuildBankRepairButton, nil, nil, nil, MerchantGuildBankRepairButtonIcon)
- MerchantGuildBankRepairButtonIcon:SetTexCoord(.59, .82, .06, .54)
- hooksecurefunc("MerchantFrame_UpdateRepairButtons", function()
- MerchantGuildBankRepairButton:ClearAllPoints()
- MerchantGuildBankRepairButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -14, 0)
- MerchantRepairAllButton:ClearAllPoints()
- MerchantRepairAllButton:SetPoint("RIGHT", MerchantGuildBankRepairButton, "LEFT", -6, 0)
- end)
- else -- vanilla
- MerchantRepairAllButton:ClearAllPoints()
- MerchantRepairAllButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -6, 0)
- end
+ MerchantRepairAllButton:ClearAllPoints()
+ MerchantRepairAllButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -6, 0)
StripTextures(MerchantFrame)
CreateBackdrop(MerchantFrame, nil, nil, .75)
diff --git a/skins/blizzard/miscellaneous.lua b/skins/blizzard/miscellaneous.lua
index ea67ac3b..2af1e4de 100644
--- a/skins/blizzard/miscellaneous.lua
+++ b/skins/blizzard/miscellaneous.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Stack Split", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Stack Split", "vanilla", function ()
StripTextures(StackSplitFrame)
CreateBackdrop(StackSplitFrame, nil, nil, .75)
CreateBackdropShadow(StackSplitFrame)
@@ -7,7 +7,7 @@ pfUI:RegisterSkin("Stack Split", "vanilla:tbc", function ()
SkinButton(StackSplitCancelButton)
end)
-pfUI:RegisterSkin("Coin Pickup", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Coin Pickup", "vanilla", function ()
StripTextures(CoinPickupFrame)
CreateBackdrop(CoinPickupFrame, nil, nil, .75)
CreateBackdropShadow(CoinPickupFrame)
@@ -16,7 +16,7 @@ pfUI:RegisterSkin("Coin Pickup", "vanilla:tbc", function ()
SkinButton(CoinPickupCancelButton)
end)
-pfUI:RegisterSkin("Color Picker", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Color Picker", "vanilla", function ()
CreateBackdrop(ColorPickerFrame)
CreateBackdropShadow(ColorPickerFrame)
@@ -32,7 +32,7 @@ pfUI:RegisterSkin("Color Picker", "vanilla:tbc", function ()
SkinSlider(OpacitySliderFrame)
end)
-pfUI:RegisterSkin("Opacity", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Opacity", "vanilla", function ()
CreateBackdrop(OpacityFrame, nil, true, .75)
CreateBackdropShadow(OpacityFrame)
@@ -41,7 +41,7 @@ pfUI:RegisterSkin("Opacity", "vanilla:tbc", function ()
OpacityFrameSlider:SetPoint("CENTER", 0, 0)
end)
-pfUI:RegisterSkin("Tutorial", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Tutorial", "vanilla", function ()
CreateBackdrop(TutorialFrame, nil, true, .75)
CreateBackdropShadow(TutorialFrame)
@@ -49,7 +49,7 @@ pfUI:RegisterSkin("Tutorial", "vanilla:tbc", function ()
SkinButton(TutorialFrameOkayButton)
end)
-pfUI:RegisterSkin("Quest Timer", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Quest Timer", "vanilla", function ()
CreateBackdrop(QuestTimerFrame, nil, nil, .75)
CreateBackdropShadow(QuestTimerFrame)
UpdateMovable(QuestTimerFrame, true)
diff --git a/skins/blizzard/options-sound.lua b/skins/blizzard/options-sound.lua
index 341486ab..257d4023 100644
--- a/skins/blizzard/options-sound.lua
+++ b/skins/blizzard/options-sound.lua
@@ -1,40 +1,18 @@
-pfUI:RegisterSkin("Options - Sound", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Options - Sound", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
- -- Compatibility
- local SoundOptionsFrameHeaderText, NUM_CHECKBOXES, NUM_SLIDERS
- if SOUND_OPTIONS then -- tbc
- SoundOptionsFrameHeaderText = GetNoNameObject(SoundOptionsFrame, "FontString", "BACKGROUND", SOUND_OPTIONS)
- NUM_CHECKBOXES = 11
- NUM_SLIDERS = 6
+ local SoundOptionsFrameHeaderText = GetNoNameObject(SoundOptionsFrame, "FontString", "ARTWORK", SOUNDOPTIONS_MENU)
+ local NUM_CHECKBOXES = 8
+ local NUM_SLIDERS = 4
- StripTextures(AudioOptionsFrame)
- CreateBackdrop(SoundOptionsFramePlayback, nil, true, .75)
- CreateBackdrop(SoundOptionsFrameHardware, nil, true, .75)
- CreateBackdrop(SoundOptionsFrameVolume, nil, true, .75)
-
- SkinDropDown(SoundOptionsOutputDropDown)
-
- SoundOptionsFrameDefaults:ClearAllPoints()
- SoundOptionsFrameDefaults:SetPoint("TOPLEFT", SoundOptionsFramePlayback, "BOTTOMLEFT", 0, -10)
- SoundOptionsFrameCancel:ClearAllPoints()
- SoundOptionsFrameCancel:SetPoint("TOPRIGHT", SoundOptionsFrameVolume, "BOTTOMRIGHT", 0, -10)
- SoundOptionsFrameOkay:ClearAllPoints()
- SoundOptionsFrameOkay:SetPoint("RIGHT", SoundOptionsFrameCancel, "LEFT", -2*bpad, 0)
- else -- vanilla
- SoundOptionsFrameHeaderText = GetNoNameObject(SoundOptionsFrame, "FontString", "ARTWORK", SOUNDOPTIONS_MENU)
- NUM_CHECKBOXES = 8
- NUM_SLIDERS = 4
-
- SoundOptionsFrameOkay:ClearAllPoints()
- SoundOptionsFrameOkay:SetPoint("RIGHT", SoundOptionsFrameCancel, "LEFT", -2*bpad, 0)
- SoundOptionsFrameSlider1:ClearAllPoints()
- SoundOptionsFrameSlider1:SetPoint("TOPRIGHT", SoundOptionsFrame, "TOPRIGHT", -18, -43)
- for i=2, NUM_SLIDERS do
- _G["SoundOptionsFrameSlider"..i]:ClearAllPoints()
- _G["SoundOptionsFrameSlider"..i]:SetPoint("TOP", _G["SoundOptionsFrameSlider"..i-1], "BOTTOM", 0, -30)
- end
+ SoundOptionsFrameOkay:ClearAllPoints()
+ SoundOptionsFrameOkay:SetPoint("RIGHT", SoundOptionsFrameCancel, "LEFT", -2*bpad, 0)
+ SoundOptionsFrameSlider1:ClearAllPoints()
+ SoundOptionsFrameSlider1:SetPoint("TOPRIGHT", SoundOptionsFrame, "TOPRIGHT", -18, -43)
+ for i=2, NUM_SLIDERS do
+ _G["SoundOptionsFrameSlider"..i]:ClearAllPoints()
+ _G["SoundOptionsFrameSlider"..i]:SetPoint("TOP", _G["SoundOptionsFrameSlider"..i-1], "BOTTOM", 0, -30)
end
StripTextures(SoundOptionsFrame)
diff --git a/skins/blizzard/options-video.lua b/skins/blizzard/options-video.lua
index 70c7e325..853bdcb0 100644
--- a/skins/blizzard/options-video.lua
+++ b/skins/blizzard/options-video.lua
@@ -1,45 +1,19 @@
-pfUI:RegisterSkin("Options - Video", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Options - Video", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
- -- Compatibility
- local MAX_SLIDERS, MAX_CHECKBOXES
- if OptionsFrameSlider10 then -- tbc
- MAX_SLIDERS = 11
- MAX_CHECKBOXES = 19
+ local MAX_SLIDERS = 9
+ local MAX_CHECKBOXES = 18
- for i=1, MAX_SLIDERS do
- local slider = _G["OptionsFrameSlider"..i]
- local shift = 0
- if i == 4 or i == 5 or i == 7 or i == 8 or i == 10 or i == 11 then shift = 10 end
- local point, anchor, anchorPoint, x, y = slider:GetPoint()
- slider:ClearAllPoints()
- slider:SetPoint(point, anchor, anchorPoint, x, y - shift)
- end
-
- hooksecurefunc("OptionsFrame_Load", function()
- OptionsFramePixelShaders:SetWidth(230)
- OptionsFrameMiscellaneous:ClearAllPoints()
- OptionsFrameMiscellaneous:SetPoint("LEFT", OptionsFramePixelShaders, "RIGHT", 6, 0)
- end)
- OptionsFrameDefaults:ClearAllPoints()
- OptionsFrameDefaults:SetPoint("TOPLEFT", OptionsFramePixelShaders, "BOTTOMLEFT", 0, -10)
- OptionsFrameCancel:ClearAllPoints()
- OptionsFrameCancel:SetPoint("TOPRIGHT", OptionsFrameMiscellaneous, "BOTTOMRIGHT", 0, -10)
- else -- vanilla
- MAX_SLIDERS = 9
- MAX_CHECKBOXES = 18
-
- for i=1, MAX_SLIDERS do
- local slider = _G["OptionsFrameSlider"..i]
- local shift = 0
- if i == 1 or i == 6 then shift = 4
- elseif i == 4 or i == 8 then shift = 10
- end
- local point, anchor, anchorPoint, x, y = slider:GetPoint()
- slider:ClearAllPoints()
- slider:SetPoint(point, anchor, anchorPoint, x, y - shift)
+ for i=1, MAX_SLIDERS do
+ local slider = _G["OptionsFrameSlider"..i]
+ local shift = 0
+ if i == 1 or i == 6 then shift = 4
+ elseif i == 4 or i == 8 then shift = 10
end
+ local point, anchor, anchorPoint, x, y = slider:GetPoint()
+ slider:ClearAllPoints()
+ slider:SetPoint(point, anchor, anchorPoint, x, y - shift)
end
CreateBackdrop(OptionsFrame, nil, nil, .75)
diff --git a/skins/blizzard/popup_dialogs.lua b/skins/blizzard/popup_dialogs.lua
index d795a7bf..fc3aed02 100644
--- a/skins/blizzard/popup_dialogs.lua
+++ b/skins/blizzard/popup_dialogs.lua
@@ -1,12 +1,5 @@
-pfUI:RegisterSkin("Popup Dialogs", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Popup Dialogs", "vanilla", function ()
for i = 1, STATICPOPUP_NUMDIALOGS do
- -- Compatibility
- local money = _G["StaticPopup"..i.."MoneyInputFrame"]
- if money then -- tbc
- SkinMoneyInputFrame(money)
- end
-
-
local dialog = _G["StaticPopup"..i]
CreateBackdrop(dialog, nil, true, .75)
CreateBackdropShadow(dialog)
diff --git a/skins/blizzard/professions.lua b/skins/blizzard/professions.lua
index eab6d31e..bbd266d1 100644
--- a/skins/blizzard/professions.lua
+++ b/skins/blizzard/professions.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Profession", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Profession", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
@@ -219,37 +219,7 @@ pfUI:RegisterSkin("Profession", "vanilla:tbc", function ()
end)
end
- -- Compatibility
- if search then -- tbc
- _G[displayed] = 21
- scrollframe:SetHeight(338)
-
- local rank = _G[name.."RankFrameSkillRank"]
- rank:ClearAllPoints()
- rank:SetPoint("CENTER", rankbar, "CENTER", 0, 0)
-
- local available = _G[frame:GetName().."AvailableFilterCheckButton"]
- SkinCheckbox(available)
- available:ClearAllPoints()
- available:SetPoint("TOPLEFT", scrollframe.backdrop, "BOTTOMLEFT", -4, -5)
-
- search:DisableDrawLayer("BACKGROUND")
- CreateBackdrop(search, nil, nil, 1)
- search.backdrop:SetAllPoints(search)
- search:SetTextInsets(5, 5, 5, 5)
- search:SetHeight(22)
- search:ClearAllPoints()
- search:SetPoint("TOPRIGHT", scrollframe.backdrop, "BOTTOMRIGHT", 0, -5)
-
- local craft_filter = CraftFrameFilterDropDown
- if craft_filter then
- SkinDropDown(craft_filter)
- craft_filter:ClearAllPoints()
- craft_filter:SetPoint("BOTTOMRIGHT", scrollframe.backdrop, "TOPRIGHT", 15, 0)
- end
- else -- vanilla
- _G[displayed] = 23
- end
+ _G[displayed] = 23
-- build remaining tradeskills
for i = 9, _G[displayed] do
local button = _G[template..i] or CreateFrame("Button", template..i, frame, template.."ButtonTemplate")
diff --git a/skins/blizzard/questlog.lua b/skins/blizzard/questlog.lua
index 23b4d0e8..748b2fb9 100644
--- a/skins/blizzard/questlog.lua
+++ b/skins/blizzard/questlog.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Quest Log", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Quest Log", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
@@ -6,23 +6,10 @@ pfUI:RegisterSkin("Quest Log", "vanilla:tbc", function ()
_G.MAX_WATCHABLE_QUESTS = 20 -- TODO
do -- quest log frame
- -- Compatibility
- local QUEST_COUNT
- if QuestLogCount then -- tbc
- QUEST_COUNT = QuestLogCount
+ local QUEST_COUNT = QuestLogQuestCount
- StripTextures(QUEST_COUNT)
- QUEST_COUNT:ClearAllPoints()
- hooksecurefunc("QuestLogUpdateQuestCount", function(numQuests)
- QUEST_COUNT:ClearAllPoints()
- QUEST_COUNT:SetPoint("BOTTOMRIGHT", QuestLogFrame, "TOPRIGHT", 0, -50)
- end)
- else -- vanilla
- QUEST_COUNT = QuestLogQuestCount
-
- QUEST_COUNT:ClearAllPoints()
- QUEST_COUNT:SetPoint("TOPRIGHT", -10, -30)
- end
+ QUEST_COUNT:ClearAllPoints()
+ QUEST_COUNT:SetPoint("TOPRIGHT", -10, -30)
hooksecurefunc("QuestLog_OnShow", function()
QuestLogFrame:ClearAllPoints()
diff --git a/skins/blizzard/readycheck.lua b/skins/blizzard/readycheck.lua
index 51ec176b..0d21ec89 100644
--- a/skins/blizzard/readycheck.lua
+++ b/skins/blizzard/readycheck.lua
@@ -1,12 +1,6 @@
-pfUI:RegisterSkin("Readycheck", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Readycheck", "vanilla", function ()
HookAddonOrVariable("Blizzard_RaidUI", function()
- -- Compatibility
- local update_func
- if ReadyCheckFrame_OnUpdate then -- tbc
- update_func = "ReadyCheckFrame_OnUpdate"
- else -- vanilla
- update_func = "ReadyCheck_OnUpdate"
- end
+ local update_func = "ReadyCheck_OnUpdate"
StripTextures(ReadyCheckFrame, true)
CreateBackdrop(ReadyCheckFrame, nil, nil, .75)
diff --git a/skins/blizzard/spellbook.lua b/skins/blizzard/spellbook.lua
index e28383c3..db5bf427 100644
--- a/skins/blizzard/spellbook.lua
+++ b/skins/blizzard/spellbook.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Spellbook", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Spellbook", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/stable.lua b/skins/blizzard/stable.lua
index 9e6e7a52..fdf6f7f1 100644
--- a/skins/blizzard/stable.lua
+++ b/skins/blizzard/stable.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Pet Stable Master", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Pet Stable Master", "vanilla", function ()
StripTextures(PetStableFrame)
CreateBackdrop(PetStableFrame, nil, nil, .75)
CreateBackdropShadow(PetStableFrame)
diff --git a/skins/blizzard/tabard.lua b/skins/blizzard/tabard.lua
index e8e48c21..46efde05 100644
--- a/skins/blizzard/tabard.lua
+++ b/skins/blizzard/tabard.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Guild Tabard", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Guild Tabard", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/talents.lua b/skins/blizzard/talents.lua
index f26e5a4c..11c9370a 100644
--- a/skins/blizzard/talents.lua
+++ b/skins/blizzard/talents.lua
@@ -1,16 +1,10 @@
-pfUI:RegisterSkin("Talents", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Talents", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddonOrVariable("Blizzard_TalentUI", function()
- -- Compatibility
- local TALENT_FRAME, TALENT_FRAME_NAME
- if PlayerTalentFrame then -- tbc
- TALENT_FRAME = _G.PlayerTalentFrame
- else -- vanilla
- TALENT_FRAME = _G.TalentFrame
- end
- TALENT_FRAME_NAME = TALENT_FRAME:GetName()
+ local TALENT_FRAME = _G.TalentFrame
+ local TALENT_FRAME_NAME = TALENT_FRAME:GetName()
StripTextures(TALENT_FRAME)
diff --git a/skins/blizzard/taxi.lua b/skins/blizzard/taxi.lua
index fac03ade..79a7bc36 100644
--- a/skins/blizzard/taxi.lua
+++ b/skins/blizzard/taxi.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Flightmaster", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Flightmaster", "vanilla", function ()
StripTextures(TaxiFrame)
CreateBackdrop(TaxiFrame, nil, nil, .75)
CreateBackdropShadow(TaxiFrame)
diff --git a/skins/blizzard/tooltips.lua b/skins/blizzard/tooltips.lua
index c050c541..d1195ee8 100644
--- a/skins/blizzard/tooltips.lua
+++ b/skins/blizzard/tooltips.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Tooltips", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Tooltips", "vanilla", function ()
local rawborder, border = GetBorderSize()
local alpha = tonumber(C.tooltip.alpha)
diff --git a/skins/blizzard/trade.lua b/skins/blizzard/trade.lua
index fd6237d6..fe0a9e4c 100644
--- a/skins/blizzard/trade.lua
+++ b/skins/blizzard/trade.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Trade", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Trade", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
diff --git a/skins/blizzard/trainer.lua b/skins/blizzard/trainer.lua
index 62df6005..e752f7bb 100644
--- a/skins/blizzard/trainer.lua
+++ b/skins/blizzard/trainer.lua
@@ -1,4 +1,4 @@
-pfUI:RegisterSkin("Trainer", "vanilla:tbc", function ()
+pfUI:RegisterSkin("Trainer", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
From 921a5833fa73cdf31a7ecf1aad0b17bc818848a6 Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 12:55:51 +0100
Subject: [PATCH 12/13] Update pfUI.toc
---
pfUI.toc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pfUI.toc b/pfUI.toc
index 72c42fa4..187f4a22 100644
--- a/pfUI.toc
+++ b/pfUI.toc
@@ -3,7 +3,7 @@
## Author: Shagu
## Notes: A complete user interface replacement.
## Notes-ruRU: Полная замена пользовательского интерфейса.
-## Version: 5.5.4
+## Version: 5.5.5
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
From 5e44fcd2d32690c0abe7624569562f71202247d3 Mon Sep 17 00:00:00 2001
From: Meow <30401521+me0wg4ming@users.noreply.github.com>
Date: Sat, 3 Jan 2026 15:21:37 +0100
Subject: [PATCH 13/13] nameplate color fix
nameplate color fix
---
modules/nameplates.lua | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/nameplates.lua b/modules/nameplates.lua
index ce25a161..cb926b50 100644
--- a/modules/nameplates.lua
+++ b/modules/nameplates.lua
@@ -2,6 +2,9 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
-- disable original castbars
pcall(SetCVar, "ShowVKeyCastbar", 0)
+ -- check for SuperWoW support
+ local superwow_active = HasSuperWoW()
+
local unitcolors = {
["ENEMY_NPC"] = { .9, .2, .3, .8 },
["NEUTRAL_NPC"] = { 1, 1, .3, .8 },