14 Commits

Author SHA1 Message Date
Brues c994d00596 Toggle bagslots visibility via SetShown
Replace explicit if/else calling :Hide()/:Show() with :SetShown(not IsShown())
2026-07-31 13:22:17 -05:00
Brues 4be680183a Use GetSize/SetSize for size operations
Replace separate GetWidth/GetHeight and SetWidth/SetHeight calls with GetSize/SetSize for consistency and brevity. Updated modules: addonbuttons (store size via GetSize), chatcopy (use SetSize), easteregg (use SetSize for explosions), farmmode (use GetSize/SetSize when adjusting map size), and game_menu (use GetSize/SetSize when resizing frame).
2026-07-30 14:29:30 -05:00
Brues 2352f1c6ed Use GetSize/SetSize for map frame and buttons
Replace separate GetWidth/GetHeight and SetWidth/SetHeight calls with GetSize and SetSize in modules/map.lua.
2026-07-30 14:11:34 -05:00
Brues 305ff6c86e Collapse frameState.hasTarget into targetGuid
hasTarget was always snapshotted alongside targetGuid (UnitExists("target")
next to UnitGUID("target")), so it was just targetGuid ~= nil. Drop the
field and derive it from targetGuid at both read sites; remove the now-unused
UnitExists perf-cache local.
2026-07-30 13:45:53 -05:00
Brues a8b131898b Event-drive nameplate target state; drop per-tick poll and targetPlateGuid
frameState.hasTarget/targetGuid were polled via UnitExists("target") every
central-loop tick, while targetPlateGuid held the same guid but was already
event-driven -- redundant. Set frameState target fields in PLAYER_TARGET_CHANGED
(seeded on PLAYER_ENTERING_WORLD for a target held across reload), remove the
poll, and collapse targetPlateGuid into frameState.targetGuid (the castbar
frame now reads that). The central loop's only remaining per-tick poll is
GetTime().
2026-07-30 11:59:56 -05:00
Brues 1f9be33772 Use GetStringColorObject for buffbar colors; numeric border check
Store the buffbar color/bordercolor/textcolor as cached read-only ColorMixins
via GetStringColorObject instead of building per-bar {r,g,b,a} tables from
GetStringColor. These color tables are only ever read (SetStatusBarColor /
SetTextColor / the border check), so sharing the cached objects is safe and
drops the intermediate locals and per-bar allocations.

GetStringColorObject's components are numbers, so fix CreateBuffBarFrame's
border check from ~= "0" (string) to ~= 0.
2026-07-30 02:44:56 -05:00
Brues a798e67b7f Use GetStringColor for buffbar color parsing
Route the three buffbar color config splits through GetStringColor (cached)
instead of bare strsplit. GetStringColor returns strings, so this is
behavior-preserving -- including the bordercolor ~= "0" check in
CreateBuffBarFrame -- and just adds the shared color cache and consistency
with the rest of the codebase.
2026-07-30 02:39:56 -05:00
Brues 8b87e30266 Revert GetStringColor to strings; keep object numeric; tidy cmatch
- GetStringColor returns strings again (its lifelong contract). The earlier
  numeric conversion was a return-type change that could break any caller
  doing string comparisons on components (e.g. buffwatch's `~= "0"`); every
  caller was written against strings and color setters coerce, so reverting
  is the safe fix without a codebase-wide audit.
- GetStringColorObject now tonumbers its own inputs, so its ColorMixin stays
  numerically correct (GenerateHexColor/IsEqualTo) independent of the above.
- cmatch: move its a-e / va-ve / ra-re scratch out of module scope into clear
  function-locals (idx*/val*/out*). Strict 1:1 rename, logic unchanged; also
  drops the shared-upvalue reentrancy concern.
2026-07-30 02:39:16 -05:00
Brues f68b14e53b Use SetSize instead of SetWidth/SetHeight
Replaced numerous SetWidth/SetHeight calls with SetSize for consistency and brevity across UI code. Touched api/ui-widgets.lua, api/unitframes.lua and multiple modules (actionbar, addonbuttons, addons, afkcam, autovendor, bags, bgscore, buff, buffwatch, nameplates). Also simplified some sizing math in buff module. No functional behavior intended to change — code modernization only.
2026-07-30 02:27:03 -05:00
Brues 8ab6fab04f Event-drive nameplate mouseover via UPDATE_MOUSEOVER_UNIT
ClassicAPI polyfills UPDATE_MOUSEOVER_UNIT to fire on mouseover loss as well
as gain (src/unit/Mouseover.cpp), so the per-tick UnitGUID("mouseover") poll
in the central loop is no longer needed. Update frameState.mouseoverGuid on
the event and flag just the plates losing/gaining hover (via plateByGuid,
which holds overlays) for an immediate refresh.
2026-07-30 02:01:10 -05:00
Brues 6d1bfe805e Use UnitClassBase for class detection 2026-07-30 01:26:29 -05:00
Brues 838f7f5d25 guard against nil units
UPDATE_MOUSEOVER_UNIT can fire when unit is dropped now so guard against that
2026-07-30 01:20:50 -05:00
Brues fad078fa87 Drop dead GUID-label branch in unit frame OnEnter
No unit frame ever has a GUID label -- CreateUnitFrame is only ever called
with fixed type names (Player/Target/Focus/Party/Raid/...), and .label is only
ever assigned those. The string.find(this.label, "^0x") branch was a leftover
from an older focus implementation; focus now uses the real "focus" unit
token, so OnEnter always resolves the mouseover via the normal unitstr path.
2026-07-30 01:09:53 -05:00
Brues 48d76138ed Iterate active nameplates only; fix global eventcache propagation
- The central OnUpdate looped the entire plate pool (registry) every tick with
  an IsVisible guard. Maintain a visiblePlates set via NAME_PLATE_UNIT_ADDED/
  _REMOVED and iterate that instead, so hidden pool slots aren't touched. The
  IsVisible guard stays as a safety net.
- Fix the global refresh propagation: it set .eventcache on the base frame,
  but OnUpdate reads/clears it on the overlay (nameplate) -- so the propagation
  was a no-op and global refreshes (e.g. target-change alpha/strata) fell
  through to the 0.5s catch-all timer. Set plate.nameplate.eventcache and scope
  to visiblePlates, so those refreshes land on the next tick as intended.

OnConfigChange still iterates the full registry (hidden plates must pick up
config changes before they next show).
2026-07-29 23:43:27 -05:00
32 changed files with 193 additions and 268 deletions
+15 -19
View File
@@ -231,7 +231,7 @@ end
-- unit [string] the unitstring
-- return: [table] string, r, g, b
function pfUI.api.GetUnitColor(unitstr)
local _, class = UnitClass(unitstr)
local class = UnitClassBase(unitstr)
local classColor = PFUI_CLASS_COLORS[class]
return classColor:GenerateHexColorMarkup(), classColor:GetRGB()
end
@@ -377,22 +377,20 @@ end
-- 'str' [string] input string that should be matched
-- 'pat' [string] unformatted pattern
-- returns: [strings] matched string in capture order
local a, b, c, d, e
local _, va, vb, vc, vd, ve
local ra, rb, rc, rd, re
function pfUI.api.cmatch(str, pat)
-- read capture indexes
a, b, c, d, e = GetCaptures(pat)
_, _, va, vb, vc, vd, ve = string.find(str, pfUI.api.SanitizePattern(pat))
-- idx* = the logical %N index of each physical capture slot (nil when the
-- pattern has no %N$ markers); val* = the matched values in physical order.
local idx1, idx2, idx3, idx4, idx5 = GetCaptures(pat)
local _, _, val1, val2, val3, val4, val5 = string.find(str, pfUI.api.SanitizePattern(pat))
-- put entries into the proper return values
ra = e == 1 and ve or d == 1 and vd or c == 1 and vc or b == 1 and vb or va
rb = e == 2 and ve or d == 2 and vd or c == 2 and vc or a == 2 and va or vb
rc = e == 3 and ve or d == 3 and vd or a == 3 and va or b == 3 and vb or vc
rd = e == 4 and ve or a == 4 and va or c == 4 and vc or b == 4 and vb or vd
re = a == 5 and va or d == 5 and vd or c == 5 and vc or b == 5 and vb or ve
-- reorder the physical matches into logical (%1..%5) order
local out1 = idx5 == 1 and val5 or idx4 == 1 and val4 or idx3 == 1 and val3 or idx2 == 1 and val2 or val1
local out2 = idx5 == 2 and val5 or idx4 == 2 and val4 or idx3 == 2 and val3 or idx1 == 2 and val1 or val2
local out3 = idx5 == 3 and val5 or idx4 == 3 and val4 or idx1 == 3 and val1 or idx2 == 3 and val2 or val3
local out4 = idx5 == 4 and val5 or idx1 == 4 and val1 or idx3 == 4 and val3 or idx2 == 4 and val2 or val4
local out5 = idx1 == 5 and val1 or idx4 == 5 and val4 or idx3 == 5 and val3 or idx2 == 5 and val2 or val5
return ra, rb, rc, rd, re
return out1, out2, out3, out4, out5
end
-- [ GetItemLinkByName ]
@@ -997,13 +995,10 @@ end
-- [ GetStringColor ]
-- Queries the pfUI setting strings and extract its color codes
-- returns r,g,b,a as numbers
-- returns r,g,b,a as strings
local color_cache = setmetatable({}, {
__index = function(t, k)
local color = { pfUI.api.strsplit(",", k) }
for i = 1, table.getn(color) do
color[i] = tonumber(color[i])
end
rawset(t, k, color)
return color
end
@@ -1018,7 +1013,8 @@ end
-- returns a ColorMixin
local color_object_cache = setmetatable({}, {
__index = function(t, k)
local color = CreateColor(pfUI.api.GetStringColor(k))
local r,g,b,a = pfUI.api.GetStringColor(k)
local color = CreateColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
rawset(t, k, color)
return color
end
+1 -2
View File
@@ -895,8 +895,7 @@ function pfUI.api.SkinDropDown(frame, cr, cg, cb, useSmall)
CreateBackdrop(button)
button.backdrop:ClearAllPoints()
button.backdrop:SetWidth(18)
button.backdrop:SetHeight(18)
button.backdrop:SetSize(18, 18)
button.backdrop:SetPoint("RIGHT", frame.backdrop, "RIGHT", -2, 0)
if not button.icon then
+15 -30
View File
@@ -397,8 +397,7 @@ function pfUI.uf:UpdateConfig()
f.power:ClearAllPoints()
f.power:SetPoint(f.config.panchor, f.hp, relative_point, f.config.poffx, -2 * default_border - spacing + f.config.poffy * GetPerfectPixel())
f.power:SetWidth((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width))
f.power:SetHeight(f.config.pheight)
f.power:SetSize((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width), f.config.pheight)
if tonumber(f.config.pheight) < 0 then f.power:Hide() end
pfUI.api.CreateBackdrop(f.power, default_border)
@@ -790,8 +789,7 @@ function pfUI.uf:UpdateConfig()
f.debuffs[i]:SetFrameLevel(12)
f.debuffs[i]:RegisterForClicks("RightButtonUp")
f.debuffs[i]:ClearAllPoints()
f.debuffs[i]:SetWidth(f.config.debuffsize)
f.debuffs[i]:SetHeight(f.config.debuffsize)
f.debuffs[i]:SetSize(f.config.debuffsize, f.config.debuffsize)
f.debuffs[i]:SetNormalTexture(nil)
-- Create CD frame if it doesn't exist
@@ -1182,15 +1180,9 @@ end
function pfUI.uf.OnEnter()
if not this.label then return end
-- Nampower: 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
local unitstr = this.label .. this.id
if UnitExists(unitstr) then
SetMouseoverUnit(unitstr)
end
if this.config.showtooltip == "0" then return end
@@ -1200,10 +1192,7 @@ function pfUI.uf.OnEnter()
end
function pfUI.uf.OnLeave()
-- Nampower: Clear native mouseover unit
if SetMouseoverUnit then
SetMouseoverUnit()
end
SetMouseoverUnit("")
GameTooltip:FadeOut()
end
@@ -1528,7 +1517,7 @@ function pfUI.uf:RefreshIndicators(unit)
end
if unit.happinessIcon and unit:GetName() == "pfPet" then -- Happiness Icon
local _, pclass = UnitClass("player")
local pclass = UnitClassBase("player")
if unit.config.happinessicon == "0" or pclass ~= "HUNTER" then
unit.happinessIcon:Hide()
else
@@ -1572,7 +1561,7 @@ function pfUI.uf:UpdateDruidMana(unit)
local unitstr = unit.label .. unit.id
if not UnitExists(unitstr) then bar:Hide() return end
if unit.label ~= "player" then
local _, cls = UnitClass(unitstr)
local cls = UnitClassBase(unitstr)
if cls ~= "DRUID" then bar:Hide() return end
end
if UnitPowerType(unitstr) == Enum.PowerType.Mana then bar:Hide() return end
@@ -1791,8 +1780,7 @@ function pfUI.uf:RefreshUnit(unit, component)
if size ~= indicator.size or disptype ~= indicator.disp or indipos ~= indicator.ipos then
indicator:ClearAllPoints()
indicator:SetPoint(indipos, 0, 0)
indicator:SetHeight(size)
indicator:SetWidth(size)
indicator:SetSize(size, size)
indicator.size = size
indicator.disp = disptype
indicator.ipos = indipos
@@ -1821,16 +1809,14 @@ function pfUI.uf:RefreshUnit(unit, component)
indicator[debuff].tex:SetVertexColor(dispelColor:GetRGBA())
indicator[debuff].tex:Show()
indicator[debuff]:ClearAllPoints()
indicator[debuff]:SetHeight(size)
indicator[debuff]:SetWidth(size)
indicator[debuff]:SetSize(size, size)
indicator[debuff]:SetBackdrop(nil)
elseif disptype == "3" then
indicator[debuff].tex:SetTexture(dispelColor:GetRGBA())
indicator[debuff].tex:SetVertexColor(1,1,1,1)
indicator[debuff].tex:Show()
indicator[debuff]:ClearAllPoints()
indicator[debuff]:SetHeight(size)
indicator[debuff]:SetWidth(size)
indicator[debuff]:SetSize(size, size)
indicator[debuff]:SetBackdrop(nil)
elseif disptype == "2" then
indicator[debuff].tex:Hide()
@@ -2226,7 +2212,7 @@ function pfUI.uf:ClickAction(button)
-- drop food on petframe
if label == "pet" and CursorHasItem() then
local _, playerClass = UnitClass("player")
local playerClass = UnitClassBase("player")
if playerClass == "HUNTER" then
DropItemOnUnit("pet")
return
@@ -2279,8 +2265,7 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks, start, duration)
-- update icon configuration
if frame.icon[pos].iconsize ~= iconsize or frame.icon[pos].spacing ~= spacing then
frame.icon[pos]:SetWidth(iconsize)
frame.icon[pos]:SetHeight(iconsize)
frame.icon[pos]:SetSize(iconsize, iconsize)
frame.icon[pos]:SetPoint("TOPLEFT", frame.icon, "TOPLEFT", (pos-1)*(iconsize + spacing), 0)
frame.icon[pos].stacks:SetFont(pfUI.font_unit, math.max(iconsize/3, 10), "OUTLINE")
frame.icon[pos].iconsize = iconsize
@@ -2336,7 +2321,7 @@ function pfUI.uf:HideIcon(frame, pos)
end
function pfUI.uf:SetupDebuffFilter(allclasses)
local _, myclass = UnitClass("player")
local myclass = UnitClassBase("player")
local debuffs = {}
if myclass == "PALADIN" or myclass == "PRIEST" or myclass == "WARLOCK" or allclasses then
@@ -2359,7 +2344,7 @@ function pfUI.uf:SetupDebuffFilter(allclasses)
end
function pfUI.uf:SetupBuffIndicators(config)
local _, myclass = UnitClass("player")
local myclass = UnitClassBase("player")
local indicators = {}
if config.show_buffs == "1" then -- buffs
+1 -2
View File
@@ -29,8 +29,7 @@ if GetLocale() == "ruRU" then
end
local libdebuff = CreateFrame("Frame", "pfdebuffsScanner", UIParent)
local _, class = UnitClass("player")
local lastspell
local class = UnitClassBase("player")
-- Nampower Support
local hasNampower = false
+22 -20
View File
@@ -89,7 +89,7 @@ libunitscan:SetScript("OnEvent", function()
-- update own character details
local name = UnitName("player")
local _, class = UnitClass("player")
local class = UnitClassBase("player")
local level = UnitLevel("player")
local guild = GetGuildInfo("player")
AddData("players", name, class, level, nil, guild)
@@ -128,7 +128,7 @@ libunitscan:SetScript("OnEvent", function()
local name, class, level, unit, _, guild
for i = 1, GetNumPartyMembers() do
unit = "party" .. i
_, class = UnitClass(unit)
class = UnitClassBase(unit)
name = UnitName(unit)
level = UnitLevel(unit)
guild = GetGuildInfo(unit)
@@ -149,24 +149,26 @@ libunitscan:SetScript("OnEvent", function()
or event == "NAME_PLATE_UNIT_ADDED" and arg1
or "mouseover"
local name, class, level, elite, guild, _
if UnitIsPlayer(scan) then
_, class = UnitClass(scan)
level = UnitLevel(scan)
-- UnitLevel returns -1 for unknown levels, don't overwrite known values
level = level > 0 and level or nil
name = UnitName(scan)
guild = GetGuildInfo(scan)
AddData("players", name, class, level, nil, guild)
RememberByUnit(scan, name, class)
else
_, class = UnitClass(scan)
elite = UnitClassification(scan)
level = UnitLevel(scan)
-- UnitLevel returns -1 for unknown levels, don't overwrite known values
level = level > 0 and level or nil
name = UnitName(scan)
guild = UnitSubName(scan)
AddData("mobs", name, class, level, elite, guild)
if UnitExists(scan) then
if UnitIsPlayer(scan) then
class = UnitClassBase(scan)
level = UnitLevel(scan)
-- UnitLevel returns -1 for unknown levels, don't overwrite known values
level = level > 0 and level or nil
name = UnitName(scan)
guild = GetGuildInfo(scan)
AddData("players", name, class, level, nil, guild)
RememberByUnit(scan, name, class)
else
class = UnitClassBase(scan)
elite = UnitClassification(scan)
level = UnitLevel(scan)
-- UnitLevel returns -1 for unknown levels, don't overwrite known values
level = level > 0 and level or nil
name = UnitName(scan)
guild = UnitSubName(scan)
AddData("mobs", name, class, level, elite, guild)
end
end
end
end)
+7 -13
View File
@@ -1,5 +1,5 @@
pfUI:RegisterModule("actionbar", function ()
local _, class = UnitClass("player")
local class = UnitClassBase("player")
local _, cr, cg, cb = GetUnitColor('player')
local er, eg, eb, ea = GetStringColor(pfUI_config.appearance.border.color)
@@ -168,8 +168,7 @@ pfUI:RegisterModule("actionbar", function ()
["zoomfade"] = function()
if this.active == 0 then
-- init animation
this:SetWidth(this.parent:GetWidth())
this:SetHeight(this.parent:GetHeight())
this:SetSize(this.parent:GetSize())
this:SetScale(this.parent:GetScale())
this.tex:SetTexture(this.parent.icon:GetTexture())
this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
@@ -191,8 +190,7 @@ pfUI:RegisterModule("actionbar", function ()
["shrinkreturn"] = function()
if this.active == 0 then
-- init animation
this:SetWidth(this.parent:GetWidth())
this:SetHeight(this.parent:GetHeight())
this:SetSize(this.parent:GetSize())
this:SetScale(this.parent:GetScale())
this.tex:SetTexture(this.parent.icon:GetTexture())
this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
@@ -218,8 +216,7 @@ pfUI:RegisterModule("actionbar", function ()
["elasticzoom"] = function()
if this.active == 0 then
-- init animation
this:SetWidth(this.parent:GetWidth())
this:SetHeight(this.parent:GetHeight())
this:SetSize(this.parent:GetSize())
this:SetScale(this.parent:GetScale())
this.tex:SetTexture(this.parent.icon:GetTexture())
this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
@@ -245,8 +242,7 @@ pfUI:RegisterModule("actionbar", function ()
["wobblezoom"] = function()
if this.active == 0 then
-- init animation
this:SetWidth(this.parent:GetWidth())
this:SetHeight(this.parent:GetHeight())
this:SetSize(this.parent:GetSize())
this:SetScale(this.parent:GetScale())
this.tex:SetTexture(this.parent.icon:GetTexture())
this.tex:SetVertexColor(this.parent.icon:GetVertexColor())
@@ -1176,8 +1172,7 @@ pfUI:RegisterModule("actionbar", function ()
-- general appearance
f.showempty = showempty == "1" and true or nil
f:SetHeight(size)
f:SetWidth(size)
f:SetSize(size, size)
CreateBackdrop(f, border)
return f
@@ -1349,8 +1344,7 @@ pfUI:RegisterModule("actionbar", function ()
-- adjust actionbar size
BarLayoutSize(bars[i], buttons, formfactor, size, border, spacing, uneven, fillmode)
bars[i]:SetWidth(bars[i]._size[1])
bars[i]:SetHeight(bars[i]._size[2])
bars[i]:SetSize(bars[i]._size[1], bars[i]._size[2])
bars[i]:ClearAllPoints()
if i == 1 then -- main
bars[i]:SetPoint("BOTTOM", 0, 2*border)
+10 -18
View File
@@ -37,15 +37,10 @@ pfUI:RegisterModule("addonbuttons", function ()
pfUI.addonbuttons.minimapbutton = CreateFrame("Button", "pfMinimapButton", pfUI.minimap or UIParent)
pfUI.addonbuttons.minimapbutton:SetFrameLevel(24)
pfUI.addonbuttons.minimapbutton:SetWidth(12)
pfUI.addonbuttons.minimapbutton:SetHeight(12)
pfUI.addonbuttons.minimapbutton:SetSize(12, 12)
pfUI.addonbuttons.minimapbutton:SetScript("OnClick", function()
if pfUI.addonbuttons:IsShown() then
pfUI.addonbuttons:Hide()
else
pfUI.addonbuttons:Show()
end
pfUI.addonbuttons:SetShown(not pfUI.addonbuttons:IsShown())
end)
pfUI.addonbuttons.buttons = {}
@@ -163,27 +158,25 @@ pfUI:RegisterModule("addonbuttons", function ()
pfUI.addonbuttons:SetScale(pfUI.minimap:GetScale())
pfUI.addonbuttons.minimapbutton:ClearAllPoints()
local mbtnWidth, mbtnHeight = pfUI.minimap:GetSize()
local dynamicSize = ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing)
if C.abuttons.position == "bottom" then
pfUI.addonbuttons:SetWidth(pfUI.minimap:GetWidth())
pfUI.addonbuttons:SetHeight(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing))
pfUI.addonbuttons:SetSize(mbtnWidth, dynamicSize)
pfUI.addonbuttons:SetPoint("TOP", pfUI.minimap, "BOTTOM", 0 , -default_border * 3)
SkinArrowButton(pfUI.addonbuttons.minimapbutton, "down")
pfUI.addonbuttons.minimapbutton:SetPoint("BOTTOM", pfUI.minimap, "BOTTOM", 0, 4)
elseif C.abuttons.position == "left" then
pfUI.addonbuttons:SetWidth(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing))
pfUI.addonbuttons:SetHeight(pfUI.minimap:GetHeight())
pfUI.addonbuttons:SetSize(dynamicSize, mbtnHeight)
pfUI.addonbuttons:SetPoint("TOPRIGHT", pfUI.minimap, "TOPLEFT", -default_border * 3, 0)
SkinArrowButton(pfUI.addonbuttons.minimapbutton, "left")
pfUI.addonbuttons.minimapbutton:SetPoint("LEFT", pfUI.minimap, "LEFT", 4, 0)
elseif C.abuttons.position == "top" then
pfUI.addonbuttons:SetWidth(pfUI.minimap:GetWidth())
pfUI.addonbuttons:SetHeight(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing))
pfUI.addonbuttons:SetSize(mbtnWidth, dynamicSize)
pfUI.addonbuttons:SetPoint("BOTTOM", pfUI.minimap, "TOP", 0 , default_border * 3)
SkinArrowButton(pfUI.addonbuttons.minimapbutton, "up")
pfUI.addonbuttons.minimapbutton:SetPoint("TOP", pfUI.minimap, "TOP", 0, -4)
elseif C.abuttons.position == "right" then
pfUI.addonbuttons:SetWidth(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing))
pfUI.addonbuttons:SetHeight(pfUI.minimap:GetHeight())
pfUI.addonbuttons:SetSize(dynamicSize, mbtnHeight)
pfUI.addonbuttons:SetPoint("TOPLEFT", pfUI.minimap, "TOPRIGHT", default_border * 3, 0)
SkinArrowButton(pfUI.addonbuttons.minimapbutton, "right")
pfUI.addonbuttons.minimapbutton:SetPoint("RIGHT", pfUI.minimap, "RIGHT", -4, 0)
@@ -231,7 +224,7 @@ pfUI:RegisterModule("addonbuttons", function ()
frame.backup.is_clamped_to_screen = frame:IsClampedToScreen()
frame.backup.is_movable = frame:IsMovable()
frame.backup.point = {frame:GetPoint()}
frame.backup.size = {frame:GetHeight(), frame:GetWidth()}
frame.backup.size = {frame:GetSize()}
frame.backup.scale = frame:GetScale()
if frame:HasScript("OnDragStart") then
frame.backup.on_drag_start = frame:GetScript("OnDragStart")
@@ -256,8 +249,7 @@ pfUI:RegisterModule("addonbuttons", function ()
frame:SetClampedToScreen(frame.backup.is_clamped_to_screen)
frame:SetMovable(frame.backup.is_movable)
frame:SetScale(frame.backup.scale)
frame:SetHeight(frame.backup.size[1])
frame:SetWidth(frame.backup.size[2])
frame:SetSize(frame.backup.size[2], frame.backup.size[1])
frame:ClearAllPoints()
frame:SetPoint(frame.backup.point[1], frame.backup.point[2], frame.backup.point[3], frame.backup.point[4], frame.backup.point[5])
if frame.backup.on_drag_start ~= nil then
+7 -14
View File
@@ -18,8 +18,7 @@ pfUI:RegisterModule("addons", function ()
-- addon window
pfUI.addons = CreateFrame("Frame", "pfAddons", UIParent)
pfUI.addons:SetFrameStrata("DIALOG")
pfUI.addons:SetHeight(490)
pfUI.addons:SetWidth(380)
pfUI.addons:SetSize(380, 490)
pfUI.addons:SetPoint("CENTER", 0,0)
pfUI.addons:EnableMouseWheel(1)
pfUI.addons:SetMovable(true)
@@ -51,8 +50,7 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons.close = CreateFrame("Button", "pfBagClose", pfUI.addons)
pfUI.addons.close:SetPoint("TOPRIGHT", -border*2,-border*2 )
CreateBackdrop(pfUI.addons.close)
pfUI.addons.close:SetHeight(15)
pfUI.addons.close:SetWidth(15)
pfUI.addons.close:SetSize(15, 15)
pfUI.addons.close.texture = pfUI.addons.close:CreateTexture("pfBagClose")
pfUI.addons.close.texture:SetTexture(pfUI.media["img:close"])
pfUI.addons.close.texture:ClearAllPoints()
@@ -125,8 +123,7 @@ pfUI:RegisterModule("addons", function ()
end)
pfUI.addons.profile:SetPoint("TOP", pfUI.addons, "TOP", 0, -30)
pfUI.addons.profile:SetHeight(30)
pfUI.addons.profile:SetWidth(370)
pfUI.addons.profile:SetSize(370, 30)
CreateBackdrop(pfUI.addons.profile, nil, true)
-- addon profile: title
@@ -139,8 +136,7 @@ pfUI:RegisterModule("addons", function ()
-- addon profile: delete
pfUI.addons.profile.del = CreateFrame("Button", nil, pfUI.addons.profile, "UIPanelButtonTemplate")
SkinButton(pfUI.addons.profile.del)
pfUI.addons.profile.del:SetWidth(16)
pfUI.addons.profile.del:SetHeight(16)
pfUI.addons.profile.del:SetSize(16, 16)
pfUI.addons.profile.del:SetPoint("RIGHT", -10, 0)
pfUI.addons.profile.del:GetFontString():SetPoint("CENTER", 1, 0)
pfUI.addons.profile.del:SetText("-")
@@ -157,8 +153,7 @@ pfUI:RegisterModule("addons", function ()
-- addon profile: create
pfUI.addons.profile.add = CreateFrame("Button", nil, pfUI.addons.profile, "UIPanelButtonTemplate")
SkinButton(pfUI.addons.profile.add)
pfUI.addons.profile.add:SetWidth(16)
pfUI.addons.profile.add:SetHeight(16)
pfUI.addons.profile.add:SetSize(16, 16)
pfUI.addons.profile.add:SetPoint("RIGHT", pfUI.addons.profile.del, "LEFT", -4, 0)
pfUI.addons.profile.add:GetFontString():SetPoint("CENTER", 1, 0)
pfUI.addons.profile.add:SetText("+")
@@ -201,8 +196,7 @@ pfUI:RegisterModule("addons", function ()
-- addon list: scroll frame
pfUI.addons.scroll = CreateScrollFrame("pfAddonListScroll", pfUI.addons)
pfUI.addons.scroll:SetWidth(360)
pfUI.addons.scroll:SetHeight(410)
pfUI.addons.scroll:SetSize(360, 410)
pfUI.addons.scroll:SetPoint("BOTTOM", 0, 10)
pfUI.addons.scroll.backdrop = CreateFrame("Frame", nil, pfUI.addons.scroll)
@@ -292,8 +286,7 @@ pfUI:RegisterModule("addons", function ()
frame.adeps = { GetAddOnDependencies(i) } -- required (.toc Dependencies)
frame.aoptdeps = { C_AddOns.GetAddOnOptionalDependencies(i) } -- optional (.toc OptionalDeps)
frame:SetWidth(340)
frame:SetHeight(25)
frame:SetSize(340, 25)
frame:SetPoint("TOPLEFT", 5, i * -25 + 20)
frame:SetBackdrop(pfUI.backdrop_hover)
+1 -2
View File
@@ -48,8 +48,7 @@ pfUI:RegisterModule("afkcam", function ()
local chat = CreateFrame("ScrollingMessageFrame", "pfAFKCamChat", overlay)
chat:EnableMouse(false)
chat:EnableMouseWheel(true)
chat:SetHeight(150)
chat:SetWidth(500)
chat:SetSize(500, 150)
chat:SetPoint("BOTTOMLEFT",overlay,"BOTTOMLEFT", 10, 10)
chat:SetTimeVisible(1800.0)
chat:SetMaxLines(500)
+1 -2
View File
@@ -56,8 +56,7 @@ pfUI:RegisterModule("autovendor", function ()
-- Setup Autosell button
autovendor.button = CreateFrame("Button", "pfMerchantAutoVendorButton", MerchantFrame)
autovendor.button:SetWidth(36)
autovendor.button:SetHeight(36)
autovendor.button:SetSize(36, 36)
autovendor.button.icon = autovendor.button:CreateTexture("ARTWORK")
autovendor.button.icon:SetTexture("Interface\\Icons\\Spell_Shadow_SacrificialShield")
autovendor.button:SetScript("OnEnter", function()
+15 -33
View File
@@ -326,8 +326,7 @@ pfUI:RegisterModule("bags", function ()
default_border + x*(frame.button_size+default_border*3),
-default_border*2 - y*(frame.button_size+default_border*3) - topspace)
pfUI.bags[bag].slots[slot].frame:SetHeight(frame.button_size)
pfUI.bags[bag].slots[slot].frame:SetWidth(frame.button_size)
pfUI.bags[bag].slots[slot].frame:SetSize(frame.button_size, frame.button_size)
if x >= rowlength - 1 then
y = y + 1
@@ -545,8 +544,7 @@ pfUI:RegisterModule("bags", function ()
local width = (frame.button_size/5*4 + default_border*2) * (max-min+1+extra)
local height = default_border + (frame.button_size/5*4 + default_border)
frame.bagslots:SetWidth(width)
frame.bagslots:SetHeight(height)
frame.bagslots:SetSize(width, height)
for slot=min, max do
if not frame.bagslots.slots[slot] then
frame.bagslots.slots[slot] = {}
@@ -606,8 +604,7 @@ pfUI:RegisterModule("bags", function ()
frame.bagslots.slots[slot].frame:ClearAllPoints()
frame.bagslots.slots[slot].frame:SetPoint("TOPLEFT", frame.bagslots, "TOPLEFT", left, top)
frame.bagslots.slots[slot].frame:SetHeight(frame.button_size/5*4)
frame.bagslots.slots[slot].frame:SetWidth(frame.button_size/5*4)
frame.bagslots.slots[slot].frame:SetSize(frame.button_size/5*4, frame.button_size/5*4)
CreateBackdrop(frame.bagslots.slots[slot].frame, default_border)
frame.bagslots.slots[slot].frame:Show()
@@ -626,8 +623,7 @@ pfUI:RegisterModule("bags", function ()
end
frame.bagslots.buy:SetPoint("RIGHT", frame.bagslots, "RIGHT", -default_border, 0)
CreateBackdrop(frame.bagslots.buy, default_border)
frame.bagslots.buy:SetHeight(frame.button_size/5*4)
frame.bagslots.buy:SetWidth(frame.button_size/5*4)
frame.bagslots.buy:SetSize(frame.button_size/5*4, frame.button_size/5*4)
frame.bagslots.buy:SetText("+")
frame.bagslots.buy:SetTextColor(.5,.5,1,1)
frame.bagslots.buy:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
@@ -719,8 +715,7 @@ pfUI:RegisterModule("bags", function ()
frame.close = CreateFrame("Button", "pfBagClose", frame)
frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border )
CreateBackdrop(frame.close, default_border)
frame.close:SetHeight(12)
frame.close:SetWidth(12)
frame.close:SetSize(12, 12)
frame.close.texture = frame.close:CreateTexture("pfBagClose")
frame.close.texture:SetTexture(pfUI.media["img:close"])
frame.close.texture:ClearAllPoints()
@@ -745,8 +740,7 @@ pfUI:RegisterModule("bags", function ()
frame.bags = CreateFrame("Button", "pfBagSlotShow", frame)
frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.bags, default_border)
frame.bags:SetHeight(12)
frame.bags:SetWidth(12)
frame.bags:SetSize(12, 12)
frame.bags:SetTextColor(1,1,.25,1)
frame.bags:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.bags.texture = frame.bags:CreateTexture("pfBagArrowUp")
@@ -773,11 +767,7 @@ pfUI:RegisterModule("bags", function ()
end)
frame.bags:SetScript("OnClick", function()
if pfUI.bag.right.bagslots:IsShown() then
pfUI.bag.right.bagslots:Hide()
else
pfUI.bag.right.bagslots:Show()
end
pfUI.bag.right.bagslots:SetShown(not pfUI.bag.right.bagslots:IsShown())
end)
end
@@ -786,8 +776,7 @@ pfUI:RegisterModule("bags", function ()
frame.open = CreateFrame("Button", "pfBagSlotOpen", frame)
frame.open:SetPoint("TOPRIGHT", frame.bags, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.open, default_border)
frame.open:SetHeight(12)
frame.open:SetWidth(12)
frame.open:SetSize(12, 12)
frame.open:SetTextColor(1,1,.25,1)
frame.open:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.open.texture = frame.open:CreateTexture("pfBagOpenContainer")
@@ -845,8 +834,7 @@ pfUI:RegisterModule("bags", function ()
frame.disenchant = CreateFrame("Button", "pfBagSlotDisenchant", frame)
frame.disenchant:SetPoint("TOPRIGHT", frame.open, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.disenchant, default_border)
frame.disenchant:SetHeight(12)
frame.disenchant:SetWidth(12)
frame.disenchant:SetSize(12, 12)
frame.disenchant:SetTextColor(1,1,.25,1)
frame.disenchant:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.disenchant.texture = frame.disenchant:CreateTexture("pfBagDisenchant")
@@ -888,8 +876,7 @@ pfUI:RegisterModule("bags", function ()
frame.picklock = CreateFrame("Button", "pfBagSlotPicklock", frame)
frame.picklock:SetPoint("TOPRIGHT", frame.disenchant, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.picklock, default_border)
frame.picklock:SetHeight(12)
frame.picklock:SetWidth(12)
frame.picklock:SetSize(12, 12)
frame.picklock:SetTextColor(1,1,.25,1)
frame.picklock:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.picklock.texture = frame.picklock:CreateTexture("pfBagPicklock")
@@ -931,8 +918,7 @@ pfUI:RegisterModule("bags", function ()
frame.keys = CreateFrame("Button", "pfBagSlotShow", frame)
frame.keys:SetPoint("TOPRIGHT", frame.picklock, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.keys, default_border)
frame.keys:SetHeight(12)
frame.keys:SetWidth(12)
frame.keys:SetSize(12, 12)
frame.keys:SetTextColor(1,1,.25,1)
frame.keys:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.keys.texture = frame.keys:CreateTexture("pfBagArrowUp")
@@ -974,8 +960,7 @@ pfUI:RegisterModule("bags", function ()
frame.sort = CreateFrame("Button", "pfBagSort", frame)
frame.sort:SetPoint("TOPRIGHT", frame.keys, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.sort, default_border)
frame.sort:SetHeight(12)
frame.sort:SetWidth(12)
frame.sort:SetSize(12, 12)
frame.sort.texture = frame.sort:CreateTexture("pfBagSortIcon")
frame.sort.texture:SetTexture(pfUI.media["img:sort"])
frame.sort.texture:ClearAllPoints()
@@ -1008,8 +993,7 @@ pfUI:RegisterModule("bags", function ()
if not frame.gold and (C.appearance.bags.movable == "1" or not pfUI.panel) then
frame.gold = CreateFrame("Frame", "pfBagGoldString", frame)
frame.gold:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 1)
frame.gold:SetWidth(200)
frame.gold:SetHeight(18)
frame.gold:SetSize(200, 18)
frame.gold:RegisterEvent("PLAYER_ENTERING_WORLD")
frame.gold:RegisterEvent("PLAYER_MONEY")
frame.gold:SetScript("OnEvent", function()
@@ -1145,8 +1129,7 @@ pfUI:RegisterModule("bags", function ()
frame.close = CreateFrame("Button", "pfBagClose", frame)
frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border )
CreateBackdrop(frame.close, default_border)
frame.close:SetHeight(12)
frame.close:SetWidth(12)
frame.close:SetSize(12, 12)
frame.close.texture = frame.close:CreateTexture("pfBagClose")
frame.close.texture:SetTexture(pfUI.media["img:close"])
frame.close.texture:ClearAllPoints()
@@ -1171,8 +1154,7 @@ pfUI:RegisterModule("bags", function ()
frame.bags = CreateFrame("Button", "pfBagSlotShow", frame)
frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0)
CreateBackdrop(frame.bags, default_border)
frame.bags:SetHeight(12)
frame.bags:SetWidth(12)
frame.bags:SetSize(12, 12)
frame.bags:SetTextColor(1,1,.25,1)
frame.bags:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.bags.texture = frame.bags:CreateTexture("pfBagArrowUp")
+2 -4
View File
@@ -2,14 +2,12 @@ pfUI:RegisterModule("bgscore", function ()
local bgframe = WorldStateAlwaysUpFrame
if not bgframe then
bgframe = CreateFrame("Frame", "WorldStateAlwaysUpFrame", UIParent)
bgframe:SetWidth(200)
bgframe:SetHeight(25)
bgframe:SetSize(200, 25)
bgframe:SetPoint("TOP", UIParent, "TOP", 0, -100)
end
local mover = CreateFrame("Frame", "pfUIBGScoreMover", UIParent)
mover:SetWidth(220)
mover:SetHeight(30)
mover:SetSize(220, 30)
mover:SetPoint("TOP", UIParent, "TOP", 0, -100)
mover:SetFrameStrata("DIALOG")
mover:SetMovable(true)
+21 -16
View File
@@ -277,28 +277,27 @@ pfUI:RegisterModule("buff", function ()
-- config loading
function pfUI.buff:UpdateConfigBuffButton(buff)
local fontsize = C.buffs.fontsize == "-1" and C.global.font_size or C.buffs.fontsize
local buffSize, buffSpacing = tonumber(C.buffs.size), tonumber(C.buffs.spacing)
local rowcount, relFrame, offsetX, offsetY
if buff.btype == "HELPFUL" then
if buff.weapon == 1 and C.buffs.separateweapons == "1" then
rowcount = floor((buff.gid-1) / tonumber(C.buffs.wepbuffrowsize))
relFrame = pfUI.buff.wepbuffs
offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.wepbuffrowsize))*(tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))
offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.wepbuffrowsize))*(buffSize+2*buffSpacing)
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing)
else
rowcount = floor((buff.gid-1) / tonumber(C.buffs.buffrowsize))
relFrame = pfUI.buff.buffs
offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.buffrowsize))*(tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))
offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.buffrowsize))*(buffSize+2*buffSpacing)
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing)
end
else
rowcount = floor((buff.gid-1) / tonumber(C.buffs.debuffrowsize))
relFrame = pfUI.buff.debuffs
offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.debuffrowsize))*(tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))
offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.debuffrowsize))*(buffSize+2*buffSpacing)
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing)
end
buff:SetWidth(tonumber(C.buffs.size))
buff:SetHeight(tonumber(C.buffs.size))
buff:SetSize(buffSize, buffSize)
buff:ClearAllPoints()
buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY)
@@ -318,20 +317,26 @@ pfUI:RegisterModule("buff", function ()
function pfUI.buff:UpdateConfig()
local fontsize = C.buffs.fontsize == "-1" and C.global.font_size or C.buffs.fontsize
pfUI.buff.buffs:SetWidth(tonumber(C.buffs.buffrowsize) * (tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)))
pfUI.buff.buffs:SetHeight(ceil(32/tonumber(C.buffs.buffrowsize)) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)))
pfUI.buff.buffs:SetPoint("TOPRIGHT", pfUI.minimap or UIParent, "TOPLEFT", -4*tonumber(C.buffs.spacing), 0)
local spacing = tonumber(C.buffs.spacing)
local cell = tonumber(C.buffs.size) + 2 * spacing
local rowextra = C.buffs.textinside == "1" and 0 or (fontsize * 1.5)
local function SizeBuffFrame(frame, rowsize, count)
rowsize = tonumber(rowsize)
frame:SetSize(rowsize * cell, ceil(count / rowsize) * (rowextra + cell))
end
SizeBuffFrame(pfUI.buff.buffs, C.buffs.buffrowsize, 32)
pfUI.buff.buffs:SetPoint("TOPRIGHT", pfUI.minimap or UIParent, "TOPLEFT", -4 * spacing, 0)
UpdateMovable(pfUI.buff.buffs)
pfUI.buff.debuffs:SetWidth(tonumber(C.buffs.debuffrowsize) * (tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)))
pfUI.buff.debuffs:SetHeight(ceil(16/tonumber(C.buffs.debuffrowsize)) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)))
SizeBuffFrame(pfUI.buff.debuffs, C.buffs.debuffrowsize, 16)
pfUI.buff.debuffs:SetPoint("TOPRIGHT", pfUI.buff.buffs, "BOTTOMRIGHT", 0, 0)
UpdateMovable(pfUI.buff.debuffs)
if C.buffs.separateweapons == "1" then
pfUI.buff.wepbuffs:ClearAllPoints()
pfUI.buff.wepbuffs:SetWidth(tonumber(C.buffs.wepbuffrowsize) * (tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)))
pfUI.buff.wepbuffs:SetHeight(ceil(2/tonumber(C.buffs.wepbuffrowsize)) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)))
SizeBuffFrame(pfUI.buff.wepbuffs, C.buffs.wepbuffrowsize, 2)
pfUI.buff.wepbuffs:SetPoint("TOPRIGHT", pfUI.buff.debuffs, "BOTTOMRIGHT", 0, 0)
pfUI.buff.wepbuffs:Show()
UpdateMovable(pfUI.buff.wepbuffs)
+13 -25
View File
@@ -162,8 +162,7 @@ pfUI:RegisterModule("buffwatch", function ()
local color = parent.color
local bordercolor = parent.bordercolor
local textcolor = parent.textcolor
local width = parent:GetWidth()
local height = parent:GetHeight()
local width, height = parent:GetSize()
local framename = "pf" .. parent.unit .. ( parent.type == "HARMFUL" and "Debuff" or "Buff" ) .. "Bar" .. bar
local font = parent.config.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
@@ -172,8 +171,7 @@ pfUI:RegisterModule("buffwatch", function ()
frame:EnableMouse(1)
frame:Hide()
frame:SetPoint("BOTTOM", 0, (bar-1)*(height+2*border+1))
frame:SetWidth(width)
frame:SetHeight(height)
frame:SetSize(width, height)
frame.bar = CreateFrame("StatusBar", "pfBuffBar" .. bar, frame)
frame.bar:SetPoint("TOPLEFT", frame, "TOPLEFT", height+1, 0)
@@ -202,8 +200,7 @@ pfUI:RegisterModule("buffwatch", function ()
frame.time:SetJustifyH("RIGHT")
frame.icon = frame:CreateTexture(nil, "OVERLAY")
frame.icon:SetWidth(height)
frame.icon:SetHeight(height)
frame.icon:SetSize(height, height)
frame.icon:SetPoint("LEFT", frame, "LEFT", 0, 0)
frame.icon:SetTexCoord(.07,.93,.07,.93)
@@ -225,7 +222,7 @@ pfUI:RegisterModule("buffwatch", function ()
CreateBackdrop(frame)
CreateBackdropShadow(frame)
if bordercolor.r ~= "0" and bordercolor.g ~= "0" and bordercolor.b ~= "0" and bordercolor.a ~= "0" then
if bordercolor.r ~= 0 and bordercolor.g ~= 0 and bordercolor.b ~= 0 and bordercolor.a ~= 0 then
frame.backdrop:SetBackdropBorderColor(bordercolor.r,bordercolor.g,bordercolor.b,1)
end
@@ -422,18 +419,15 @@ pfUI:RegisterModule("buffwatch", function ()
if pfUI.uf.player and C.buffbar.pbuff.enable == "1" then
pfUI.uf.player.buffbar = CreateBuffBarFrame("Player", "HELPFUL")
local config = C.buffbar.pbuff
local r, g, b, a = strsplit(",", config.color)
local br, bg, bb, ba = strsplit(",", config.bordercolor)
local tr, tg, tb, ta = strsplit(",", config.textcolor)
pfUI.uf.player.buffbar:SetWidth(config.width == "-1" and pfUI.uf.player:GetWidth() or config.width)
pfUI.uf.player.buffbar:SetHeight(config.height)
pfUI.uf.player.buffbar.threshold = tonumber(config.threshold)
pfUI.uf.player.buffbar.config = config
pfUI.uf.player.buffbar.buffcmp = config.sort == "asc" and asc or desc
pfUI.uf.player.buffbar.color = { r = r, g = g, b = b, a = a }
pfUI.uf.player.buffbar.bordercolor = { r = br, g = bg, b = bb, a = ba }
pfUI.uf.player.buffbar.textcolor = { r = tr, g = tg, b = tb, a = ta }
pfUI.uf.player.buffbar.color = GetStringColorObject(config.color)
pfUI.uf.player.buffbar.bordercolor = GetStringColorObject(config.bordercolor)
pfUI.uf.player.buffbar.textcolor = GetStringColorObject(config.textcolor)
pfUI.uf.player.buffbar.anchors = {
pfUI.uf.player,
pfUI.uf.player and pfUI.uf.player.debuffs,
@@ -448,9 +442,6 @@ pfUI:RegisterModule("buffwatch", function ()
-- create player debuffbars
if pfUI.uf.player and C.buffbar.pdebuff.enable == "1" then
local config = C.buffbar.pdebuff
local r, g, b, a = strsplit(",", config.color)
local br, bg, bb, ba = strsplit(",", config.bordercolor)
local tr, tg, tb, ta = strsplit(",", config.textcolor)
pfUI.uf.player.debuffbar = CreateBuffBarFrame("Player", "HARMFUL")
pfUI.uf.player.debuffbar:SetWidth(config.width == "-1" and pfUI.uf.player:GetWidth() or config.width)
@@ -458,9 +449,9 @@ pfUI:RegisterModule("buffwatch", function ()
pfUI.uf.player.debuffbar.threshold = tonumber(config.threshold)
pfUI.uf.player.debuffbar.config = config
pfUI.uf.player.debuffbar.buffcmp = config.sort == "asc" and asc or desc
pfUI.uf.player.debuffbar.color = { r = r, g = g, b = b, a = a }
pfUI.uf.player.debuffbar.bordercolor = { r = br, g = bg, b = bb, a = ba }
pfUI.uf.player.debuffbar.textcolor = { r = tr, g = tg, b = tb, a = ta }
pfUI.uf.player.debuffbar.color = GetStringColorObject(config.color)
pfUI.uf.player.debuffbar.bordercolor = GetStringColorObject(config.bordercolor)
pfUI.uf.player.debuffbar.textcolor = GetStringColorObject(config.textcolor)
pfUI.uf.player.debuffbar.anchors = {
pfUI.uf.player,
pfUI.uf.player and pfUI.uf.player.buffbar and pfUI.uf.player.buffbar.bars,
@@ -476,18 +467,15 @@ pfUI:RegisterModule("buffwatch", function ()
-- create target debuffbars
if pfUI.uf.target and C.buffbar.tdebuff.enable == "1" then
local config = C.buffbar.tdebuff
local r, g, b, a = strsplit(",", config.color)
local br, bg, bb, ba = strsplit(",", config.bordercolor)
local tr, tg, tb, ta = strsplit(",", config.textcolor)
pfUI.uf.target.debuffbar = CreateBuffBarFrame("Target", "HARMFUL")
pfUI.uf.target.debuffbar:SetWidth(config.width == "-1" and pfUI.uf.target:GetWidth() or config.width)
pfUI.uf.target.debuffbar:SetHeight(config.height)
pfUI.uf.target.debuffbar.config = config
pfUI.uf.target.debuffbar.buffcmp = config.sort == "asc" and asc or desc
pfUI.uf.target.debuffbar.color = { r = r, g = g, b = b, a = a }
pfUI.uf.target.debuffbar.bordercolor = { r = br, g = bg, b = bb, a = ba }
pfUI.uf.target.debuffbar.textcolor = { r = tr, g = tg, b = tb, a = ta }
pfUI.uf.target.debuffbar.color = GetStringColorObject(config.color)
pfUI.uf.target.debuffbar.bordercolor = GetStringColorObject(config.bordercolor)
pfUI.uf.target.debuffbar.textcolor = GetStringColorObject(config.textcolor)
pfUI.uf.target.debuffbar.threshold = tonumber(config.threshold)
pfUI.uf.target.debuffbar.anchors = {
pfUI.uf.target,
+1 -1
View File
@@ -429,7 +429,7 @@ pfUI:RegisterModule("chat", function ()
_G["ChatFrame" .. i .. "TabFlash"].Show = function() return end
end
local _, class = UnitClass("player")
local class = UnitClassBase("player")
local classColor = PFUI_CLASS_COLORS[class]
_G["ChatFrame" .. i .. "TabText"]:SetTextColor((classColor.r + .3) * .5, (classColor.g + .3) * .5, (classColor.b + .3) * .5, 1)
_G["ChatFrame" .. i .. "TabText"]:SetFont(panelfont,panelfont_size, "OUTLINE")
+1 -2
View File
@@ -96,8 +96,7 @@ pfUI:RegisterModule("chatcopy", function ()
scroll:Hide()
local editbox = CreateFrame("EditBox", "pfChatCopyBox" .. i, scroll)
editbox:SetHeight(frame:GetHeight())
editbox:SetWidth(frame:GetWidth())
editbox:SetSize(frame:GetSize())
editbox:SetAllPoints(scroll)
editbox:SetTextColor(1,1,1,1)
editbox:SetFontObject(ChatFontNormal)
+1 -1
View File
@@ -5,7 +5,7 @@ pfUI:RegisterModule("combopoints", function ()
ComboFrame:Hide()
ComboFrame:UnregisterAllEvents()
local _, class = UnitClass("player")
local class = UnitClassBase("player")
local combo_width = C["unitframes"]["combowidth"]
local combo_height = C["unitframes"]["comboheight"]
pfUI.combopoints = {}
+2 -4
View File
@@ -123,8 +123,7 @@ pfUI:RegisterModule("easteregg", function ()
local f = GetExplosion()
f:ClearAllPoints()
f:SetPoint("CENTER", fireworks, "TOPLEFT", x, y)
f:SetWidth(25)
f:SetHeight(25)
f:SetSize(25, 25)
f.tex:SetTexture(1,1,1,.5)
f:SetAlpha(1)
f:Show()
@@ -134,8 +133,7 @@ pfUI:RegisterModule("easteregg", function ()
local f = GetExplosion()
f:ClearAllPoints()
f:SetPoint("CENTER", fireworks, "TOPLEFT", x+(math.random(0,100)-50), y+(math.random(0,100)-50))
f:SetWidth(2)
f:SetHeight(2)
f:SetSize(2, 2)
f.tex:SetTexture(math.random(),math.random(),math.random(),1)
f:SetAlpha(1)
f:Show()
+1 -1
View File
@@ -2,7 +2,7 @@ local function getAdjustedTickTimer()
local adjustedEnergyTick = 2
-- Check rogue talents and compute energy tick timing reduction for Combat spec (1.18.0 Blade Rush Talent)
if UnitClass("player") == "Rogue" then
if UnitClassBase("player") == "ROGUE" then
local _, _, _, _, currRank = GetTalentInfo(2, 16)
local bladeRushRank = currRank or 0
+3 -2
View File
@@ -41,8 +41,9 @@ pfUI:RegisterModule("farmmode", function ()
pfUI.farmmap:RegisterForDrag("LeftButton")
pfUI.farmmap:SetScript("OnMouseWheel", function()
if IsControlKeyDown() then
this:SetWidth(this:GetWidth() + (arg1 > 0 and 10 or -10))
this:SetHeight(this:GetHeight() + (arg1 > 0 and 10 or -10))
local adjust = (arg1 > 0 and 10 or -10)
local width, height = this:GetSize()
this:SetSize(width + adjust, height + adjust)
Minimap_ZoomIn()
Minimap_ZoomOut()
elseif IsShiftKeyDown() then
+1 -1
View File
@@ -1,5 +1,5 @@
pfUI:RegisterModule("hunterbar", function ()
local _,class = UnitClass("player")
local class = UnitClassBase("player")
if class ~= "HUNTER" or C.bars.hunterbar == "0" then return end
-- Wing Clip (any rank) and Arcane Shot (any rank) spell IDs.
+1 -2
View File
@@ -7,8 +7,7 @@ pfUI:RegisterModule("innervatecall", function ()
if not GetNampowerVersion then return end
-- Only load for druids
local _, playerClass = UnitClass("player")
if playerClass ~= "DRUID" then return end
if UnitClassBase("player") ~= "DRUID" then return end
local INNERVATE_SPELLID = 29166
+4 -6
View File
@@ -103,8 +103,8 @@ pfUI:RegisterModule("map", function ()
WorldMapFrame:ClearAllPoints()
WorldMapFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
WorldMapFrame:SetWidth(WorldMapButton:GetWidth() + 15)
WorldMapFrame:SetHeight(WorldMapButton:GetHeight() + 55)
local wmWidth, wmHeight = WorldMapButton:GetSize()
WorldMapFrame:SetSize(wmWidth + 15, wmHeight + 55)
LoadMovable(WorldMapFrame)
-- skin
@@ -126,8 +126,7 @@ pfUI:RegisterModule("map", function ()
btn:SetHighlightTexture("")
btn.text = _G["pfUI_map_autozoneswitchText"]
CreateBackdrop(btn, nil, true)
btn:SetWidth(14)
btn:SetHeight(14)
btn:SetSize(14, 14)
btn:SetPoint("RIGHT", WorldMapContinentDropDown, "LEFT", -8, 2)
btn.text:ClearAllPoints()
btn.text:SetPoint("RIGHT", btn, "LEFT", -4, 1)
@@ -165,8 +164,7 @@ pfUI:RegisterModule("map", function ()
WorldMapButton.coords.text:SetJustifyH("RIGHT")
WorldMapButton.coords:SetScript("OnUpdate", function()
local width = WorldMapButton:GetWidth()
local height = WorldMapButton:GetHeight()
local width, height = WorldMapButton:GetSize()
local mx, my = WorldMapButton:GetCenter()
local scale = WorldMapButton:GetEffectiveScale()
local x, y = GetCursorPosition()
+1 -1
View File
@@ -85,7 +85,7 @@ pfUI:RegisterModule("mapcolors", function ()
end
local function ColorizeName(frame)
local _, class = UnitClass(frame.unit)
local class = UnitClassBase(frame.unit)
local color = PFUI_CLASS_COLORS[class]
frame.name = frame.name or UnitName(frame.unit)
frame.name = '|c'..color.colorStr..frame.name..'|r'
+36 -37
View File
@@ -4,7 +4,6 @@ pfUI:RegisterModule("nameplates", function ()
-- Local function references for performance
local GetTime = GetTime
local UnitExists = UnitExists
local UnitName = UnitName
local UnitClass = UnitClass
local UnitLevel = UnitLevel
@@ -58,6 +57,10 @@ pfUI:RegisterModule("nameplates", function ()
local inFriendlyZone = false
local platecount = 0
local registry = {}
-- Subset of registry that currently has a unit assigned (between
-- NAME_PLATE_UNIT_ADDED and _REMOVED). The central loop iterates this instead
-- of the full pool so hidden pool slots aren't touched every tick.
local visiblePlates = {}
local raidGuidCache = {} -- guid -> name (rebuilt on RAID_ROSTER_UPDATE/PARTY_MEMBERS_CHANGED)
@@ -69,7 +72,6 @@ pfUI:RegisterModule("nameplates", function ()
-- guid -> nameplate, maintained on NAME_PLATE_UNIT_ADDED/_REMOVED so a cast
-- event can find its plate in O(1) and only cache casts we actually show.
local plateByGuid = {}
local targetPlateGuid = nil
-- One-shot C_Spell poll. Only used to seed a plate that spawns while its
-- unit is already mid-cast (its SPELL_START_OTHER fired before the plate
@@ -113,7 +115,7 @@ pfUI:RegisterModule("nameplates", function ()
local debuffDisplayBuf = {} -- [i] = { effect, texture, stacks, dtype, duration, timeleft }
for i = 1, 16 do debuffDisplayBuf[i] = {} end
local threatMemory = {} -- guid -> true if mob had player targeted
local debuffSeen = {} -- reusable table for debuff tracking (avoid GC churn)
-- local debuffSeen = {} -- reusable table for debuff tracking (avoid GC churn)
-- PERF: visiblePlateCount maintained event-driven (NAME_PLATE_UNIT_ADDED/_REMOVED)
local visiblePlateCount = 0
@@ -177,7 +179,6 @@ pfUI:RegisterModule("nameplates", function ()
-- ============================================================================
local frameState = {
now = 0,
hasTarget = false,
targetGuid = nil,
mouseoverGuid = nil,
}
@@ -448,8 +449,7 @@ pfUI:RegisterModule("nameplates", function ()
nameplate.debuffs[i]:SetPoint(aligna, nameplate.debuffs[i-limit], alignb, 0, space)
end
nameplate.debuffs[i]:SetWidth(tonumber(C.nameplates.debuffsize))
nameplate.debuffs[i]:SetHeight(tonumber(C.nameplates.debuffsize))
nameplate.debuffs[i]:SetSize(debuffsize, debuffsize)
-- Update cooldown display settings
if nameplate.debuffs[i].cd then
@@ -476,9 +476,7 @@ nameplates:RegisterEvent("NAME_PLATE_UNIT_ADDED")
nameplates:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
nameplates:RegisterEvent("UNIT_AURA")
nameplates:RegisterEvent("UNIT_FLAGS")
-- nampower cast lifecycle for other units (gated by NP_EnableSpell{Start,Go}
-- Events, enabled by libdebuff). Drives castbars event-first instead of
-- polling C_Spell on every plate each tick. Mirrors castbar.lua's target bar.
nameplates:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
nameplates:RegisterEvent("SPELL_START_OTHER")
nameplates:RegisterEvent("SPELL_FAILED_OTHER")
@@ -498,7 +496,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
CacheConfig()
this:SetGameVariables()
RebuildRaidGuidCache()
targetPlateGuid = UnitExists("target") and UnitGUID("target") or nil
frameState.targetGuid = UnitGUID("target")
end
-- Handle friendly zone nameplate disable feature
@@ -558,6 +556,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
-- token itself for token-based UnitX reads (stable per plate lifetime).
local plate = C_NamePlate.GetNamePlateForUnit(arg1)
if plate and plate.nameplate then
visiblePlates[plate] = plate
local guid = UnitGUID(arg1)
plate.nameplate.cachedGuid = guid
plate.nameplate.unit = arg1
@@ -576,6 +575,8 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
visiblePlateCount = visiblePlateCount > 0 and visiblePlateCount - 1 or 0
-- arg1 = "nameplateN" unit token; UnitGUID still resolves inside the
-- handler (the slot is freed after dispatch returns)
local plate = C_NamePlate.GetNamePlateForUnit(arg1)
if plate then visiblePlates[plate] = nil end
local guid = UnitGUID(arg1)
if guid then
if debuffCache[guid] then debuffCache[guid] = nil end
@@ -583,7 +584,6 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
if combatColorCache[guid] then combatColorCache[guid] = nil end
if castState[guid] then castState[guid] = nil end
if plateByGuid[guid] then plateByGuid[guid] = nil end
local plate = C_NamePlate.GetNamePlateForUnit(arg1)
if plate and plate.nameplate and plate.nameplate.cachedGuid == guid then
plate.nameplate.cachedGuid = nil
plate.nameplate.unit = nil
@@ -591,10 +591,6 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
end
elseif event == "UNIT_FLAGS" then
-- ClassicAPI: fires with arg1 == "nameplateN" when a unit's flags change
-- (stun, combat enter/leave). Flag that plate for an immediate update,
-- bypassing the throttle. Guard on the token prefix -- UNIT_FLAGS also
-- fires for target/party/raid, which aren't ours to handle here.
if arg1 and strfind(arg1, "^nameplate") then
local plate = C_NamePlate.GetNamePlateForUnit(arg1)
if plate and plate.nameplate then
@@ -602,6 +598,17 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
end
end
elseif event == "UPDATE_MOUSEOVER_UNIT" then
local new = UnitGUID("mouseover")
local old = frameState.mouseoverGuid
if new ~= old then
frameState.mouseoverGuid = new
local po = old and plateByGuid[old]
if po then po.eventcache = true end
local pn = new and plateByGuid[new]
if pn then pn.eventcache = true end
end
elseif event == "SPELL_START_OTHER" then
-- nampower: arg2=spellId, arg3=casterGuid, arg6=castTime(ms),
-- arg7=channel duration(ms, 0 if not a channel), arg8=spellType
@@ -652,7 +659,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
end
elseif event == "PLAYER_TARGET_CHANGED" then
targetPlateGuid = UnitExists("target") and UnitGUID("target") or nil
frameState.targetGuid = UnitGUID('target')
-- Flag the target's plate for update
local plate = C_NamePlate.GetNamePlateForUnit("target")
if plate and plate.nameplate then
@@ -681,21 +688,15 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
-- PERF: Cache GetTime() once per frame
frameState.now = now
frameState.hasTarget, frameState.targetGuid = UnitExists("target")
frameState.mouseoverGuid = UnitGUID("mouseover")
-- propagate events to all nameplates
if this.eventcache then
this.eventcache = nil
for plate in pairs(registry) do
plate.eventcache = true
for plate in pairs(visiblePlates) do
plate.nameplate.eventcache = true
end
end
-- visiblePlateCount is maintained event-driven via NAME_PLATE_UNIT_ADDED/_REMOVED.
-- Central OnUpdate for all visible plates
for plate in pairs(registry) do
for plate in pairs(visiblePlates) do
if plate:IsVisible() then
nameplates.OnUpdate(plate, frameState)
end
@@ -728,7 +729,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
nameplates.OnCreate = function(frame)
local parent = frame or this
platecount = platecount + 1
platename = "pfNamePlate" .. platecount
local platename = "pfNamePlate" .. platecount
-- create pfUI nameplate overlay
local nameplate = CreateFrame("Button", platename, parent)
@@ -793,8 +794,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
nameplate.totem = CreateFrame("Frame", nil, nameplate)
nameplate.totem:SetPoint("CENTER", nameplate, "CENTER", 0, 0)
nameplate.totem:SetHeight(32)
nameplate.totem:SetWidth(32)
nameplate.totem:SetSize(32, 32)
nameplate.totem.icon = nameplate.totem:CreateTexture(nil, "OVERLAY")
nameplate.totem.icon:SetTexCoord(.078, .92, .079, .937)
nameplate.totem.icon:SetAllPoints()
@@ -882,11 +882,11 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
local plate_width = C.nameplates.width + 50
local plate_height = C.nameplates.heighthealth + font_size + 5
local plate_height_cast = C.nameplates.heighthealth + font_size + 5 + C.nameplates.heightcast + 5
-- local plate_height_cast = C.nameplates.heighthealth + font_size + 5 + C.nameplates.heightcast + 5
local combo_size = 5
local width = tonumber(C.nameplates.width)
local debuffsize = tonumber(C.nameplates.debuffsize)
-- local width = tonumber(C.nameplates.width)
-- local debuffsize = tonumber(C.nameplates.debuffsize)
local healthoffset = tonumber(C.nameplates.health.offset)
local orientation = C.nameplates.verticalhealth == "1" and "VERTICAL" or "HORIZONTAL"
@@ -1337,7 +1337,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
-- and immediately correct on de-target (unlike istarget which updates one tick later)
local targetGuid = state and state.targetGuid
local target = (targetGuid and nameplate.cachedGuid and targetGuid == nameplate.cachedGuid) or
(state and state.hasTarget and frame:GetAlpha() >= 0.99) or nil
(state and state.targetGuid and frame:GetAlpha() >= 0.99) or nil
-- Target plate castbar runs on its own dedicated frame (nameplates.castbarFrame).
-- For non-target plates with castbar active, use castbar throttle to ensure
-- smooth animation without overloading the central loop.
@@ -1451,7 +1451,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
-- Set non-target plate alpha
local configAlpha = cfg.notargalpha or 0.5
local desiredAlpha = (target or not state.hasTarget) and 1 or configAlpha
local desiredAlpha = (target or not state.targetGuid) and 1 or configAlpha
if nameplate.cachedAlpha ~= desiredAlpha then
nameplate:SetAlpha(desiredAlpha)
@@ -1542,8 +1542,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
nameplate.health.zoomTransition = true
else
if nameplate.health.zoomTransition then
nameplate.health:SetWidth(wc)
nameplate.health:SetHeight(hc)
nameplate.health:SetSize(wc, hc)
nameplate.health.zoomTransition = nil
end
nameplate.health.zoomed = true
@@ -1668,8 +1667,8 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER")
-- loop's nameplates_castbar gate.)
nameplates.castbarFrame = CreateFrame("Frame", nil, UIParent)
nameplates.castbarFrame:SetScript("OnUpdate", function()
if not cfg.showcastbar or not targetPlateGuid then return end
local nameplate = plateByGuid[targetPlateGuid]
if not cfg.showcastbar or not frameState.targetGuid then return end
local nameplate = plateByGuid[frameState.targetGuid]
if not nameplate then return end
nameplates.UpdateCastbar(nameplate, GetTime())
end)
+1 -1
View File
@@ -34,7 +34,7 @@ pfUI:RegisterModule("player", function ()
playerFrame.infoTopCenterText:SetHeight(14)
end
local _, myclass = UnitClass("player")
local myclass = UnitClassBase("player")
playerFrame.myclass = myclass
playerFrame.isSpellCaster = myclass ~= "WARRIOR" and myclass ~= "ROGUE" and myclass ~= "HUNTER"
+2 -2
View File
@@ -82,7 +82,7 @@ pfUI:RegisterModule("swingtimer", function ()
local ohR, ohG, ohB, ohA = ParseColor(C.unitframes.swingtimerohcolor, 0.3, 0.8, 0.3, 1)
local raR, raG, raB, raA = ParseColor(C.unitframes.swingtimerrangedcolor, 0.3, 0.6, 1.0, 1)
local rwR, rwG, rwB, rwA = ParseColor(C.unitframes.swingtimerrangedwarncolor, 0.9, 0.0, 0.0, 1)
local isHunter = UnitClass("player") == "Hunter"
local isHunter = UnitClassBase("player") == "HUNTER"
local mhDefaultR, mhDefaultG, mhDefaultB = mhR, mhG, mhB
@@ -908,7 +908,7 @@ pfUI:RegisterModule("swingtimer", function ()
S.autoAttackActive = false
elseif event == "PLAYER_ENTERING_WORLD" then
local _, class = UnitClass("player")
local class = UnitClassBase("player")
S.isWarrior = (class == "WARRIOR")
S.isDruid = (class == "DRUID")
UpdateWeaponSpeeds()
+2 -2
View File
@@ -201,7 +201,7 @@ pfUI:RegisterModule("tooltip", function ()
local pvpname = UnitPVPName(unit)
local name = UnitName(unit)
local validTarget, target = pcall(UnitName, unit .. 'target')
local _, class = UnitClass(unit)
local class = UnitClassBase(unit)
local guild, rankstr, rankid = GetGuildInfo(unit)
local reaction = UnitReaction(unit, "player")
local pvptitle = gsub(gsub(pvpname or name, name, "", 1), "^%s*(.-)%s*$", "%1")
@@ -236,7 +236,7 @@ pfUI:RegisterModule("tooltip", function ()
end
if validTarget and target then
local _, targetClass = UnitClass(unit .. "target")
local targetClass = UnitClassBase(unit .. "target")
local targetReaction = UnitReaction("player",unit .. "target")
if UnitIsPlayer(unit .. "target") and targetClass then
local color = PFUI_CLASS_COLORS[targetClass]
+1 -1
View File
@@ -128,7 +128,7 @@ pfUI:RegisterModule("tracking", function ()
end)
function pfUI.tracking:RefreshSpells()
local _, playerClass = UnitClass("player")
local playerClass = UnitClassBase("player")
local isCatForm = pfUI.tracking:PlayerIsDruidInCatForm(playerClass)
-- Build set of valid SpellIDs for this class
+1 -1
View File
@@ -309,7 +309,7 @@ function pfUI:CheckNewModules()
pfUI_init.seen_modules = pfUI_init.seen_modules or {}
local pending = 0
local _, playerClass = UnitClass("player")
local playerClass = UnitClassBase("player")
for _, entry in pairs(pfUI.new_modules) do
if not pfUI_init.seen_modules[entry.name] and pfUI_init["finalize"] then
if not entry.class or entry.class == playerClass then
+2 -2
View File
@@ -3,8 +3,8 @@ pfUI:RegisterSkin("Game Menu", function ()
CreateBackdrop(GameMenuFrame, nil, true, .75)
CreateBackdropShadow(GameMenuFrame)
GameMenuFrame:SetWidth(GameMenuFrame:GetWidth() - 30)
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
local menuWidth, menuHeight = GameMenuFrame:GetSize()
GameMenuFrame:SetSize(menuWidth - 30, menuHeight + 6)
local title = GetNoNameObject(GameMenuFrame, "FontString", "ARTWORK", MAIN_MENU)
title:SetTextColor(1,1,1,1)
+1 -1
View File
@@ -105,7 +105,7 @@ pfUI:RegisterSkin("Options - New", function ()
local er, eg, eb = pfUI.api.GetStringColor(pfUI_config.appearance.border.color)
btn:SetBackdropColor(br, bg, bb, 0.75)
btn:SetBackdropBorderColor(er, eg, eb, 1)
local _, class = UnitClass("player")
local class = UnitClassBase("player")
local color = PFUI_CLASS_COLORS[class]
SetHighlight(btn, color.r, color.g, color.b)
btn:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")