57 Commits
Author SHA1 Message Date
Brues 03ea3d5aa5 Clear cancelled resurrections announced over HealComm and CTRA
ParseChatMessage tested the raw message for "RessStop", which no
HealComm message is, so ParseComm's Resurrection/stop/ result was never
acted on. CTRA's RESNO was matched against the whole message, but it
carries the target's name, and the CTRA parser only recognised RES. A
cancelled rez from another player left the icon on the target's frame
until they were revived. RessStop still keeps a rez whose cast landed
and whose accept window is open.
2026-10-29 18:58:15 -05:00
Brues 2b4d33d46a Keep libpredict tracking casts when HealComm is loaded
With HealComm-1.0 present (HealComm, LunaUnitFrames, NotGrid), the
compat hook unregistered every event on libpredict.sender to stop pfUI
broadcasting a duplicate of the player's casts. Since cast detection
moved onto that frame's UNIT_SPELLCAST_* handlers, that also blinded
libpredict to every cast, so the player's own resurrections never put
the rez icon on the target's frame: ParseChatMessage drops the player's
own Resurrection echo, expecting the cast events to have tracked it.

The compat hook now only mutes the outgoing HealComm and CTRA messages.
The HealComm.SendAddonMessage hook that parsed the player's own messages
while solo goes too, since libpredict tracks its own casts directly.
2026-10-29 18:56:51 -05:00
Brues 94dcfb3dad Compute bar layout options instead of tabulating pfGridmath
pfGridmath listed every exact cols x rows grid per bar size; the only
live use was seeding the layout dropdown, which a divisor loop now does.

Everything else that read it was unreachable: every layout option is a
"cols x rows" string, so ResolveBarLayout's BarLayoutFormfactor lookup
never matched, and the actionbar module resets a stored layout that
isn't one before BarLayoutSize/BarButtonAnchor run, so their fallbacks
never fired. BarLayoutFormfactor and env/tables.lua go with it.
2026-10-29 14:16:43 -05:00
Brues 0890905eb6 Drop named-unit frames and the pfValidUnits global
CreateUnitFrame and CreateCastbar could take a character name instead of
a unit token, but every caller passes a token, so that mode and the
empty-label guards around it were dead. The OnClick TargetByName branch
could never run anyway: label was always a string, and "" is truthy.

With that gone, the aggro scan was the only reader of pfValidUnits, so
its unit list now lives in unitframes.lua and is built once at load.

/focusname resolves the name with UnitTokenFromName (exact first, then
prefix) instead of swapping the target and muting UIErrorsFrame.
2026-10-29 14:00:54 -05:00
Brues 6c76a88467 Draw unit frame bars with the native StatusBar
The custom bar sized its textures in Lua from GetWidth(), so it had to
track how ClassicAPI reports the UI scale (#71), and it stretched the bar
texture instead of cropping it. The engine's StatusBar does that layout
itself.

The background of the missing part is a second StatusBar that fills
from the other end (ClassicAPI's SetReverseFill), one frame level below
the fill, so the incoming-heal texture still draws between the two.
SetFrameLevel moves both, and the health and power bars now sit two
levels above their backdrops. SetStatusBarBackgroundTexture becomes
SetStatusBarBackgroundColor, as it only ever took a color.
2026-10-29 11:06:02 -05:00
Brues 35c32f365e Remove scaledsize fix 2026-10-29 10:38:28 -05:00
Brues 6dcb5162be bags: use ClassicAPI's native item search
C_Container.SetItemSearch drives the search box; slots dim from isFiltered on INVENTORY_SEARCH_UPDATE and on each slot update. Matches name, subclass, equip slot and equipment set names. Drops the tooltip-scanning full-text option.
2026-10-29 10:35:28 -05:00
Brues 8afafe71cf Drop RunMacroText fallback and dead actionbar spellslot branches
ClassicAPI 1.18 provides RunMacroText natively; bump CAPI min to 1.18.0. spellslot/booktype/scanmacro were only ever cleared, never set.
2026-10-29 10:35:28 -05:00
Brues 99ed538ee7 bump CAPI min to 1.17.10 2026-10-29 10:35:28 -05:00
Brues f382039f21 panel: show per-addon memory in FPS & Lag tooltip
Use UpdateAddOnMemoryUsage/GetAddOnMemoryUsage like Blizzard's MainMenuBar performance tooltip: total addon memory plus the top 3 consumers, formatted with the TOTAL_MEM/ADDON_MEM global strings. Guarded so the tooltip falls back gracefully on clients without these APIs.
2026-10-29 10:35:28 -05:00
Brues 8307dd757e Bump ClassicAPI minimum 1.17.4 2026-10-29 10:35:28 -05:00
Brues 5ab5337bbc Keep status bars true to their value on ClassicAPI 1.18.0
ClassicAPI 1.18.0 divides the UI scale out of an anchored frame's
GetWidth/GetHeight, as 4.3.4 does. The status bar still divided it out
itself, so under a UI scale below 1 the bar emptied early (at 29% health
on a 0.71 scale). Only divide on older ClassicAPI.

Fixes #71
2026-10-29 10:33:55 -05:00
Brues d15b1cd320 Only declare RunMacroText if it doesn't exist 2026-10-28 12:21:34 -05:00
0cabf2ec29 Add equipment manager auto-switching and "Unused" items panel (#70)
* Add equipment manager auto-switching and "Unused" items panel

Equipment manager (modules/equipmentmanager.lua):
- Add automatic set switching: ordered triggers (mounted, swimming,
  eating/drinking, shapeshift form/stance, zone, instance type, time
  of day, resting, stealthed, targeting a boss) equip a set; topmost
  matching trigger wins, with a 0.5s debounce
- Never swap gear in combat, while dead or casting; optionally restore
  the previous gear via a hidden "pfUI Auto-Restore" set
- Add an "Unused" side panel listing equippable items in bags, bank
  and paperdoll that no set uses, with an ignore list (tools and quest
  disguises pre-ignored), bank snapshot and bag highlighting
- Persist triggers, ignore list and bank snapshot in new per-character
  SavedVariable pfUI_eqmgr (all three .toc files)
- Add Character > Equipment Manager options (autoswitch, announce,
  minimum item quality, include bank) in gui.lua and config.lua
- Hide ignored-slot overlays when the manager frame is closed

Add frFR translations for the new equipment manager strings.

* equipmentmanager: lean on ClassicAPI for unused scan and autoswitch

- Unused panel: list items via GetInventoryItemsForSlot instead of
  hand-packing locations and walking the bags.
- Bank snapshot: record set membership while the bank is open.
  GetItemLocations reports bank items as missing once it closes, so set
  items in the bank were listed as unused.
- Autoswitch: check CanUseEquipmentSets and the UseEquipmentSet result
  before marking a trigger applied, and retry when the swap is blocked.
- Drive the engine from events (aura, form, zone, resting, target,
  regen) instead of a 4 Hz ticker; poll only swimming, time and eating.
- Detect eating/drinking by the localized names of the Food (433) and
  Drink (430) auras instead of hardcoded locale strings and icon paths.
- Drop presence guards on APIs that always exist; use strsplittable and
  strtrim for trigger values.

* equipmentmanager: wake the dining trigger on player health/mana events

Drop dining from the poll: listen to UNIT_HEALTH/UNIT_MANA for the player
while a dining trigger is enabled, so taking the set off once full is
event-driven. Register UNIT_AURA for the player only.

* equipmentmanager: split trigger values with strsplit

strsplittable needs ClassicAPI 1.17.11; strsplit has been there since
1.7.3, so this keeps the minimum where it is.

* equipmentmanager: let the trigger hint wrap

---------

Co-authored-by: Duciel <336374+Duciel@users.noreply.github.com>
Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
2026-10-27 11:02:44 -05:00
Brues fe376b8e51 Keep buff timer text above the cooldown sweep 2026-10-25 20:32:49 -05:00
Brues e326cea05e Add radial sweeps to buff/debuff icon display 2026-10-25 20:26:45 -05:00
Brues d9e74b3bc5 Add per-frame reverse toggle for cooldown sweeps 2026-10-25 20:24:12 -05:00
Brues 0e428de74c Fix inactive nameplate alpha capped at 99%
CacheConfig clamped notargalpha to 0.99, so a 100% setting never reached full opacity. Clamp to 1.0 instead and detect the target plate by GUID comparison only, removing the alpha-based fallback that required the headroom.
2026-10-25 20:00:50 -05:00
Brues df21f1f26c stable: capture per-iteration button in Enable/Disable closures
Lua 5.0 shares the generic-for loop variable across iterations, so the
closures all saw the final (nil) value.
2026-10-25 12:12:05 -05:00
Brues bd7bf3f39f Size aura cooldown text to its laid-out icon
Unit frame aura icons only get their size from the layout pass, but
RefreshUnit started their timers before it ran. A cooldown text created
on a never-laid-out icon saw a height of 0 and fell back to a 16pt font,
so some buff and debuff timers overflowed their icons. (Closes #64)

- RefreshUnit stores each aura's timer and starts them after
  LayoutAuras, once every icon has its final size.
- With dynamic size on, the cooldown text re-sizes its font whenever
  its frame's height changed since the last SetTimer, so icons that
  switch between the normal and own aura size keep a matching font.
2026-10-25 11:48:24 -05:00
Brues 987c337709 Revert "Remove CLINK parsing"
This reverts commit c03b74c3d1.
2026-10-25 11:39:39 -05:00
Brues cdaf9336a3 nameplates: skip destroyed plates on PLAYER_LOGOUT
Leaving the world destroys the units before PLAYER_LOGOUT fires, so some
plates in the registry are already dead: their overlay buttons dropped
their events and lost their methods, and UnregisterAllEvents errored as a
nil method. Only silence the plates that are still alive.
2026-10-25 11:33:51 -05:00
Brues e4f0849816 Pass the draw layer as CreateTexture's second argument
CreateTexture("OVERLAY") names the texture "OVERLAY" and leaves it on
the default ARTWORK layer. Pass nil for the name so the layer applies.
2026-10-25 11:21:01 -05:00
Brues c03b74c3d1 Remove CLINK parsing 2026-10-24 23:23:16 -05:00
Brues e583ac1e83 Drive mapreveal from MAP_EXPLORATION_UPDATED and C_MapExplorationInfo 2026-10-24 21:33:12 -05:00
Brues 964c316cdc Replace Nampower combat events with ClassicAPI events
Read casts from UNIT_SPELLCAST_* and heal amounts from
COMBAT_LOG_EVENT_UNFILTERED in libpredict, swingtimer and the prowl
page switch. Drop libdebuff's AURA_CAST/DEBUFF_* bookkeeping and hook
tables, which nothing read: its aura readers already use C_UnitAuras.
Drop the unitframe BUFF_ADDED_OTHER start-time tracker, since
C_UnitAuras stamps an expiration for auras seen being applied.
2026-10-23 21:27:28 -05:00
Brues b73ed88346 Split chat faction and race icons into separate options 2026-10-23 19:33:08 -05:00
Brues b374a0914a Color equipment flyout borders by item quality 2026-10-23 17:27:37 -05:00
Brues aaddeb120a Drive innervate callout from the combat log
Read Innervate casts from COMBAT_LOG_EVENT_UNFILTERED instead of
Nampower's AURA_CAST events, taking the target name from the event.
Schedule the ready callout once Innervate's own cooldown appears on
SPELL_UPDATE_COOLDOWN; at cast time GetSpellCooldown reports only the GCD.
2026-10-23 17:03:23 -05:00
Brues 1ad78d43e9 nil 2026-10-23 16:21:05 -05:00
Brues dde4a5aa2d Merge chat class color and player level passes into one loop 2026-10-23 12:51:04 -05:00
Brues e7e1382693 Port unitframe and actionbar performance fixes from Duciel/pfUI@45f8ca6
Unitframes: only set the unit attribute when it changes, poll group frame indicators every 3s since events already cover them, and limit full refreshes on eventless frames to unit changes or once a second.

Actionbar: handle UNIT_INVENTORY_CHANGED with a light count/cooldown/usable pass instead of a full update of every button, and skip hidden buttons in the cached passes, catching them up once they become visible.
2026-10-23 12:39:07 -05:00
Brues 6aaf4f2047 Read chat sender and channel from GetCurrentChatEvent
Pull the CHAT_MSG payload once per line instead of decoding it from the
rendered text. The sender match uses arg2 rather than the name resolved
from the GUID, and channel shortening only runs on CHAT_MSG_CHANNEL with
a single anchored replacement in place of the backtracking pattern.
2026-10-23 03:12:42 -05:00
Brues 233d0dafc0 one more bump 2026-10-23 03:09:07 -05:00
Brues 95e832835e Color chat senders by GUID and drop the who-search option
The engine name-queries a chat sender before the CHAT_MSG event fires,
so GetPlayerInfoByGUID(GetCurrentChatGUID()) resolves every player
sender, including strangers in world channels. Other names in the text
still fall back to C_PlayerCache.GetPlayerInfoByName and libunitscan.

This makes the silent /who lookup for unknown classes obsolete; remove
it along with its FriendsFrame_OnEvent wrapper, config default, GUI
entry and translations.
2026-10-23 02:40:08 -05:00
Brues cae7c2d68a Guard unusable bag refresh against the bank frame not existing yet 2026-10-23 02:39:42 -05:00
Brues 8abde7beba Classify nameplate units with UnitSelectionType instead of bar color 2026-10-23 02:06:43 -05:00
Brues fbb0c4c254 Refresh unusable bag tint when item requirements change 2026-10-23 02:00:27 -05:00
Brues 42e950639f Rotate bar textures on vertical XP, rep and nameplate health bars
Vertical StatusBars stretched the bar texture's shading along the wrong axis. ClassicAPI's SetRotatesTexture turns it with the bar.
2026-10-22 23:56:51 -05:00
Brues e70c8025c2 Draw the ranged swing timer as a native center-fill StatusBar
The ranged bar faked its fills with three textures resized and re-texcoorded every frame. A StatusBar with ClassicAPI's SetFillStyle covers all of it: CENTER for hunters (reload drains to the middle, the deadzone grows back out in the warn color), STANDARD otherwise.
2026-10-22 23:43:44 -05:00
Brues 8f1322d71c Skin ClassicAPI's Interface Options frame and its option controls
SkinCollapseButton's icon no longer takes the mouse, so clicks reach the button under it.
2026-10-22 23:34:08 -05:00
Brues 935b854073 Remove dead buffdetect setting 2026-10-22 23:25:59 -05:00
Brues df16988d3f Flow unit frame auras: debuffs first on enemies, own size, spacing
Unit frame aura icons are placed by a layout pass after each aura
refresh instead of a fixed grid set at setup. Rows are as tall as
their largest icon, and the debuff block no longer uses the debuff
size to step past buff rows. (Closes #25)

- When buffs and debuffs share a corner, debuffs come first on
  neutral and hostile units.
- New Own Buff Size / Own Debuff Size (-1 = normal size) enlarge the
  player's auras, which C_UnitAuras already lists first.
- New Buff/Debuff X-Spacing and Y-Spacing set the gaps between icons
  and rows; the default of 1 keeps the old look.
- The selfdebuff tooltip remap is gone from unit frames and buffwatch:
  own auras lead the list, so the HARMFUL|PLAYER index is the HARMFUL
  index.
2026-10-22 23:24:15 -05:00
Brues 627ab8b437 Use ClassicAPI's native Cooldown frame for cooldown sweeps
ClassicAPI 1.17.1 draws the Cooldown sweep natively, as 4.3.4's
CGCooldown, so pfUI's cooldowns no longer need the indicator Model.

- Action buttons, bank slots, totems, unit frame auras and icons, and
  nameplate debuffs are Cooldown frames with CooldownFrameTemplate.
- The plain-Frame fallbacks for disabled animations are gone; the hook
  already hides the sweep with alpha 0.
- The 36px scale-and-inset realign only runs on stock indicator Models.
2026-10-22 22:47:18 -05:00
Brues c36184081a Bump min ClassicAPI to 1.17.1 2026-10-22 22:19:35 -05:00
Brues d881d73246 Use region:IsMouseOver instead of the MouseIsOver global 2026-10-22 21:37:50 -05:00
Brues b9f473c049 Test hover against the hit rect, not the bare frame rect
CreateBackdrop widens a frame's hit rect by the border, so mouse focus
and OnEnter/OnLeave cover a band that plain MouseIsOver reports as
outside. Add MouseIsOverHitRect, which passes the frame's hit rect
insets as MouseIsOver offsets, and use it at the unpadded call sites.
The XP bar's hover text follows the same OnEnter/OnLeave flag as its
fade.
2026-10-22 21:36:27 -05:00
Brues 9cb21b982b Use ClassicAPI animation groups for fades and pulses
Replace hand-rolled OnUpdate alpha loops with engine animation groups:
unit frame aggro/combat glow, tracking icon pulse, new-mail blink,
castbar fade-out, autohide, XP/rep bar fade, info box timeout and the
unlock-mode scale label. Timing no longer depends on framerate, and the
always-running glow driver and tracking OnUpdate are gone.

The XP bar tracks hover through OnEnter/OnLeave instead of MouseIsOver,
so a fade can't restart under the cursor.
2026-10-22 21:28:34 -05:00
Brues 65ad47e842 Bump min ClassicAPI to 1.17 2026-10-22 21:10:39 -05:00
Brues 50aba54289 castbar, nameplates: update the shield on mid-cast interruptible changes 2026-10-22 21:09:17 -05:00
Brues d58060b188 hoverbind: Escape clears every key bound to the button 2026-10-22 21:00:01 -05:00
Brues 340bd9be9e pagemaster: page modifiers via override bindings; hoverbind: warn on conflicts
The old pagemaster wipe block checked a setting that was migrated away and
never ran, so saved MOD-key bindings beat the paged action. Override every
key bound to ACTIONBUTTON1-12 for each enabled page modifier instead; the
saved binding set stays untouched.

Hoverbind now reports when a bind takes a key from another action, and when
an override masks the new bind.
2026-10-22 20:59:30 -05:00
Thorsten42andBrues 287a4ed46c Fix panel alignment: center-panel overlap and Quest Log/Friends/Spellbook heights (#63)
* Only move the center panel when it overlaps the left panel

The panel aligner cached the left panel's rightmost child once and then
re-anchored the center panel to that edge on every change. Children that
were hidden later (such as Spellbook skill-line tabs) kept pushing the
center panel right, and panels that already cleared the left panel were
pulled back to the left.

Recalculate the rightmost visible child while both panels are shown and
only shift the center panel when its backdrop really overlaps.

* Align Quest Log, Friends and Spellbook panel heights

Most skinned panels draw their backdrop 430px tall, 10px below the frame
top (insets 10/-10 and -30/72). Three panels did not match:

- Quest Log: frame was 440px and anchored at y -104, so it stood 10px
  taller than a panel opened beside it. It is now 430px at y -114, with
  the list/detail panes and visible rows (22) reduced to fit.
- Friends: bottom inset was 74 instead of 72.
- Spellbook: top-left inset was 12/-12 instead of 10/-10.

The Quest Log is a doublewide UI panel. Opening another panel next to
it made UpdateUIPanelPositions re-anchor it to the default (0, -104),
causing a visible jump. Its UIPanelWindows entry now carries the same
x/y offsets as the OnShow anchor.

* Let the panel manager place UI panels

Remove the OnUpdate panel aligner. UpdateUIPanelPositions already lays
out left/center/right panels, and with the overlap-only rule the
aligner no longer changed the spacing in normal cases.

The Quest Log's UIPanelWindows offsets put it at 10, -114 on every
layout pass, so the QuestLog_OnShow re-anchor is redundant.

---------

Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
2026-10-22 20:48:41 -05:00
Seraphic8x2244 341ba95561 Fix addon button panel startup visibility (#61)
* fix(addonbuttons): rescan before startup visibility check

* Fix missing percentage symbols in unitframe labels
2026-10-22 20:40:00 -05:00
Brues 1600ec333b game_menu: skin every menu button dynamically
Scan GameMenuFrame's children on load and on each show instead of a
hardcoded list, so buttons added by other addons (ClassicAPI AddOn
Options, MoveAnything, MCP, SuperMacro, HardcoreDeath, Turtle shop) get
skinned without per-addon calls.
2026-10-22 18:41:47 -05:00
Brues 471c5713c5 use GetPhysicalScreenSize to get Screen Resolution 2026-10-19 20:20:03 -05:00
Brues 5d38322b2e stable: skin every stabled pet slot the client creates 2026-10-19 01:33:09 -05:00
62 changed files with 2667 additions and 3073 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ do
-- on. There pfUI does load, and will throw wherever it reaches for something -- on. There pfUI does load, and will throw wherever it reaches for something
-- the installed DLL doesn't have yet -- the popup names the cause so those -- the installed DLL doesn't have yet -- the popup names the cause so those
-- errors aren't a mystery. -- errors aren't a mystery.
local PFUI_CLASSIC_API_MIN = 11510 -- (X*10000 + Y*100 + Z) local PFUI_CLASSIC_API_MIN = 11800 -- (X*10000 + Y*100 + Z)
local PFUI_CLASSIC_API_LATEST = PFUI_CLASSIC_API_MIN local PFUI_CLASSIC_API_LATEST = PFUI_CLASSIC_API_MIN
local PFUI_CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI" local PFUI_CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI"
local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest" local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest"
+47 -60
View File
@@ -293,14 +293,6 @@ function pfUI.api.GetFactionIcon(raceKey)
return FACTION_ICON[info.faction] or "" return FACTION_ICON[info.faction] or ""
end end
-- [ GetPlayerRaceIcons ]
-- Returns the faction and race emblems of the player character.
-- return: [string] both inline textures, or an empty string
function pfUI.api.GetPlayerRaceIcons()
local _, raceKey = UnitRace("player")
return pfUI.api.GetFactionIcon(raceKey) .. pfUI.api.GetRaceIcon(raceKey, UnitSex("player"))
end
-- [ strvertical ] -- [ strvertical ]
-- Creates vertical text using linebreaks. Multibyte char friendly. -- Creates vertical text using linebreaks. Multibyte char friendly.
-- 'str' [string] String to columnize. -- 'str' [string] String to columnize.
@@ -1361,15 +1353,18 @@ end
-- [ Bar Layout Options ] -- -- [ Bar Layout Options ] --
-- 'barsize' size of bar in number of buttons -- 'barsize' size of bar in number of buttons
-- returns: array of options as strings for pfUI.gui.bar -- returns: array of options as strings for pfUI.gui.bar: every grid
-- that fits the bar exactly, plus common uneven ones
function pfUI.api.BarLayoutOptions(barsize) function pfUI.api.BarLayoutOptions(barsize)
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutOptions: barsize "..tostring(barsize).." is invalid") assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutOptions: barsize "..tostring(barsize).." is invalid")
local options, seen = {}, {} local options, seen = {}, {}
local function add(option) local function add(option)
if not seen[option] then table.insert(options, option); seen[option] = true end if not seen[option] then table.insert(options, option); seen[option] = true end
end end
for i,layout in ipairs(pfGridmath[barsize]) do for cols = 1, barsize do
add(string.format("%d x %d",layout[1],layout[2])) if barsize % cols == 0 then
add(string.format("%d x %d", cols, barsize / cols))
end
end end
for _, option in ipairs({ for _, option in ipairs({
"1 x 12", "1 x 10", "2 x 10", "2 x 5", "3 x 10", "3 x 5", "3 x 3", "1 x 12", "1 x 10", "2 x 10", "2 x 5", "3 x 10", "3 x 5", "3 x 3",
@@ -1389,49 +1384,23 @@ function pfUI.api.BarLayoutOptions(barsize)
return options return options
end end
-- [ Bar Layout Formfactor ] -- -- 'formfactor' has to be a "cols x rows" string; the actionbar module resets
-- 'option' string option as used in pfUI_config.bars[bar].option -- a stored layout that isn't one before it lays out a bar
-- returns: integer formfactor
local formfactors = {}
setmetatable(formfactors, {__mode = "v"}) -- weak table so values not referenced are collected on next gc
function pfUI.api.BarLayoutFormfactor(option)
if formfactors[option] then
return formfactors[option]
else
for barsize,_ in ipairs(pfGridmath) do
local options = pfUI.api.BarLayoutOptions(barsize)
for i,opt in ipairs(options) do
if opt == option then
formfactors[option] = i
return formfactors[option]
end
end
end
end
end
local function ResolveBarLayout(barsize, formfactor, uneven) local function ResolveBarLayout(barsize, formfactor, uneven)
local layout = tostring(formfactor or "") local _, _, a, b = string.find(formfactor, "(%d+)%s*x%s*(%d+)")
local _, _, a, b = string.find(layout, "(%d+)%s*x%s*(%d+)") local cols, rows = tonumber(a), tonumber(b)
if a and b then cols = math.min(NUM_ACTIONBAR_BUTTONS, math.max(1, cols))
local cols, rows = tonumber(a), tonumber(b) rows = math.min(NUM_ACTIONBAR_BUTTONS, math.max(1, rows))
cols = math.min(NUM_ACTIONBAR_BUTTONS, math.max(1, cols)) local orientation = string.upper(uneven or "DOWN")
rows = math.min(NUM_ACTIONBAR_BUTTONS, math.max(1, rows)) local mode = (orientation == "LEFT" or orientation == "RIGHT") and "cols" or "rows"
local orientation = string.upper(uneven or "DOWN") if mode == "rows" then
local mode = (orientation == "LEFT" or orientation == "RIGHT") and "cols" or "rows" cols = math.max(1, math.min(cols, barsize))
if mode == "rows" then rows = math.max(1, math.ceil(barsize / cols))
cols = math.max(1, math.min(cols, barsize)) else
rows = math.max(1, math.ceil(barsize / cols)) rows = math.max(1, math.min(rows, barsize))
else cols = math.max(1, math.ceil(barsize / rows))
rows = math.max(1, math.min(rows, barsize))
cols = math.max(1, math.ceil(barsize / rows))
end
return cols, rows, mode, orientation
end end
local index = pfUI.api.BarLayoutFormfactor(layout) return cols, rows, mode, orientation
if not index then return nil end
local cols, rows = unpack(pfGridmath[barsize][index])
return cols, rows, "rows", "DOWN"
end end
-- [ Bar Layout Size ] -- -- [ Bar Layout Size ] --
@@ -1442,7 +1411,6 @@ end
function pfUI.api.BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize,padding,uneven,fillmode) function pfUI.api.BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize,padding,uneven,fillmode)
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutSize: barsize "..tostring(barsize).." is invalid") assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutSize: barsize "..tostring(barsize).." is invalid")
local cols, rows = ResolveBarLayout(barsize, formfactor, uneven) local cols, rows = ResolveBarLayout(barsize, formfactor, uneven)
if not cols or not rows then cols, rows = unpack(pfGridmath[barsize][1]) end
local width = (iconsize + bordersize*2+padding) * cols + padding local width = (iconsize + bordersize*2+padding) * cols + padding
local height = (iconsize + bordersize*2+padding) * rows + padding local height = (iconsize + bordersize*2+padding) * rows + padding
bar._size = {width,height} bar._size = {width,height}
@@ -1460,9 +1428,6 @@ end
function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor,iconsize,bordersize,padding,uneven,fillmode) function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor,iconsize,bordersize,padding,uneven,fillmode)
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarButtonAnchor: barsize "..tostring(barsize).." is invalid") assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarButtonAnchor: barsize "..tostring(barsize).." is invalid")
local cols, rows, mode, orientation = ResolveBarLayout(barsize, formfactor, uneven) local cols, rows, mode, orientation = ResolveBarLayout(barsize, formfactor, uneven)
if not cols or not rows then
cols, rows, mode, orientation = unpack(pfGridmath[barsize][1]), "rows", "DOWN"
end
-- fillmode: remap buttonindex to slotindex (grid position in native fill order) -- fillmode: remap buttonindex to slotindex (grid position in native fill order)
-- only needed when fill direction differs from layout mode -- only needed when fill direction differs from layout mode
@@ -1543,6 +1508,18 @@ function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor
return button._anchor return button._anchor
end end
-- [ MouseIsOverHitRect ] --
-- Like frame:IsMouseOver(), but tests the frame's hit rect, the area the
-- engine uses for mouse focus and OnEnter/OnLeave. CreateBackdrop widens
-- that rect by the border, so plain IsMouseOver misses a band around it.
-- 'frame' the frame to test
-- return true when the cursor is inside the frame's hit rect
function pfUI.api.MouseIsOverHitRect(frame)
if not frame.GetHitRectInsets then return frame:IsMouseOver() end
local left, right, top, bottom = frame:GetHitRectInsets()
return frame:IsMouseOver(-top, bottom, left, -right)
end
-- [ Enable Autohide ] -- -- [ Enable Autohide ] --
-- 'frame' the frame that should be hidden -- 'frame' the frame that should be hidden
function pfUI.api.EnableAutohide(frame, timeout, combat) function pfUI.api.EnableAutohide(frame, timeout, combat)
@@ -1555,11 +1532,20 @@ function pfUI.api.EnableAutohide(frame, timeout, combat)
frame.hover.parent = frame frame.hover.parent = frame
frame.hover:Show() frame.hover:Show()
if not frame.hover.fade then
frame.hover.fade = frame:CreateAnimationGroup()
local fade = frame.hover.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(1)
frame.hover.fade:SetScript("OnFinished", function() frame:SetAlpha(0) end)
end
if combat then if combat then
frame.hover:RegisterEvent("PLAYER_REGEN_ENABLED") frame.hover:RegisterEvent("PLAYER_REGEN_ENABLED")
frame.hover:RegisterEvent("PLAYER_REGEN_DISABLED") frame.hover:RegisterEvent("PLAYER_REGEN_DISABLED")
frame.hover:SetScript("OnEvent", function() frame.hover:SetScript("OnEvent", function()
if event == "PLAYER_REGEN_DISABLED" then if event == "PLAYER_REGEN_DISABLED" then
this.fade:Stop()
this.parent:SetAlpha(1) this.parent:SetAlpha(1)
this.activeTo = "keep" this.activeTo = "keep"
elseif event == "PLAYER_REGEN_ENABLED" then elseif event == "PLAYER_REGEN_ENABLED" then
@@ -1575,13 +1561,13 @@ function pfUI.api.EnableAutohide(frame, timeout, combat)
if this.activeTo == "keep" then return end if this.activeTo == "keep" then return end
if MouseIsOver(this, 10, -10, -10, 10) then if this:IsMouseOver(10, -10, -10, 10) then
this.activeTo = GetTime() + timeout this.activeTo = GetTime() + timeout
this.fade:Stop()
this.parent:SetAlpha(1) this.parent:SetAlpha(1)
elseif this.activeTo then elseif this.activeTo then
if this.activeTo < GetTime() and this.parent:GetAlpha() > 0 then if this.activeTo < GetTime() and this.parent:GetAlpha() > 0 and not this.fade:IsPlaying() then
local fps = (60 / math.max(GetFramerate(), 1)) this.fade:Play()
this.parent:SetAlpha(this.parent:GetAlpha() - 0.05*fps)
end end
else else
this.activeTo = GetTime() + timeout this.activeTo = GetTime() + timeout
@@ -1598,6 +1584,7 @@ function pfUI.api.DisableAutohide(frame)
frame.hover:SetScript("OnEvent", nil) frame.hover:SetScript("OnEvent", nil)
frame.hover:SetScript("OnUpdate", nil) frame.hover:SetScript("OnUpdate", nil)
frame.hover:Hide() frame.hover:Hide()
frame.hover.fade:Stop()
frame:SetAlpha(1) frame:SetAlpha(1)
end end
+19 -4
View File
@@ -71,6 +71,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("buffs", nil, "debuffrowsize", "16") pfUI:UpdateConfig("buffs", nil, "debuffrowsize", "16")
pfUI:UpdateConfig("buffs", nil, "textinside", "0") pfUI:UpdateConfig("buffs", nil, "textinside", "0")
pfUI:UpdateConfig("buffs", nil, "fontsize", "-1") pfUI:UpdateConfig("buffs", nil, "fontsize", "-1")
pfUI:UpdateConfig("buffs", nil, "cooldown_anim", "1")
pfUI:UpdateConfig("buffs", nil, "cooldown_reverse", "1")
pfUI:UpdateConfig("buffbar", "pbuff", "enable", "0") pfUI:UpdateConfig("buffbar", "pbuff", "enable", "0")
pfUI:UpdateConfig("buffbar", "pbuff", "use_unitfonts", "0") pfUI:UpdateConfig("buffbar", "pbuff", "use_unitfonts", "0")
@@ -169,11 +171,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("appearance", "bags", "newitem_color", "1,1,1,1") pfUI:UpdateConfig("appearance", "bags", "newitem_color", "1,1,1,1")
pfUI:UpdateConfig("appearance", "bags", "borderlimit", "1") pfUI:UpdateConfig("appearance", "bags", "borderlimit", "1")
pfUI:UpdateConfig("appearance", "bags", "borderonlygear", "0") pfUI:UpdateConfig("appearance", "bags", "borderonlygear", "0")
pfUI:UpdateConfig("appearance", "bags", "fulltext", "1")
pfUI:UpdateConfig("appearance", "bags", "movable", "0") pfUI:UpdateConfig("appearance", "bags", "movable", "0")
pfUI:UpdateConfig("appearance", "bags", "abovechat", "0") pfUI:UpdateConfig("appearance", "bags", "abovechat", "0")
pfUI:UpdateConfig("appearance", "bags", "hidechat", "0") pfUI:UpdateConfig("appearance", "bags", "hidechat", "0")
pfUI:UpdateConfig("appearance", "bags", "icon_size", "-1") pfUI:UpdateConfig("appearance", "bags", "icon_size", "-1")
pfUI:UpdateConfig("appearance", "bags", "cooldown_reverse", "0")
pfUI:UpdateConfig("appearance", "bags", "bagrowlength", "10") pfUI:UpdateConfig("appearance", "bags", "bagrowlength", "10")
pfUI:UpdateConfig("appearance", "bags", "bankrowlength", "10") pfUI:UpdateConfig("appearance", "bags", "bankrowlength", "10")
pfUI:UpdateConfig("appearance", "bags", "autoSortOnOpen", "0") pfUI:UpdateConfig("appearance", "bags", "autoSortOnOpen", "0")
@@ -228,7 +230,6 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", nil, "rangecheck", "0") pfUI:UpdateConfig("unitframes", nil, "rangecheck", "0")
pfUI:UpdateConfig("unitframes", nil, "rangecheck_mode", "vanilla") pfUI:UpdateConfig("unitframes", nil, "rangecheck_mode", "vanilla")
pfUI:UpdateConfig("unitframes", nil, "rangecheck_distance", "40") pfUI:UpdateConfig("unitframes", nil, "rangecheck_distance", "40")
pfUI:UpdateConfig("unitframes", nil, "buffdetect", "0")
pfUI:UpdateConfig("unitframes", nil, "druidmanabar", "1") pfUI:UpdateConfig("unitframes", nil, "druidmanabar", "1")
pfUI:UpdateConfig("unitframes", nil, "druidmanaheight", "10") pfUI:UpdateConfig("unitframes", nil, "druidmanaheight", "10")
pfUI:UpdateConfig("unitframes", nil, "druidmanawidth", "-1") pfUI:UpdateConfig("unitframes", nil, "druidmanawidth", "-1")
@@ -517,14 +518,21 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", unit, "pspace", "-3") pfUI:UpdateConfig("unitframes", unit, "pspace", "-3")
pfUI:UpdateConfig("unitframes", unit, "cooldown_text", "1") pfUI:UpdateConfig("unitframes", unit, "cooldown_text", "1")
pfUI:UpdateConfig("unitframes", unit, "cooldown_anim", "0") pfUI:UpdateConfig("unitframes", unit, "cooldown_anim", "0")
pfUI:UpdateConfig("unitframes", unit, "cooldown_reverse", "1")
pfUI:UpdateConfig("unitframes", unit, "buffs", "TOPLEFT") pfUI:UpdateConfig("unitframes", unit, "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", unit, "buffsize", "20") pfUI:UpdateConfig("unitframes", unit, "buffsize", "20")
pfUI:UpdateConfig("unitframes", unit, "bufflimit", "32") pfUI:UpdateConfig("unitframes", unit, "bufflimit", "32")
pfUI:UpdateConfig("unitframes", unit, "buffperrow", "8") pfUI:UpdateConfig("unitframes", unit, "buffperrow", "8")
pfUI:UpdateConfig("unitframes", unit, "ownbuffsize", "-1")
pfUI:UpdateConfig("unitframes", unit, "buffspacingx", "1")
pfUI:UpdateConfig("unitframes", unit, "buffspacingy", "1")
pfUI:UpdateConfig("unitframes", unit, "debuffs", "TOPLEFT") pfUI:UpdateConfig("unitframes", unit, "debuffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", unit, "debuffsize", "20") pfUI:UpdateConfig("unitframes", unit, "debuffsize", "20")
pfUI:UpdateConfig("unitframes", unit, "debufflimit", "32") pfUI:UpdateConfig("unitframes", unit, "debufflimit", "32")
pfUI:UpdateConfig("unitframes", unit, "debuffperrow", "8") pfUI:UpdateConfig("unitframes", unit, "debuffperrow", "8")
pfUI:UpdateConfig("unitframes", unit, "owndebuffsize", "-1")
pfUI:UpdateConfig("unitframes", unit, "debuffspacingx", "1")
pfUI:UpdateConfig("unitframes", unit, "debuffspacingy", "1")
pfUI:UpdateConfig("unitframes", unit, "invert_healthbar", "0") pfUI:UpdateConfig("unitframes", unit, "invert_healthbar", "0")
pfUI:UpdateConfig("unitframes", unit, "verticalbar", "0") pfUI:UpdateConfig("unitframes", unit, "verticalbar", "0")
pfUI:UpdateConfig("unitframes", unit, "buff_indicator", "0") pfUI:UpdateConfig("unitframes", unit, "buff_indicator", "0")
@@ -677,6 +685,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "bind_size", "8") pfUI:UpdateConfig("bars", nil, "bind_size", "8")
pfUI:UpdateConfig("bars", nil, "bind_color", "1,1,0,1") pfUI:UpdateConfig("bars", nil, "bind_color", "1,1,0,1")
pfUI:UpdateConfig("bars", nil, "cd_size", "12") pfUI:UpdateConfig("bars", nil, "cd_size", "12")
pfUI:UpdateConfig("bars", nil, "cooldown_reverse", "0")
pfUI:UpdateConfig("bars", "gryphons", "texture", "None") pfUI:UpdateConfig("bars", "gryphons", "texture", "None")
pfUI:UpdateConfig("bars", "gryphons", "color", ".6,.6,.6,1") pfUI:UpdateConfig("bars", "gryphons", "color", ".6,.6,.6,1")
@@ -690,6 +699,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("totems", nil, "iconsize", "26") pfUI:UpdateConfig("totems", nil, "iconsize", "26")
pfUI:UpdateConfig("totems", nil, "spacing", "3") pfUI:UpdateConfig("totems", nil, "spacing", "3")
pfUI:UpdateConfig("totems", nil, "showbg", "0") pfUI:UpdateConfig("totems", nil, "showbg", "0")
pfUI:UpdateConfig("totems", nil, "cooldown_reverse", "1")
pfUI:UpdateConfig("panel", nil, "use_unitfonts", "0") pfUI:UpdateConfig("panel", nil, "use_unitfonts", "0")
pfUI:UpdateConfig("panel", nil, "hide_leftchat", "0") pfUI:UpdateConfig("panel", nil, "hide_leftchat", "0")
@@ -821,8 +831,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("chat", "text", "playerlinks", "1") pfUI:UpdateConfig("chat", "text", "playerlinks", "1")
pfUI:UpdateConfig("chat", "text", "detecturl", "1") pfUI:UpdateConfig("chat", "text", "detecturl", "1")
pfUI:UpdateConfig("chat", "text", "classcolor", "1") pfUI:UpdateConfig("chat", "text", "classcolor", "1")
pfUI:UpdateConfig("chat", "text", "playericons", "0") pfUI:UpdateConfig("chat", "text", "factionicons", "0")
pfUI:UpdateConfig("chat", "text", "whosearchunknown", "0") pfUI:UpdateConfig("chat", "text", "raceicons", "0")
pfUI:UpdateConfig("chat", "text", "playerlevel", "0") pfUI:UpdateConfig("chat", "text", "playerlevel", "0")
pfUI:UpdateConfig("chat", "left", "width", "380") pfUI:UpdateConfig("chat", "left", "width", "380")
pfUI:UpdateConfig("chat", "left", "height", "180") pfUI:UpdateConfig("chat", "left", "height", "180")
@@ -937,6 +947,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "debufftimers", "1") pfUI:UpdateConfig("nameplates", nil, "debufftimers", "1")
pfUI:UpdateConfig("nameplates", nil, "debufftext", "1") pfUI:UpdateConfig("nameplates", nil, "debufftext", "1")
pfUI:UpdateConfig("nameplates", nil, "debuffanim", "0") pfUI:UpdateConfig("nameplates", nil, "debuffanim", "0")
pfUI:UpdateConfig("nameplates", nil, "debreverse", "1")
pfUI:UpdateConfig("abuttons", nil, "enable", "1") pfUI:UpdateConfig("abuttons", nil, "enable", "1")
pfUI:UpdateConfig("abuttons", nil, "position", "bottom") pfUI:UpdateConfig("abuttons", nil, "position", "bottom")
@@ -964,6 +975,10 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("character", "inventory", "durability", "1") pfUI:UpdateConfig("character", "inventory", "durability", "1")
pfUI:UpdateConfig("character", "inventory", "equipflyout", "0") pfUI:UpdateConfig("character", "inventory", "equipflyout", "0")
pfUI:UpdateConfig("equipmentmanager", nil, "autoswitch", "1")
pfUI:UpdateConfig("equipmentmanager", nil, "announce", "1")
pfUI:UpdateConfig("equipmentmanager", nil, "unusedquality", "1")
pfUI:UpdateConfig("equipmentmanager", nil, "unusedbank", "1")
pfUI:UpdateConfig("character", "reputation", "repRequired", "1") pfUI:UpdateConfig("character", "reputation", "repRequired", "1")
pfUI:UpdateConfig("thirdparty", nil, "chatbg", "1") pfUI:UpdateConfig("thirdparty", nil, "chatbg", "1")
pfUI:UpdateConfig("thirdparty", nil, "showmeter", "0") pfUI:UpdateConfig("thirdparty", nil, "showmeter", "0")
+52 -80
View File
@@ -3,15 +3,19 @@ setfenv(1, pfUI:GetEnvironment())
do -- statusbars do -- statusbars
local animations = {} local animations = {}
local stepsize, val local stepsize
local width, height, point
-- native StatusBar methods the bar overrides
local statusbar = CreateFrame("StatusBar")
local SetValue, SetMinMaxValues = statusbar.SetValue, statusbar.SetMinMaxValues
local SetOrientation, SetFrameLevel = statusbar.SetOrientation, statusbar.SetFrameLevel
local animate = CreateFrame("Frame", "pfStatusBarAnimation", UIParent) local animate = CreateFrame("Frame", "pfStatusBarAnimation", UIParent)
animate:SetScript("OnUpdate", function() animate:SetScript("OnUpdate", function()
stepsize = tonumber(pfUI_config.unitframes.animation_speed) stepsize = tonumber(pfUI_config.unitframes.animation_speed)
for bar in pairs(animations) do for bar in pairs(animations) do
if not bar.val_ or abs(bar.val_ - bar.val) < stepsize or bar.instant then if not bar.val_ or abs(bar.val_ - bar.val) < stepsize then
bar:DisplayValue(bar.val) bar:DisplayValue(bar.val)
elseif bar.val ~= bar.val_ then elseif bar.val ~= bar.val_ then
bar:DisplayValue(bar.val_ + min((bar.val-bar.val_) / stepsize, max(bar.val-bar.val_, 30 / GetFramerate()))) bar:DisplayValue(bar.val_ + min((bar.val-bar.val_) / stepsize, max(bar.val-bar.val_, 30 / GetFramerate())))
@@ -21,7 +25,8 @@ do -- statusbars
local handlers = { local handlers = {
["DisplayValue"] = function(self, val) ["DisplayValue"] = function(self, val)
val = Clamp(val, self.min, self.max) local smin, smax = self:GetMinMaxValues()
val = Clamp(val, smin, smax)
-- remove animation queue -- remove animation queue
if val == self.val_ then if val == self.val_ then
@@ -30,53 +35,20 @@ do -- statusbars
-- set current visible value -- set current visible value
self.val_ = val self.val_ = val
SetValue(self, val)
if self.mode == "vertical" then -- the background fills the missing part, all of an empty range
height = self:GetHeight() self.bg:SetValue(smax > smin and (smax - val) / (smax - smin) or 1)
height = height / self:GetEffectiveScale()
point = height / (self.max - self.min) * (val - self.min)
-- keep values in limits
point = Clamp(point, 0, height)
-- set point to zero if value and max is zero
if val == 0 then point = 0 end
-- set status bar position/size
self.bar:SetPoint("TOPLEFT", self, "TOPLEFT", 0, - height + point)
self.bar:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 0)
-- set background bar position/size
self.bg:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 0)
self.bg:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, point)
else
width = self:GetWidth()
width = width / self:GetEffectiveScale()
point = width / (self.max - self.min) * (val - self.min)
-- keep values in limits
point = Clamp(point, 0, width)
-- set point to zero if value and max is zero
if val == 0 then point = 0 end
-- set status bar position/size
self.bar:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 0)
self.bar:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", - width + point, 0)
-- set background bar position/size
self.bg:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 0)
self.bg:SetPoint("TOPLEFT", self, "TOPLEFT", point, 0)
end
end, end,
["SetMinMaxValues"] = function(self, smin, smax, smooth) ["SetMinMaxValues"] = function(self, smin, smax, smooth)
-- smoothen the transition by keeping the value at the same percentage as before -- smoothen the transition by keeping the value at the same percentage as before
if smooth and self.max and self.max > 0 and smax > 0 and self.max ~= smax then local _, oldmax = self:GetMinMaxValues()
self.val_ = (self.val_ or self.val) / self.max * smax if smooth and oldmax > 0 and smax > 0 and oldmax ~= smax then
self.val_ = (self.val_ or self.val) / oldmax * smax
end end
self.min, self.max = smin, smax SetMinMaxValues(self, smin, smax)
self:DisplayValue(self.val_ or self.val) self:DisplayValue(self.val_ or self.val)
end, end,
@@ -89,41 +61,35 @@ do -- statusbars
end end
end, end,
["SetStatusBarTexture"] = function(self, r, g, b, a)
self.bar:SetTexture(r, g, b, a)
end,
["SetStatusBarColor"] = function(self, r, g, b, a)
self.bar:SetVertexColor(r, g, b, a)
end,
["SetStatusBarBackgroundTexture"] = function(self, r, g, b, a)
self.bg:SetTexture(r, g, b, a)
end,
["SetStatusBarBackgroundColor"] = function(self, r, g, b, a) ["SetStatusBarBackgroundColor"] = function(self, r, g, b, a)
self.bg:SetVertexColor(r, g, b, a) self.bg:SetColorFill(r, g, b, a)
end, end,
["SetOrientation"] = function(self, mode) ["SetOrientation"] = function(self, orientation)
self.mode = strlower(mode) SetOrientation(self, orientation)
self.bg:SetOrientation(orientation)
end,
-- the background stays one level below the fill, under anything else
-- drawn on the fill's frame
["SetFrameLevel"] = function(self, level)
SetFrameLevel(self, level)
self.bg:SetFrameLevel(level - 1)
end, end,
} }
function pfUI.api.CreateStatusBar(name, parent) function pfUI.api.CreateStatusBar(name, parent)
local f = CreateFrame("Button", name, parent) local f = CreateFrame("StatusBar", name, parent)
f:EnableMouse(false) SetMinMaxValues(f, 0, 100)
SetValue(f, 0)
f.val = 0
f.bar = f:CreateTexture(nil, "NORMAL") f.bg = CreateFrame("StatusBar", nil, f)
f.bar:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0) f.bg:SetFrameLevel(f:GetFrameLevel() - 1)
f.bar:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 0, 0) f.bg:SetAllPoints(f)
f.bg:SetReverseFill(true)
f.bg = f:CreateTexture(nil, "BACKGROUND") f.bg:SetMinMaxValues(0, 1)
f.bg:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0) f.bg:SetValue(1)
f.bg:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 0, 0)
-- set some default values
f.min, f.max, f.val = 0, 100, 0
-- add all handler functions to the object -- add all handler functions to the object
for name, func in pairs(handlers) do for name, func in pairs(handlers) do
@@ -170,7 +136,7 @@ do -- dropdown
end end
local function MenuOnUpdate() local function MenuOnUpdate()
if not MouseIsOver(this, 100, -100, -100, 100) then if not this:IsMouseOver(100, -100, -100, 100) then
this.button:HideMenu() this.button:HideMenu()
end end
end end
@@ -661,7 +627,7 @@ function pfUI.api.SkinButton(button, cr, cg, cb, icon, disableHighlight)
end end
b.UnlockHighlight = function() b.UnlockHighlight = function()
if not MouseIsOver(b) then if not MouseIsOverHitRect(b) then
b:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color)) b:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
end end
b.locked = false b.locked = false
@@ -683,6 +649,7 @@ function pfUI.api.SkinCollapseButton(button, all)
b.icon:SetSize(size, size) b.icon:SetSize(size, size)
b.icon:SetPoint("LEFT", 2, 2) b.icon:SetPoint("LEFT", 2, 2)
CreateBackdrop(b.icon) CreateBackdrop(b.icon)
b.icon:EnableMouse(false)
b.icon.text = b.icon:CreateFontString(nil, "OVERLAY") b.icon.text = b.icon:CreateFontString(nil, "OVERLAY")
b.icon.text:SetFontObject(GameFontWhite) b.icon.text:SetFontObject(GameFontWhite)
b.icon.text:SetPoint("CENTER", -1, 0) b.icon.text:SetPoint("CENTER", -1, 0)
@@ -1160,18 +1127,22 @@ function pfUI.api.CreateInfoBox(text, time, parent, height)
infobox = CreateFrame("Button", "pfInfoBox", UIParent) infobox = CreateFrame("Button", "pfInfoBox", UIParent)
infobox:Hide() infobox:Hide()
infobox.fade = infobox:CreateAnimationGroup()
local fade = infobox.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(.3)
infobox.fade:SetScript("OnFinished", function()
infobox:Hide()
infobox:SetAlpha(1)
end)
infobox:SetScript("OnUpdate", function() infobox:SetScript("OnUpdate", function()
local time = infobox.lastshow + infobox.duration - GetTime() local time = infobox.lastshow + infobox.duration - GetTime()
infobox.timeout:SetValue(time) infobox.timeout:SetValue(time)
if GetTime() > infobox.lastshow + infobox.duration then if GetTime() > infobox.lastshow + infobox.duration then
infobox:SetAlpha(infobox:GetAlpha()-0.05) if not infobox.fade:IsPlaying() then infobox.fade:Play() end
elseif MouseIsOverHitRect(this) then
if infobox:GetAlpha() <= 0.1 then
infobox:Hide()
infobox:SetAlpha(1)
end
elseif MouseIsOver(this) then
this:SetAlpha(max(0.4, this:GetAlpha() - .1)) this:SetAlpha(max(0.4, this:GetAlpha() - .1))
else else
this:SetAlpha(min(1, this:GetAlpha() + .1)) this:SetAlpha(min(1, this:GetAlpha() + .1))
@@ -1214,6 +1185,7 @@ function pfUI.api.CreateInfoBox(text, time, parent, height)
infobox:SetParent(parent) infobox:SetParent(parent)
infobox:SetFrameStrata("FULLSCREEN_DIALOG") infobox:SetFrameStrata("FULLSCREEN_DIALOG")
infobox.fade:Stop()
infobox:Show() infobox:Show()
end end
+230 -305
View File
@@ -10,10 +10,93 @@ pfUI.uf.frames = {}
-- Scans run back to back and consume the buffer before the next refill. -- Scans run back to back and consume the buffer before the next refill.
local auraSlots = {} local auraSlots = {}
-- Separate buffer for the tooltip handlers. They run from OnEnter, which can -- Aura block corner -> { icon anchor point, x direction, y direction, below frame }
-- fire while RefreshUnit is showing/hiding icons under the cursor, so they must local auraCorners = {
-- not share the refresh buffer. TOPLEFT = { "BOTTOMLEFT", 1, 1 },
local tooltipSlots = {} BOTTOMLEFT = { "TOPLEFT", 1, -1, true },
TOPRIGHT = { "BOTTOMRIGHT", -1, 1 },
BOTTOMRIGHT = { "TOPRIGHT", -1, -1, true },
}
-- Flows the shown icons of an aura block outward from the frame edge, starting
-- `offset` away from it (its own row gap when nil): `perrow` icons per row,
-- each row as tall as its largest icon. The first `icons.own` icons are the
-- player's (C_UnitAuras lists them first) and use `icons.ownsize`. Returns the
-- offset just past the block's last row, where a block sharing the same corner
-- continues.
local function LayoutAuraBlock(unit, icons, offset)
local corner = auraCorners[icons.pos]
local anchor = unit.config.portraitheight ~= "-1" and unit.hp or unit
if anchor == unit.hp and corner[4] then anchor = unit.power end
offset = offset or icons.gapy
local x, rowsize, col = 0, 0, 0
local i = 1
while icons[i] and icons[i]:IsShown() do
if col == icons.perrow then
offset = offset + rowsize + icons.gapy
x, rowsize, col = 0, 0, 0
end
local size = i <= icons.own and icons.ownsize or icons.size
icons[i]:SetSize(size, size)
icons[i]:ClearAllPoints()
icons[i]:SetPoint(corner[1], anchor, icons.pos, corner[2] * x, corner[3] * offset)
x = x + size + icons.gapx
if size > rowsize then rowsize = size end
col = col + 1
i = i + 1
end
if col > 0 then offset = offset + rowsize + icons.gapy end
return offset
end
-- Buffs and debuffs sharing a corner stack in one column: buffs first on
-- friendly units, debuffs first on neutral and hostile ones.
local function LayoutAuras(unit, unitstr)
local first, second = unit.buffs, unit.debuffs
if not UnitIsFriend("player", unitstr) then first, second = second, first end
if not first then first, second = second, nil end
if not first then return end
local offset = LayoutAuraBlock(unit, first)
if second then
LayoutAuraBlock(unit, second, second.pos == first.pos and offset or nil)
end
end
-- Returns the cooldown start and duration of an aura, 0, 0 when it has none.
-- Start is capped to now: talent-extended auras run past their Spell.dbc base
-- duration, and a start in the future trips the cooldown text's 2^32
-- wraparound branch.
local function AuraTimer(duration, expirationTime)
if expirationTime <= 0 then return 0, 0 end
local now = GetTime()
local start, dur = expirationTime - duration, duration
if start > now or dur <= 0 then
start, dur = now, expirationTime - now
end
if dur <= 0 then return 0, 0 end
return start, dur
end
-- Starts the timers RefreshUnit stored on the shown icons of an aura block.
local function StartAuraTimers(icons)
if not icons then return end
local i = 1
while icons[i] and icons[i]:IsShown() do
local dur = icons[i].auraDuration
CooldownFrame_SetTimer(icons[i].cd, icons[i].auraStart, dur, dur > 0 and 1 or 0)
i = i + 1
end
end
-- ============================================================================ -- ============================================================================
-- GUID-based Roster Tracking for Smart Updates -- GUID-based Roster Tracking for Smart Updates
@@ -78,10 +161,6 @@ local glow2 = {
insets = {left = 0, right = 0, top = 0, bottom = 0}, insets = {left = 0, right = 0, top = 0, bottom = 0},
} }
local function DoNothing()
return
end
local function BuffOnEnter() local function BuffOnEnter()
local parent = this:GetParent() local parent = this:GetParent()
if not parent.label then return end if not parent.label then return end
@@ -119,32 +198,8 @@ local function DebuffOnEnter()
local unitstr = this:GetParent().label .. this:GetParent().id local unitstr = this:GetParent().label .. this:GetParent().id
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT") GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
if this:GetParent().label ~= "player" then -- C_UnitAuras lists the player's own auras first, so the selfdebuff
local parent = this:GetParent() -- (HARMFUL|PLAYER) list is a prefix of the HARMFUL list: same index.
-- selfdebuff filters the displayed list to player-cast harmful auras, but
-- SetUnitAura's index has to be into the unfiltered HARMFUL list. Look up
-- the displayed aura via the PLAYER filter, then find its position in the
-- unfiltered list by name + sourceGUID.
--
-- The unfiltered list is NOT capped at 16: once a unit's 16 debuff slots
-- are full the server parks further debuffs in buff slots, and C_UnitAuras
-- reports those as harmful too. So enumerate however many the unit has.
if parent.config and parent.config.selfdebuff == "1" then
local ownAura = C_UnitAuras.GetAuraDataByIndex(unitstr, this.id, "HARMFUL|PLAYER")
if ownAura then
local n = ScanAuraSlots(unitstr, "HARMFUL", tooltipSlots)
for i = 1, n do
local check = C_UnitAuras.GetAuraDataBySlot(unitstr, tooltipSlots[i])
if check and check.name == ownAura.name and check.sourceGUID == ownAura.sourceGUID then
GameTooltip:SetUnitAura(unitstr, i, "HARMFUL")
return
end
end
end
end
end
GameTooltip:SetUnitAura(unitstr, this.id, "HARMFUL") GameTooltip:SetUnitAura(unitstr, this.id, "HARMFUL")
end end
@@ -180,7 +235,50 @@ function pfUI.api.GetUnitStats(unitstr)
end end
local aggrodata = { } local aggrodata = { }
local aggroScan = nil -- static { u, t, tt } triples, built once so the hot scan allocates nothing
-- every unit whose target or target's target UnitHasAggro checks, as static
-- { u, t, tt } triples so the hot scan allocates nothing
local aggroScan = { }
do
local function add(u)
local t = u .. "target"
table.insert(aggroScan, { u = u, t = t, tt = t .. "target" })
end
add("pet")
add("player")
add("target")
add("mouseover")
add("focus")
add("focustarget")
add("focustargettarget")
add("pettarget")
add("playertarget")
add("targettarget")
add("mouseovertarget")
add("targettargettarget")
for i=1,4 do
add("party" .. i)
add("party" .. i .. "target")
add("partypet" .. i)
add("partypet" .. i .. "target")
end
for i=1,40 do
add("raid" .. i)
add("raid" .. i .. "target")
add("raidpet" .. i)
add("raidpet" .. i .. "target")
add("nameplate" .. i)
add("nameplate" .. i .. "target")
end
end
function pfUI.api.UnitHasAggro(unit) function pfUI.api.UnitHasAggro(unit)
local now = GetTime() local now = GetTime()
local data = aggrodata[unit] local data = aggrodata[unit]
@@ -195,16 +293,6 @@ function pfUI.api.UnitHasAggro(unit)
data.state = 0 data.state = 0
if UnitExists(unit) and UnitIsFriend(unit, "player") then if UnitExists(unit) and UnitIsFriend(unit, "player") then
-- pfValidUnits never changes after load, so precompute the "<u>target" /
-- "<u>targettarget" token strings once instead of concatenating per call.
if not aggroScan then
aggroScan = {}
for u in pairs(pfValidUnits) do
local t = u .. "target"
table.insert(aggroScan, { u = u, t = t, tt = t .. "target" })
end
end
for i = 1, table.getn(aggroScan) do for i = 1, table.getn(aggroScan) do
local s = aggroScan[i] local s = aggroScan[i]
if UnitExists(s.t) and UnitIsUnit(s.t, unit) and UnitCanAttack(s.u, unit) then if UnitExists(s.t) and UnitIsUnit(s.t, unit) and UnitCanAttack(s.u, unit) then
@@ -219,27 +307,6 @@ function pfUI.api.UnitHasAggro(unit)
return data.state return data.state
end end
pfUI.uf.glow = CreateFrame("Frame", nil, UIParent)
pfUI.uf.glow:SetScript("OnUpdate", function()
local fpsmod = GetFramerate() / 30
if not this.val or this.val >= .8 then
this.mod = -0.01 / fpsmod
elseif this.val <= .4 then
this.mod = 0.01 / fpsmod
end
this.val = this.val + this.mod
end)
pfUI.uf.glow.mod = 0
pfUI.uf.glow.val = 0.6
function pfUI.uf.glow.UpdateGlowAnimation()
local val = pfUI.uf.glow.val or 0.6
if val < 0.4 then val = 0.4 end
if val > 0.8 then val = 0.8 end
this:SetAlpha(val)
end
function pfUI.uf:UpdateVisibility() function pfUI.uf:UpdateVisibility()
local self = self or this local self = self or this
@@ -313,10 +380,15 @@ function pfUI.uf:UpdateVisibility()
self._label, self._id = nil, nil self._label, self._id = nil, nil
end end
local unitstr = ("%s%s"):format(self.label or "", self.id or "") -- this runs for every frame five times a second, so only touch the
self.unitstr = unitstr ~= "" and unitstr or nil -- attribute when the unit actually changed
self:SetAttribute("unit", self.unitstr) local unitstr = self.label .. self.id
local visibility = ("[target=%s,exists] show; hide"):format(unitstr) if unitstr ~= self.unitstr then
self.unitstr = unitstr
self:SetAttribute("unit", unitstr)
end
-- anything but "show"/"hide" means "show if the unit exists"
local visibility = "exists"
-- Group frames are redundant when the group is already shown as a raid grid: -- Group frames are redundant when the group is already shown as a raid grid:
-- either an actual raid, or a party promoted to the raid grid via -- either an actual raid, or a party promoted to the raid grid via
@@ -355,9 +427,7 @@ function pfUI.uf:UpdateVisibility()
self:RegisterUnitEvents(visibility ~= "hide" and self.unitstr or nil) self:RegisterUnitEvents(visibility ~= "hide" and self.unitstr or nil)
-- vanilla visibility -- vanilla visibility
if self.unitname then if visibility == "hide" then
self:Show()
elseif visibility == "hide" then
self:Hide() self:Hide()
elseif visibility == "show" then elseif visibility == "show" then
self:Show() self:Show()
@@ -425,9 +495,12 @@ function pfUI.uf:UpdateConfig()
local C = pfUI_config local C = pfUI_config
local rawborder, default_border = GetBorderSize("unitframes") local rawborder, default_border = GetBorderSize("unitframes")
local spacing = f.config.pspace * GetPerfectPixel() local spacing = f.config.pspace * GetPerfectPixel()
-- aura icon backdrops sit outside the icon, so gaps clear both borders
local aura_border = (C.appearance.border.force_blizz == "1" and 1 or 2) * default_border
local cooldown_text = tonumber(f.config.cooldown_text) local cooldown_text = tonumber(f.config.cooldown_text)
local cooldown_anim = tonumber(f.config.cooldown_anim) local cooldown_anim = tonumber(f.config.cooldown_anim)
local cooldown_reverse = tonumber(f.config.cooldown_reverse) or 0
local relative_point = "BOTTOM" local relative_point = "BOTTOM"
if f.config.panchor == "TOPLEFT" then if f.config.panchor == "TOPLEFT" then
@@ -451,7 +524,6 @@ function pfUI.uf:UpdateConfig()
f.glow:SetBackdrop(glow2) f.glow:SetBackdrop(glow2)
f.glow:SetPoint("TOPLEFT", f, "TOPLEFT", -6 - default_border,6 + default_border) f.glow:SetPoint("TOPLEFT", f, "TOPLEFT", -6 - default_border,6 + default_border)
f.glow:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 6 + default_border,-6 - default_border) f.glow:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 6 + default_border,-6 - default_border)
f.glow:SetScript("OnUpdate", pfUI.uf.glow.UpdateGlowAnimation)
f.glow:Hide() f.glow:Hide()
f.combat:SetSize(tonumber(f.config.squaresize), tonumber(f.config.squaresize)) f.combat:SetSize(tonumber(f.config.squaresize), tonumber(f.config.squaresize))
@@ -466,6 +538,8 @@ function pfUI.uf:UpdateConfig()
if tonumber(f.config.height) < 0 then f.hp:Hide() end if tonumber(f.config.height) < 0 then f.hp:Hide() end
pfUI.api.CreateBackdrop(f.hp, default_border) pfUI.api.CreateBackdrop(f.hp, default_border)
-- one level above the backdrop for the bar's background, one more for its fill
f.hp.bar:SetFrameLevel(f.hp.backdrop:GetFrameLevel() + 2)
f.hp.bar:SetStatusBarTexture(pfUI.media[f.config.bartexture]) f.hp.bar:SetStatusBarTexture(pfUI.media[f.config.bartexture])
f.hp.bar:SetAllPoints(f.hp) f.hp.bar:SetAllPoints(f.hp)
if f.config.verticalbar == "1" then if f.config.verticalbar == "1" then
@@ -480,7 +554,7 @@ function pfUI.uf:UpdateConfig()
if custombg == "1" then if custombg == "1" then
local cr, cg, cb, ca = GetStringColor(custombgcolor) local cr, cg, cb, ca = GetStringColor(custombgcolor)
cr, cg, cb, ca = tonumber(cr), tonumber(cg), tonumber(cb), tonumber(ca) cr, cg, cb, ca = tonumber(cr), tonumber(cg), tonumber(cb), tonumber(ca)
f.hp.bar:SetStatusBarBackgroundTexture(cr,cg,cb,ca) f.hp.bar:SetStatusBarBackgroundColor(cr,cg,cb,ca)
end end
f.power:ClearAllPoints() f.power:ClearAllPoints()
@@ -489,7 +563,7 @@ function pfUI.uf:UpdateConfig()
if tonumber(f.config.pheight) < 0 then f.power:Hide() end if tonumber(f.config.pheight) < 0 then f.power:Hide() end
pfUI.api.CreateBackdrop(f.power, default_border) pfUI.api.CreateBackdrop(f.power, default_border)
f.power.bar:SetFrameLevel(f.power.backdrop:GetFrameLevel() + 1) f.power.bar:SetFrameLevel(f.power.backdrop:GetFrameLevel() + 2)
f.power.bar:SetStatusBarTexture(pfUI.media[f.config.pbartexture]) f.power.bar:SetStatusBarTexture(pfUI.media[f.config.pbartexture])
f.power.bar:SetAllPoints(f.power) f.power.bar:SetAllPoints(f.power)
@@ -499,7 +573,7 @@ function pfUI.uf:UpdateConfig()
if custompbg == "1" then if custompbg == "1" then
local cr, cg, cb, ca = GetStringColor(custompbgcolor) local cr, cg, cb, ca = GetStringColor(custompbgcolor)
cr, cg, cb, ca = tonumber(cr), tonumber(cg), tonumber(cb), tonumber(ca) cr, cg, cb, ca = tonumber(cr), tonumber(cg), tonumber(cb), tonumber(ca)
f.power.bar:SetStatusBarBackgroundTexture(cr,cg,cb,ca) f.power.bar:SetStatusBarBackgroundColor(cr,cg,cb,ca)
end end
local fontname, fontsize, fontstyle local fontname, fontsize, fontstyle
@@ -757,13 +831,17 @@ function pfUI.uf:UpdateConfig()
f.buffs = nil f.buffs = nil
else else
f.buffs = f.buffs or {} f.buffs = f.buffs or {}
f.buffs.pos = f.config.buffs
f.buffs.size = tonumber(f.config.buffsize)
f.buffs.ownsize = f.config.ownbuffsize == "-1" and f.buffs.size or tonumber(f.config.ownbuffsize)
f.buffs.perrow = tonumber(f.config.buffperrow)
f.buffs.gapx = aura_border + tonumber(f.config.buffspacingx)
f.buffs.gapy = aura_border + tonumber(f.config.buffspacingy)
f.buffs.own = 0
for i=1, 32 do for i=1, 32 do
if i > tonumber(f.config.bufflimit) then break end if i > tonumber(f.config.bufflimit) then break end
local perrow = f.config.buffperrow
local row = floor((i-1) / perrow)
f.buffs[i] = f.buffs[i] or CreateFrame("Button", "pfUI" .. f.fname .. "Buff" .. i, f) f.buffs[i] = f.buffs[i] or CreateFrame("Button", "pfUI" .. f.fname .. "Buff" .. i, f)
f.buffs[i].texture = f.buffs[i].texture or f.buffs[i]:CreateTexture() f.buffs[i].texture = f.buffs[i].texture or f.buffs[i]:CreateTexture()
f.buffs[i].texture:SetTexCoord(.08, .92, .08, .92) f.buffs[i].texture:SetTexCoord(.08, .92, .08, .92)
@@ -778,61 +856,13 @@ function pfUI.uf:UpdateConfig()
f.buffs[i]:SetFrameLevel(12) f.buffs[i]:SetFrameLevel(12)
f.buffs[i]:RegisterForClicks("RightButtonUp") f.buffs[i]:RegisterForClicks("RightButtonUp")
f.buffs[i]:ClearAllPoints()
local invert_h, invert_v, af f.buffs[i].cd = f.buffs[i].cd or CreateFrame("Cooldown", f.buffs[i]:GetName() .. "Cooldown", f.buffs[i], "CooldownFrameTemplate")
if f.config.buffs == "TOPLEFT" then
invert_h = 1
invert_v = 1
af = "BOTTOMLEFT"
elseif f.config.buffs == "BOTTOMLEFT" then
invert_h = -1
invert_v = 1
af = "TOPLEFT"
elseif f.config.buffs == "TOPRIGHT" then
invert_h = 1
invert_v = -1
af = "BOTTOMRIGHT"
elseif f.config.buffs == "BOTTOMRIGHT" then
invert_h = -1
invert_v = -1
af = "TOPRIGHT"
end
local anchor = f.config.portraitheight ~= "-1" and f.hp or f
if anchor == f.hp and (f.config.buffs == "BOTTOMLEFT" or f.config.buffs == "BOTTOMRIGHT") then
anchor = f.power
end
local multiply = C.appearance.border.force_blizz == "1" and 1 or 2
f.buffs[i]:SetPoint(af, anchor, f.config.buffs,
invert_v * (i-1-row*perrow)*(multiply*default_border + f.config.buffsize + 1),
invert_h * (row*(multiply*default_border + f.config.buffsize + 1) + (multiply*default_border + 1)))
f.buffs[i]:SetSize(f.config.buffsize, f.config.buffsize)
-- Create CD frame if it doesn't exist
if not f.buffs[i].cd then
if cooldown_anim == 1 then
-- Animation enabled: Use Model frame with CooldownFrameTemplate
f.buffs[i].cd = CreateFrame("Model", f.buffs[i]:GetName() .. "Cooldown", f.buffs[i], "CooldownFrameTemplate")
else
-- Animation disabled: Use regular Frame with dummy functions
f.buffs[i].cd = CreateFrame("Frame", f.buffs[i]:GetName() .. "Cooldown", f.buffs[i])
f.buffs[i].cd.AdvanceTime = DoNothing
f.buffs[i].cd.SetSequence = DoNothing
f.buffs[i].cd.SetSequenceTime = DoNothing
end
end
-- Always update CD properties (in case size changed)
local cdScale = f.config.buffsize / 32
f.buffs[i].cd:ClearAllPoints()
f.buffs[i].cd:SetScale(cdScale)
f.buffs[i].cd:SetAllPoints(f.buffs[i])
f.buffs[i].cd:SetFrameLevel(14) f.buffs[i].cd:SetFrameLevel(14)
f.buffs[i].cd.pfCooldownType = "ALL" f.buffs[i].cd.pfCooldownType = "ALL"
f.buffs[i].cd.pfCooldownStyleText = cooldown_text f.buffs[i].cd.pfCooldownStyleText = cooldown_text
f.buffs[i].cd.pfCooldownStyleAnimation = cooldown_anim f.buffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
f.buffs[i].cd.pfCooldownReverse = cooldown_reverse
f.buffs[i].cd:SetAlpha(cooldown_anim == 1 and 1 or 0) f.buffs[i].cd:SetAlpha(cooldown_anim == 1 and 1 or 0)
-- immediately show/hide existing cooldown text -- immediately show/hide existing cooldown text
@@ -861,6 +891,13 @@ function pfUI.uf:UpdateConfig()
f.debuffs = nil f.debuffs = nil
else else
f.debuffs = f.debuffs or {} f.debuffs = f.debuffs or {}
f.debuffs.pos = f.config.debuffs
f.debuffs.size = tonumber(f.config.debuffsize)
f.debuffs.ownsize = f.config.owndebuffsize == "-1" and f.debuffs.size or tonumber(f.config.owndebuffsize)
f.debuffs.perrow = tonumber(f.config.debuffperrow)
f.debuffs.gapx = aura_border + tonumber(f.config.debuffspacingx)
f.debuffs.gapy = aura_border + tonumber(f.config.debuffspacingy)
f.debuffs.own = 0
for i=1, 32 do for i=1, 32 do
if i > tonumber(f.config.debufflimit) then break end if i > tonumber(f.config.debufflimit) then break end
@@ -879,33 +916,14 @@ function pfUI.uf:UpdateConfig()
f.debuffs[i]:SetFrameLevel(12) f.debuffs[i]:SetFrameLevel(12)
f.debuffs[i]:RegisterForClicks("RightButtonUp") f.debuffs[i]:RegisterForClicks("RightButtonUp")
f.debuffs[i]:ClearAllPoints()
f.debuffs[i]:SetSize(f.config.debuffsize, f.config.debuffsize)
f.debuffs[i]:SetNormalTexture(nil) f.debuffs[i]:SetNormalTexture(nil)
-- Create CD frame if it doesn't exist f.debuffs[i].cd = f.debuffs[i].cd or CreateFrame("Cooldown", f.debuffs[i]:GetName() .. "Cooldown", f.debuffs[i], "CooldownFrameTemplate")
if not f.debuffs[i].cd then
if cooldown_anim == 1 then
-- Animation enabled: Use Model frame with CooldownFrameTemplate
f.debuffs[i].cd = CreateFrame("Model", f.debuffs[i]:GetName() .. "Cooldown", f.debuffs[i], "CooldownFrameTemplate")
else
-- Animation disabled: Use regular Frame with dummy functions
f.debuffs[i].cd = CreateFrame("Frame", f.debuffs[i]:GetName() .. "Cooldown", f.debuffs[i])
f.debuffs[i].cd.AdvanceTime = DoNothing
f.debuffs[i].cd.SetSequence = DoNothing
f.debuffs[i].cd.SetSequenceTime = DoNothing
end
end
-- Always update CD properties (in case size changed)
local cdScale = f.config.debuffsize / 32
f.debuffs[i].cd:ClearAllPoints()
f.debuffs[i].cd:SetScale(cdScale)
f.debuffs[i].cd:SetAllPoints(f.debuffs[i])
f.debuffs[i].cd:SetFrameLevel(14) f.debuffs[i].cd:SetFrameLevel(14)
f.debuffs[i].cd.pfCooldownType = "ALL" f.debuffs[i].cd.pfCooldownType = "ALL"
f.debuffs[i].cd.pfCooldownStyleText = cooldown_text f.debuffs[i].cd.pfCooldownStyleText = cooldown_text
f.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim f.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
f.debuffs[i].cd.pfCooldownReverse = cooldown_reverse
f.debuffs[i].cd:SetAlpha(cooldown_anim == 1 and 1 or 0) f.debuffs[i].cd:SetAlpha(cooldown_anim == 1 and 1 or 0)
-- immediately show/hide existing cooldown text -- immediately show/hide existing cooldown text
@@ -943,32 +961,6 @@ function pfUI.uf.OnShow()
pfUI.uf:RefreshUnit(this, "base") pfUI.uf:RefreshUnit(this, "base")
end end
-- GUID-keyed aura start-time tracker, fed by Nampower's BUFF_ADDED_OTHER /
-- BUFF_REMOVED_OTHER. Non-player units have aura.expirationTime == 0 (server
-- doesn't broadcast time), so we reconstruct the swirl from "when we saw it
-- applied" + aura.duration (Spell.dbc base). Only auras we actually witnessed
-- being cast get tracked — pre-existing auras (already on a unit when you
-- target them) intentionally show no timer rather than a fabricated one.
pfUI.uf.aura_starts = {} -- {[guid] = {[spellId] = startTime}}
local auraTracker = CreateFrame("Frame", "pfUF_AuraTracker", UIParent)
auraTracker:RegisterEvent("BUFF_ADDED_OTHER")
auraTracker:RegisterEvent("BUFF_REMOVED_OTHER")
auraTracker:SetScript("OnEvent", function()
-- Nampower arg layout: arg1=guid, arg3=spellId. State code 0=added, 1=removed,
-- 2=modified; we treat any added/modified as "reset start = now" and let the
-- REMOVED event clear the entry.
if not arg1 or not arg3 or arg3 == 0 then return end
if event == "BUFF_REMOVED_OTHER" then
if pfUI.uf.aura_starts[arg1] then
pfUI.uf.aura_starts[arg1][arg3] = nil
end
else
pfUI.uf.aura_starts[arg1] = pfUI.uf.aura_starts[arg1] or {}
pfUI.uf.aura_starts[arg1][arg3] = GetTime()
end
end)
function pfUI.uf.OnEvent() function pfUI.uf.OnEvent()
-- Handle shutdown to prevent crash 132 -- Handle shutdown to prevent crash 132
if event == "PLAYER_LOGOUT" then if event == "PLAYER_LOGOUT" then
@@ -1140,7 +1132,18 @@ function pfUI.uf.OnUpdate()
end end
else else
pfUI.uf:RefreshUnitState(this) pfUI.uf:RefreshUnitState(this)
pfUI.uf:RefreshIndicators(this) -- group frames get their leader/loot/raid mark icons refreshed by
-- events through update_indicators, so polling them is only a safety
-- net; frames whose unit changes without events keep polling per tick
local label = this.label
if label == "raid" or label == "party" or label == "raidpet" or label == "partypet" then
if (this.lastIndicatorPoll or 0) < now then
this.lastIndicatorPoll = now + 3
pfUI.uf:RefreshIndicators(this)
end
else
pfUI.uf:RefreshIndicators(this)
end
end end
if this.config and this.config.glowaggro == "1" and pfUI.api.UnitHasAggro(unitstr) > 0 then if this.config and this.config.glowaggro == "1" and pfUI.api.UnitHasAggro(unitstr) > 0 then
@@ -1153,9 +1156,18 @@ function pfUI.uf.OnUpdate()
this.glow:Hide() this.glow:Hide()
end end
-- update everything on eventless frames (targettarget, etc) -- update eventless frames (targettarget, etc). A full refresh rescans
-- every aura and the portrait, so only do it when the unit behind the
-- frame changes or once a second; other ticks refresh the bars only.
if this.tick then if this.tick then
pfUI.uf:RefreshUnit(this, "all") local guid = UnitGUID(unitstr)
if guid ~= this.tickGuid or (this.tickFull or 0) < now then
this.tickGuid = guid
this.tickFull = now + 1
pfUI.uf:RefreshUnit(this, "all")
else
pfUI.uf:RefreshUnit(this, "base")
end
end end
end end
@@ -1264,8 +1276,6 @@ function pfUI.uf.OnUpdate()
end end
end end
if not this.label or this.label == "" then return end
-- update portrait on first visible frame -- update portrait on first visible frame
if this.portrait and this.portrait.model and this.portrait.model.update then if this.portrait and this.portrait.model and this.portrait.model.update then
this.portrait.model.lastUnit = UnitName(this.portrait.model.update) this.portrait.model.lastUnit = UnitName(this.portrait.model.update)
@@ -1352,11 +1362,7 @@ end
-- ============================================================ -- ============================================================
function pfUI.uf.OnClick() function pfUI.uf.OnClick()
if not this.label and this.unitname then pfUI.uf:ClickAction(arg1)
TargetByName(this.unitname, true)
else
pfUI.uf:ClickAction(arg1)
end
end end
function pfUI.uf:ClickAction(button) function pfUI.uf:ClickAction(button)
@@ -1453,13 +1459,6 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.config = config or pfUI_config.unitframes.fallback f.config = config or pfUI_config.unitframes.fallback
f.tick = tick f.tick = tick
-- disable events for unknown unitstrings
if not pfValidUnits[strlower(unit) .. id] then
f.unitname = unit
f.label, f.id = "", ""
f.RegisterEvent = function() return end
end
CreateBackdropShadow(f) CreateBackdropShadow(f)
f.hp = CreateFrame("Frame",nil, f) f.hp = CreateFrame("Frame",nil, f)
@@ -1482,7 +1481,18 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
end end
f.glow = CreateFrame("Frame", nil, f) f.glow = CreateFrame("Frame", nil, f)
f.combat = CreateFrame("Frame", nil, f.hp.bar) -- Pulse between .8 and .4 for good. The group only advances while the glow
-- is shown, so a hidden glow costs nothing.
f.glow:SetAlpha(.8)
f.glow.pulse = f.glow:CreateAnimationGroup()
f.glow.pulse:SetLooping("BOUNCE")
local fade = f.glow.pulse:CreateAnimation("Alpha")
fade:SetChange(-.4)
fade:SetDuration(1.3)
fade:SetSmoothing("IN_OUT")
f.glow.pulse:Play()
f.combat =CreateFrame("Frame", nil, f.hp.bar)
f.combat.tex = f.combat:CreateTexture(nil, "OVERLAY") f.combat.tex = f.combat:CreateTexture(nil, "OVERLAY")
f.combat.tex:SetAllPoints() f.combat.tex:SetAllPoints()
@@ -1499,7 +1509,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.incHeal = CreateFrame("Frame", nil, f.hp) f.incHeal = CreateFrame("Frame", nil, f.hp)
-- Texture lives on hp.bar for correct draw order: -- Texture lives on hp.bar for correct draw order:
-- hp.bar.bg (BACKGROUND) < incHeal (BORDER) < hp.bar.bar (NORMAL) -- hp.bar.bg (a level below) < incHeal (BORDER) < hp.bar's fill (ARTWORK)
f.incHeal.texture = f.hp.bar:CreateTexture(nil, "BORDER") f.incHeal.texture = f.hp.bar:CreateTexture(nil, "BORDER")
f.incHeal.texture:SetAllPoints(f.incHeal) f.incHeal.texture:SetAllPoints(f.incHeal)
-- Override Show/Hide since texture lives on hp.bar, not incHeal -- Override Show/Hide since texture lives on hp.bar, not incHeal
@@ -1565,9 +1575,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f:Hide() f:Hide()
end end
if f.label ~= "" then f:SetAttribute("unit", f.label .. f.id)
f:SetAttribute("unit", f.label .. f.id)
end
-- register frame for clique -- register frame for clique
_G.ClickCastFrames = ClickCastFrames or {} _G.ClickCastFrames = ClickCastFrames or {}
@@ -1752,78 +1760,23 @@ function pfUI.uf:RefreshUnit(unit, component)
unit.buffs[i].stacks:SetText("") unit.buffs[i].stacks:SetText("")
end end
if expirationTime > 0 then unit.buffs[i].auraStart, unit.buffs[i].auraDuration = AuraTimer(duration, expirationTime)
-- pfUI's cooldown text falls into a 2^32 wraparound branch when start > GetTime(),
-- which happens for talent-extended buffs where the real duration exceeds the
-- Spell.dbc base. Anchor start to now in that case to keep the remaining math sane.
local now = GetTime()
local start = expirationTime - duration
local dur = duration
if start > now or dur <= 0 then
start, dur = now, expirationTime - now
end
if dur > 0 then
CooldownFrame_SetTimer(unit.buffs[i].cd, start, dur, 1)
else
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
end
elseif duration > 0 then
local guid = UnitGUID(unitstr)
local guidStarts = guid and pfUI.uf.aura_starts[guid]
local start = guidStarts and guidStarts[spellId]
if start then
CooldownFrame_SetTimer(unit.buffs[i].cd, start, duration, 1)
else
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
end
else
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
end
else else
unit.buffs[i]:Hide() unit.buffs[i]:Hide()
end end
end end
-- own buffs lead the list; count them only when they're drawn larger
if unit.buffs.ownsize ~= unit.buffs.size then
unit.buffs.own = ScanAuraSlots(unitstr, "HELPFUL|PLAYER", auraSlots, unit.config.bufflimit)
end
end end
-- debuffs -- debuffs
if unit.debuffs and ( component == "all" or component == "aura" ) then if unit.debuffs and ( component == "all" or component == "aura" ) then
local texture, stacks, dtype local texture, stacks, dtype
local perrow = unit.config.debuffperrow
local bperrow = unit.config.buffperrow
local selfdebuff = unit.config.selfdebuff local selfdebuff = unit.config.selfdebuff
local invert_h, invert_v, af
if unit.config.debuffs == "TOPLEFT" then
invert_h = 1
invert_v = 1
af = "BOTTOMLEFT"
elseif unit.config.debuffs == "BOTTOMLEFT" then
invert_h = -1
invert_v = 1
af = "TOPLEFT"
elseif unit.config.debuffs == "TOPRIGHT" then
invert_h = 1
invert_v = -1
af = "BOTTOMRIGHT"
elseif unit.config.debuffs == "BOTTOMRIGHT" then
invert_h = -1
invert_v = -1
af = "TOPRIGHT"
end
local buffrow, reposition = 0, ( component == "all" and true or nil )
if unit.config.buffs == unit.config.debuffs then
if unit.buffs[0*bperrow+1] and unit.buffs[0*bperrow+1]:IsShown() then buffrow = buffrow + 1 end
if unit.buffs[1*bperrow+1] and unit.buffs[1*bperrow+1]:IsShown() then buffrow = buffrow + 1 end
if unit.buffs[2*bperrow+1] and unit.buffs[2*bperrow+1]:IsShown() then buffrow = buffrow + 1 end
if unit.buffs[3*bperrow+1] and unit.buffs[3*bperrow+1]:IsShown() then buffrow = buffrow + 1 end
end
if buffrow ~= unit.lastbuffrow then
unit.lastbuffrow = buffrow
reposition = true
end
-- selfdebuff narrows to player-cast harmful auras via the PLAYER filter. -- selfdebuff narrows to player-cast harmful auras via the PLAYER filter.
-- Player-frame debuffs aren't gated on it (it'd hide most party-applied -- Player-frame debuffs aren't gated on it (it'd hide most party-applied
-- effects on you). One GetAuraSlots enumeration per refresh; the i-th slot -- effects on you). One GetAuraSlots enumeration per refresh; the i-th slot
@@ -1834,19 +1787,6 @@ function pfUI.uf:RefreshUnit(unit, component)
for i=1, unit.config.debufflimit do for i=1, unit.config.debufflimit do
if not unit.debuffs[i] then break end if not unit.debuffs[i] then break end
local row = floor((i-1) / unit.config.debuffperrow)
if reposition then
local anchor = unit.config.portraitheight ~= "-1" and unit.hp or unit
if anchor == unit.hp and (unit.config.debuffs == "BOTTOMLEFT" or unit.config.debuffs == "BOTTOMRIGHT") then
anchor = unit.power
end
local multiply = C.appearance.border.force_blizz == "1" and 1 or 2
unit.debuffs[i]:SetPoint(af, anchor, unit.config.debuffs,
invert_v * (i-1-row*perrow)*(multiply*default_border + unit.config.debuffsize + 1),
invert_h * ((row+buffrow)*(multiply*default_border + unit.config.debuffsize + 1) + (multiply*default_border + 1)))
end
-- positional read by slot id allocates nothing -- positional read by slot id allocates nothing
local name, icon, count, dispelType, duration, expirationTime = C_UnitAuras.UnitAuraBySlot(unitstr, auraSlots[i]) local name, icon, count, dispelType, duration, expirationTime = C_UnitAuras.UnitAuraBySlot(unitstr, auraSlots[i])
if name then if name then
@@ -1863,24 +1803,7 @@ function pfUI.uf:RefreshUnit(unit, component)
if texture then if texture then
unit.debuffs[i]:Show() unit.debuffs[i]:Show()
if expirationTime > 0 then unit.debuffs[i].auraStart, unit.debuffs[i].auraDuration = AuraTimer(duration, expirationTime)
-- Cap start to now so talent-extended debuffs (expirationTime past
-- the dbc base duration) don't push start into the future and trip
-- CooldownFrame_SetTimer's 2^32-wraparound branch.
local now = GetTime()
local start = expirationTime - duration
local dur = duration
if start > now or dur <= 0 then
start, dur = now, expirationTime - now
end
if dur > 0 then
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, dur, 1)
else
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
end
else
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
end
if stacks > 1 then if stacks > 1 then
unit.debuffs[i].stacks:SetText(stacks) unit.debuffs[i].stacks:SetText(stacks)
@@ -1891,6 +1814,18 @@ function pfUI.uf:RefreshUnit(unit, component)
unit.debuffs[i]:Hide() unit.debuffs[i]:Hide()
end end
end end
-- own debuffs lead the list; count them only when they're drawn larger
if unit.debuffs.ownsize ~= unit.debuffs.size then
unit.debuffs.own = ScanAuraSlots(unitstr, "HARMFUL|PLAYER", auraSlots, unit.config.debufflimit)
end
end
-- timers start after the layout so each cooldown text is sized to its icon
if component == "all" or component == "aura" then
LayoutAuras(unit, unitstr)
StartAuraTimers(unit.buffs)
StartAuraTimers(unit.debuffs)
end end
-- indicators -- indicators
@@ -2321,7 +2256,7 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks, start, duration)
if not frame.icon[pos] then if not frame.icon[pos] then
frame.icon[pos] = CreateFrame("Frame", nil, frame.icon) frame.icon[pos] = CreateFrame("Frame", nil, frame.icon)
frame.icon[pos]:SetParent(frame) frame.icon[pos]:SetParent(frame)
frame.icon[pos].tex = frame.icon[pos]:CreateTexture("OVERLAY") frame.icon[pos].tex = frame.icon[pos]:CreateTexture(nil, "OVERLAY")
frame.icon[pos].tex:SetAllPoints(frame.icon[pos]) frame.icon[pos].tex:SetAllPoints(frame.icon[pos])
frame.icon[pos].tex:SetTexCoord(.08, .92, .08, .92) frame.icon[pos].tex:SetTexCoord(.08, .92, .08, .92)
frame.icon[pos].stacks = frame.icon[pos]:CreateFontString(nil, "OVERLAY") frame.icon[pos].stacks = frame.icon[pos]:CreateFontString(nil, "OVERLAY")
@@ -2329,17 +2264,7 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks, start, duration)
frame.icon[pos].stacks:SetJustifyH("RIGHT") frame.icon[pos].stacks:SetJustifyH("RIGHT")
frame.icon[pos].stacks:SetJustifyV("BOTTOM") frame.icon[pos].stacks:SetJustifyV("BOTTOM")
-- Check if parent frame has cooldown animation enabled frame.icon[pos].cd = CreateFrame("Cooldown", nil, frame.icon[pos], "CooldownFrameTemplate")
local parent_cooldown_anim = frame.config and tonumber(frame.config.cooldown_anim) or 1
if parent_cooldown_anim == 1 then
frame.icon[pos].cd = CreateFrame("Model", nil, frame.icon[pos])
else
frame.icon[pos].cd = CreateFrame("Frame", nil, frame.icon[pos])
frame.icon[pos].cd.AdvanceTime = DoNothing
frame.icon[pos].cd.SetSequence = DoNothing
frame.icon[pos].cd.SetSequenceTime = DoNothing
end
frame.icon[pos].cd.pfCooldownStyleAnimation = 0 frame.icon[pos].cd.pfCooldownStyleAnimation = 0
frame.icon[pos].cd.pfCooldownType = "ALL" frame.icon[pos].cd.pfCooldownType = "ALL"
frame.icon[pos].cd:SetFrameLevel(48) frame.icon[pos].cd:SetFrameLevel(48)
@@ -2647,7 +2572,7 @@ function pfUI.uf:GetStatusValue(unit, pos)
elseif config == "healthmax" then elseif config == "healthmax" then
return unit:GetColor("health") .. pfUI.api.Abbreviate(rhpmax) return unit:GetColor("health") .. pfUI.api.Abbreviate(rhpmax)
elseif config == "healthperc" then elseif config == "healthperc" then
return unit:GetColor("health") .. ceil(hp / hpmax * 100) return unit:GetColor("health") .. ceil(hp / hpmax * 100) .. "%"
elseif config == "healthmiss" then elseif config == "healthmiss" then
local health = ceil(rhp - rhpmax) local health = ceil(rhp - rhpmax)
if UnitIsDead(unitstr) then if UnitIsDead(unitstr) then
@@ -2700,7 +2625,7 @@ function pfUI.uf:GetStatusValue(unit, pos)
return unit:GetColor("power") .. pfUI.api.Abbreviate(mpmax) return unit:GetColor("power") .. pfUI.api.Abbreviate(mpmax)
elseif config == "powerperc" then elseif config == "powerperc" then
local perc = UnitPowerMax(unitstr) > 0 and ceil(mp / mpmax * 100) or 0 local perc = UnitPowerMax(unitstr) > 0 and ceil(mp / mpmax * 100) or 0
return unit:GetColor("power") .. perc return unit:GetColor("power") .. perc .. "%"
elseif config == "powermiss" then elseif config == "powermiss" then
local power = ceil(mp - mpmax) local power = ceil(mp - mpmax)
if power == 0 then if power == 0 then
-50
View File
@@ -1,50 +0,0 @@
-- barlength = {[formfactor]={cols, rows}}
pfGridmath = {
[1] = {{1,1}},
[2] = {{2,1},{1,2}},
[3] = {{3,1},{1,3}},
[4] = {{4,1},{2,2},{1,4}},
[5] = {{5,1},{1,5}},
[6] = {{6,1},{3,2},{2,3},{1,6}},
[7] = {{7,1},{1,7}},
[8] = {{8,1},{4,2},{2,4},{1,8}},
[9] = {{9,1},{3,3},{1,9}},
[10] = {{10,1},{5,2},{2,5},{1,10}},
[11] = {{11,1},{1,11}},
[12] = {{12,1},{6,2},{4,3},{3,4},{2,6},{1,12}}
}
-- list of valid unitstrings
pfValidUnits = {}
pfValidUnits["pet"] = true
pfValidUnits["player"] = true
pfValidUnits["target"] = true
pfValidUnits["mouseover"] = true
pfValidUnits["focus"] = true
pfValidUnits["focustarget"] = true
pfValidUnits["focustargettarget"] = true
pfValidUnits["pettarget"] = true
pfValidUnits["playertarget"] = true
pfValidUnits["targettarget"] = true
pfValidUnits["mouseovertarget"] = true
pfValidUnits["targettargettarget"] = true
for i=1,4 do
pfValidUnits["party" .. i] = true
pfValidUnits["party" .. i .. "target"] = true
pfValidUnits["partypet" .. i] = true
pfValidUnits["partypet" .. i .. "target"] = true
end
for i=1,40 do
pfValidUnits["raid" .. i] = true
pfValidUnits["raid" .. i .. "target"] = true
pfValidUnits["raidpet" .. i] = true
pfValidUnits["raidpet" .. i .. "target"] = true
pfValidUnits["nameplate" .. i] = true
pfValidUnits["nameplate" .. i .. "target"] = true
end
-3
View File
@@ -200,7 +200,6 @@ pfUI_translation["deDE"] = {
["Description Font"] = nil, ["Description Font"] = nil,
["Description Font Size"] = nil, ["Description Font Size"] = nil,
["Detailed Random Roll Announcement"] = nil, ["Detailed Random Roll Announcement"] = nil,
["Detect Enemy Buffs"] = nil,
["Disable"] = nil, ["Disable"] = nil,
["Disable Blizzard Castbar"] = nil, ["Disable Blizzard Castbar"] = nil,
["Disabled"] = nil, ["Disabled"] = nil,
@@ -282,7 +281,6 @@ pfUI_translation["deDE"] = {
["Enable Energy Ticks"] = nil, ["Enable Energy Ticks"] = nil,
["Enable Extended Guild Information"] = nil, ["Enable Extended Guild Information"] = nil,
["Enable Frame Shadow"] = nil, ["Enable Frame Shadow"] = nil,
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = nil, ["Enable Indicators"] = nil,
["Enable Item Quality Color For Equipment Only"] = nil, ["Enable Item Quality Color For Equipment Only"] = nil,
["Enable \"Loot & Spam\" Chat Window"] = nil, ["Enable \"Loot & Spam\" Chat Window"] = nil,
@@ -873,7 +871,6 @@ pfUI_translation["deDE"] = {
["Website"] = nil, ["Website"] = nil,
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = nil, ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = nil,
["Whitelist"] = nil, ["Whitelist"] = nil,
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = nil, ["Width"] = nil,
["Wobble Zoom"] = nil, ["Wobble Zoom"] = nil,
["Won"] = nil, ["Won"] = nil,
+6 -3
View File
@@ -87,6 +87,8 @@ pfUI_translation["enUS"] = {
["Buffs"] = nil, ["Buffs"] = nil,
["Buff Size"] = nil, ["Buff Size"] = nil,
["Buff Spacing"] = nil, ["Buff Spacing"] = nil,
["Buff X-Spacing"] = nil,
["Buff Y-Spacing"] = nil,
["Buffs Per Row"] = nil, ["Buffs Per Row"] = nil,
["Button"] = nil, ["Button"] = nil,
["Button already exists in pfMinimapButtons frame"] = nil, ["Button already exists in pfMinimapButtons frame"] = nil,
@@ -192,6 +194,8 @@ pfUI_translation["enUS"] = {
["Debuff Position"] = nil, ["Debuff Position"] = nil,
["Debuffs"] = nil, ["Debuffs"] = nil,
["Debuff Size"] = nil, ["Debuff Size"] = nil,
["Debuff X-Spacing"] = nil,
["Debuff Y-Spacing"] = nil,
["Debuffs Per Row"] = nil, ["Debuffs Per Row"] = nil,
["Decode"] = nil, ["Decode"] = nil,
["Default"] = nil, ["Default"] = nil,
@@ -205,7 +209,6 @@ pfUI_translation["enUS"] = {
["Description Font"] = nil, ["Description Font"] = nil,
["Description Font Size"] = nil, ["Description Font Size"] = nil,
["Detailed Random Roll Announcement"] = nil, ["Detailed Random Roll Announcement"] = nil,
["Detect Enemy Buffs"] = nil,
["Disable"] = nil, ["Disable"] = nil,
["Disable Blizzard Castbar"] = nil, ["Disable Blizzard Castbar"] = nil,
["Disabled"] = nil, ["Disabled"] = nil,
@@ -287,7 +290,6 @@ pfUI_translation["enUS"] = {
["Enable Energy Ticks"] = nil, ["Enable Energy Ticks"] = nil,
["Enable Extended Guild Information"] = nil, ["Enable Extended Guild Information"] = nil,
["Enable Frame Shadow"] = nil, ["Enable Frame Shadow"] = nil,
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = nil, ["Enable Indicators"] = nil,
["Enable Item Quality Color For Equipment Only"] = nil, ["Enable Item Quality Color For Equipment Only"] = nil,
["Enable \"Loot & Spam\" Chat Window"] = nil, ["Enable \"Loot & Spam\" Chat Window"] = nil,
@@ -582,6 +584,8 @@ pfUI_translation["enUS"] = {
["Overwrite If Unit Is Attacking Others"] = nil, ["Overwrite If Unit Is Attacking Others"] = nil,
["Overwrite If Unit Is Attacking You"] = nil, ["Overwrite If Unit Is Attacking You"] = nil,
["Overwrite If Unit Is Casting"] = nil, ["Overwrite If Unit Is Casting"] = nil,
["Own Buff Size"] = nil,
["Own Debuff Size"] = nil,
["Owner Name"] = nil, ["Owner Name"] = nil,
["Pageable"] = nil, ["Pageable"] = nil,
["Paging Actionbar"] = nil, ["Paging Actionbar"] = nil,
@@ -895,7 +899,6 @@ pfUI_translation["enUS"] = {
["Website"] = nil, ["Website"] = nil,
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = nil, ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = nil,
["Whitelist"] = nil, ["Whitelist"] = nil,
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = nil, ["Width"] = nil,
["Wobble Zoom"] = nil, ["Wobble Zoom"] = nil,
["Won"] = nil, ["Won"] = nil,
-3
View File
@@ -200,7 +200,6 @@ pfUI_translation["esES"] = {
["Description Font"] = "Fuente de descripción", ["Description Font"] = "Fuente de descripción",
["Description Font Size"] = "Tamaño de la fuente de descripción", ["Description Font Size"] = "Tamaño de la fuente de descripción",
["Detailed Random Roll Announcement"] = "Anuncio detallado para tirar los dados aleatoriamente", ["Detailed Random Roll Announcement"] = "Anuncio detallado para tirar los dados aleatoriamente",
["Detect Enemy Buffs"] = nil,
["Disable"] = "Desactivar", ["Disable"] = "Desactivar",
["Disable Blizzard Castbar"] = "Desactivar la barra de lanzamiento de Blizzard", ["Disable Blizzard Castbar"] = "Desactivar la barra de lanzamiento de Blizzard",
["Disabled"] = "Desactivado", ["Disabled"] = "Desactivado",
@@ -282,7 +281,6 @@ pfUI_translation["esES"] = {
["Enable Energy Ticks"] = "Activar tics de energía", ["Enable Energy Ticks"] = "Activar tics de energía",
["Enable Extended Guild Information"] = "Activar información de hermandad extendida", ["Enable Extended Guild Information"] = "Activar información de hermandad extendida",
["Enable Frame Shadow"] = "Activar sombra del marco", ["Enable Frame Shadow"] = "Activar sombra del marco",
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = "Activar indicadores", ["Enable Indicators"] = "Activar indicadores",
["Enable Item Quality Color For Equipment Only"] = "Mostrar el color de calidad de objetos solo para equipo", ["Enable Item Quality Color For Equipment Only"] = "Mostrar el color de calidad de objetos solo para equipo",
["Enable \"Loot & Spam\" Chat Window"] = "Activar ventana de chat \"Botín y spam\"", ["Enable \"Loot & Spam\" Chat Window"] = "Activar ventana de chat \"Botín y spam\"",
@@ -873,7 +871,6 @@ pfUI_translation["esES"] = {
["Website"] = "Sitio de web", ["Website"] = "Sitio de web",
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "¡Bienvenido a |cff33ffccpf|cffffffffUI|r!\n\nSoy el asistente de instalación que te guiará con la configuración básica. Si prefieres, puedes hacer clic el botón \"Predeterminado\" para cargar la configuración por defecto. Si quieres abrir este diálogo de nuevo, ve a la configuración y haz clic en el botón \"Reiniciar Primera vez\".\n\nVisita |cff33ffcc%s|r para descargar la última versión.", ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "¡Bienvenido a |cff33ffccpf|cffffffffUI|r!\n\nSoy el asistente de instalación que te guiará con la configuración básica. Si prefieres, puedes hacer clic el botón \"Predeterminado\" para cargar la configuración por defecto. Si quieres abrir este diálogo de nuevo, ve a la configuración y haz clic en el botón \"Reiniciar Primera vez\".\n\nVisita |cff33ffcc%s|r para descargar la última versión.",
["Whitelist"] = "Lista blanca", ["Whitelist"] = "Lista blanca",
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = "Ancho", ["Width"] = "Ancho",
["Wobble Zoom"] = "Acerca tambalea", ["Wobble Zoom"] = "Acerca tambalea",
["Won"] = "Ganado", ["Won"] = "Ganado",
+70 -3
View File
@@ -200,7 +200,6 @@ pfUI_translation["frFR"] = {
["Description Font"] = "Description de la Police", ["Description Font"] = "Description de la Police",
["Description Font Size"] = "Description de la taille de la Police", ["Description Font Size"] = "Description de la taille de la Police",
["Detailed Random Roll Announcement"] = "Annonce détaillée des Rolls aléatoires", ["Detailed Random Roll Announcement"] = "Annonce détaillée des Rolls aléatoires",
["Detect Enemy Buffs"] = nil,
["Disable"] = "Désactiver", ["Disable"] = "Désactiver",
["Disable Blizzard Castbar"] = "Désactiver la barre d'incantation d'origine", ["Disable Blizzard Castbar"] = "Désactiver la barre d'incantation d'origine",
["Disabled"] = "Désactivé", ["Disabled"] = "Désactivé",
@@ -282,7 +281,6 @@ pfUI_translation["frFR"] = {
["Enable Energy Ticks"] = "Activer la barre de rechargement d'énergie", ["Enable Energy Ticks"] = "Activer la barre de rechargement d'énergie",
["Enable Extended Guild Information"] = "Activer les informations de guilde étendues", ["Enable Extended Guild Information"] = "Activer les informations de guilde étendues",
["Enable Frame Shadow"] = "Activer l'ombre des cadres", ["Enable Frame Shadow"] = "Activer l'ombre des cadres",
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = "Activer les indicateurs", ["Enable Indicators"] = "Activer les indicateurs",
["Enable Item Quality Color For Equipment Only"] = "Activer la couleur de la qualité des objets seulement sur les pièces d'équipement", ["Enable Item Quality Color For Equipment Only"] = "Activer la couleur de la qualité des objets seulement sur les pièces d'équipement",
["Enable \"Loot & Spam\" Chat Window"] = "Activer la fenêtre de chat \"Butins & Spam\"", ["Enable \"Loot & Spam\" Chat Window"] = "Activer la fenêtre de chat \"Butins & Spam\"",
@@ -873,7 +871,6 @@ pfUI_translation["frFR"] = {
["Website"] = "Site web", ["Website"] = "Site web",
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "Bienvenue sur l'assistant d'installation de l'interface |cff33ffccpf|cffffffffUI|r!\n\nNous allons effectuer quelques configurations de base. Si vous n'avez pas la patience, cliquer sur le bouton \"Paramètres par défaut\". Si vous souhaitez relancer cette fenêtre de dialogue, allez dans les options et cliquez sur le bouton\"Réinitialiser l'assistant d'installation\" .\n\nAllez sur |cff33ffcc%s|r pour télécharger la dernière version.", ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "Bienvenue sur l'assistant d'installation de l'interface |cff33ffccpf|cffffffffUI|r!\n\nNous allons effectuer quelques configurations de base. Si vous n'avez pas la patience, cliquer sur le bouton \"Paramètres par défaut\". Si vous souhaitez relancer cette fenêtre de dialogue, allez dans les options et cliquez sur le bouton\"Réinitialiser l'assistant d'installation\" .\n\nAllez sur |cff33ffcc%s|r pour télécharger la dernière version.",
["Whitelist"] = "List blanche", ["Whitelist"] = "List blanche",
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = "Largeur", ["Width"] = "Largeur",
["Wobble Zoom"] = "Zoom oscillant", ["Wobble Zoom"] = "Zoom oscillant",
["Won"] = "A gagné", ["Won"] = "A gagné",
@@ -892,4 +889,74 @@ pfUI_translation["frFR"] = {
["Zonetime"] = nil, ["Zonetime"] = nil,
["Zoom & Fade"] = "Zoom et fondu", ["Zoom & Fade"] = "Zoom et fondu",
["Zoom Target Nameplate"] = "Zoom la cible des barres de vie flottantes", ["Zoom Target Nameplate"] = "Zoom la cible des barres de vie flottantes",
["%d items, %d ignored"] = "%d objets, %d ignorés",
["Add the current zone"] = "Ajouter la zone actuelle",
["Announce Automatic Set Switches In Chat"] = "Annoncer les changements automatiques d'ensemble dans le chat",
["Any Form"] = "N'importe quelle forme",
["Aquatic Form"] = "Forme aquatique",
["Automatic Set Switching"] = "Changement automatique d'ensemble",
["Battle Stance"] = "Posture de combat",
["Battleground"] = "Champ de bataille",
["Bear Form"] = "Forme d'ours",
["Berserker Stance"] = "Posture berserker",
["Cat Form"] = "Forme de félin",
["Condition met, but a trigger higher in the list wins"] = "Condition remplie, mais un déclencheur plus haut dans la liste est prioritaire",
["Create an equipment set first."] = "Créez d'abord un ensemble d'équipement.",
["Currently active"] = "Actuellement actif",
["Defensive Stance"] = "Posture défensive",
["Do Nothing"] = "Ne rien faire",
["Dungeon"] = "Donjon",
["Eating / Drinking"] = "Manger / Boire",
["Enable Automatic Set Switching"] = "Activer le changement automatique d'ensemble",
["Equip"] = "Équiper",
["Equip sets automatically when mounted, swimming, eating, in a zone, at a given time and more."] = "Équipe automatiquement des ensembles en monture, en nageant, en mangeant, dans une zone, à une heure donnée, etc.",
["Equipment Manager"] = "Gestionnaire d'équipement",
["Equippable items in your bags, bank and paperdoll that no equipment set uses."] = "Objets équipables dans vos sacs, votre banque et sur votre personnage qu'aucun ensemble n'utilise.",
["Equipping %s"] = "Équipement de %s",
["Equipping %s (%s)"] = "Équipement de %s (%s)",
["Every equippable item is part of a set."] = "Tous les objets équipables font partie d'un ensemble.",
["Ghost Wolf"] = "Loup fantôme",
["Here"] = "Ici",
["Ignored (Right-Click to unignore)"] = "Ignoré (clic droit pour ne plus ignorer)",
["In Bags"] = "Dans les sacs",
["In Bank"] = "En banque",
["Include Bank Items"] = "Inclure les objets en banque",
["Instance Type"] = "Type d'instance",
["Items Not In Any Set"] = "Objets hors de tout ensemble",
["Local time window, e.g. 20:00-23:00"] = "Plage horaire locale, ex. 20:00-23:00",
["Minimum Item Quality"] = "Qualité minimale des objets",
["Moonkin Form"] = "Forme de sélénien",
["Mounted"] = "En monture",
["New Trigger"] = "Nouveau déclencheur",
["No Form (Caster)"] = "Sans forme (lanceur de sorts)",
["No set selected"] = "Aucun ensemble choisi",
["No triggers yet. Click \"New Trigger\" to add one."] = "Aucun déclencheur. Cliquez sur \"Nouveau déclencheur\" pour en ajouter un.",
["Not part of any equipment set"] = "Ne fait partie d'aucun ensemble",
["Open World"] = "Monde extérieur",
["Resting (Inn / City)"] = "Repos (auberge / ville)",
["Restore Previous Gear"] = "Remettre l'équipement précédent",
["Restoring previous gear"] = "Remise de l'équipement précédent",
["Select a trigger to edit it."] = "Sélectionnez un déclencheur pour le modifier.",
["Selected Trigger"] = "Déclencheur sélectionné",
["Separate several zones with ;"] = "Séparez plusieurs zones par ;",
["Shadowform"] = "Forme d'Ombre",
["Shapeshift Form / Stance"] = "Forme / Posture",
["Shift-Click: Link Ctrl-Click: Preview\nRight-Click: Ignore / Unignore"] = "Maj-clic : lien Ctrl-clic : aperçu\nClic droit : ignorer / ne plus ignorer",
["Show Ignored"] = "Afficher les ignorés",
["Stealth"] = "Camouflage",
["Stealthed"] = "Camouflé",
["Swimming"] = "À la nage",
["Targeting A Boss"] = "Cible un boss",
["Time Of Day"] = "Heure de la journée",
["Travel Form"] = "Forme de voyage",
["Tree of Life Form"] = "Forme d'arbre de vie",
["Triggers"] = "Déclencheurs",
["Triggers higher in the list take priority. Gear is never swapped in combat, while dead or while casting: the switch waits until it can happen."] = "Les déclencheurs en haut de la liste sont prioritaires. L'équipement n'est jamais changé en combat, mort ou pendant une incantation : le changement attend que ce soit possible.",
["Unused"] = "Inutilisés",
["Value"] = "Valeur",
["When"] = "Quand",
["When It Ends"] = "À la fin",
["Windows may wrap past midnight (22:00-02:00)."] = "Une plage peut passer minuit (22:00-02:00).",
["Zone"] = "Zone",
["Zone or subzone name"] = "Nom de zone ou de sous-zone",
} }
-3
View File
@@ -200,7 +200,6 @@ pfUI_translation["koKR"] = {
["Description Font"] = nil, ["Description Font"] = nil,
["Description Font Size"] = nil, ["Description Font Size"] = nil,
["Detailed Random Roll Announcement"] = nil, ["Detailed Random Roll Announcement"] = nil,
["Detect Enemy Buffs"] = nil,
["Disable"] = "가리기", ["Disable"] = "가리기",
["Disable Blizzard Castbar"] = "블리자드 캐스트바 사용 중지", ["Disable Blizzard Castbar"] = "블리자드 캐스트바 사용 중지",
["Disabled"] = "가리기", ["Disabled"] = "가리기",
@@ -282,7 +281,6 @@ pfUI_translation["koKR"] = {
["Enable Energy Ticks"] = "Energy Ticks 활성화", ["Enable Energy Ticks"] = "Energy Ticks 활성화",
["Enable Extended Guild Information"] = "길드 정보 확장 사용", ["Enable Extended Guild Information"] = "길드 정보 확장 사용",
["Enable Frame Shadow"] = nil, ["Enable Frame Shadow"] = nil,
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = nil, ["Enable Indicators"] = nil,
["Enable Item Quality Color For Equipment Only"] = "착용장비 전용 아이템품질 색상 활성화", ["Enable Item Quality Color For Equipment Only"] = "착용장비 전용 아이템품질 색상 활성화",
["Enable \"Loot & Spam\" Chat Window"] = "\"루팅 & 스팜\"채팅 창 사용", ["Enable \"Loot & Spam\" Chat Window"] = "\"루팅 & 스팜\"채팅 창 사용",
@@ -873,7 +871,6 @@ pfUI_translation["koKR"] = {
["Website"] = nil, ["Website"] = nil,
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "|cff33ffccpf|cffffffffUI|r에 |cff33ffcc오신걸 환영합니다.|r \n\n저는 몇 가지 기본 구성을 안내 할 첫 번째 실행 위자드입니다. 모든 단계를 건너 뛰고 싶으시면 \"기본값 사용\" 버튼을 누르십시오. 이 대화 상자를 다시 실행하려면 추후 설정으로 이동하여 \"첫단계로 재설정\" 버튼을 누르십시오.\n\n최신버전 다운로드 사이트: |cff33ffcc%s|r", ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "|cff33ffccpf|cffffffffUI|r에 |cff33ffcc오신걸 환영합니다.|r \n\n저는 몇 가지 기본 구성을 안내 할 첫 번째 실행 위자드입니다. 모든 단계를 건너 뛰고 싶으시면 \"기본값 사용\" 버튼을 누르십시오. 이 대화 상자를 다시 실행하려면 추후 설정으로 이동하여 \"첫단계로 재설정\" 버튼을 누르십시오.\n\n최신버전 다운로드 사이트: |cff33ffcc%s|r",
["Whitelist"] = nil, ["Whitelist"] = nil,
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = nil, ["Width"] = nil,
["Wobble Zoom"] = nil, ["Wobble Zoom"] = nil,
["Won"] = nil, ["Won"] = nil,
-3
View File
@@ -200,7 +200,6 @@ pfUI_translation["ruRU"] = {
["Description Font"] = "Шрифт описания", ["Description Font"] = "Шрифт описания",
["Description Font Size"] = "Размер шрифта описания", ["Description Font Size"] = "Размер шрифта описания",
["Detailed Random Roll Announcement"] = "Подробное объявление о случайном броске", ["Detailed Random Roll Announcement"] = "Подробное объявление о случайном броске",
["Detect Enemy Buffs"] = nil,
["Disable"] = "Отключить", ["Disable"] = "Отключить",
["Disable Blizzard Castbar"] = "Отключить панель применения Blizzard", ["Disable Blizzard Castbar"] = "Отключить панель применения Blizzard",
["Disabled"] = "Отключено", ["Disabled"] = "Отключено",
@@ -282,7 +281,6 @@ pfUI_translation["ruRU"] = {
["Enable Energy Ticks"] = "Включить восполнение энергии", ["Enable Energy Ticks"] = "Включить восполнение энергии",
["Enable Extended Guild Information"] = "Включить расширенную информацию о гильдии", ["Enable Extended Guild Information"] = "Включить расширенную информацию о гильдии",
["Enable Frame Shadow"] = "Включить тень окон", ["Enable Frame Shadow"] = "Включить тень окон",
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = "Включить индикаторы", ["Enable Indicators"] = "Включить индикаторы",
["Enable Item Quality Color For Equipment Only"] = "Включить цвет качества предметов только для экипировки", ["Enable Item Quality Color For Equipment Only"] = "Включить цвет качества предметов только для экипировки",
["Enable \"Loot & Spam\" Chat Window"] = "Включить окно чата \"Добыча & Спам\"", ["Enable \"Loot & Spam\" Chat Window"] = "Включить окно чата \"Добыча & Спам\"",
@@ -873,7 +871,6 @@ pfUI_translation["ruRU"] = {
["Website"] = "Веб-сайт", ["Website"] = "Веб-сайт",
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "Добро пожаловать в |cff33ffccpf|cffffffffUI|r!\n\nЯ мастер первого запуска, который проведет вас через некоторую базовую конфигурацию. Если вы ленитесь, не стесняйтесь нажать кнопку \"По умолчанию\". Если вы хотите снова запустить этот диалог, перейдите к настройкам и нажмите кнопку \"Первый запуск\".\n\nПосетите |cff33ffcc%s|r, чтобы проверить последнюю версию.", ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "Добро пожаловать в |cff33ffccpf|cffffffffUI|r!\n\nЯ мастер первого запуска, который проведет вас через некоторую базовую конфигурацию. Если вы ленитесь, не стесняйтесь нажать кнопку \"По умолчанию\". Если вы хотите снова запустить этот диалог, перейдите к настройкам и нажмите кнопку \"Первый запуск\".\n\nПосетите |cff33ffcc%s|r, чтобы проверить последнюю версию.",
["Whitelist"] = "\"Белый\" список", ["Whitelist"] = "\"Белый\" список",
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = "Ширина", ["Width"] = "Ширина",
["Wobble Zoom"] = "Подпрыгивание", ["Wobble Zoom"] = "Подпрыгивание",
["Won"] = "Победа", ["Won"] = "Победа",
-3
View File
@@ -200,7 +200,6 @@ pfUI_translation["zhCN"] = {
["Description Font"] = "描述字体", ["Description Font"] = "描述字体",
["Description Font Size"] = "描述字体大小", ["Description Font Size"] = "描述字体大小",
["Detailed Random Roll Announcement"] = "通告详细随机Roll点", ["Detailed Random Roll Announcement"] = "通告详细随机Roll点",
["Detect Enemy Buffs"] = "探测敌方Buffs",
["Disable"] = "禁用", ["Disable"] = "禁用",
["Disable Blizzard Castbar"] = "隐藏暴雪施法条", ["Disable Blizzard Castbar"] = "隐藏暴雪施法条",
["Disabled"] = "不显示", ["Disabled"] = "不显示",
@@ -282,7 +281,6 @@ pfUI_translation["zhCN"] = {
["Enable Energy Ticks"] = "显示能量刻度", ["Enable Energy Ticks"] = "显示能量刻度",
["Enable Extended Guild Information"] = "公会信息扩展显示", ["Enable Extended Guild Information"] = "公会信息扩展显示",
["Enable Frame Shadow"] = "启用框架阴影", ["Enable Frame Shadow"] = "启用框架阴影",
["Enable Full-Text Search"] = "启用全文搜索",
["Enable Indicators"] = "启用指示器", ["Enable Indicators"] = "启用指示器",
["Enable Item Quality Color For Equipment Only"] = "仅在装备上显示品质颜色", ["Enable Item Quality Color For Equipment Only"] = "仅在装备上显示品质颜色",
["Enable \"Loot & Spam\" Chat Window"] = "启用[拾取、综合]聊天窗口", ["Enable \"Loot & Spam\" Chat Window"] = "启用[拾取、综合]聊天窗口",
@@ -874,7 +872,6 @@ pfUI_translation["zhCN"] = {
["Website"] = "网站", ["Website"] = "网站",
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "欢迎使用 |cff33ffccpf|cffffffffUI|r! \n\n这是第一次运行向导,将引导您完成一些基本配置。 如果你想跳过所有步骤\"使用默认\"按钮。 如果您再次运行此对话框,请转到设置并点击 \"Reset Firstrun\" 按钮。\n\n访问 |cff33ffcc%s|r 检查最新版本。", ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "欢迎使用 |cff33ffccpf|cffffffffUI|r! \n\n这是第一次运行向导,将引导您完成一些基本配置。 如果你想跳过所有步骤\"使用默认\"按钮。 如果您再次运行此对话框,请转到设置并点击 \"Reset Firstrun\" 按钮。\n\n访问 |cff33ffcc%s|r 检查最新版本。",
["Whitelist"] = "白名单", ["Whitelist"] = "白名单",
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = "宽度", ["Width"] = "宽度",
["Wobble Zoom"] = "摆动变焦", ["Wobble Zoom"] = "摆动变焦",
["Won"] = "获胜", ["Won"] = "获胜",
-3
View File
@@ -200,7 +200,6 @@ pfUI_translation["zhTW"] = {
["Description Font"] = nil, ["Description Font"] = nil,
["Description Font Size"] = nil, ["Description Font Size"] = nil,
["Detailed Random Roll Announcement"] = "通告詳細隨機Roll點", ["Detailed Random Roll Announcement"] = "通告詳細隨機Roll點",
["Detect Enemy Buffs"] = nil,
["Disable"] = "禁用", ["Disable"] = "禁用",
["Disable Blizzard Castbar"] = "隱藏暴雪施法條", ["Disable Blizzard Castbar"] = "隱藏暴雪施法條",
["Disabled"] = "不顯示", ["Disabled"] = "不顯示",
@@ -282,7 +281,6 @@ pfUI_translation["zhTW"] = {
["Enable Energy Ticks"] = "顯示能量刻度", ["Enable Energy Ticks"] = "顯示能量刻度",
["Enable Extended Guild Information"] = "公會資訊擴展顯示", ["Enable Extended Guild Information"] = "公會資訊擴展顯示",
["Enable Frame Shadow"] = "啟用框架陰影", ["Enable Frame Shadow"] = "啟用框架陰影",
["Enable Full-Text Search"] = nil,
["Enable Indicators"] = nil, ["Enable Indicators"] = nil,
["Enable Item Quality Color For Equipment Only"] = "僅在裝備上顯示品質顏色", ["Enable Item Quality Color For Equipment Only"] = "僅在裝備上顯示品質顏色",
["Enable \"Loot & Spam\" Chat Window"] = "啟用[拾取、綜合]聊天視窗", ["Enable \"Loot & Spam\" Chat Window"] = "啟用[拾取、綜合]聊天視窗",
@@ -873,7 +871,6 @@ pfUI_translation["zhTW"] = {
["Website"] = nil, ["Website"] = nil,
["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "歡迎使用 |cff33ffccpf|cffffffffUI|r! \n\n這是第一次運行嚮導,將引導您完成一些基本配置。 如果你想跳過所有步驟\"使用預設\"按鈕。 如果您再次運行此對話方塊,請轉到設置並點擊 \"Reset Firstrun\" 按鈕。\n\n訪問 |cff33ffcc%s|r 檢查最新版本。", ["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."] = "歡迎使用 |cff33ffccpf|cffffffffUI|r! \n\n這是第一次運行嚮導,將引導您完成一些基本配置。 如果你想跳過所有步驟\"使用預設\"按鈕。 如果您再次運行此對話方塊,請轉到設置並點擊 \"Reset Firstrun\" 按鈕。\n\n訪問 |cff33ffcc%s|r 檢查最新版本。",
["Whitelist"] = "白名單", ["Whitelist"] = "白名單",
["Who Search Unknown Classes (|cffffaaaaExperimental|r)"] = nil,
["Width"] = nil, ["Width"] = nil,
["Wobble Zoom"] = nil, ["Wobble Zoom"] = nil,
["Won"] = nil, ["Won"] = nil,
-1
View File
@@ -7,7 +7,6 @@
<Include file="..\env\locales_esES.lua"/> <Include file="..\env\locales_esES.lua"/>
<Include file="..\env\locales_ruRU.lua"/> <Include file="..\env\locales_ruRU.lua"/>
<Include file="..\env\tables.lua"/>
<Include file="..\env\profiles.lua"/> <Include file="..\env\profiles.lua"/>
<Include file="..\env\translations_enUS.lua"/> <Include file="..\env\translations_enUS.lua"/>
+1
View File
@@ -30,6 +30,7 @@
<Include file="..\skins\blizzard\options-sound.lua"/> <Include file="..\skins\blizzard\options-sound.lua"/>
<Include file="..\skins\blizzard\options-video.lua"/> <Include file="..\skins\blizzard\options-video.lua"/>
<Include file="..\skins\blizzard\options-new.lua"/> <Include file="..\skins\blizzard\options-new.lua"/>
<Include file="..\skins\blizzard\options-interface.lua"/>
<Include file="..\skins\blizzard\petition.lua"/> <Include file="..\skins\blizzard\petition.lua"/>
<Include file="..\skins\blizzard\taxi.lua"/> <Include file="..\skins\blizzard\taxi.lua"/>
<Include file="..\skins\blizzard\tooltips.lua"/> <Include file="..\skins\blizzard\tooltips.lua"/>
+8 -1616
View File
File diff suppressed because it is too large Load Diff
+165 -210
View File
@@ -13,34 +13,23 @@ setfenv(1, pfUI:GetEnvironment())
-- including resurrections. It has an option to disable the sending of those -- including resurrections. It has an option to disable the sending of those
-- messages in case HealComm is already active. -- messages in case HealComm is already active.
-- --
-- HOT TRACKING INTEGRATION (NEW): -- Casts are read from ClassicAPI's UNIT_SPELLCAST_* events and heal amounts
-- With Nampower enabled, HoT tracking now primarily uses libdebuff's AURA_CAST -- from COMBAT_LOG_EVENT_UNFILTERED. GetHotDuration() reads live HoT timers
-- event system for accurate server-side buff/debuff tracking with full rank -- from C_UnitAuras (via libdebuff) and falls back to the HealComm-fed table.
-- protection. GetHotDuration() first checks libdebuff, then falls back to the
-- legacy prediction system for backwards compatibility with non-Nampower clients.
-- This provides:
-- - Accurate duration from server (no prediction needed)
-- - Automatic rank protection (lower ranks won't overwrite higher ranks)
-- - Support for multiple casters of same HoT on one target
-- - Zero event overhead (libdebuff already tracks all auras)
-- return instantly when another libpredict is already active -- return instantly when another libpredict is already active
if pfUI.api.libpredict then return end if pfUI.api.libpredict then return end
-- Check if libdebuff integration is available
local libdebuff_available = (pfUI.api.libdebuff and pfUI.api.libdebuff.GetBestAuraCast) and true or false
-- Check if Nampower is available for SPELL_FAILED events
local senttarget
local heals, ress, events, hots = {}, {}, {}, {} local heals, ress, events, hots = {}, {}, {}, {}
local spell_queue = { "DUMMY", "DUMMYRank 9", "TARGET" } local spell_queue = { "DUMMY", "DUMMYRank 9", "TARGET" }
local player = UnitName("player") local player = UnitName("player")
local cache, gear_string = {}, "" local cache, gear_string = {}, ""
local foreignCache = {} -- [casterName][spellKey] = amount, in-memory cache for other healers local foreignCache = {} -- [casterName][spellKey] = amount, in-memory cache for other healers
local rejuvDuration, renewDuration = 12, 15 --default durations local rejuvDuration, renewDuration = 12, 15 --default durations
local ressGuidToName = {} -- [casterGuid] = casterName, for SPELL_FAILED_OTHER cleanup local ressGuidToName = {} -- [casterGuid] = casterName, for interrupted-cast cleanup
local healGuidToName = {} -- [casterGuid] = casterName, for SPELL_FAILED_OTHER cleanup local healGuidToName = {} -- [casterGuid] = casterName, for interrupted-cast cleanup
local sentTargets = {} -- [castGUID] = target name of an own cast, from UNIT_SPELLCAST_SENT
local castTargets = {} -- [castGUID] = target name of a foreign cast, from UNIT_SPELLCAST_START
local ress_timers = {} -- [target][sender] = expiry_timestamp (60s rez window) local ress_timers = {} -- [target][sender] = expiry_timestamp (60s rez window)
local RESS_TIMEOUT = 60 -- Vanilla: rez offer expires after 60s local RESS_TIMEOUT = 60 -- Vanilla: rez offer expires after 60s
@@ -124,43 +113,25 @@ libpredict:SetScript("OnEvent", function()
if origOnEvent then origOnEvent() end if origOnEvent then origOnEvent() end
end) end)
-- SPELL_START_SELF: own cast started (heals + rez) -- Own cast-time spell started (heals + rez)
pfUI.libdebuff_spell_start_self_hooks = pfUI.libdebuff_spell_start_self_hooks or {} local function OnOwnCastStart(spellId, castGUID)
pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGuid, targetGuid, castTime)
local spellName = C_Spell.GetSpellName(spellId) local spellName = C_Spell.GetSpellName(spellId)
if not spellName then return end if not spellName then return end
local pendingTarget = nil -- SENT names the unit the cast went out at; self and no-target casts
local pendingTargetGuid = nil -- carry none, so fall back to what the cast hooks recorded
local pending = pfUI.libpredict_pending_cast local target = sentTargets[castGUID] or spell_queue[3]
if pending and pending.spellName == spellName and pending.targetGuid local _, _, _, startMs, endMs = C_Spell.CastingInfo()
and pending.time and (GetTime() - pending.time) < 1 then local castTime = startMs and endMs - startMs or 0
-- If SPELL_CAST_EVENT target differs from SPELL_START_SELF target,
-- the client redirected the cast (e.g. offline target → selfcast).
-- Discard pending and trust the actual targetGuid from SPELL_START_SELF.
if pending.targetGuid == targetGuid then
local name = UnitName(pending.targetGuid)
if name and name ~= UNKNOWNOBJECT and name ~= UKNOWNBEING then
pendingTarget = name
pendingTargetGuid = pending.targetGuid
end
end
pending.spellId = nil
pending.spellName = nil
pending.targetGuid = nil
pending.time = nil
end
local target = pendingTarget or resolveNameFromGuid(targetGuid) or senttarget or spell_queue[3]
-- resolved GUID: prefer pendingTargetGuid (mouseover/click-to-cast), fall back to targetGuid
local resolvedTargetGuid = pendingTargetGuid or targetGuid
libpredict.sender.castGUID = castGUID
libpredict.sender.delayMs = 0
libpredict.sender.current_cast = spellName libpredict.sender.current_cast = spellName
libpredict.sender.current_cast_target = target libpredict.sender.current_cast_target = target
if L["resurrections"][spellName] then if L["resurrections"][spellName] then
if target then if target then
libpredict:Ress(player, target, casterGuid) libpredict:Ress(player, target, UnitGUID("player"))
libpredict.sender:SendHealCommMsg("Resurrection/" .. target .. "/start/") libpredict.sender:SendHealCommMsg("Resurrection/" .. target .. "/start/")
libpredict.sender:SendResCommMsg("RES " .. target) libpredict.sender:SendResCommMsg("RES " .. target)
libpredict.sender.resurrecting = true libpredict.sender.resurrecting = true
@@ -235,27 +206,17 @@ pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGu
return -- skip the generic Heal call below return -- skip the generic Heal call below
end end
-- If the resolved heal target is itself hostile (e.g. self-cast heal while targeting an enemy), libpredict:Heal(player, target, amount, casttime)
-- store the heal under the player so the player frame shows the prediction. libpredict.sender:SendHealCommMsg("Heal/" .. (target or "") .. "/" .. amount .. "/" .. casttime .. "/")
-- Use resolvedTargetGuid (prefers pendingTargetGuid from mouseover/click-to-cast) so we
-- don't wrongly fall back to player when healing a friend via mouseover with a foe in target.
local healTarget = target
local unitTargetGuid = UnitGUID and UnitGUID("target")
local healTargetIsHostile = resolvedTargetGuid and unitTargetGuid
and resolvedTargetGuid == unitTargetGuid
and UnitExists("target")
and (UnitCanAttack("player", "target") or not UnitIsFriend("player", "target"))
if healTargetIsHostile then
healTarget = player
end
libpredict:Heal(player, healTarget, amount, casttime)
libpredict.sender:SendHealCommMsg("Heal/" .. (healTarget or "") .. "/" .. amount .. "/" .. casttime .. "/")
libpredict.sender.healing = true libpredict.sender.healing = true
end end
end end
-- SPELL_GO_SELF: own cast landed (HealStop + Regrowth timer) -- Own cast landed: HealStop, Regrowth timer, instant HoTs, own rez timer
pfUI.libdebuff_spell_go_hooks["libpredict_sender"] = function(spellId) local function OnOwnCastSucceeded(spellId, castGUID)
local target = sentTargets[castGUID] or spell_queue[3]
sentTargets[castGUID] = nil
libpredict:HealStop(player) libpredict:HealStop(player)
local spellName = C_Spell.GetSpellName(spellId) local spellName = C_Spell.GetSpellName(spellId)
if spellName == REGROWTH then if spellName == REGROWTH then
@@ -267,32 +228,57 @@ pfUI.libdebuff_spell_go_hooks["libpredict_sender"] = function(spellId)
end end
libpredict.sender.regrowth_timer = now + 0.1 libpredict.sender.regrowth_timer = now + 0.1
end end
libpredict.sender.castGUID = nil
libpredict.sender.current_cast = nil libpredict.sender.current_cast = nil
libpredict.sender.current_cast_target = nil libpredict.sender.current_cast_target = nil
if not target then return end
-- Instant HoTs — classify by name (rank-independent) instead of a
-- hardcoded per-rank ID table.
local hotType
if spellName == REJUVENATION then hotType = "Reju"
elseif spellName == RENEW then hotType = "Renew"
end
if hotType then
local duration = hotType == "Reju" and rejuvDuration or renewDuration
local rank = 0
local rankSub = C_Spell.GetSpellSubtext(spellId)
if rankSub and rankSub ~= "" then
rank = tonumber((string.gsub(rankSub, "Rank ", ""))) or 0
end
libpredict:Hot(player, target, hotType, duration, nil, "UNIT_SPELLCAST_SUCCEEDED", rank)
libpredict.sender:SendHealCommMsg(hotType .. "/" .. target .. "/" .. duration .. "/" .. rank .. "/")
end
if isRezSpell(spellId) then
libpredict:RessSetTimer(player, target)
end
end end
-- SPELL_START_OTHER: foreign cast started (heals + rez) -- Foreign cast-time spell started (heals + rez)
-- Signature: fn(spellId, casterGuid, targetGuid, castTime) local function OnOtherCastStart(unit, spellId, castGUID)
pfUI.libdebuff_spell_start_other_hooks = pfUI.libdebuff_spell_start_other_hooks or {}
pfUI.libdebuff_spell_start_other_hooks["libpredict"] = function(spellId, casterGuid, targetGuid, castTime)
local spellName = C_Spell.GetSpellName(spellId) local spellName = C_Spell.GetSpellName(spellId)
if not spellName then return end if not spellName then return end
local casterGuid = UnitGUID(unit)
local casterName = resolveNameFromGuid(casterGuid) local casterName = resolveNameFromGuid(casterGuid)
if not casterName then return end if not casterName then return end
local targetName = UnitSpellTargetName(unit)
if not targetName then return end
castTargets[castGUID] = targetName
-- Resurrection cast -- Resurrection cast
if L["resurrections"][spellName] then if L["resurrections"][spellName] then
local targetName = resolveNameFromGuid(targetGuid) libpredict:Ress(casterName, targetName, casterGuid)
if targetName then
libpredict:Ress(casterName, targetName, casterGuid)
end
return return
end end
-- Heal cast: look up cached amount from a previous cast by this healer -- Heal cast: look up cached amount from a previous cast by this healer
local targetName = resolveNameFromGuid(targetGuid) local _, _, _, startMs, endMs = C_Spell.UnitCastingInfo(unit)
if not targetName then return end if not startMs then return end
local castTime = endMs - startMs
local rankStr = C_Spell.GetSpellSubtext(spellId) or "" local rankStr = C_Spell.GetSpellSubtext(spellId) or ""
local spellKey = spellName .. (rankStr or "") local spellKey = spellName .. (rankStr or "")
@@ -338,77 +324,26 @@ pfUI.libdebuff_spell_start_other_hooks["libpredict"] = function(spellId, casterG
libpredict:Heal(casterName, targetName, amount, castTime, casterGuid) libpredict:Heal(casterName, targetName, amount, castTime, casterGuid)
end end
-- SPELL_GO_SELF: own cast landed - HoTs + own rez timer -- Foreign cast landed: rez timer, or the predicted heal is fulfilled
-- Signature: fn(spellId, arg1, arg2, arg3, arg4, arg5, arg6, arg7) local function OnOtherCastSucceeded(unit, spellId, castGUID)
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {} local casterGuid = UnitGUID(unit)
pfUI.libdebuff_spell_go_hooks["libpredict"] = function(spellId, a1, a2, a3, a4, a5, a6, a7)
-- Instant HoTs — classify by name (rank-independent) instead of a
-- hardcoded per-rank ID table.
local spellName = C_Spell.GetSpellName(spellId)
local hotType
if spellName == REJUVENATION then hotType = "Reju"
elseif spellName == RENEW then hotType = "Renew"
end
if hotType then
local targetGuid = a4
local targetName = resolveNameFromGuid(targetGuid)
if targetName then
local duration
if hotType == "Reju" then duration = rejuvDuration or 12
elseif hotType == "Renew" then duration = renewDuration or 15
end
local rank = 0
local rankSub = C_Spell.GetSpellSubtext(spellId)
if rankSub and rankSub ~= "" then
rank = tonumber((string.gsub(rankSub, "Rank ", ""))) or 0
end
local playerName = UnitName("player")
libpredict:Hot(playerName, targetName, hotType, duration, nil, "SPELL_GO_SELF", rank)
local rankStr = tostring(rank)
if libpredict.sender and libpredict.sender.SendHealCommMsg then
libpredict.sender:SendHealCommMsg(hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/")
elseif IsInRaid() then
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "RAID")
elseif IsInGroup() then
SendAddonMessage("HealComm", hotType .. "/" .. targetName .. "/" .. duration .. "/" .. rankStr .. "/", "PARTY")
end
end
end
-- Own rez landed: set timer
if isRezSpell(spellId) then
local targetGuid = a4
local targetName = resolveNameFromGuid(targetGuid)
local playerName = UnitName("player")
if playerName and targetName then
libpredict:RessSetTimer(playerName, targetName)
end
end
end
-- SPELL_GO_OTHER: foreign cast landed - rez timer + HealStop
-- Signature: fn(spellId, casterGuid, targetGuid)
pfUI.libdebuff_spell_go_other_hooks = pfUI.libdebuff_spell_go_other_hooks or {}
pfUI.libdebuff_spell_go_other_hooks["libpredict"] = function(spellId, casterGuid, targetGuid)
local casterName = resolveNameFromGuid(casterGuid) local casterName = resolveNameFromGuid(casterGuid)
if not casterName then return end if not casterName then return end
if isRezSpell(spellId) then if isRezSpell(spellId) then
local targetName = resolveNameFromGuid(targetGuid) local targetName = castTargets[castGUID]
if targetName then if targetName then
libpredict:RessSetTimer(casterName, targetName) libpredict:RessSetTimer(casterName, targetName)
end end
return return
end end
-- Heal landed → prediction fulfilled, clean up
libpredict:HealStop(casterName) libpredict:HealStop(casterName)
end end
-- SPELL_FAILED_OTHER: remove cancelled resses/heals -- Foreign cast interrupted: remove cancelled resses/heals
-- Signature: fn(casterGuid, spellId) local function OnOtherCastInterrupted(unit)
pfUI.libdebuff_spell_failed_other_hooks = pfUI.libdebuff_spell_failed_other_hooks or {} local casterGuid = UnitGUID(unit)
pfUI.libdebuff_spell_failed_other_hooks["libpredict"] = function(casterGuid, spellId)
if not casterGuid then return end if not casterGuid then return end
local ressName = ressGuidToName[casterGuid] local ressName = ressGuidToName[casterGuid]
if ressName then if ressName then
@@ -547,13 +482,15 @@ function libpredict:ParseChatMessage(sender, msg, comm)
if cmd and ctratarget and cmd == "RES" and ctratarget ~= "" and ctratarget ~= UNKNOWN then if cmd and ctratarget and cmd == "RES" and ctratarget ~= "" and ctratarget ~= UNKNOWN then
msgtype = "Ress" msgtype = "Ress"
target = ctratarget target = ctratarget
elseif cmd == "RESNO" then
msgtype = "RessStop"
end end
end end
if msgtype == "Stop" and sender then if msgtype == "Stop" and sender then
libpredict:HealStop(sender) libpredict:HealStop(sender)
return return
elseif ( msg == "RessStop" or msg == "RESNO" ) and sender then elseif msgtype == "RessStop" and sender then
libpredict:RessStop(sender) libpredict:RessStop(sender)
return return
elseif msgtype == "Delay" and time then elseif msgtype == "Delay" and time then
@@ -567,7 +504,7 @@ function libpredict:ParseChatMessage(sender, msg, comm)
libpredict:Heal(sender, target, heal, time) libpredict:Heal(sender, target, heal, time)
end end
elseif msgtype == "Ress" then elseif msgtype == "Ress" then
-- HealComm: only for other players (own resses tracked via SPELL_START_SELF hook) -- HealComm: only for other players (own resses tracked via UNIT_SPELLCAST_START)
local playerName = UnitName("player") local playerName = UnitName("player")
if sender ~= playerName then if sender ~= playerName then
local senderGuid local senderGuid
@@ -899,7 +836,6 @@ local pendingHots = {}
-- Gather Data by User Actions -- Gather Data by User Actions
hooksecurefunc("CastSpell", function(id, bookType) hooksecurefunc("CastSpell", function(id, bookType)
if not libpredict.sender.enabled then return end
local effect, rank = libspell.GetSpellInfo(id, bookType) local effect, rank = libspell.GetSpellInfo(id, bookType)
if not effect then return end if not effect then return end
spell_queue[1] = effect spell_queue[1] = effect
@@ -912,7 +848,7 @@ hooksecurefunc("CastSpell", function(id, bookType)
rankNum = tonumber((string.gsub(rank, "Rank ", ""))) or nil rankNum = tonumber((string.gsub(rank, "Rank ", ""))) or nil
end end
-- Instant HoTs: libdebuff/Nampower via GetHotDuration, hook method as fallback -- Instant HoTs: UNIT_SPELLCAST_SUCCEEDED and C_UnitAuras, hook method as fallback
if effect == REJUVENATION then if effect == REJUVENATION then
local target = spell_queue[3] local target = spell_queue[3]
@@ -952,7 +888,6 @@ hooksecurefunc("CastSpell", function(id, bookType)
end) end)
hooksecurefunc("CastSpellByName", function(effect, target) hooksecurefunc("CastSpellByName", function(effect, target)
if not libpredict.sender.enabled then return end
local effect, rank = libspell.GetSpellInfo(effect) local effect, rank = libspell.GetSpellInfo(effect)
if not effect then return end if not effect then return end
@@ -976,7 +911,7 @@ hooksecurefunc("CastSpellByName", function(effect, target)
spell_queue[3] = target or default spell_queue[3] = target or default
end end
-- Instant HoTs: libdebuff/Nampower via GetHotDuration, hook method as fallback -- Instant HoTs: UNIT_SPELLCAST_SUCCEEDED and C_UnitAuras, hook method as fallback
if effect == REJUVENATION then if effect == REJUVENATION then
local hotTarget = target or default local hotTarget = target or default
@@ -1016,7 +951,6 @@ hooksecurefunc("CastSpellByName", function(effect, target)
end) end)
hooksecurefunc("UseAction", function(slot, target, selfcast) hooksecurefunc("UseAction", function(slot, target, selfcast)
if not libpredict.sender.enabled then return end
if not IsCurrentAction(slot) then return end if not IsCurrentAction(slot) then return end
local kind, id = GetActionInfo(slot) local kind, id = GetActionInfo(slot)
local effect, rank local effect, rank
@@ -1037,7 +971,7 @@ hooksecurefunc("UseAction", function(slot, target, selfcast)
rankNum = tonumber((string.gsub(rank, "Rank ", ""))) or nil rankNum = tonumber((string.gsub(rank, "Rank ", ""))) or nil
end end
-- Instant HoTs: libdebuff/Nampower via GetHotDuration, hook method as fallback -- Instant HoTs: UNIT_SPELLCAST_SUCCEEDED and C_UnitAuras, hook method as fallback
if effect == REJUVENATION then if effect == REJUVENATION then
local hotTarget = spell_queue[3] local hotTarget = spell_queue[3]
@@ -1077,8 +1011,10 @@ hooksecurefunc("UseAction", function(slot, target, selfcast)
end) end)
libpredict.sender = CreateFrame("Frame", "pfPredictionSender", UIParent) libpredict.sender = CreateFrame("Frame", "pfPredictionSender", UIParent)
-- cleared when a HealComm addon already broadcasts this player's casts
libpredict.sender.enabled = true libpredict.sender.enabled = true
libpredict.sender.SendHealCommMsg = function(self, msg) libpredict.sender.SendHealCommMsg = function(self, msg)
if not self.enabled then return end
-- Smart channel selection: Only send to relevant channel to avoid duplicates -- Smart channel selection: Only send to relevant channel to avoid duplicates
if IsInRaid() then if IsInRaid() then
-- In raid: Only send to RAID (includes all raid members) -- In raid: Only send to RAID (includes all raid members)
@@ -1091,6 +1027,7 @@ libpredict.sender.SendHealCommMsg = function(self, msg)
-- BG groups are handled by RAID channel -- BG groups are handled by RAID channel
end end
libpredict.sender.SendResCommMsg = function(self, msg) libpredict.sender.SendResCommMsg = function(self, msg)
if not self.enabled then return end
-- Smart channel selection: Only send to relevant channel to avoid duplicates -- Smart channel selection: Only send to relevant channel to avoid duplicates
if IsInRaid() then if IsInRaid() then
-- In raid: Only send to RAID (includes all raid members) -- In raid: Only send to RAID (includes all raid members)
@@ -1127,15 +1064,17 @@ libpredict.sender:SetScript("OnUpdate", function()
end end
end) end)
-- Nampower events -- Own casts arrive as "player"; every other caster fires once per unit token
libpredict.sender:RegisterEvent("SPELL_FAILED_SELF") -- it currently holds (raidN, target, nameplateN, ...), so other-unit handlers
libpredict.sender:RegisterEvent("SPELL_DELAYED_SELF") -- drop the repeats by castGUID.
libpredict.sender:RegisterEvent("SPELL_HEAL_BY_SELF") libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SENT")
libpredict.sender:RegisterEvent("SPELL_HEAL_BY_OTHER") -- populates foreignCache for other healers libpredict.sender:RegisterEvent("UNIT_SPELLCAST_START")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_DELAYED")
-- force cache updates libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
libpredict.sender:RegisterUnitEvent("UNIT_INVENTORY_CHANGED", "player") libpredict.sender:RegisterEvent("UNIT_SPELLCAST_FAILED")
libpredict.sender:RegisterEvent("SKILL_LINES_CHANGED") libpredict.sender:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_STOP")
libpredict.sender:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
-- Shared cleanup helper for failed/interrupted casts -- Shared cleanup helper for failed/interrupted casts
local function onCastFailed() local function onCastFailed()
@@ -1145,7 +1084,7 @@ local function onCastFailed()
s:SendHealCommMsg("Healstop") s:SendHealCommMsg("Healstop")
s.healing = nil s.healing = nil
elseif s.resurrecting then elseif s.resurrecting then
local target = s.current_cast_target or senttarget or spell_queue[3] local target = s.current_cast_target or spell_queue[3]
libpredict:RessStop(UnitName("player")) libpredict:RessStop(UnitName("player"))
s:SendHealCommMsg("Resurrection/stop/") s:SendHealCommMsg("Resurrection/stop/")
s:SendResCommMsg("RESNO " .. (target or "")) s:SendResCommMsg("RESNO " .. (target or ""))
@@ -1157,81 +1096,103 @@ local function onCastFailed()
s.regrowth_target_next = nil s.regrowth_target_next = nil
s.regrowth_start_next = nil s.regrowth_start_next = nil
end end
s.castGUID = nil
s.current_cast = nil s.current_cast = nil
s.current_cast_target = nil s.current_cast_target = nil
end end
libpredict.sender:SetScript("OnEvent", function() -- Real heal amounts: own heals refresh the spell cache, other group healers'
-- ============================================================ -- heals fill foreignCache (one event per hit target for AoE heals like PoH).
-- NAMPOWER PATH local function OnHeal()
-- ============================================================ -- arg4=sourceGUID, arg12=spellId, arg13=spellName, arg15=amount, arg18=critical
if event == "SPELL_HEAL_BY_SELF" then local spellId, spellName, amount, isCrit = arg12, arg13, arg15, arg18 == 1
-- arg1=targetGuid, arg2=casterGuid, arg3=spellId, arg4=amount, arg5=critical, arg6=periodic if not spellName or not amount or amount <= 0 then return end
local spellId = arg3
local amount = arg4 if IsPlayerGuid(arg4) then
local isCrit = arg5 == 1 if spell_queue[1] == spellName then
local isPeriodic = arg6 == 1
local spellName = C_Spell.GetSpellName(spellId)
if spellName and spell_queue[1] == spellName then
UpdateCache(spell_queue[2], amount, isCrit) UpdateCache(spell_queue[2], amount, isCrit)
end end
return
end
elseif event == "SPELL_HEAL_BY_OTHER" then local casterName = resolveNameFromGuid(arg4)
-- Fires once per hit target for AoE heals (e.g. PoH). if not casterName then return end
-- Use this to build a per-caster cache of real heal amounts.
-- arg1=targetGuid, arg2=casterGuid, arg3=spellId, arg4=amount, arg5=critical, arg6=periodic
local casterGuid = arg2
local spellId = arg3
local amount = arg4
local isCrit = arg5 == 1
local isPeriodic = arg6 == 1
if isPeriodic or not spellId or not amount or amount <= 0 then return end local spellKey = spellName .. (C_Spell.GetSpellSubtext(spellId) or "")
local casterName = resolveNameFromGuid(casterGuid) foreignCache[casterName] = foreignCache[casterName] or {}
if not casterName or casterName == player then return end -- own heals handled by SPELL_HEAL_BY_SELF local existing = foreignCache[casterName][spellKey]
-- Store highest non-crit value for best prediction accuracy
if isCrit then
-- Estimate base from crit (vanilla crit = 150%)
local base = math.floor(amount * 2 / 3)
if not existing or base > existing then
foreignCache[casterName][spellKey] = base
end
else
if not existing or amount > existing then
foreignCache[casterName][spellKey] = amount
end
end
end
local spellName = C_Spell.GetSpellName(spellId) local lastOtherCast = {} -- [event] = castGUID of the last other-unit event handled
if not spellName then return end
local rankStr = C_Spell.GetSpellSubtext(spellId)
local spellKey = spellName .. (rankStr or "")
foreignCache[casterName] = foreignCache[casterName] or {} libpredict.sender:SetScript("OnEvent", function()
local existing = foreignCache[casterName][spellKey] if event == "COMBAT_LOG_EVENT_UNFILTERED" then
-- Store highest non-crit value for best prediction accuracy if arg2 == "SPELL_HEAL" then OnHeal() end
if isCrit then return
-- Estimate base from crit (vanilla crit = 150%) end
local base = math.floor(amount * 2 / 3)
if not existing or base > existing then -- UNIT_SPELLCAST_SENT: arg1=unit, arg2=target token, arg3=castGUID, arg4=spellID
foreignCache[casterName][spellKey] = base -- every other UNIT_SPELLCAST_*: arg1=unit, arg2=castGUID, arg3=spellID
end local unit = arg1
else if unit == "player" then
if not existing or amount > existing then if event == "UNIT_SPELLCAST_SENT" then
foreignCache[casterName][spellKey] = amount sentTargets[arg3] = arg2 ~= "" and UnitName(arg2) or nil
elseif event == "UNIT_SPELLCAST_START" then
OnOwnCastStart(arg3, arg2)
elseif event == "UNIT_SPELLCAST_SUCCEEDED" then
OnOwnCastSucceeded(arg3, arg2)
elseif event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED" then
sentTargets[arg2] = nil
-- a refused cast (cooldown, range) fails under its own castGUID and
-- must not cancel the heal that is still casting
if arg2 == this.castGUID then onCastFailed() end
elseif event == "UNIT_SPELLCAST_DELAYED" then
-- delayTimeMs is the pushback so far; HealComm wants each step
local _, _, _, _, _, _, _, _, _, _, delayMs = C_Spell.CastingInfo()
if this.healing and delayMs and delayMs > this.delayMs then
local step = delayMs - this.delayMs
this.delayMs = delayMs
libpredict:HealDelay(player, step)
this:SendHealCommMsg("Healdelay/" .. step .. "/")
end end
end end
return
end
elseif event == "SPELL_FAILED_SELF" then if UnitIsUnit(unit, "player") or lastOtherCast[event] == arg2 then return end
onCastFailed() lastOtherCast[event] = arg2
elseif event == "SPELL_DELAYED_SELF" then
-- arg1=casterGuid, arg2=delayMs
if libpredict.sender.healing then
libpredict:HealDelay(player, arg2)
libpredict.sender:SendHealCommMsg("Healdelay/" .. arg2 .. "/")
end
if event == "UNIT_SPELLCAST_START" then
OnOtherCastStart(unit, arg3, arg2)
elseif event == "UNIT_SPELLCAST_SUCCEEDED" then
OnOtherCastSucceeded(unit, arg3, arg2)
elseif event == "UNIT_SPELLCAST_INTERRUPTED" then
OnOtherCastInterrupted(unit)
elseif event == "UNIT_SPELLCAST_STOP" then
castTargets[arg2] = nil
end end
end) end)
function libpredict:GetHotDuration(unit, spell) function libpredict:GetHotDuration(unit, spell)
if unit == UNKNOWNOBJECT or unit == UKNOWNBEING then return end if unit == UNKNOWNOBJECT or unit == UKNOWNBEING then return end
-- NEW: Try libdebuff first (Nampower AURA_CAST events) -- Live aura timer first (C_UnitAuras via libdebuff)
if pfUI.api.libdebuff and pfUI.api.libdebuff.GetBestAuraCast then if pfUI.api.libdebuff then
local guid = UnitGUID(unit) local guid = UnitGUID(unit)
if guid then if guid then
-- Get the best (highest rank) aura cast for this spell
local spellName = spell local spellName = spell
-- Map short spell codes to full names -- Map short spell codes to full names
@@ -1246,7 +1207,6 @@ function libpredict:GetHotDuration(unit, spell)
local start, duration, timeleft, rank, casterGuid = pfUI.api.libdebuff:GetBestAuraCast(guid, spellName) local start, duration, timeleft, rank, casterGuid = pfUI.api.libdebuff:GetBestAuraCast(guid, spellName)
if start and duration and timeleft then if start and duration and timeleft then
-- SUCCESS: libdebuff has accurate server-side data!
if libpredict.debug then if libpredict.debug then
DEFAULT_CHAT_FRAME:AddMessage(string.format("|cff00ff00[GetHotDuration]|r %s on %s via libdebuff: dur=%.1fs timeleft=%.1fs rank=%d", DEFAULT_CHAT_FRAME:AddMessage(string.format("|cff00ff00[GetHotDuration]|r %s on %s via libdebuff: dur=%.1fs timeleft=%.1fs rank=%d",
spell, unit, duration, timeleft, rank or 0)) spell, unit, duration, timeleft, rank or 0))
@@ -1256,7 +1216,7 @@ function libpredict:GetHotDuration(unit, spell)
end end
end end
-- FALLBACK: Use old prediction system (for non-Nampower clients or no AURA_CAST data) -- FALLBACK: the HealComm/cast-fed table, for HoTs C_UnitAuras has no timer for
local start, duration, timeleft local start, duration, timeleft
local now = pfUI.uf.now or GetTime() local now = pfUI.uf.now or GetTime()
@@ -1290,16 +1250,11 @@ _G.SlashCmdList.HOTDEBUG = function()
DEFAULT_CHAT_FRAME:AddMessage("|cff00ffff[HoT Tracking Debug]|r") DEFAULT_CHAT_FRAME:AddMessage("|cff00ffff[HoT Tracking Debug]|r")
DEFAULT_CHAT_FRAME:AddMessage("|cff00ffff========================================|r") DEFAULT_CHAT_FRAME:AddMessage("|cff00ffff========================================|r")
-- Check libdebuff availability if pfUI.api.libdebuff then
local libdebuff_now = (pfUI.api.libdebuff and pfUI.api.libdebuff.GetBestAuraCast) and true or false
if libdebuff_now then
DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00[PRIMARY]|r libdebuff integration: ACTIVE") DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00[PRIMARY]|r libdebuff integration: ACTIVE")
DEFAULT_CHAT_FRAME:AddMessage(" Using AURA_CAST events for server-side tracking") DEFAULT_CHAT_FRAME:AddMessage(" Using C_UnitAuras timers")
DEFAULT_CHAT_FRAME:AddMessage(" Rank protection: ENABLED")
else else
DEFAULT_CHAT_FRAME:AddMessage("|cffff9900[PRIMARY]|r libdebuff integration: NOT AVAILABLE") DEFAULT_CHAT_FRAME:AddMessage("|cffff9900[PRIMARY]|r libdebuff integration: NOT AVAILABLE")
DEFAULT_CHAT_FRAME:AddMessage(" Reason: Nampower not enabled or libdebuff outdated")
end end
DEFAULT_CHAT_FRAME:AddMessage("|cff00ffff[FALLBACK]|r Legacy prediction system: ACTIVE") DEFAULT_CHAT_FRAME:AddMessage("|cff00ffff[FALLBACK]|r Legacy prediction system: ACTIVE")
+97 -63
View File
@@ -81,6 +81,9 @@ pfUI:RegisterModule("actionbar", function ()
["ACTIONBAR_UPDATE_COOLDOWN"] = true, ["ACTIONBAR_UPDATE_COOLDOWN"] = true,
["ACTIONBAR_UPDATE_USABLE"] = true, ["ACTIONBAR_UPDATE_USABLE"] = true,
["ACTIONBAR_UPDATE_STATE"] = true, ["ACTIONBAR_UPDATE_STATE"] = true,
-- fires on every ammo shot / consumable use, but only counts, equipped
-- state, cooldowns and usability can change from it
["UNIT_INVENTORY_CHANGED"] = true,
} }
-- events that are shared across all buttons -- events that are shared across all buttons
@@ -97,8 +100,6 @@ pfUI:RegisterModule("actionbar", function ()
["TRADE_SKILL_CLOSE"] = true, ["TRADE_SKILL_CLOSE"] = true,
["PLAYER_ENTER_COMBAT"] = true, ["PLAYER_ENTER_COMBAT"] = true,
["PLAYER_LEAVE_COMBAT"] = true, ["PLAYER_LEAVE_COMBAT"] = true,
-- cooldown updates
["UNIT_INVENTORY_CHANGED"] = true,
-- auto repeat action -- auto repeat action
["START_AUTOREPEAT_SPELL"] = true, ["START_AUTOREPEAT_SPELL"] = true,
["STOP_AUTOREPEAT_SPELL"] = true, ["STOP_AUTOREPEAT_SPELL"] = true,
@@ -317,7 +318,7 @@ pfUI:RegisterModule("actionbar", function ()
-- handle button highlight -- handle button highlight
if keystate == "down" then if keystate == "down" then
self.highlight:Show() self.highlight:Show()
elseif not MouseIsOver(self) then elseif not MouseIsOverHitRect(self) then
self.highlight:Hide() self.highlight:Hide()
end end
end end
@@ -381,8 +382,6 @@ pfUI:RegisterModule("actionbar", function ()
end end
elseif self.spellID then elseif self.spellID then
GameTooltip:SetSpellByID(self.spellID) GameTooltip:SetSpellByID(self.spellID)
elseif self.spellslot and self.booktype then
GameTooltip:SetSpell(self.spellslot, self.booktype)
else else
GameTooltip:SetAction(self.id) GameTooltip:SetAction(self.id)
end end
@@ -400,6 +399,28 @@ pfUI:RegisterModule("actionbar", function ()
GameTooltip:Hide() GameTooltip:Hide()
end end
-- item counts and equipped border, the parts of a slot an inventory change touches
local function ButtonInventoryUpdate(self)
if self.bar == 11 or self.bar == 12 then return end
local sid = self.id
-- 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
end
local start, duration, enable, castable, autocast, token local start, duration, enable, castable, autocast, token
local grid, sid, id, bar, active, texture, _ local grid, sid, id, bar, active, texture, _
local function ButtonSlotUpdate(self) local function ButtonSlotUpdate(self)
@@ -433,11 +454,6 @@ pfUI:RegisterModule("actionbar", function ()
id = self.bar == 1 and self.slot or sid-((self.bar)-1)*12 id = self.bar == 1 and self.slot or sid-((self.bar)-1)*12
end 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 if not self.showempty and self.backdrop and not texture and grid == 0 then
self.backdrop:Hide() self.backdrop:Hide()
self.hide = true self.hide = true
@@ -460,23 +476,9 @@ pfUI:RegisterModule("actionbar", function ()
self.active:Hide() self.active:Hide()
end end
ButtonInventoryUpdate(self)
if self.bar ~= 11 and self.bar ~= 12 then 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 -- update macro text
if C.bars["bar"..self.bar] and C.bars["bar"..self.bar].showmacro == "1" then if C.bars["bar"..self.bar] and C.bars["bar"..self.bar].showmacro == "1" then
self.macro:SetText(GetActionText(sid)) self.macro:SetText(GetActionText(sid))
@@ -581,9 +583,6 @@ pfUI:RegisterModule("actionbar", function ()
start, duration, enable = GetShapeshiftFormCooldown(button.id) start, duration, enable = GetShapeshiftFormCooldown(button.id)
elseif button.bar == 12 then elseif button.bar == 12 then
start, duration, enable = GetPetActionCooldown(button.id) start, duration, enable = GetPetActionCooldown(button.id)
elseif button.spellslot and button.booktype then
start, duration = GetSpellCooldown(button.spellslot, button.booktype)
enable = 1
else else
start, duration, enable = GetActionCooldown(button.id) start, duration, enable = GetActionCooldown(button.id)
end end
@@ -696,11 +695,29 @@ pfUI:RegisterModule("actionbar", function ()
end end
end end
-- The cached passes below only touch visible buttons. Hidden ones (other
-- pages, hidden bars) are flagged stale and get a full update once the
-- range pass sees them visible again.
-- run cached inventory changes (ammo, reagents, consumables)
if eventcache["UNIT_INVENTORY_CHANGED"] then
eventcache["UNIT_INVENTORY_CHANGED"] = nil
for id, button in pairs(buttoncache) do
if button:IsVisible() then
ButtonInventoryUpdate(button)
ButtonCooldownUpdate(button)
ButtonUsableUpdate(button)
else
button.stale = true
end
end
end
-- run cached usable usable actions -- run cached usable usable actions
if eventcache["ACTIONBAR_UPDATE_USABLE"] then if eventcache["ACTIONBAR_UPDATE_USABLE"] then
eventcache["ACTIONBAR_UPDATE_USABLE"] = nil eventcache["ACTIONBAR_UPDATE_USABLE"] = nil
for id, button in pairs(buttoncache) do for id, button in pairs(buttoncache) do
ButtonUsableUpdate(button) if button:IsVisible() then ButtonUsableUpdate(button) else button.stale = true end
end end
end end
@@ -708,7 +725,7 @@ pfUI:RegisterModule("actionbar", function ()
if eventcache["ACTIONBAR_UPDATE_COOLDOWN"] then if eventcache["ACTIONBAR_UPDATE_COOLDOWN"] then
eventcache["ACTIONBAR_UPDATE_COOLDOWN"] = nil eventcache["ACTIONBAR_UPDATE_COOLDOWN"] = nil
for id, button in pairs(buttoncache) do for id, button in pairs(buttoncache) do
ButtonCooldownUpdate(button) if button:IsVisible() then ButtonCooldownUpdate(button) else button.stale = true end
end end
end end
@@ -716,7 +733,7 @@ pfUI:RegisterModule("actionbar", function ()
if eventcache["ACTIONBAR_UPDATE_STATE"] then if eventcache["ACTIONBAR_UPDATE_STATE"] then
eventcache["ACTIONBAR_UPDATE_STATE"] = nil eventcache["ACTIONBAR_UPDATE_STATE"] = nil
for id, button in pairs(buttoncache) do for id, button in pairs(buttoncache) do
ButtonIsActiveUpdate(button) if button:IsVisible() then ButtonIsActiveUpdate(button) else button.stale = true end
end end
end end
@@ -738,7 +755,13 @@ pfUI:RegisterModule("actionbar", function ()
if ( this.tick or .2) > GetTime() then return else this.tick = GetTime() + .2 end if ( this.tick or .2) > GetTime() then return else this.tick = GetTime() + .2 end
for id, button in pairs(buttoncache) do for id, button in pairs(buttoncache) do
if button:IsShown() then ButtonRangeUpdate(button) end if button.stale and button:IsVisible() then
-- catch up on updates skipped while hidden
button.stale = nil
ButtonFullUpdate(button)
elseif button:IsShown() then
ButtonRangeUpdate(button)
end
end end
end end
@@ -828,17 +851,28 @@ pfUI:RegisterModule("actionbar", function ()
do do
local formpage, shift, ctrl, alt, default = 8, 6, 5, 3, 1 local formpage, shift, ctrl, alt, default = 8, 6, 5, 3, 1
-- set temporary pagemaster bindings keybinds -- while a page modifier is held, MOD-key must run the main bar binding on
if C.bars.pagemaster == "1" then -- that key so the switched page fires. Overrides do this without touching
local modifier = { "ALT", "SHIFT", "CTRL" } -- the saved binding set.
local buttons = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "+", "=", "´" } local pagemods = {}
local current = CURRENT_ACTIONBAR_PAGE if C.bars.pagemasteralt == "1" then table.insert(pagemods, "ALT") end
bars.pagemaster = bars.pagemaster or CreateFrame("Frame", "pfPageMaster", UIParent) if C.bars.pagemasterctrl == "1" then table.insert(pagemods, "CTRL") end
bars.pagemaster:RegisterEvent("PLAYER_ENTERING_WORLD") if C.bars.pagemastershift == "1" then table.insert(pagemods, "SHIFT") end
bars.pagemaster:SetScript("OnEvent", function()
for _,mod in pairs(modifier) do if table.getn(pagemods) > 0 then
for _,but in pairs(buttons) do local pagemaster = CreateFrame("Frame", "pfPageMaster", UIParent)
SetBinding(mod.."-"..but) pagemaster:RegisterEvent("PLAYER_ENTERING_WORLD")
pagemaster:RegisterEvent("UPDATE_BINDINGS")
pagemaster:SetScript("OnEvent", function()
ClearOverrideBindings(this)
for i = 1, 12 do
for _, key in ipairs({ GetBindingKey("ACTIONBUTTON"..i) }) do
-- skip keys that already carry a modifier, e.g. "SHIFT-Q"
if not key:find("^%u+%-.") then
for _, mod in ipairs(pagemods) do
SetOverrideBinding(this, false, mod.."-"..key, "ACTIONBUTTON"..i)
end
end
end end
end end
end) end)
@@ -853,6 +887,10 @@ pfUI:RegisterModule("actionbar", function ()
pageswitch:RegisterEvent("UPDATE_SHAPESHIFT_FORM") pageswitch:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
pageswitch:RegisterEvent("PLAYER_AURAS_CHANGED") pageswitch:RegisterEvent("PLAYER_AURAS_CHANGED")
pageswitch:RegisterEvent("PLAYER_LOGOUT") pageswitch:RegisterEvent("PLAYER_LOGOUT")
local PROWL_IDS = { [5215] = true, [6783] = true, [9913] = true }
if class == "DRUID" then
pageswitch:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
end
pageswitch:SetScript("OnEvent", function() pageswitch:SetScript("OnEvent", function()
if event == "PLAYER_LOGOUT" then if event == "PLAYER_LOGOUT" then
this:UnregisterAllEvents() this:UnregisterAllEvents()
@@ -875,6 +913,18 @@ pfUI:RegisterModule("actionbar", function ()
return return
end end
-- Eager prowl detection on the cast itself — zero-latency vs.
-- PLAYER_AURAS_CHANGED, which can land a frame or two behind it.
-- arg3 = spellID
if event == "UNIT_SPELLCAST_SUCCEEDED" then
if PROWL_IDS[arg3] then
inCatForm = true
prowlActive = true
formpaging = true
end
return
end
if event == "UPDATE_SHAPESHIFT_FORM" then if event == "UPDATE_SHAPESHIFT_FORM" then
-- Authoritative form-change signal — recompute and short-circuit. -- Authoritative form-change signal — recompute and short-circuit.
inCatForm = HasCatForm() inCatForm = HasCatForm()
@@ -898,20 +948,6 @@ pfUI:RegisterModule("actionbar", function ()
end end
end) end)
-- Eager prowl detection via Nampower SPELL_GO_SELF — zero-latency vs.
-- PLAYER_AURAS_CHANGED, which can land a frame or two behind the cast.
-- Form changes are no longer hooked here; UPDATE_SHAPESHIFT_FORM covers
-- those without needing a per-spellID watchlist.
local PROWL_IDS = { [5215] = true, [6783] = true, [9913] = true }
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {}
pfUI.libdebuff_spell_go_hooks["actionbar_prowl"] = function(spellId)
if class ~= "DRUID" then return end
if PROWL_IDS[spellId] then
inCatForm = true
prowlActive = true
formpaging = true
end
end
pageswitch:SetScript("OnUpdate", function() pageswitch:SetScript("OnUpdate", function()
-- switch actionbar page depending on meta key that is pressed -- switch actionbar page depending on meta key that is pressed
if C.bars.pagemastershift == "1" and IsShiftKeyDown() then if C.bars.pagemastershift == "1" and IsShiftKeyDown() then
@@ -997,8 +1033,9 @@ pfUI:RegisterModule("actionbar", function ()
f.slot = id f.slot = id
-- cooldown -- cooldown
f.cd = CreateFrame("Model", f:GetName() .. "Cooldown", f, "CooldownFrameTemplate") f.cd = CreateFrame("Cooldown", f:GetName() .. "Cooldown", f, "CooldownFrameTemplate")
f.cd.pfCooldownStyleAnimation = 1 f.cd.pfCooldownStyleAnimation = 1
f.cd.pfCooldownReverse = tonumber(C.bars.cooldown_reverse) or 0
f.cd.pfCooldownType = "NOGCD" f.cd.pfCooldownType = "NOGCD"
f.cd.pfCooldownSize = cd_size f.cd.pfCooldownSize = cd_size
@@ -1103,8 +1140,6 @@ pfUI:RegisterModule("actionbar", function ()
f.count:SetJustifyH("RIGHT") f.count:SetJustifyH("RIGHT")
f.count:SetJustifyV("BOTTOM") f.count:SetJustifyV("BOTTOM")
f.scanmacro, f.spellslot, f.booktype = nil, nil, nil
-- range glow color -- range glow color
f.rangeColor = GetStringColorObject(C.bars.rangecolor) f.rangeColor = GetStringColorObject(C.bars.rangecolor)
@@ -1171,8 +1206,7 @@ pfUI:RegisterModule("actionbar", function ()
end end
-- the stored layout is invalid, temporary fallback -- the stored layout is invalid, temporary fallback
local _, _, fcols, frows = string.find(tostring(formfactor or ""), "(%d+)%s*x%s*(%d+)") if not fcols2 or not frows2 then
if not ((fcols and frows) or pfGridmath[buttons][BarLayoutFormfactor(formfactor)]) then
formfactor = BarLayoutOptions(buttons)[1] formfactor = BarLayoutOptions(buttons)[1]
end end
+4 -3
View File
@@ -399,15 +399,16 @@ pfUI:RegisterModule("addonbuttons", function ()
-- Initial setup on the next frame, once other addons' minimap buttons exist -- Initial setup on the next frame, once other addons' minimap buttons exist
RunNextFrame(function() RunNextFrame(function()
-- check if the panel should be shown by default -- rescan before deciding whether the panel should be shown by default
pfUI.addonbuttons:ProcessButtons()
if C.abuttons.showdefault == "1" and GetNumButtons() > 0 then if C.abuttons.showdefault == "1" and GetNumButtons() > 0 then
pfUI.addonbuttons:Show() pfUI.addonbuttons:Show()
else else
pfUI.addonbuttons:Hide() pfUI.addonbuttons:Hide()
end end
-- update all buttons and apply workarounds -- apply workarounds
pfUI.addonbuttons:ProcessButtons()
for k, v in pairs(pfUI.addonbuttons.overrides) do for k, v in pairs(pfUI.addonbuttons.overrides) do
_G[k] = v _G[k] = v
end end
-1
View File
@@ -9,7 +9,6 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons:Show() pfUI.addons:Show()
HideUIPanel(GameMenuFrame) HideUIPanel(GameMenuFrame)
end) end)
SkinButton(pfUIAddonButton)
local point, relativeTo, relativePoint, xOffset, yOffset = GameMenuButtonOptions:GetPoint() local point, relativeTo, relativePoint, xOffset, yOffset = GameMenuButtonOptions:GetPoint()
GameMenuButtonOptions:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset - 22) GameMenuButtonOptions:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset - 22)
+1 -1
View File
@@ -57,7 +57,7 @@ pfUI:RegisterModule("autovendor", function ()
-- Setup Autosell button -- Setup Autosell button
autovendor.button = CreateFrame("Button", "pfMerchantAutoVendorButton", MerchantFrame) autovendor.button = CreateFrame("Button", "pfMerchantAutoVendorButton", MerchantFrame)
autovendor.button:SetSize(36, 36) autovendor.button:SetSize(36, 36)
autovendor.button.icon = autovendor.button:CreateTexture("ARTWORK") autovendor.button.icon = autovendor.button:CreateTexture(nil, "ARTWORK")
autovendor.button.icon:SetTexture("Interface\\Icons\\Spell_Shadow_SacrificialShield") autovendor.button.icon:SetTexture("Interface\\Icons\\Spell_Shadow_SacrificialShield")
autovendor.button:SetScript("OnEnter", function() autovendor.button:SetScript("OnEnter", function()
GameTooltip:SetOwner(this, "ANCHOR_RIGHT") GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
+34 -59
View File
@@ -6,8 +6,6 @@ pfUI:RegisterModule("bags", function ()
[1804] = {frame="picklock"}, [1804] = {frame="picklock"},
} }
local scanner = libtipscan:GetScanner("input_search")
local function BagSortOpts() local function BagSortOpts()
return { return {
reverse = C.appearance.bags.sortreverse == "1", reverse = C.appearance.bags.sortreverse == "1",
@@ -95,6 +93,7 @@ pfUI:RegisterModule("bags", function ()
pfUI.bag:RegisterEvent("ITEM_LOCK_CHANGED") pfUI.bag:RegisterEvent("ITEM_LOCK_CHANGED")
pfUI.bag:RegisterEvent("SPELLS_CHANGED") pfUI.bag:RegisterEvent("SPELLS_CHANGED")
pfUI.bag:RegisterEvent("MERCHANT_CLOSED") pfUI.bag:RegisterEvent("MERCHANT_CLOSED")
pfUI.bag:RegisterEvent("INVENTORY_SEARCH_UPDATE")
pfUI.bag.delay = { UpdateBag = {} } pfUI.bag.delay = { UpdateBag = {} }
@@ -122,6 +121,11 @@ pfUI:RegisterModule("bags", function ()
pfUI.bag:UpdateItemLock() pfUI.bag:UpdateItemLock()
end end
if this.delay.UpdateSearch then
this.delay.UpdateSearch = nil
pfUI.bag:UpdateSearch()
end
for bag in pairs(this.delay.UpdateBag) do for bag in pairs(this.delay.UpdateBag) do
this.delay.UpdateBag[bag] = nil this.delay.UpdateBag[bag] = nil
pfUI.bag:UpdateBag(bag) pfUI.bag:UpdateBag(bag)
@@ -159,6 +163,10 @@ pfUI:RegisterModule("bags", function ()
this.delay.UpdateItemLock = true this.delay.UpdateItemLock = true
end end
if event == "INVENTORY_SEARCH_UPDATE" then
this.delay.UpdateSearch = true
end
if event == "PLAYERBANKSLOTS_CHANGED" then if event == "PLAYERBANKSLOTS_CHANGED" then
this.delay.UpdateBag[-1] = true this.delay.UpdateBag[-1] = true
end end
@@ -377,6 +385,21 @@ pfUI:RegisterModule("bags", function ()
end end
end end
-- dim the slots that the bag search (C_Container.SetItemSearch) filters out
local searchInfo = {}
function pfUI.bag:UpdateSlotSearch(bag, slot)
local info = C_Container.GetContainerItemInfo(bag, slot, searchInfo)
pfUI.bags[bag].slots[slot].frame:SetAlpha(info and info.isFiltered and .25 or 1)
end
function pfUI.bag:UpdateSearch()
for bag = -2, 11 do
for slot in ipairs(pfUI.bags[bag].slots) do
pfUI.bag:UpdateSlotSearch(bag, slot)
end
end
end
function pfUI.bag:UpdateSlot(bag, slot) function pfUI.bag:UpdateSlot(bag, slot)
if not pfUI.bags[bag] then return end if not pfUI.bags[bag] then return end
@@ -396,14 +419,15 @@ pfUI:RegisterModule("bags", function ()
if tpl == "BankItemButtonGenericTemplate" then if tpl == "BankItemButtonGenericTemplate" then
local bankslot = pfUI.bags[bag].slots[slot].frame local bankslot = pfUI.bags[bag].slots[slot].frame
local name = "pfBag" .. bag .. "item" .. slot .. "Cooldown" local name = "pfBag" .. bag .. "item" .. slot .. "Cooldown"
bankslot.cd = CreateFrame("Model", name, bankslot, "CooldownFrameTemplate") bankslot.cd = CreateFrame("Cooldown", name, bankslot, "CooldownFrameTemplate")
bankslot.cd:SetAllPoints(bankslot)
bankslot.cd.pfCooldownStyleAnimation = 1 bankslot.cd.pfCooldownStyleAnimation = 1
bankslot.cd.pfCooldownType = "ALL" bankslot.cd.pfCooldownReverse = tonumber(C.appearance.bags.cooldown_reverse) or 0
bankslot.cd.pfCooldownType = "NOGCD"
else else
local bagslot = pfUI.bags[bag].slots[slot].frame local bagslot = pfUI.bags[bag].slots[slot].frame
bagslot.cd = _G[bagslot:GetName().."Cooldown"] bagslot.cd = _G[bagslot:GetName().."Cooldown"]
bagslot.cd.pfCooldownType = "ALL" bagslot.cd.pfCooldownType = "NOGCD"
bagslot.cd.pfCooldownReverse = tonumber(C.appearance.bags.cooldown_reverse) or 0
end end
if not pfUI.bags[bag].slots[slot].frame.backdrop then if not pfUI.bags[bag].slots[slot].frame.backdrop then
@@ -464,6 +488,7 @@ pfUI:RegisterModule("bags", function ()
SetItemButtonTexture(pfUI.bags[bag].slots[slot].frame, texture) SetItemButtonTexture(pfUI.bags[bag].slots[slot].frame, texture)
SetItemButtonCount(pfUI.bags[bag].slots[slot].frame, count) SetItemButtonCount(pfUI.bags[bag].slots[slot].frame, count)
SetItemButtonDesaturated(pfUI.bags[bag].slots[slot].frame, locked, 0.5, 0.5, 0.5) SetItemButtonDesaturated(pfUI.bags[bag].slots[slot].frame, locked, 0.5, 0.5, 0.5)
pfUI.bag:UpdateSlotSearch(bag, slot)
local hasItem = texture and 1 or nil local hasItem = texture and 1 or nil
pfUI.bags[bag].slots[slot].frame.hasItem = hasItem pfUI.bags[bag].slots[slot].frame.hasItem = hasItem
@@ -1009,7 +1034,6 @@ pfUI:RegisterModule("bags", function ()
-- bag search -- bag search
if not frame.search then if not frame.search then
frame.search = CreateFrame("Frame", "pfBagSearch", frame) frame.search = CreateFrame("Frame", "pfBagSearch", frame)
frame.search.db = {}
frame.search:SetHeight(12) frame.search:SetHeight(12)
frame.search:SetPoint("TOPLEFT", frame, "TOPLEFT", default_border, -default_border) frame.search:SetPoint("TOPLEFT", frame, "TOPLEFT", default_border, -default_border)
frame.search:SetPoint("TOPRIGHT", frame.sort, "TOPLEFT", -default_border*3, -default_border) frame.search:SetPoint("TOPRIGHT", frame.sort, "TOPLEFT", -default_border*3, -default_border)
@@ -1034,51 +1058,12 @@ pfUI:RegisterModule("bags", function ()
frame.search.edit:SetScript("OnEditFocusLost", function() frame.search.edit:SetScript("OnEditFocusLost", function()
this:SetText(T["Search"]) this:SetText(T["Search"])
for bag=-2, 11 do C_Container.SetItemSearch("")
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot=1, bagsize do
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
end
end
end) end)
frame.search.edit:SetScript("OnTextChanged", function() frame.search.edit:SetScript("OnTextChanged", function()
if this:GetText() == T["Search"] then return end if this:GetText() == T["Search"] then return end
for bag=-2, 11 do C_Container.SetItemSearch(this:GetText())
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot=1, bagsize do
pfUI.bags[bag].slots[slot].frame:SetAlpha(.25)
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bag, slot)
if itemCount then
local itemLink = GetContainerItemLink(bag, slot)
local itemstring = string.sub(itemLink, string.find(itemLink, "%[")+1, string.find(itemLink, "%]")-1)
if C.appearance.bags.fulltext == "1" then
if not frame.search.db[itemLink] then
scanner:SetBagItem(bag, slot)
local text = scanner:Text()
local str = ""
for k, v in pairs(text) do
str = str .. (v[1] or "") .. (v[2] or "")
end
frame.search.db[itemLink] = strlower(str)
end
if strfind(frame.search.db[itemLink], strlower(this:GetText()), 1, true) then
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
end
end
if strfind(strlower(itemstring), strlower(this:GetText()), 1, true) then
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
end
end
end
end
end) end)
frame.search:SetScript("OnLeave", function() frame.search:SetScript("OnLeave", function()
@@ -1093,17 +1078,7 @@ pfUI:RegisterModule("bags", function ()
frame.search:SetScript("OnHide", function() frame.search:SetScript("OnHide", function()
frame.search.edit:SetText(T["Search"]) frame.search.edit:SetText(T["Search"])
for bag = -2, 11 do C_Container.SetItemSearch("")
if pfUI.bags[bag] then
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot = 1, bagsize do
if pfUI.bags[bag] and pfUI.bags[bag].slots[slot] then
pfUI.bags[bag].slots[slot].frame:SetAlpha(1)
end
end
end
end
end) end)
end end
else else
+44 -4
View File
@@ -19,7 +19,7 @@ pfUI:RegisterModule("buff", function ()
local function RefreshBuffButton(buff) local function RefreshBuffButton(buff)
if buff.btype == "HELPFUL" then if buff.btype == "HELPFUL" then
if C.buffs.separateweapons == "1" then if C.buffs.separateweapons == "1" then
buff.id = buff.gid - (buff.weapon ~= nill and buff.gid or 0) buff.id = buff.gid - (buff.weapon ~= nil and buff.gid or 0)
else else
buff.id = buff.gid - pfUI.buff.wepbuffs.count buff.id = buff.gid - pfUI.buff.wepbuffs.count
end end
@@ -33,7 +33,7 @@ pfUI:RegisterModule("buff", function ()
end end
local slots = buff.btype == "HELPFUL" and helpfulSlots or harmfulSlots local slots = buff.btype == "HELPFUL" and helpfulSlots or harmfulSlots
local name, icon, count, dispelType, _, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAuraBySlot("player", slots[buff.id]) local name, icon, count, dispelType, duration, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAuraBySlot("player", slots[buff.id])
--detect weapon buffs --detect weapon buffs
if buff.btype == "HELPFUL" and ((C.buffs.separateweapons == "0" and buff.gid <= pfUI.buff.wepbuffs.count) or (pfUI.buff.wepbuffs.count > 0 and buff.weapon ~= nil)) then if buff.btype == "HELPFUL" and ((C.buffs.separateweapons == "0" and buff.gid <= pfUI.buff.wepbuffs.count) or (pfUI.buff.wepbuffs.count > 0 and buff.weapon ~= nil)) then
@@ -84,6 +84,28 @@ pfUI:RegisterModule("buff", function ()
return return
end end
-- drive the sweep from the aura duration (weapon enchants and permanent
-- auras report no usable total, so those buttons stay text-only)
if buff.mode == buff.btype and duration and duration > 0 and expirationTime and expirationTime > 0 then
local now = GetTime()
local timeleft = expirationTime - now
if timeleft > 0 then
local effDuration = duration > timeleft and duration or timeleft
local newStart = now + timeleft - effDuration
if buff.cdStart == nil or abs(buff.cdStart - newStart) > .5 or buff.cdDuration ~= effDuration then
CooldownFrame_SetTimer(buff.cd, newStart, effDuration, 1)
buff.cdStart = newStart
buff.cdDuration = effDuration
end
else
CooldownFrame_SetTimer(buff.cd, 0, 0, 0)
buff.cdStart = nil
end
else
CooldownFrame_SetTimer(buff.cd, 0, 0, 0)
buff.cdStart = nil
end
buff:Show() buff:Show()
end end
@@ -106,17 +128,33 @@ pfUI:RegisterModule("buff", function ()
buff.texture:SetTexCoord(.07,.93,.07,.93) buff.texture:SetTexCoord(.07,.93,.07,.93)
buff.texture:SetAllPoints(buff) buff.texture:SetAllPoints(buff)
buff.timer = buff:CreateFontString(nil, "OVERLAY", "GameFontNormal") -- overlay lifts the texts above the sweep: a child frame renders above
-- all of its parent's own regions, so the timer would dim under the
-- dark wedge otherwise (same reason pfCooldownText is its own frame)
buff.overlay = CreateFrame("Frame", nil, buff)
buff.overlay:SetAllPoints(buff)
buff.timer = buff.overlay:CreateFontString(nil, "OVERLAY", "GameFontNormal")
buff.timer:SetTextColor(1,1,1,1) buff.timer:SetTextColor(1,1,1,1)
buff.timer:SetJustifyH("CENTER") buff.timer:SetJustifyH("CENTER")
buff.timer:SetJustifyV("CENTER") buff.timer:SetJustifyV("CENTER")
buff.stacks = buff:CreateFontString(nil, "OVERLAY", "GameFontNormal") buff.stacks = buff.overlay:CreateFontString(nil, "OVERLAY", "GameFontNormal")
buff.stacks:SetTextColor(1,1,1,1) buff.stacks:SetTextColor(1,1,1,1)
buff.stacks:SetJustifyH("RIGHT") buff.stacks:SetJustifyH("RIGHT")
buff.stacks:SetJustifyV("BOTTOM") buff.stacks:SetJustifyV("BOTTOM")
buff.stacks:SetAllPoints(buff) buff.stacks:SetAllPoints(buff)
-- radial sweep (the template covers the button and starts hidden;
-- the cooldown hook drives it from here, text stays with buff.timer)
buff.cd = CreateFrame("Cooldown", buttonName .. "Cooldown", buff, "CooldownFrameTemplate")
buff.cd:SetFrameLevel(buff:GetFrameLevel() + 1)
buff.overlay:SetFrameLevel(buff:GetFrameLevel() + 2)
buff.cd.pfCooldownType = "ALL"
buff.cd.pfCooldownStyleText = 0
buff.cd.pfCooldownStyleAnimation = tonumber(C.buffs.cooldown_anim) or 0
buff.cd.pfCooldownReverse = tonumber(C.buffs.cooldown_reverse) or 0
buff:RegisterForClicks("RightButtonUp") buff:RegisterForClicks("RightButtonUp")
buff.weapon = weapon buff.weapon = weapon
@@ -307,6 +345,8 @@ pfUI:RegisterModule("buff", function ()
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing) offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing)
end end
buff:SetSize(buffSize, buffSize) buff:SetSize(buffSize, buffSize)
buff.cd.pfCooldownStyleAnimation = tonumber(C.buffs.cooldown_anim) or 0
buff.cd.pfCooldownReverse = tonumber(C.buffs.cooldown_reverse) or 0
buff:ClearAllPoints() buff:ClearAllPoints()
buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY) buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY)
+3 -34
View File
@@ -76,10 +76,6 @@ pfUI:RegisterModule("buffwatch", function ()
-- reusable GetAuraSlots buffer, filled once per RefreshBuffBarFrame -- reusable GetAuraSlots buffer, filled once per RefreshBuffBarFrame
local auraSlots = {} local auraSlots = {}
-- Separate buffer for the tooltip handler: OnEnter can fire while a refresh
-- is showing/hiding bars under the cursor, so it must not share the above.
local tooltipSlots = {}
-- Reads one aura by the slot id GetAuraSlots returned (nil slot -> nil). -- Reads one aura by the slot id GetAuraSlots returned (nil slot -> nil).
local function GetBuffData(unit, slot) local function GetBuffData(unit, slot)
local name, icon, count, dispelType, _, expirationTime = C_UnitAuras.UnitAuraBySlot(unit, slot) local name, icon, count, dispelType, _, expirationTime = C_UnitAuras.UnitAuraBySlot(unit, slot)
@@ -116,36 +112,9 @@ pfUI:RegisterModule("buffwatch", function ()
local function StatusBarOnEnter() local function StatusBarOnEnter()
GameTooltip:SetOwner(this, "NONE") GameTooltip:SetOwner(this, "NONE")
if this.unit == "player" then -- C_UnitAuras lists the player's own auras first, so the selfdebuff
GameTooltip:SetUnitAura("player", this.id, this.type) -- (HARMFUL|PLAYER) list is a prefix of the HARMFUL list: same index.
elseif this.type == "HARMFUL" then GameTooltip:SetUnitAura(this.unit, this.id, this.type)
-- selfdebuff filters the displayed list to player-cast harmful auras, but
-- SetUnitAura's index has to be into the unfiltered HARMFUL list. Look up
-- the displayed aura via the PLAYER filter, then find its position in the
-- unfiltered list by name + sourceGUID.
--
-- The unfiltered list is NOT capped at 16: once a unit's 16 debuff slots
-- are full the server parks further debuffs in buff slots, and
-- C_UnitAuras reports those as harmful too. So enumerate what it has.
local config = this.parent and this.parent.config
if config and config.selfdebuff == "1" then
local ownAura = C_UnitAuras.GetAuraDataByIndex(this.unit, this.id, "HARMFUL|PLAYER")
if ownAura then
local n = ScanAuraSlots(this.unit, "HARMFUL", tooltipSlots)
for i = 1, n do
local check = C_UnitAuras.GetAuraDataBySlot(this.unit, tooltipSlots[i])
if check and check.name == ownAura.name and check.sourceGUID == ownAura.sourceGUID then
GameTooltip:SetUnitAura(this.unit, i, "HARMFUL")
break
end
end
end
else
GameTooltip:SetUnitAura(this.unit, this.id, "HARMFUL")
end
elseif this.type == "HELPFUL" then
GameTooltip:SetUnitAura(this.unit, this.id, "HELPFUL")
end
if IsShiftKeyDown() then if IsShiftKeyDown() then
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
+28 -20
View File
@@ -36,7 +36,7 @@ pfUI:RegisterModule("castbar", function ()
cb.bar:SetValue(1) cb.bar:SetValue(1)
end end
if cb.bar.spark then cb.bar.spark:Hide() end if cb.bar.spark then cb.bar.spark:Hide() end
cb.fadeout = 1 if cb:GetAlpha() > 0 and not cb.fade:IsPlaying() then cb.fade:Play() end
end end
-- "Spellname (N)" label for an active tradeskill merge — N is the number -- "Spellname (N)" label for an active tradeskill merge — N is the number
@@ -94,8 +94,8 @@ pfUI:RegisterModule("castbar", function ()
cb.activeName = name cb.activeName = name
cb.isTradeskill = isTradeskill cb.isTradeskill = isTradeskill
cb.delay = (delayMs or 0) / 1000 cb.delay = (delayMs or 0) / 1000
cb.fade:Stop()
cb:SetAlpha(1) cb:SetAlpha(1)
cb.fadeout = nil
-- Shield an uninterruptible cast. Not on the player's own bar: the flag is -- Shield an uninterruptible cast. Not on the player's own bar: the flag is
-- measured against the reader's own interrupts and silences, so on your own -- measured against the reader's own interrupts and silences, so on your own
@@ -150,8 +150,8 @@ pfUI:RegisterModule("castbar", function ()
-- One-shot poll: read C_Spell for the bar's unit, stamp or clear. Called -- One-shot poll: read C_Spell for the bar's unit, stamp or clear. Called
-- from event handlers (cast start, target/focus change), never per-frame. -- from event handlers (cast start, target/focus change), never per-frame.
local function RefreshBar(cb, rank) local function RefreshBar(cb, rank)
local query = cb.unitstr ~= "" and cb.unitstr or cb.unitname local query = cb.unitstr
if not query or (cb.unitstr ~= "" and not UnitExists(cb.unitstr)) then if not UnitExists(query) then
ClearBar(cb) ClearBar(cb)
return return
end end
@@ -178,7 +178,7 @@ pfUI:RegisterModule("castbar", function ()
end end
end end
local function CreateCastbar(name, parent, unitstr, unitname) local function CreateCastbar(name, parent, unitstr)
local cb = CreateFrame("Frame", name, parent or UIParent) local cb = CreateFrame("Frame", name, parent or UIParent)
cb:SetHeight(C.global.font_size * 1.5) cb:SetHeight(C.global.font_size * 1.5)
@@ -186,7 +186,6 @@ pfUI:RegisterModule("castbar", function ()
cb:SetFrameLevel(8) cb:SetFrameLevel(8)
cb.unitstr = unitstr cb.unitstr = unitstr
cb.unitname = unitname
-- icon -- icon
cb.icon = CreateFrame("Frame", nil, cb) cb.icon = CreateFrame("Frame", nil, cb)
@@ -248,8 +247,14 @@ pfUI:RegisterModule("castbar", function ()
cb.bar.spark:SetPoint("BOTTOM", cb.bar, "BOTTOMLEFT", 0, 0) cb.bar.spark:SetPoint("BOTTOM", cb.bar, "BOTTOMLEFT", 0, 0)
cb.bar.spark:Hide() cb.bar.spark:Hide()
-- OnUpdate animates the bar fill and fades it out on completion. All -- Fade-out after a cast ends. The bar stays at alpha 0 while idle.
-- state transitions (cast start/stop/interrupt, channel start/stop, cb.fade = cb:CreateAnimationGroup()
local fade = cb.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(.4)
cb.fade:SetScript("OnFinished", function() cb:SetAlpha(0) end)
-- OnUpdate animates the bar fill. All state transitions (cast start/stop/interrupt, channel start/stop,
-- pushback) come from the event handler below — we never poll C_Spell -- pushback) come from the event handler below — we never poll C_Spell
-- here. -- here.
cb:SetScript("OnUpdate", function() cb:SetScript("OnUpdate", function()
@@ -257,15 +262,12 @@ pfUI:RegisterModule("castbar", function ()
this.tick = GetTime() + 0.020 -- ~50 FPS this.tick = GetTime() + 0.020 -- ~50 FPS
if this.drag and this.drag:IsShown() then if this.drag and this.drag:IsShown() then
this.fade:Stop()
this:SetAlpha(1) this:SetAlpha(1)
return return
end end
if this.fadeout and this:GetAlpha() > 0 then if this.fade:IsPlaying() then return end
this:SetAlpha(this:GetAlpha() - 0.05)
if this:GetAlpha() <= 0 then this.fadeout = nil end
return
end
if not this.endTime then if not this.endTime then
if this:GetAlpha() ~= 0 then this:SetAlpha(0) end if this:GetAlpha() ~= 0 then this:SetAlpha(0) end
@@ -274,7 +276,7 @@ pfUI:RegisterModule("castbar", function ()
-- Non-player bars: if the unit disappears (target died / detarget), -- Non-player bars: if the unit disappears (target died / detarget),
-- drop the bar immediately. -- drop the bar immediately.
if this.unitstr ~= "" and this.unitstr ~= "player" and not UnitExists(this.unitstr) then if this.unitstr ~= "player" and not UnitExists(this.unitstr) then
ClearBar(this) ClearBar(this)
return return
end end
@@ -345,6 +347,12 @@ pfUI:RegisterModule("castbar", function ()
elseif unitstr == "focus" then elseif unitstr == "focus" then
cb:RegisterEvent("PLAYER_FOCUS_CHANGED") cb:RegisterEvent("PLAYER_FOCUS_CHANGED")
end end
-- The shield can flip mid-cast (the caster gains or loses an aura that
-- blocks interrupts). These only fire for target and focus.
if unitstr == "target" or unitstr == "focus" then
cb:RegisterUnitEvent("UNIT_SPELLCAST_INTERRUPTIBLE", unitstr)
cb:RegisterUnitEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE", unitstr)
end
cb:SetScript("OnEvent", function() cb:SetScript("OnEvent", function()
local unit = this.unitstr local unit = this.unitstr
@@ -400,6 +408,10 @@ pfUI:RegisterModule("castbar", function ()
if not this.tradeskillTotal then ClearBar(this) end if not this.tradeskillTotal then ClearBar(this) end
elseif event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED" then elseif event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED" then
ClearBar(this, true) ClearBar(this, true)
elseif event == "UNIT_SPELLCAST_INTERRUPTIBLE" or event == "UNIT_SPELLCAST_NOT_INTERRUPTIBLE" then
if this.endTime then
SetCastbarShield(this.bar, this.icon, event == "UNIT_SPELLCAST_NOT_INTERRUPTIBLE", this.isChannel)
end
elseif event == "UNIT_SPELLCAST_DELAYED" or event == "UNIT_SPELLCAST_CHANNEL_UPDATE" then elseif event == "UNIT_SPELLCAST_DELAYED" or event == "UNIT_SPELLCAST_CHANNEL_UPDATE" then
-- Pushback: a cast delayed later or a channel shortened. Following -- Pushback: a cast delayed later or a channel shortened. Following
-- Quartz, re-poll just the times and accumulate the shift into a running -- Quartz, re-poll just the times and accumulate the shift into a running
@@ -410,13 +422,12 @@ pfUI:RegisterModule("castbar", function ()
-- endMs. delay is a positive magnitude; OnUpdate signs it "+" for casts -- endMs. delay is a positive magnitude; OnUpdate signs it "+" for casts
-- and "-" for channels. Skipped during a tradeskill merge. -- and "-" for channels. Skipped during a tradeskill merge.
if this.endTime and not this.tradeskillTotal then if this.endTime and not this.tradeskillTotal then
local query = this.unitstr ~= "" and this.unitstr or this.unitname
local startMs, endMs local startMs, endMs
if this.isChannel then if this.isChannel then
local _, _, _, s, e = C_Spell.UnitChannelInfo(query) local _, _, _, s, e = C_Spell.UnitChannelInfo(unit)
startMs, endMs = s, e startMs, endMs = s, e
else else
local _, _, _, s, e = C_Spell.UnitCastingInfo(query) local _, _, _, s, e = C_Spell.UnitCastingInfo(unit)
startMs, endMs = s, e startMs, endMs = s, e
end end
if startMs and endMs then if startMs and endMs then
@@ -531,9 +542,6 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.focus:SetHeight(C.castbar.focus.height) pfUI.castbar.focus:SetHeight(C.castbar.focus.height)
end end
-- bind castbar to the "focus" unit token; the GUID resolves at read time
pfUI.castbar.focus.unitstr = "focus"
UpdateMovable(pfUI.castbar.focus) UpdateMovable(pfUI.castbar.focus)
end end
end) end)
+52 -61
View File
@@ -526,10 +526,10 @@ pfUI:RegisterModule("chat", function ()
if pfUI.chat.hideLock then return end if pfUI.chat.hideLock then return end
if MouseIsOver(pfUI.chat.left, 10, -10, -10, 10) then if pfUI.chat.left:IsMouseOver(10, -10, -10, 10) then
pfUI.chat.left.panelTop:Show() pfUI.chat.left.panelTop:Show()
FCF_DockUpdate() FCF_DockUpdate()
elseif MouseIsOver(pfUI.chat.right, 10, -10, -10, 10) then elseif pfUI.chat.right:IsMouseOver(10, -10, -10, 10) then
-- disable while dock is active -- disable while dock is active
if pfUI.chat.right:GetAlpha() == 0 then return end if pfUI.chat.right:GetAlpha() == 0 then return end
@@ -782,16 +782,6 @@ pfUI:RegisterModule("chat", function ()
local r,g,b = GetStringColor(C.chat.text.unknowncolor) local r,g,b = GetStringColor(C.chat.text.unknowncolor)
local unknowncolorhex = rgbhex(r,g,b) local unknowncolorhex = rgbhex(r,g,b)
-- Suppress FriendsFrame's WHO_LIST_UPDATE handling for our DLL-issued
-- name lookups so they don't pop the friends panel. User-issued /who
-- still works because IsWhoQueryPending only reports true for queries
-- issued via C_FriendList.SendWhoQueryByName.
local original_FriendsFrame_OnEvent = FriendsFrame_OnEvent
_G.FriendsFrame_OnEvent = function()
if _G.event == "WHO_LIST_UPDATE" and C_FriendList.IsWhoQueryPending() then return end
return original_FriendsFrame_OnEvent()
end
local function GetPlayerLevel(name) local function GetPlayerLevel(name)
if not pfUI_playerDB then return nil end if not pfUI_playerDB then return nil end
if not pfUI_playerDB[name] then return nil end if not pfUI_playerDB[name] then return nil end
@@ -806,6 +796,10 @@ pfUI:RegisterModule("chat", function ()
return frame:HookAddMessage(text, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) return frame:HookAddMessage(text, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17)
end end
-- payload of the CHAT_MSG event printing this line; nil for lines
-- that don't come from one (system text, addon output, history)
local event, _, sender, _, _, _, _, _, _, _, _, _, guid = GetCurrentChatEvent()
-- Remove prat CLINKs -- 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-]-:[%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") -- vanilla
@@ -821,67 +815,64 @@ pfUI:RegisterModule("chat", function ()
text = pfUI.chat:HandleLink(text) text = pfUI.chat:HandleLink(text)
end end
-- display class colors if already indexed -- display class colors and player levels if already indexed
if C.chat.text.classcolor == "1" then local classcolor = C.chat.text.classcolor == "1"
for name in gfind(text, "|Hplayer:(.-)|h") do local playerlevel = C.chat.text.playerlevel == "1"
local real, _ = strsplit(":", name) if classcolor or playerlevel then
local color = unknowncolorhex -- the engine name-queries a chat sender before the event fires,
local match = false -- so the sender's GUID always resolves; other names in the text
local _, class, _, raceKey, sex = C_PlayerCache.GetPlayerInfoByName(real) -- fall back to the name-keyed lookups
-- local guid = GetCurrentChatGUID() local _, senderClass, senderRace, senderSex
-- if guid then if classcolor and guid and guid ~= "" then
-- _, class = GetPlayerInfoByGUID(guid) _, senderClass, _, senderRace, senderSex = GetPlayerInfoByGUID(guid)
-- end
if not class then
class = GetUnitInfo(real)
end
if class then
if class ~= UNKNOWN then
color = "|c" .. PFUI_CLASS_COLORS[class].colorStr
match = true
end
elseif C.chat.text.whosearchunknown == "1" then
C_FriendList.SendWhoQueryByName(name) -- cooldown + state managed by DLL
end
if C.chat.text.tintunknown == "1" or match then
local icon = ""
if match and C.chat.text.playericons == "1" then
icon = GetFactionIcon(raceKey) .. GetRaceIcon(raceKey, sex)
end
text = string.gsub(text, "|Hplayer:"..name.."|h%["..real.."%]|h(.-:-)",
left..icon..color.."|Hplayer:"..name.."|h" .. color .. real .. "|h|r"..right.."%1")
end
end end
end
-- display player levels if available
if C.chat.text.playerlevel == "1" then
for name in gfind(text, "|Hplayer:(.-)|h") do for name in gfind(text, "|Hplayer:(.-)|h") do
local real, _ = strsplit(":", name) local real, _ = strsplit(":", name)
local level = GetPlayerLevel(real) local color, icon = "", ""
if classcolor then
local class, raceKey, sex
if senderClass and real == sender then
class, raceKey, sex = senderClass, senderRace, senderSex
else
_, class, _, raceKey, sex = C_PlayerCache.GetPlayerInfoByName(real)
end
if not class then
class = GetUnitInfo(real)
end
if class and class ~= UNKNOWN then
color = "|c" .. PFUI_CLASS_COLORS[class].colorStr
if C.chat.text.factionicons == "1" then
icon = GetFactionIcon(raceKey)
end
if C.chat.text.raceicons == "1" then
icon = icon .. GetRaceIcon(raceKey, sex)
end
elseif C.chat.text.tintunknown == "1" then
color = unknowncolorhex
end
end
local suffix = ""
local level = playerlevel and GetPlayerLevel(real)
if level and level > 0 then if level and level > 0 then
local levelcolor = rgbhex(GetDifficultyColor(level)) suffix = " " .. rgbhex(GetDifficultyColor(level)) .. level .. "|r"
-- Add level after the player name, before the closing bracket elseif level then
text = string.gsub(text, "(|Hplayer:" .. name .. "|h.-|h|r)" .. right,
"%1 " .. levelcolor .. level .. "|r" .. right)
elseif level and level <= 0 then
-- Show ?? for unknown levels (e.g. -1 from UnitLevel) -- Show ?? for unknown levels (e.g. -1 from UnitLevel)
text = string.gsub(text, "(|Hplayer:" .. name .. "|h.-|h|r)" .. right, suffix = " |cffff0000??|r"
"%1 |cffff0000??|r" .. right) end
if color ~= "" or suffix ~= "" then
text = string.gsub(text, "|Hplayer:"..name.."|h%["..real.."%]|h(.-:-)",
left..icon..color.."|Hplayer:"..name.."|h" .. color .. real .. "|h|r"..suffix..right.."%1")
end end
end end
end end
-- reduce channel name to number -- reduce channel name to number
if C.chat.text.channelnumonly == "1" then if C.chat.text.channelnumonly == "1" and event == "CHAT_MSG_CHANNEL" then
local channel = string.gsub(text, ".*%[(.-)%]%s+(.*|Hplayer).+", "%1") text = string.gsub(text, "%[(%d+)%..-%] ", left .. "%1" .. right .. " ", 1)
if string.find(channel, "%d+%. ") then
channel = string.gsub(channel, "(%d+)%..*", "channel%1")
channel = string.gsub(channel, "channel", "")
text = string.gsub(text, "%[%d+%..-%]%s+(.*|Hplayer)", left .. channel .. right .. " %1")
end
end end
-- detect the whisper prefix BEFORE prepending a timestamp; the timestamp -- detect the whisper prefix BEFORE prepending a timestamp; the timestamp
+1 -1
View File
@@ -23,7 +23,7 @@ pfUI:RegisterModule("combopoints", function ()
pfUI.combopoints[point]:SetPoint("CENTER", UIParent, "CENTER", (point - 3) * (combo_width + border*3), 10 ) pfUI.combopoints[point]:SetPoint("CENTER", UIParent, "CENTER", (point - 3) * (combo_width + border*3), 10 )
end end
pfUI.combopoints[point].tex = pfUI.combopoints[point]:CreateTexture("OVERLAY") pfUI.combopoints[point].tex = pfUI.combopoints[point]:CreateTexture(nil, "OVERLAY")
pfUI.combopoints[point].tex:SetAllPoints(pfUI.combopoints[point]) pfUI.combopoints[point].tex:SetAllPoints(pfUI.combopoints[point])
if point < 3 then if point < 3 then
+38 -17
View File
@@ -59,18 +59,14 @@ pfUI:RegisterModule("cooldown", function ()
end end
end end
local height, size local function GetCooldownHeight(cooldown)
local textcount = 0 return cooldown:GetParent() and cooldown:GetParent():GetHeight() or cooldown:GetHeight() or 0
local function pfCreateCoolDown(cooldown, start, duration) end
textcount = textcount + 1
local name = cooldown.GetName and cooldown:GetName() or "pfCooldown" .. textcount
cooldown.pfCooldownText = CreateFrame("Frame", name .. "Text", cooldown:GetParent())
cooldown.pfCooldownText.cooldown = cooldown
cooldown.pfCooldownText:SetAllPoints(cooldown)
cooldown.pfCooldownText:SetFrameLevel(cooldown:GetParent():GetFrameLevel() + 2)
cooldown.pfCooldownText.text = cooldown.pfCooldownText:CreateFontString(name .. "TextString", "OVERLAY")
-- sizes the text to the cooldown's current height; the dynamic size follows
-- the frame, so SetCooldown calls this again whenever that height changes
local function pfUpdateCooldownFont(cooldown)
local size
if not cooldown.pfCooldownType then if not cooldown.pfCooldownType then
size = tonumber(C.appearance.cd.font_size_foreign) size = tonumber(C.appearance.cd.font_size_foreign)
elseif cooldown.pfCooldownType == "BLIZZARD" then elseif cooldown.pfCooldownType == "BLIZZARD" then
@@ -82,12 +78,27 @@ pfUI:RegisterModule("cooldown", function ()
end end
-- enforce dynamic font size -- enforce dynamic font size
if C.appearance.cd.dynamicsize == "1" and cooldown.GetParent then if C.appearance.cd.dynamicsize == "1" then
height = cooldown:GetParent() and cooldown:GetParent():GetHeight() or cooldown:GetHeight() or 0 local height = GetCooldownHeight(cooldown)
cooldown.pfCooldownText.height = height
size = math.max((height > 0 and height * .64 or 16), size) size = math.max((height > 0 and height * .64 or 16), size)
end end
cooldown.pfCooldownText.text:SetFont(pfUI.media[C.appearance.cd.font], size, "OUTLINE") cooldown.pfCooldownText.text:SetFont(pfUI.media[C.appearance.cd.font], size, "OUTLINE")
end
local textcount = 0
local function pfCreateCoolDown(cooldown, start, duration)
textcount = textcount + 1
local name = cooldown.GetName and cooldown:GetName() or "pfCooldown" .. textcount
cooldown.pfCooldownText = CreateFrame("Frame", name .. "Text", cooldown:GetParent())
cooldown.pfCooldownText.cooldown = cooldown
cooldown.pfCooldownText:SetAllPoints(cooldown)
cooldown.pfCooldownText:SetFrameLevel(cooldown:GetParent():GetFrameLevel() + 2)
cooldown.pfCooldownText.text = cooldown.pfCooldownText:CreateFontString(name .. "TextString", "OVERLAY")
pfUpdateCooldownFont(cooldown)
cooldown.pfCooldownText.text:SetPoint("CENTER", cooldown.pfCooldownText, "CENTER", 0, 0) cooldown.pfCooldownText.text:SetPoint("CENTER", cooldown.pfCooldownText, "CENTER", 0, 0)
cooldown.pfCooldownText:SetScript("OnUpdate", pfCooldownOnUpdate) cooldown.pfCooldownText:SetScript("OnUpdate", pfCooldownOnUpdate)
end end
@@ -104,8 +115,10 @@ pfUI:RegisterModule("cooldown", function ()
return return
end end
-- realign cooldown frames -- realign the indicator Models that stock buttons build; the model is
local parent = this.GetParent and this:GetParent() -- drawn at 36px and needs scaling to its button. A Cooldown draws its
-- sweep to its own rect.
local parent = this.GetParent and not this:IsObjectType("Cooldown") and this:GetParent()
if parent and parent:GetWidth() / 36 > 0 then if parent and parent:GetWidth() / 36 > 0 then
this:SetScale(parent:GetWidth() / 36) this:SetScale(parent:GetWidth() / 36)
this:SetPoint("TOPLEFT", parent, "TOPLEFT", -1, 1) this:SetPoint("TOPLEFT", parent, "TOPLEFT", -1, 1)
@@ -129,11 +142,19 @@ pfUI:RegisterModule("cooldown", function ()
this:SetAlpha(0) this:SetAlpha(0)
end end
-- reversed sweep direction (ClassicAPI backports SetReverse with the
-- modern Cooldown frame; stock Model swipes don't have it, so guard it)
if this.pfCooldownReverse == 1 and this.SetReverse then
this:SetReverse(true)
end
-- print time as text on cooldown frames -- print time as text on cooldown frames
if ( not this.pfCooldownStyleText or this.pfCooldownStyleText == 1) if ( not this.pfCooldownStyleText or this.pfCooldownStyleText == 1)
and start > 0 and duration > 0 and (not enable or enable > 0) then and start > 0 and duration > 0 and (not enable or enable > 0) then
if( not this.pfCooldownText ) then if( not this.pfCooldownText ) then
pfCreateCoolDown(this, start, duration) pfCreateCoolDown(this, start, duration)
elseif C.appearance.cd.dynamicsize == "1" and GetCooldownHeight(this) ~= this.pfCooldownText.height then
pfUpdateCooldownFont(this)
end end
this.pfCooldownText.start = start this.pfCooldownText.start = start
@@ -144,7 +165,7 @@ pfUI:RegisterModule("cooldown", function ()
end end
end end
-- vanilla does not have a cooldown frame type, so we hook the -- hook the SetTimer function that every cooldown, Cooldown frame or
-- regular SetTimer function that each one is calling. -- stock indicator Model, is driven through.
hooksecurefunc("CooldownFrame_SetTimer", SetCooldown) hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
end) end)
File diff suppressed because it is too large Load Diff
+5 -28
View File
@@ -29,38 +29,15 @@ pfUI:RegisterModule("focus", function ()
end) end)
-- /focus and /clearfocus live in ClassicAPI's SlashCommandsRegistry now. -- /focus and /clearfocus live in ClassicAPI's SlashCommandsRegistry now.
-- /focusname is pfUI-specific because the engine has no name→GUID -- `/focus Name` takes the nearest prefix match; /focusname tries the exact
-- lookup for off-screen units — we resolve via a short target-swap. -- name first, so "Bob" still wins over a nearer "Bobby".
pfUI.api.RegisterSlashCommand("PFFOCUSNAME", { '/focusname', '/pffocusname' }, function(msg) pfUI.api.RegisterSlashCommand("PFFOCUSNAME", { '/focusname', '/pffocusname' }, function(msg)
if msg == "" then return end if msg == "" then return end
local prevGUID = UnitGUID("target") local unit = UnitTokenFromName(msg, true) or UnitTokenFromName(msg)
local prevPlayer = UnitIsUnit("target", "player") if unit then
FocusUnit(unit)
-- Suppress async "Unknown unit" errors fired by TargetByName misses.
UIErrorsFrame:UnregisterEvent("UI_ERROR_MESSAGE")
-- Try exact match first, then prefix match via /target.
TargetByName(msg, true)
if not UnitExists("target") then
SlashCmdList.TARGET(msg)
end
if UnitExists("target") then
FocusUnit("target")
end
RunNextFrame(function()
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
end)
if prevGUID and prevGUID ~= "0x0000000000000000" then
TargetUnit(prevGUID)
elseif prevPlayer then
TargetUnit("player")
else
ClearTarget()
end end
end, true) end, true)
+35 -7
View File
@@ -58,10 +58,11 @@ pfUI:RegisterModule("gui", function ()
return return
end end
if MouseIsOver(this) and not this.over then local over = MouseIsOverHitRect(this)
if over and not this.over then
this.tex:Show() this.tex:Show()
this.over = true this.over = true
elseif not MouseIsOver(this) and this.over then elseif not over and this.over then
this.tex:Hide() this.tex:Hide()
this.over = nil this.over = nil
end end
@@ -182,7 +183,7 @@ pfUI:RegisterModule("gui", function ()
frame.color:SetHeight(12) frame.color:SetHeight(12)
CreateBackdrop(frame.color) CreateBackdrop(frame.color)
frame.color:SetPoint("RIGHT" , -5, 1) frame.color:SetPoint("RIGHT" , -5, 1)
frame.color.prev = frame.color.backdrop:CreateTexture("OVERLAY") frame.color.prev = frame.color.backdrop:CreateTexture(nil, "OVERLAY")
frame.color.prev:SetAllPoints(frame.color) frame.color.prev:SetAllPoints(frame.color)
local cr, cg, cb, ca = strsplit(",", category[config]) local cr, cg, cb, ca = strsplit(",", category[config])
@@ -2072,7 +2073,6 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, T["Combopoint Width"], C.unitframes, "combowidth") CreateConfig(nil, T["Combopoint Width"], C.unitframes, "combowidth")
CreateConfig(nil, T["Combopoint Height"], C.unitframes, "comboheight") CreateConfig(nil, T["Combopoint Height"], C.unitframes, "comboheight")
CreateConfig(nil, T["Show Resting"], C.unitframes.player, "showRest", "checkbox") CreateConfig(nil, T["Show Resting"], C.unitframes.player, "showRest", "checkbox")
CreateConfig(nil, T["Detect Enemy Buffs"], C.unitframes, "buffdetect", "checkbox", nil, nil, nil, nil)
CreateConfig(nil, T["Raid Mark Icon Style"], C.unitframes, "blizzard_raidicons", "dropdown", function() return {"1:Original Blizzard", "0:pfUI Design"} end) CreateConfig(nil, T["Raid Mark Icon Style"], C.unitframes, "blizzard_raidicons", "dropdown", function() return {"1:Original Blizzard", "0:pfUI Design"} end)
CreateConfig(nil, T["Swing Timer"], nil, nil, "header") CreateConfig(nil, T["Swing Timer"], nil, nil, "header")
@@ -2341,18 +2341,25 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U[c], T["Timer"], nil, nil, "header") CreateConfig(U[c], T["Timer"], nil, nil, "header")
CreateConfig(U[c], T["Show Timer Text"], C.unitframes[c], "cooldown_text", "checkbox") CreateConfig(U[c], T["Show Timer Text"], C.unitframes[c], "cooldown_text", "checkbox")
CreateConfig(Reload, T["Show Timer Animation"], C.unitframes[c], "cooldown_anim", "checkbox") CreateConfig(Reload, T["Show Timer Animation"], C.unitframes[c], "cooldown_anim", "checkbox")
CreateConfig(Reload, T["Reverse Timer Animation"], C.unitframes[c], "cooldown_reverse", "checkbox")
CreateConfig(U[c], T["Buffs"], nil, nil, "header") CreateConfig(U[c], T["Buffs"], nil, nil, "header")
CreateConfig(U[c], T["Buff Position"], C.unitframes[c], "buffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position) CreateConfig(U[c], T["Buff Position"], C.unitframes[c], "buffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position)
CreateConfig(U[c], T["Buff Size"], C.unitframes[c], "buffsize") CreateConfig(U[c], T["Buff Size"], C.unitframes[c], "buffsize")
CreateConfig(U[c], T["Buff Limit"], C.unitframes[c], "bufflimit") CreateConfig(U[c], T["Buff Limit"], C.unitframes[c], "bufflimit")
CreateConfig(U[c], T["Buffs Per Row"], C.unitframes[c], "buffperrow") CreateConfig(U[c], T["Buffs Per Row"], C.unitframes[c], "buffperrow")
CreateConfig(U[c], T["Own Buff Size"], C.unitframes[c], "ownbuffsize")
CreateConfig(U[c], T["Buff X-Spacing"], C.unitframes[c], "buffspacingx")
CreateConfig(U[c], T["Buff Y-Spacing"], C.unitframes[c], "buffspacingy")
CreateConfig(U[c], T["Debuffs"], nil, nil, "header") CreateConfig(U[c], T["Debuffs"], nil, nil, "header")
CreateConfig(U[c], T["Debuff Position"], C.unitframes[c], "debuffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position) CreateConfig(U[c], T["Debuff Position"], C.unitframes[c], "debuffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position)
CreateConfig(U[c], T["Debuff Size"], C.unitframes[c], "debuffsize") CreateConfig(U[c], T["Debuff Size"], C.unitframes[c], "debuffsize")
CreateConfig(U[c], T["Debuff Limit"], C.unitframes[c], "debufflimit") CreateConfig(U[c], T["Debuff Limit"], C.unitframes[c], "debufflimit")
CreateConfig(U[c], T["Debuffs Per Row"], C.unitframes[c], "debuffperrow") CreateConfig(U[c], T["Debuffs Per Row"], C.unitframes[c], "debuffperrow")
CreateConfig(U[c], T["Own Debuff Size"], C.unitframes[c], "owndebuffsize")
CreateConfig(U[c], T["Debuff X-Spacing"], C.unitframes[c], "debuffspacingx")
CreateConfig(U[c], T["Debuff Y-Spacing"], C.unitframes[c], "debuffspacingy")
if c ~= "player" then if c ~= "player" then
end end
@@ -2421,6 +2428,21 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, T["Always Show Equipment Slot Flyouts"], C.character.inventory, "equipflyout", "checkbox") CreateConfig(nil, T["Always Show Equipment Slot Flyouts"], C.character.inventory, "equipflyout", "checkbox")
end) end)
CreateGUIEntry(T["Character"], T["Equipment Manager"], function()
CreateConfig(nil, T["Automatic Set Switching"], nil, nil, "header")
CreateConfig(U["equipmentmanager"], T["Enable Automatic Set Switching"], C.equipmentmanager, "autoswitch", "checkbox")
CreateConfig(U["equipmentmanager"], T["Announce Automatic Set Switches In Chat"], C.equipmentmanager, "announce", "checkbox")
CreateConfig(nil, T["Items Not In Any Set"], nil, nil, "header")
CreateConfig(U["equipmentmanager"], T["Minimum Item Quality"], C.equipmentmanager, "unusedquality", "dropdown", {
"0:" .. ITEM_QUALITY0_DESC,
"1:" .. ITEM_QUALITY1_DESC,
"2:" .. ITEM_QUALITY2_DESC,
"3:" .. ITEM_QUALITY3_DESC,
"4:" .. ITEM_QUALITY4_DESC,
})
CreateConfig(U["equipmentmanager"], T["Include Bank Items"], C.equipmentmanager, "unusedbank", "checkbox")
end)
CreateGUIEntry(T["Character"], T["Reputation"], function() CreateGUIEntry(T["Character"], T["Reputation"], function()
CreateConfig(nil, T["Show Reputation Remaining"], C.character.reputation, "repRequired", "checkbox") CreateConfig(nil, T["Show Reputation Remaining"], C.character.reputation, "repRequired", "checkbox")
end) end)
@@ -2437,8 +2459,8 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, T["Hide Chat When Bags Are Opened"], C.appearance.bags, "hidechat", "checkbox") CreateConfig(nil, T["Hide Chat When Bags Are Opened"], C.appearance.bags, "hidechat", "checkbox")
CreateConfig(nil, T["Bagslots Per Row"], C.appearance.bags, "bagrowlength") CreateConfig(nil, T["Bagslots Per Row"], C.appearance.bags, "bagrowlength")
CreateConfig(nil, T["Bankslots Per Row"], C.appearance.bags, "bankrowlength") CreateConfig(nil, T["Bankslots Per Row"], C.appearance.bags, "bankrowlength")
CreateConfig(nil, T["Enable Full-Text Search"], C.appearance.bags, "fulltext")
CreateConfig(nil, T["Item Slot Size"], C.appearance.bags, "icon_size") CreateConfig(nil, T["Item Slot Size"], C.appearance.bags, "icon_size")
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.appearance.bags, "cooldown_reverse", "checkbox")
CreateConfig(nil, T["Auto Sell Grey Items"], C.global, "autosell", "checkbox") CreateConfig(nil, T["Auto Sell Grey Items"], C.global, "autosell", "checkbox")
CreateConfig(nil, T["Auto Repair Items"], C.global, "autorepair", "checkbox") CreateConfig(nil, T["Auto Repair Items"], C.global, "autorepair", "checkbox")
CreateConfig(nil, T["Auto Sort When Opening Bags"], C.appearance.bags, "autoSortOnOpen", "checkbox") CreateConfig(nil, T["Auto Sort When Opening Bags"], C.appearance.bags, "autoSortOnOpen", "checkbox")
@@ -2489,6 +2511,8 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["buff"], T["Number Of Debuffs Per Row"], C.buffs, "debuffrowsize") CreateConfig(U["buff"], T["Number Of Debuffs Per Row"], C.buffs, "debuffrowsize")
CreateConfig(U["buff"], T["Show Duration Inside Buff"], C.buffs, "textinside", "checkbox") CreateConfig(U["buff"], T["Show Duration Inside Buff"], C.buffs, "textinside", "checkbox")
CreateConfig(U["buff"], T["Buff Font Size"], C.buffs, "fontsize") CreateConfig(U["buff"], T["Buff Font Size"], C.buffs, "fontsize")
CreateConfig(Reload, T["Show Timer Animation"], C.buffs, "cooldown_anim", "checkbox")
CreateConfig(Reload, T["Reverse Timer Animation"], C.buffs, "cooldown_reverse", "checkbox")
end) end)
CreateGUIEntry(T["Buffs"], T["Totem Icons"], function() CreateGUIEntry(T["Buffs"], T["Totem Icons"], function()
@@ -2496,6 +2520,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["totems"], T["Icon Size"], C.totems, "iconsize") CreateConfig(U["totems"], T["Icon Size"], C.totems, "iconsize")
CreateConfig(U["totems"], T["Spacing"], C.totems, "spacing", "dropdown", pfUI.gui.dropdowns.spacing) CreateConfig(U["totems"], T["Spacing"], C.totems, "spacing", "dropdown", pfUI.gui.dropdowns.spacing)
CreateConfig(U["totems"], T["Show Background"], C.totems, "showbg", "checkbox") CreateConfig(U["totems"], T["Show Background"], C.totems, "showbg", "checkbox")
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.totems, "cooldown_reverse", "checkbox")
end) end)
CreateGUIEntry(T["Buffs"], T["Player Buff Bar"], function() CreateGUIEntry(T["Buffs"], T["Player Buff Bar"], function()
@@ -2585,6 +2610,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["bars"], T["Keybind Text Size"], C.bars, "bind_size") CreateConfig(U["bars"], T["Keybind Text Size"], C.bars, "bind_size")
CreateConfig(U["bars"], T["Keybind Text Color"], C.bars, "bind_color", "color") CreateConfig(U["bars"], T["Keybind Text Color"], C.bars, "bind_color", "color")
CreateConfig(nil, T["Cooldown Text Size"], C.bars, "cd_size") CreateConfig(nil, T["Cooldown Text Size"], C.bars, "cd_size")
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.bars, "cooldown_reverse", "checkbox")
CreateConfig(nil, T["Auto Paging"], nil, nil, "header") CreateConfig(nil, T["Auto Paging"], nil, nil, "header")
CreateConfig(U["bars"], T["Switch Pages On Alt Key Press"], C.bars, "pagemasteralt", "checkbox") CreateConfig(U["bars"], T["Switch Pages On Alt Key Press"], C.bars, "pagemasteralt", "checkbox")
@@ -2873,9 +2899,10 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, T["Generate Playerlinks"], C.chat.text, "playerlinks", "checkbox") 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 URL Detection"], C.chat.text, "detecturl", "checkbox")
CreateConfig(nil, T["Enable Class Colors"], C.chat.text, "classcolor", "checkbox") CreateConfig(nil, T["Enable Class Colors"], C.chat.text, "classcolor", "checkbox")
CreateConfig(nil, T["Show Faction & Race Icons"] .. " " .. GetPlayerRaceIcons(), C.chat.text, "playericons", "checkbox") local _, playerRace = UnitRace("player")
CreateConfig(nil, T["Show Faction Icons"] .. " " .. GetFactionIcon(playerRace), C.chat.text, "factionicons", "checkbox")
CreateConfig(nil, T["Show Race Icons"] .. " " .. GetRaceIcon(playerRace, UnitSex("player")), C.chat.text, "raceicons", "checkbox")
CreateConfig(nil, T["Enable Player Levels"], C.chat.text, "playerlevel", "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["Colorize Unknown Classes"], C.chat.text, "tintunknown", "checkbox")
CreateConfig(nil, T["Unknown Class Color"], C.chat.text, "unknowncolor", "color") CreateConfig(nil, T["Unknown Class Color"], C.chat.text, "unknowncolor", "color")
CreateConfig(nil, T["Left Chat Width"], C.chat.left, "width") CreateConfig(nil, T["Left Chat Width"], C.chat.left, "width")
@@ -2953,6 +2980,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["nameplates"], T["Enable Debuff Timers"], C.nameplates, "debufftimers", "checkbox") CreateConfig(U["nameplates"], T["Enable Debuff Timers"], C.nameplates, "debufftimers", "checkbox")
CreateConfig(U["nameplates"], T["Show Timer Text"], C.nameplates, "debufftext", "checkbox") CreateConfig(U["nameplates"], T["Show Timer Text"], C.nameplates, "debufftext", "checkbox")
CreateConfig(Reload, T["Show Timer Animation"], C.nameplates, "debuffanim", "checkbox") CreateConfig(Reload, T["Show Timer Animation"], C.nameplates, "debuffanim", "checkbox")
CreateConfig(Reload, T["Reverse Timer Animation"], C.nameplates, "debreverse", "checkbox")
CreateConfig(U["nameplates"], T["Filter Mode"], C.nameplates.debuffs, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter) CreateConfig(U["nameplates"], T["Filter Mode"], C.nameplates.debuffs, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter)
CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list") CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list")
+21 -5
View File
@@ -105,6 +105,10 @@ pfUI:RegisterModule("hoverbind", function ()
end end
end end
local function BindingName(command)
return _G["BINDING_NAME_" .. command] or command
end
function pfUI.hoverbind:GetPrefix() function pfUI.hoverbind:GetPrefix()
return string.format("%s%s%s", return string.format("%s%s%s",
(IsAltKeyDown() and modifiers.ALT or ""), (IsAltKeyDown() and modifiers.ALT or ""),
@@ -157,17 +161,29 @@ pfUI:RegisterModule("hoverbind", function ()
if arg1 == "ESCAPE" and not binding then pfUI.hoverbind:Hide() return end if arg1 == "ESCAPE" and not binding then pfUI.hoverbind:Hide() return end
if binding then if binding then
if arg1 == "ESCAPE" then if arg1 == "ESCAPE" then
-- Remove existing binding -- Remove all existing bindings
local key = (GetBindingKey(binding)) local keys = { GetBindingKey(binding) }
if (key) then for _, key in ipairs(keys) do
SetBinding(key) SetBinding(key)
end
if keys[1] then
SaveBindings(GetCurrentBindingSet()) SaveBindings(GetCurrentBindingSet())
end end
else else
-- Create new binding -- Create new binding
local key = map and map[arg1] or arg1 local key = prefix .. (map and map[arg1] or arg1)
if (SetBinding(prefix..key, binding)) then local previous = GetBindingAction(key)
if (SetBinding(key, binding)) then
SaveBindings(GetCurrentBindingSet()) SaveBindings(GetCurrentBindingSet())
if previous and previous ~= "" and previous ~= binding then
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. key .. "|r " .. T["was unbound from"] .. " " .. BindingName(previous))
end
local active = GetBindingAction(key, true)
if active ~= binding then
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. key .. "|r " .. T["is currently overridden by"] .. " " .. BindingName(active))
end
end end
end end
end end
+38 -58
View File
@@ -1,25 +1,13 @@
-- Innervate Callout Module -- Innervate Callout Module
-- Announces Innervate casts via raid/party/battleground chat -- Announces Innervate casts via raid/party/battleground chat
-- Registers AURA_CAST events directly - zero polling, pure event-driven -- Listens to COMBAT_LOG_EVENT_UNFILTERED - zero polling, pure event-driven
pfUI:RegisterModule("innervatecall", function () pfUI:RegisterModule("innervatecall", function ()
-- Requires Nampower for AURA_CAST events
if not GetNampowerVersion then return end
-- Only load for druids -- Only load for druids
if UnitClassBase("player") ~= "DRUID" then return end if UnitClassBase("player") ~= "DRUID" then return end
local INNERVATE_SPELLID = 29166 local INNERVATE_SPELLID = 29166
local GCD_DURATION = 1.5
-- GUID → name resolution for the target. UnitTokenFromGUID walks the
-- engine's known unit tokens (player, party, raid, target, ...) and
-- returns the first one currently bound to the GUID, so we don't have
-- to manually iterate party/raid here.
local function ResolveTargetName(targetGuid)
if not targetGuid then return nil end
local token = UnitTokenFromGUID(targetGuid)
return token and UnitName(token) or nil
end
-- Determine chat channel based on group context -- Determine chat channel based on group context
local function GetAnnounceChannel() local function GetAnnounceChannel()
@@ -39,57 +27,49 @@ pfUI:RegisterModule("innervatecall", function ()
return nil return nil
end end
-- Event frame - registers AURA_CAST directly (bypasses libdebuff hooks -- Set on our cast, cleared once the "ready" timer is scheduled
-- which are gated behind ownDebuffs/pendingCasts checks meant for debuffs) local pending = false
local frame = CreateFrame("Frame")
-- AURA_CAST_ON_SELF fires when a buff lands ON the player
-- AURA_CAST_ON_OTHER fires when a buff lands on someone else
-- Both needed: self-innervate = ON_SELF, innervate on others = ON_OTHER
-- casterGuid check prevents announcing other druids' innervates
frame:RegisterEvent("AURA_CAST_ON_SELF")
frame:RegisterEvent("AURA_CAST_ON_OTHER")
frame:RegisterEvent("PLAYER_LOGOUT")
frame:SetScript("OnEvent", function()
if event == "PLAYER_LOGOUT" then
this:UnregisterAllEvents()
this:SetScript("OnEvent", nil)
return
end
-- AURA_CAST args: arg1=spellId, arg2=casterGuid, arg3=targetGuid -- Schedule the "ready" announcement once Innervate's own cooldown is in
local spellId = arg1 -- the spell history. Until then GetSpellCooldown reports only the GCD,
local casterGuid = arg2 -- which has no isOnGCD flag here, so tell them apart by duration.
local targetGuid = arg3 local function ScheduleReady()
if spellId ~= INNERVATE_SPELLID then return end
-- Only announce our own casts
if not IsPlayerGuid(casterGuid) then return end
-- Resolve target name from GUID
local targetName = ResolveTargetName(targetGuid) or "Unknown"
-- Determine channel
local channel = GetAnnounceChannel()
if not channel then return end -- solo, no announcement
SendChatMessage(">> Innervate casted on " .. targetName .. " <<", channel)
-- Schedule "ready" announcement when the cooldown expires. Read the
-- precise remaining time from C_Spell.GetSpellCooldown (startTime and
-- duration are seconds from the GetTime epoch); fall back to 360s.
local cdRemaining = 360
local cd = C_Spell.GetSpellCooldown(INNERVATE_SPELLID) local cd = C_Spell.GetSpellCooldown(INNERVATE_SPELLID)
if cd and cd.duration and cd.duration > 0 then if not cd or cd.duration <= GCD_DURATION then return end
local remaining = cd.startTime + cd.duration - GetTime()
if remaining > 0 then cdRemaining = remaining end
end
C_Timer.After(cdRemaining, function() pending = false
C_Timer.After(cd.startTime + cd.duration - GetTime(), function()
local ch = GetAnnounceChannel() local ch = GetAnnounceChannel()
if ch then if ch then
SendChatMessage(">> Innervate is ready <<", ch) SendChatMessage(">> Innervate is ready <<", ch)
end end
end) end)
end
local frame = CreateFrame("Frame")
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
frame:RegisterEvent("SPELL_UPDATE_COOLDOWN")
frame:SetScript("OnEvent", function()
if event == "SPELL_UPDATE_COOLDOWN" then
if pending then ScheduleReady() end
return
end
-- Innervate is instant, so it logs SPELL_CAST_SUCCESS with its target
-- arg2=subevent, arg4=sourceGUID, arg9=destName, arg12=spellId
if arg2 ~= "SPELL_CAST_SUCCESS" or arg12 ~= INNERVATE_SPELLID then return end
-- Only announce our own casts
if not IsPlayerGuid(arg4) then return end
local destName = arg9
-- Determine channel
local channel = GetAnnounceChannel()
if not channel then return end -- solo, no announcement
SendChatMessage(">> Innervate cast on " .. (destName or "Unknown") .. " <<", channel)
pending = true
ScheduleReady()
end) end)
end) end)
+1 -1
View File
@@ -180,7 +180,7 @@ pfUI:RegisterModule("map", function ()
my = (( my + height / 2 ) - ( y / scale )) / height * 100 my = (( my + height / 2 ) - ( y / scale )) / height * 100
end end
if mx and my and MouseIsOver(WorldMapButton) then if mx and my and WorldMapButton:IsMouseOver() then
WorldMapButton.coords.text:SetFormattedText('%.1f / %.1f', mx, my) WorldMapButton.coords.text:SetFormattedText('%.1f / %.1f', mx, my)
else else
WorldMapButton.coords.text:SetText("") WorldMapButton.coords.text:SetText("")
+3 -3
View File
@@ -95,7 +95,7 @@ pfUI:RegisterModule("mapcolors", function ()
local tooltipText = "" local tooltipText = ""
if unit_button_name == 'WorldMap' then if unit_button_name == 'WorldMap' then
-- check player -- check player
if MouseIsOver(WorldMapPlayer) then if WorldMapPlayer:IsMouseOver() then
ColorizeName(WorldMapPlayer) ColorizeName(WorldMapPlayer)
tooltipText = WorldMapPlayer.name tooltipText = WorldMapPlayer.name
end end
@@ -104,7 +104,7 @@ pfUI:RegisterModule("mapcolors", function ()
-- check party -- check party
for i=1, MAX_PARTY_MEMBERS do for i=1, MAX_PARTY_MEMBERS do
local frame = _G[unit_button_name.."Party"..i] local frame = _G[unit_button_name.."Party"..i]
if frame:IsVisible() and MouseIsOver(frame) then if frame:IsVisible() and frame:IsMouseOver() then
ColorizeName(frame) ColorizeName(frame)
tooltipText = tooltipText.."\n"..frame.name tooltipText = tooltipText.."\n"..frame.name
end end
@@ -113,7 +113,7 @@ pfUI:RegisterModule("mapcolors", function ()
--check Raid --check Raid
for i=1, MAX_RAID_MEMBERS do for i=1, MAX_RAID_MEMBERS do
local frame = _G[unit_button_name.."Raid"..i] local frame = _G[unit_button_name.."Raid"..i]
if frame:IsVisible() and MouseIsOver(frame) then if frame:IsVisible() and frame:IsMouseOver() then
ColorizeName(frame) ColorizeName(frame)
tooltipText = tooltipText.."\n"..frame.name tooltipText = tooltipText.."\n"..frame.name
end end
+35 -23
View File
@@ -31,7 +31,6 @@ pfUI:RegisterModule("mapreveal", function ()
end) end)
local explorecaches = {} local explorecaches = {}
local alreadyknown = {} -- per-zone accumulator: { [zone] = { [texName] = true } }
-- Own texture pool - separate from Blizzard's WorldMapOverlay textures -- Own texture pool - separate from Blizzard's WorldMapOverlay textures
local overlayPool = CreateTexturePool(WorldMapDetailFrame, "BORDER", nil, nil, function(_, tex) local overlayPool = CreateTexturePool(WorldMapDetailFrame, "BORDER", nil, nil, function(_, tex)
@@ -93,43 +92,45 @@ pfUI:RegisterModule("mapreveal", function ()
-- clear stale caches -- clear stale caches
for k in pairs(explorecaches) do explorecaches[k] = nil end for k in pairs(explorecaches) do explorecaches[k] = nil end
-- hide all our textures from last frame -- hide all our textures and icons from last frame
overlayPool:ReleaseAll() overlayPool:ReleaseAll()
explorePool:ReleaseAll()
local showExplore = C.appearance.worldmap.mapexploration == "1"
local showReveal = C.appearance.worldmap.mapreveal == "1"
if not showExplore and not showReveal then return end
local r,g,b,a = GetStringColor(C.appearance.worldmap.mapreveal_color) local r,g,b,a = GetStringColor(C.appearance.worldmap.mapreveal_color)
local mapFileName = GetMapInfo() local mapFileName = GetMapInfo()
if not mapFileName then mapFileName = "World" end if not mapFileName then mapFileName = "World" end
local numOverlays = GetNumMapOverlays()
-- accumulate explored overlays per zone (never clear, only add)
if not alreadyknown[mapFileName] then alreadyknown[mapFileName] = {} end
for i = 1, numOverlays do
local texName = GetMapOverlayInfo(i)
if texName then alreadyknown[mapFileName][string.upper(texName)] = true end
end
local zoneKnown = alreadyknown[mapFileName]
-- hide explore icons
explorePool:ReleaseAll()
-- ClassicAPI: full overlay list for the viewed zone (explored + unexplored), -- ClassicAPI: full overlay list for the viewed zone (explored + unexplored),
-- read straight from WorldMapOverlay.dbc. Replaces the hand-measured pfMapOverlayData. -- read straight from WorldMapOverlay.dbc. Replaces the hand-measured pfMapOverlayData.
local zoneData = C_Map.GetMapOverlays() or {} local zoneData = C_Map.GetMapOverlays() or {}
-- ClassicAPI: the unexplored subset of the viewed zone, using the engine's
-- own explored-bit test. Replaces the alreadyknown accumulator, which
-- replayed the explored-only GetMapOverlayInfo view. Keyed by the bare
-- texture name, the same key the icon cache below uses.
local unknown = {}
if showExplore then
for _, overlay in ipairs(C_MapExplorationInfo.GetUnexploredMapTextures() or {}) do
if overlay.textureName and overlay.textureName ~= "" then
unknown[string.upper(overlay.textureName)] = true
end
end
end
for _, overlay in ipairs(zoneData) do for _, overlay in ipairs(zoneData) do
local name = overlay.textureName -- bare, e.g. "DRYGULCHRAVINE" local name = overlay.textureName -- bare, e.g. "DRYGULCHRAVINE"
local textureName = overlay.texturePath -- full engine path (for SetTexture)
local textureWidth = overlay.textureWidth local textureWidth = overlay.textureWidth
local textureHeight = overlay.textureHeight local textureHeight = overlay.textureHeight
local offsetX = overlay.offsetX local offsetX = overlay.offsetX
local offsetY = overlay.offsetY local offsetY = overlay.offsetY
-- explore magnifying glass icon. `alreadyknown` stores the FULL paths -- explore magnifying glass icon for overlays the engine still
-- GetMapOverlayInfo returns, so compare with the full path, not the bare -- counts as unexplored.
-- name. if showExplore and unknown[string.upper(name)] then
if C.appearance.worldmap.mapexploration == "1" and not zoneKnown[string.upper(textureName)] then
local explore = explorePool:Acquire() local explore = explorePool:Acquire()
explore:SetPoint("TOPLEFT", "WorldMapDetailFrame", "TOPLEFT", offsetX + textureWidth/2, -offsetY - textureHeight/2) explore:SetPoint("TOPLEFT", "WorldMapDetailFrame", "TOPLEFT", offsetX + textureWidth/2, -offsetY - textureHeight/2)
explore.name = mapFileName .. " (" .. name .. ")" explore.name = mapFileName .. " (" .. name .. ")"
@@ -147,7 +148,7 @@ pfUI:RegisterModule("mapreveal", function ()
-- disambiguated from the actual BLP dimensions. No 256px grid -- disambiguated from the actual BLP dimensions. No 256px grid
-- math here — deriving the grid from textureWidth/Height is -- math here — deriving the grid from textureWidth/Height is
-- exactly what shears quirky overlays (e.g. Icepoint's Kaneq'nuun). -- exactly what shears quirky overlays (e.g. Icepoint's Kaneq'nuun).
if C.appearance.worldmap.mapreveal == "1" then if showReveal then
for _, tile in ipairs(overlay.tiles) do for _, tile in ipairs(overlay.tiles) do
local tex = overlayPool:Acquire() local tex = overlayPool:Acquire()
@@ -174,4 +175,15 @@ pfUI:RegisterModule("mapreveal", function ()
pfWorldMapFrame_Update() pfWorldMapFrame_Update()
end end
end) -- live refresh while the map is open: exploration changes arrive on this
-- event. Zone switches, zoom and (re)opens still come through the hook
-- above, so nothing is redrawn while the map is closed — the next open
-- rebuilds from the current state.
EventRegistry:RegisterFrameEventAndCallback("MAP_EXPLORATION_UPDATED", function()
if WorldMapFrame and WorldMapFrame:IsShown() then
pfWorldMapFrame_Update()
end
end)
end)
+18 -16
View File
@@ -103,30 +103,32 @@ pfUI:RegisterModule("minimap", function ()
this.highlight:SetAllPoints(this) this.highlight:SetAllPoints(this)
this.highlight:SetFrameLevel(this:GetFrameLevel() + 1) this.highlight:SetFrameLevel(this:GetFrameLevel() + 1)
this.highlight.tex = this.highlight:CreateTexture("OVERLAY") this.highlight.tex = this.highlight:CreateTexture(nil, "OVERLAY")
this.highlight.tex:SetTexture(pfUI.media["img:mail"]) this.highlight.tex:SetTexture(pfUI.media["img:mail"])
this.highlight.tex:SetPoint("TOPLEFT", MiniMapMailIcon, "TOPLEFT", -2, 2) this.highlight.tex:SetPoint("TOPLEFT", MiniMapMailIcon, "TOPLEFT", -2, 2)
this.highlight.tex:SetPoint("BOTTOMRIGHT", MiniMapMailIcon, "BOTTOMRIGHT", 2, -2) this.highlight.tex:SetPoint("BOTTOMRIGHT", MiniMapMailIcon, "BOTTOMRIGHT", 2, -2)
this.highlight.tex:SetVertexColor(1,.5,.5) this.highlight.tex:SetVertexColor(1,.5,.5)
this.highlight:SetScript("OnUpdate", function() -- Blink ten times between .9 and .1, then hide
if not this.count then this.count = 0 end local highlight = this.highlight
if not this.modifier then this.modifier = 1 end highlight:SetAlpha(.9)
if this.count >= 10 then this:Hide() end highlight.blink = highlight:CreateAnimationGroup()
for i = 1, 10 do
this:SetAlpha(this:GetAlpha() + this.modifier) local down = highlight.blink:CreateAnimation("Alpha")
down:SetChange(-.8)
if this:GetAlpha() <= 0.1 then down:SetDuration(.3)
this.modifier = 0.05 down:SetOrder(i * 2 - 1)
this.count = this.count + 1 local up = highlight.blink:CreateAnimation("Alpha")
elseif this:GetAlpha() >= 0.9 then up:SetChange(.8)
this.modifier = -0.05 up:SetDuration(.3)
end up:SetOrder(i * 2)
end) end
highlight.blink:SetScript("OnFinished", function() highlight:Hide() end)
end end
this.highlight.count = 0
this.highlight:Show() this.highlight:Show()
this.highlight.blink:Stop()
this.highlight.blink:Play()
end) end)
-- Create coordinates text frame with location configurable -- Create coordinates text frame with location configurable
+52 -42
View File
@@ -130,8 +130,8 @@ pfUI:RegisterModule("nameplates", function ()
cfg.targetcastbar = C.nameplates["targetcastbar"] == "1" cfg.targetcastbar = C.nameplates["targetcastbar"] == "1"
cfg.notargalpha = tonumber(C.nameplates.notargalpha) or 0.5 cfg.notargalpha = tonumber(C.nameplates.notargalpha) or 0.5
if cfg.notargalpha > 1 then cfg.notargalpha = cfg.notargalpha / 100 end if cfg.notargalpha > 1 then cfg.notargalpha = cfg.notargalpha / 100 end
-- Clamp to 0.99 so non-target plates never reach 1.0 (used for target detection) -- Clamp to 1.0 so a 100% setting yields full opacity (target detection is GUID-based)
if cfg.notargalpha > 0.99 then cfg.notargalpha = 0.99 end if cfg.notargalpha > 1 then cfg.notargalpha = 1 end
cfg.namefightcolor = C.nameplates.namefightcolor == "1" cfg.namefightcolor = C.nameplates.namefightcolor == "1"
cfg.spellname = C.nameplates.spellname == "1" cfg.spellname = C.nameplates.spellname == "1"
cfg.showhp = C.nameplates.showhp == "1" cfg.showhp = C.nameplates.showhp == "1"
@@ -159,6 +159,7 @@ pfUI:RegisterModule("nameplates", function ()
cfg.debufftimers = C.nameplates.debufftimers == "1" cfg.debufftimers = C.nameplates.debufftimers == "1"
cfg.debuffanim = tonumber(C.nameplates.debuffanim) or 0 cfg.debuffanim = tonumber(C.nameplates.debuffanim) or 0
cfg.debufftext = tonumber(C.nameplates.debufftext) or 1 cfg.debufftext = tonumber(C.nameplates.debufftext) or 1
cfg.debreverse = tonumber(C.nameplates.debreverse) or 0
-- Throttle delays, resolved once instead of per plate per tick. -- Throttle delays, resolved once instead of per plate per tick.
-- libthrottle:Get walks the saved-variable table, a defaults fallback and a -- libthrottle:Get walks the saved-variable table, a defaults fallback and a
@@ -280,10 +281,6 @@ pfUI:RegisterModule("nameplates", function ()
return color return color
end end
local function DoNothing()
return
end
local function DisableObject(object) local function DisableObject(object)
if not object then return end if not object then return end
if not object.GetObjectType then return end if not object.GetObjectType then return end
@@ -381,16 +378,23 @@ pfUI:RegisterModule("nameplates", function ()
end end
local function GetUnitType(red, green, blue) -- UnitSelectionType: 0 hostile, 1 unfriendly, 2 neutral, 3 friendly (or a
if red > .9 and green < .2 and blue < .2 then -- PvP-flagged player), 4 unflagged player. Type 3 is ambiguous, so callers
return "ENEMY_NPC" -- still promote *_NPC to *_PLAYER from their own player check.
elseif red > .9 and green > .9 and blue < .2 then local selectionTypes = {
return "NEUTRAL_NPC" [0] = "ENEMY_NPC",
elseif red < .2 and green < .2 and blue > 0.9 then [1] = "ENEMY_NPC",
return "FRIENDLY_PLAYER" [2] = "NEUTRAL_NPC",
elseif red < .2 and green > .9 and blue < .2 then [3] = "FRIENDLY_NPC",
return "FRIENDLY_NPC" [4] = "FRIENDLY_PLAYER",
end }
local function GetUnitType(plate)
-- an unresolved token reads as the player's own type (4), so never ask
-- without a GUID
local guid = plate.cachedGuid
if not guid or guid == "" then return "ENEMY_NPC" end
return selectionTypes[UnitSelectionType(guid)]
end end
local filter, list, cache local filter, list, cache
@@ -437,25 +441,12 @@ pfUI:RegisterModule("nameplates", function ()
plate.debuffs[index].stacks:SetJustifyV("BOTTOM") plate.debuffs[index].stacks:SetJustifyV("BOTTOM")
plate.debuffs[index].stacks:SetTextColor(1,1,0) plate.debuffs[index].stacks:SetTextColor(1,1,0)
-- PERF: Use lightweight fake cooldown frame when animation disabled plate.debuffs[index].cd = CreateFrame("Cooldown", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index], "CooldownFrameTemplate")
-- The Model-based CooldownFrameTemplate causes major lag with many nameplates plate.debuffs[index].cd:SetFrameLevel(6)
if cfg.debuffanim ~= 1 then
plate.debuffs[index].cd = CreateFrame("Frame", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index])
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
plate.debuffs[index].cd:SetFrameLevel(6)
plate.debuffs[index].cd:SetScript("OnUpdate", CooldownFrame_OnUpdateModel)
plate.debuffs[index].cd.AdvanceTime = DoNothing
plate.debuffs[index].cd.SetSequence = DoNothing
plate.debuffs[index].cd.SetSequenceTime = DoNothing
else
-- Use CooldownFrameTemplate for animation
plate.debuffs[index].cd = CreateFrame("Model", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index], "CooldownFrameTemplate")
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
plate.debuffs[index].cd:SetFrameLevel(6)
end
-- Set initial config flags (will be cached per-cooldown later) -- Set initial config flags (will be cached per-cooldown later)
plate.debuffs[index].cd.pfCooldownStyleAnimation = cfg.debuffanim plate.debuffs[index].cd.pfCooldownStyleAnimation = cfg.debuffanim
plate.debuffs[index].cd.pfCooldownReverse = cfg.debreverse or 0
plate.debuffs[index].cd.pfCooldownStyleText = cfg.debufftext plate.debuffs[index].cd.pfCooldownStyleText = cfg.debufftext
plate.debuffs[index].cd.pfCooldownType = "ALL" plate.debuffs[index].cd.pfCooldownType = "ALL"
end end
@@ -497,6 +488,7 @@ pfUI:RegisterModule("nameplates", function ()
local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0 local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0
nameplate.debuffs[i].cd.pfCooldownStyleText = cooldown_text nameplate.debuffs[i].cd.pfCooldownStyleText = cooldown_text
nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
nameplate.debuffs[i].cd.pfCooldownReverse = tonumber(C.nameplates.debreverse) or 0
end end
end end
@@ -519,6 +511,10 @@ nameplates:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
-- plate's own frame, against its own token -- see OnCreate and -- plate's own frame, against its own token -- see OnCreate and
-- NAME_PLATE_UNIT_ADDED. -- NAME_PLATE_UNIT_ADDED.
nameplates:RegisterEvent("PLAYER_GUILD_UPDATE") nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
-- The interruptible flips only fire for target and focus, not nameplate
-- tokens. castState is keyed by GUID, so they still reach those units' plates.
nameplates:RegisterUnitEvent("UNIT_SPELLCAST_INTERRUPTIBLE", "target", "focus")
nameplates:RegisterUnitEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE", "target", "focus")
nameplates:SetScript("OnEvent", function() nameplates:SetScript("OnEvent", function()
-- Stop event handling during logout to prevent crash 132 -- Stop event handling during logout to prevent crash 132
@@ -531,9 +527,11 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
end end
-- The plates hold their own unit subscriptions now, so silencing this -- The plates hold their own unit subscriptions now, so silencing this
-- frame alone would leave them dispatching through logout -- exactly what -- frame alone would leave them dispatching through logout -- exactly what
-- this branch exists to prevent. -- this branch exists to prevent. Leaving the world destroys the units
-- before PLAYER_LOGOUT fires, and a destroyed plate already dropped its
-- events and lost its methods, so only the live ones need silencing.
for plate in pairs(registry) do for plate in pairs(registry) do
if plate.nameplate then if plate.nameplate and plate.nameplate.UnregisterAllEvents then
plate.nameplate:UnregisterAllEvents() plate.nameplate:UnregisterAllEvents()
plate.nameplate:SetScript("OnEvent", nil) plate.nameplate:SetScript("OnEvent", nil)
end end
@@ -680,6 +678,17 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
-- Also propagate to all plates for alpha/strata updates -- Also propagate to all plates for alpha/strata updates
this.eventcache = true this.eventcache = true
elseif event == "UNIT_SPELLCAST_INTERRUPTIBLE" or event == "UNIT_SPELLCAST_NOT_INTERRUPTIBLE" then
local guid = UnitGUID(arg1)
local info = guid and castState[guid]
local plate = info and plateByGuid[guid]
if plate and plate.castbar then
info.noInterrupt = event == "UNIT_SPELLCAST_NOT_INTERRUPTIBLE"
-- UpdateCastbar only restyles on a new cast; force it
plate.castbar.lastEndTime = nil
plate.castUpdate = true
end
elseif event == "PLAYER_COMBO_POINTS" or event == "UNIT_COMBO_POINTS" then elseif event == "PLAYER_COMBO_POINTS" or event == "UNIT_COMBO_POINTS" then
-- Only flag the target's plate for combo point update -- Only flag the target's plate for combo point update
local plate = C_NamePlate.GetNamePlateForUnit("target") local plate = C_NamePlate.GetNamePlateForUnit("target")
@@ -859,7 +868,7 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
combopoints[i] = CreateFrame("Frame", nil, nameplate) combopoints[i] = CreateFrame("Frame", nil, nameplate)
combopoints[i]:Hide() combopoints[i]:Hide()
combopoints[i]:SetFrameLevel(8) combopoints[i]:SetFrameLevel(8)
combopoints[i].tex = combopoints[i]:CreateTexture("OVERLAY") combopoints[i].tex = combopoints[i]:CreateTexture(nil, "OVERLAY")
combopoints[i].tex:SetAllPoints() combopoints[i].tex:SetAllPoints()
if i < 3 then if i < 3 then
@@ -960,6 +969,7 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
nameplate.name:SetJustifyH(nameTextPos) nameplate.name:SetJustifyH(nameTextPos)
nameplate.health:SetOrientation(orientation) nameplate.health:SetOrientation(orientation)
nameplate.health:SetRotatesTexture(orientation == "VERTICAL")
-- Bar anchors to the plate directly so the name's JustifyH (configurable -- Bar anchors to the plate directly so the name's JustifyH (configurable
-- below) can shift left/right without dragging the bar with it. -- below) can shift left/right without dragging the bar with it.
nameplate.health:ClearAllPoints() nameplate.health:ClearAllPoints()
@@ -1082,8 +1092,7 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
levelFromDB = true levelFromDB = true
end end
local red, green, blue = plate.original.healthbar:GetStatusBarColor() local unittype = GetUnitType(plate)
local unittype = GetUnitType(red, green, blue) or "ENEMY_NPC"
local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
-- ignore players with npc names if plate level is lower than player level -- ignore players with npc names if plate level is lower than player level
@@ -1390,12 +1399,14 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
local cd = plate.debuffs[index].cd local cd = plate.debuffs[index].cd
cd:Show() cd:Show()
if not cachedStart or abs(cachedStart - newStart) > 0.5 then if not cachedStart or abs(cachedStart - newStart) > 0.5 then
if not cd.configCached or cd.cachedAnim ~= cfg.debuffanim or cd.cachedText ~= cfg.debufftext then if not cd.configCached or cd.cachedAnim ~= cfg.debuffanim or cd.cachedText ~= cfg.debufftext or cd.cachedReverse ~= cfg.debreverse then
cd.pfCooldownStyleAnimation = cfg.debuffanim cd.pfCooldownStyleAnimation = cfg.debuffanim
cd.pfCooldownStyleText = cfg.debufftext cd.pfCooldownStyleText = cfg.debufftext
cd.pfCooldownReverse = cfg.debreverse or 0
cd:SetAlpha(cfg.debuffanim == 1 and 1 or 0) cd:SetAlpha(cfg.debuffanim == 1 and 1 or 0)
cd.cachedAnim = cfg.debuffanim cd.cachedAnim = cfg.debuffanim
cd.cachedText = cfg.debufftext cd.cachedText = cfg.debufftext
cd.cachedReverse = cfg.debreverse
cd.configCached = true cd.configCached = true
end end
CooldownFrame_SetTimer(cd, newStart, effDuration, 1) CooldownFrame_SetTimer(cd, newStart, effDuration, 1)
@@ -1439,11 +1450,10 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
if not hasEventUpdate and (nameplate.lasttick or 0) + cfg.throttle_min > now then return end if not hasEventUpdate and (nameplate.lasttick or 0) + cfg.throttle_min > now then return end
-- PERF: Intelligent throttling based on target/castbar status and plate count -- PERF: Intelligent throttling based on target/castbar status and plate count
-- Use GUID comparison as primary target detection: instant, immune to alpha transitions, -- Use GUID comparison for target detection: instant, immune to alpha transitions,
-- and immediately correct on de-target (unlike istarget which updates one tick later) -- and immediately correct on de-target (unlike istarget which updates one tick later)
local targetGuid = state and state.targetGuid local targetGuid = state and state.targetGuid
local target = (targetGuid and nameplate.cachedGuid and targetGuid == nameplate.cachedGuid) or local target = (targetGuid and nameplate.cachedGuid and targetGuid == nameplate.cachedGuid) or nil
(state and state.targetGuid and frame:GetAlpha() >= 0.99) or nil
-- Target plate castbar runs on its own dedicated frame (nameplates.castbarFrame). -- Target plate castbar runs on its own dedicated frame (nameplates.castbarFrame).
-- For non-target plates with castbar active, use castbar throttle to ensure -- For non-target plates with castbar active, use castbar throttle to ensure
-- smooth animation without overloading the central loop. -- smooth animation without overloading the central loop.
@@ -1961,4 +1971,4 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
end) end)
pfUI.nameplates = nameplates pfUI.nameplates = nameplates
end) end)
+1 -1
View File
@@ -25,7 +25,7 @@ pfUI:RegisterModule("nampower", function ()
pfUI.spellqueue:SetPoint("CENTER", UIParent, "CENTER", 100, -100) pfUI.spellqueue:SetPoint("CENTER", UIParent, "CENTER", 100, -100)
end end
pfUI.spellqueue.icon = pfUI.spellqueue:CreateTexture("OVERLAY") pfUI.spellqueue.icon = pfUI.spellqueue:CreateTexture(nil, "OVERLAY")
pfUI.spellqueue.icon:SetAllPoints(pfUI.spellqueue) pfUI.spellqueue.icon:SetAllPoints(pfUI.spellqueue)
pfUI.spellqueue.icon:SetTexCoord(.08, .92, .08, .92) pfUI.spellqueue.icon:SetTexCoord(.08, .92, .08, .92)
+47 -1
View File
@@ -122,18 +122,64 @@ pfUI:RegisterModule("panel", function()
local gcmb = gckb and gckb > 0 and round((gckb or 0)/1000, 2) .. " MB" or UNAVAILABLE local gcmb = gckb and gckb > 0 and round((gckb or 0)/1000, 2) .. " MB" or UNAVAILABLE
local nin, nout, nping = GetNetStats() local nin, nout, nping = GetNetStats()
local screenWidth, screenHeight = GetPhysicalScreenSize()
GameTooltip:AddDoubleLine(T["Active Addons"], "|cffffffff" .. active .. "|cff555555 / |cffffffff" .. GetNumAddOns()) GameTooltip:AddDoubleLine(T["Active Addons"], "|cffffffff" .. active .. "|cff555555 / |cffffffff" .. GetNumAddOns())
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine(T["Memory Usage"], "|cffffffff" .. memmb) GameTooltip:AddDoubleLine(T["Memory Usage"], "|cffffffff" .. memmb)
GameTooltip:AddDoubleLine(T["Next Memory Cleanup"], "|cffffffff" .. gcmb) GameTooltip:AddDoubleLine(T["Next Memory Cleanup"], "|cffffffff" .. gcmb)
-- AddOn memory usage (see MainMenuBarPerformanceBarFrame_OnEnter in MainMenuBar.lua)
local ADDON_MEM_KB_ABBR = _G.ADDON_MEM_KB_ABBR or "(%.0f KB) %s";
local ADDON_MEM_MB_ABBR = _G.ADDON_MEM_MB_ABBR or "(%.2f MB) %s";
local TOTAL_MEM_KB_ABBR = _G.TOTAL_MEM_KB_ABBR or "AddOn Memory: %.0f KB";
local TOTAL_MEM_MB_ABBR = _G.TOTAL_MEM_MB_ABBR or "AddOn Memory: %.2f MB";
UpdateAddOnMemoryUsage()
local totalMem = 0
local topAddOns = {}
for i = 1, GetNumAddOns() do
local mem = GetAddOnMemoryUsage(i)
if mem and mem > 0 then
totalMem = totalMem + mem
for j = 1, 3 do
if not topAddOns[j] or mem > topAddOns[j].value then
for k = 3, j + 1, -1 do
topAddOns[k] = topAddOns[k - 1]
end
topAddOns[j] = { value = mem, name = C_AddOns.GetAddOnName(i) }
break
end
end
end
end
if totalMem > 0 then
local str
if totalMem > 1000 then
str = format(TOTAL_MEM_MB_ABBR, totalMem / 1000)
else
str = format(TOTAL_MEM_KB_ABBR, totalMem)
end
GameTooltip:AddLine(" ")
GameTooltip:AddLine(str, 1, 1, 1)
for i = 1, 3 do
if not topAddOns[i] then break end
if topAddOns[i].value > 1000 then
str = format(ADDON_MEM_MB_ABBR, topAddOns[i].value / 1000, topAddOns[i].name)
else
str = format(ADDON_MEM_KB_ABBR, topAddOns[i].value, topAddOns[i].name)
end
GameTooltip:AddLine(str, 1, 1, 1)
end
end
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine(T["Network Down"], "|cffffffff" .. round(nin,1) .. "KB/s") GameTooltip:AddDoubleLine(T["Network Down"], "|cffffffff" .. round(nin,1) .. "KB/s")
GameTooltip:AddDoubleLine(T["Network Up"], "|cffffffff" .. round(nout,1) .. "KB/s") GameTooltip:AddDoubleLine(T["Network Up"], "|cffffffff" .. round(nout,1) .. "KB/s")
GameTooltip:AddDoubleLine(T["Network Latency"], "|cffffffff" .. nping .. "ms") GameTooltip:AddDoubleLine(T["Network Latency"], "|cffffffff" .. nping .. "ms")
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine(T["Graphic Renderer"], "|cffffffff" .. GetCVar("gxApi")) GameTooltip:AddDoubleLine(T["Graphic Renderer"], "|cffffffff" .. GetCVar("gxApi"))
GameTooltip:AddDoubleLine(T["Screen Resolution"], "|cffffffff" .. GetCVar("gxResolution")) GameTooltip:AddDoubleLine(T["Screen Resolution"], "|cffffffff" .. screenWidth .. 'x' .. screenHeight)
GameTooltip:AddDoubleLine(T["UI-Scale"], "|cffffffff" .. round(UIParent:GetEffectiveScale(),2)) GameTooltip:AddDoubleLine(T["UI-Scale"], "|cffffffff" .. round(UIParent:GetEffectiveScale(),2))
GameTooltip:Show() GameTooltip:Show()
end end
+1 -1
View File
@@ -100,7 +100,7 @@ pfUI:RegisterModule("roll", function ()
f.icon:SetWidth(esize) f.icon:SetWidth(esize)
f.icon:SetHeight(esize) f.icon:SetHeight(esize)
f.icon.tex = f.icon:CreateTexture("OVERLAY") f.icon.tex = f.icon:CreateTexture(nil, "OVERLAY")
f.icon.tex:SetTexCoord(.08, .92, .08, .92) f.icon.tex:SetTexCoord(.08, .92, .08, .92)
f.icon.tex:SetAllPoints(f.icon) f.icon.tex:SetAllPoints(f.icon)
+1 -36
View File
@@ -1,39 +1,4 @@
pfUI:RegisterModule("skin", function () pfUI:RegisterModule("skin", 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
-- detect outer frame backdrops
if left and not left.rightObj then
left.rightObj = left.backdrop or left
for _, frame in pairs({left:GetChildren()}) do
rbpos = frame.backdrop and frame.backdrop.GetRight and frame.backdrop:GetRight()
ropos = left.rightObj and left.rightObj.GetRight and left.rightObj:GetRight()
if rbpos and ropos and rbpos > ropos then
left.rightObj = frame.backdrop
end
end
end
-- reset anchors
if not left or not left:IsShown() or not center or not center:IsShown() then
UIParent.pfLeftAligned = nil
return
elseif center and center:IsShown() and left and left:IsShown() then
local width = left.rightObj:GetRight()
if width and width ~= UIParent.pfLeftAligned then
center:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", width + 10, -104)
UIParent.pfLeftAligned = width
end
end
end)
-- durability frame -- durability frame
pfUI.durability = CreateFrame("Frame", "pfDurability", UIParent) pfUI.durability = CreateFrame("Frame", "pfDurability", UIParent)
if pfUI.minimap then if pfUI.minimap then
@@ -79,4 +44,4 @@ pfUI:RegisterModule("skin", function ()
else else
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE") UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
end end
end) end)
+35 -99
View File
@@ -190,36 +190,19 @@ pfUI:RegisterModule("swingtimer", function ()
CreateBackdropShadow(pfUI.swingtimer.offhand) CreateBackdropShadow(pfUI.swingtimer.offhand)
-- Ranged bar -- Ranged bar
pfUI.swingtimer.ranged = CreateFrame("Frame", "pfSwingTimerRanged", UIParent) -- Hunters fill from the center: the bar drains toward the middle during
-- the reload, then the auto shot deadzone grows back out in the warn color.
pfUI.swingtimer.ranged = CreateFrame("StatusBar", "pfSwingTimerRanged", UIParent)
pfUI.swingtimer.ranged:SetPoint("BOTTOM", UIParent, "CENTER", -189, 83) pfUI.swingtimer.ranged:SetPoint("BOTTOM", UIParent, "CENTER", -189, 83)
pfUI.swingtimer.ranged:SetWidth(sw_width) pfUI.swingtimer.ranged:SetWidth(sw_width)
pfUI.swingtimer.ranged:SetHeight(sw_height) pfUI.swingtimer.ranged:SetHeight(sw_height)
pfUI.swingtimer.ranged:SetMinMaxValues(0, 1)
pfUI.swingtimer.ranged:SetValue(0)
pfUI.swingtimer.ranged:SetStatusBarTexture(sw_texture)
pfUI.swingtimer.ranged:SetStatusBarColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged:SetFillStyle(isHunter and "CENTER" or "STANDARD")
pfUI.swingtimer.ranged:Hide() pfUI.swingtimer.ranged:Hide()
pfUI.swingtimer.ranged.left = pfUI.swingtimer.ranged:CreateTexture(nil, "ARTWORK")
pfUI.swingtimer.ranged.left:SetTexture(sw_texture)
pfUI.swingtimer.ranged.left:SetPoint("RIGHT", pfUI.swingtimer.ranged, "CENTER", 0, 0)
pfUI.swingtimer.ranged.left:SetHeight(sw_height)
pfUI.swingtimer.ranged.left:SetWidth(sw_width / 2)
pfUI.swingtimer.ranged.left:SetTexCoord(0, 0.5, 0, 1)
pfUI.swingtimer.ranged.left:SetVertexColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.right = pfUI.swingtimer.ranged:CreateTexture(nil, "ARTWORK")
pfUI.swingtimer.ranged.right:SetTexture(sw_texture)
pfUI.swingtimer.ranged.right:SetPoint("LEFT", pfUI.swingtimer.ranged, "CENTER", 0, 0)
pfUI.swingtimer.ranged.right:SetHeight(sw_height)
pfUI.swingtimer.ranged.right:SetWidth(sw_width / 2)
pfUI.swingtimer.ranged.right:SetTexCoord(0.5, 1, 0, 1)
pfUI.swingtimer.ranged.right:SetVertexColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.warn = pfUI.swingtimer.ranged:CreateTexture(nil, "ARTWORK")
pfUI.swingtimer.ranged.warn:SetTexture(sw_texture)
pfUI.swingtimer.ranged.warn:SetPoint("CENTER", pfUI.swingtimer.ranged, "CENTER", 0, 0)
pfUI.swingtimer.ranged.warn:SetHeight(sw_height)
pfUI.swingtimer.ranged.warn:SetWidth(1)
pfUI.swingtimer.ranged.warn:SetVertexColor(rwR, rwG, rwB, rwA)
pfUI.swingtimer.ranged.warn:Hide()
pfUI.swingtimer.ranged.text = pfUI.swingtimer.ranged:CreateFontString("Status", "DIALOG", "GameFontNormal") pfUI.swingtimer.ranged.text = pfUI.swingtimer.ranged:CreateFontString("Status", "DIALOG", "GameFontNormal")
pfUI.swingtimer.ranged.text:SetPoint("CENTER", pfUI.swingtimer.ranged, "CENTER", 0, 0) pfUI.swingtimer.ranged.text:SetPoint("CENTER", pfUI.swingtimer.ranged, "CENTER", 0, 0)
pfUI.swingtimer.ranged.text:SetFont(pfUI.font_default, sw_fontsize, "OUTLINE") pfUI.swingtimer.ranged.text:SetFont(pfUI.font_default, sw_fontsize, "OUTLINE")
@@ -324,26 +307,8 @@ pfUI:RegisterModule("swingtimer", function ()
S.raTimer = remaining S.raTimer = remaining
S.raActive = true S.raActive = true
if isHunter then pfUI.swingtimer.ranged:SetStatusBarColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.left:ClearAllPoints() pfUI.swingtimer.ranged:SetValue(isHunter and 1 or 0)
pfUI.swingtimer.ranged.left:SetPoint("RIGHT", pfUI.swingtimer.ranged, "CENTER", 0, 0)
pfUI.swingtimer.ranged.left:SetWidth(sw_width / 2)
pfUI.swingtimer.ranged.left:SetTexCoord(0, 0.5, 0, 1)
pfUI.swingtimer.ranged.right:SetWidth(sw_width / 2)
pfUI.swingtimer.ranged.right:SetTexCoord(0.5, 1, 0, 1)
else
pfUI.swingtimer.ranged.left:ClearAllPoints()
pfUI.swingtimer.ranged.left:SetPoint("TOPLEFT", pfUI.swingtimer.ranged, "TOPLEFT", 0, 0)
pfUI.swingtimer.ranged.left:SetWidth(0.1)
pfUI.swingtimer.ranged.left:Hide()
pfUI.swingtimer.ranged.left:SetTexCoord(0, 0, 0, 1)
pfUI.swingtimer.ranged.right:SetWidth(0.1)
pfUI.swingtimer.ranged.right:Hide()
end
pfUI.swingtimer.ranged.left:SetVertexColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.right:SetVertexColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.warn:SetWidth(1)
pfUI.swingtimer.ranged.warn:Hide()
pfUI.swingtimer.ranged:Show() pfUI.swingtimer.ranged:Show()
pfUI.swingtimer:Show() pfUI.swingtimer:Show()
end end
@@ -614,30 +579,12 @@ pfUI:RegisterModule("swingtimer", function ()
local remaining = S.raTimer local remaining = S.raTimer
if isHunter then if isHunter then
local DEADZONE = 0.5 local DEADZONE = 0.5
local halfW = sw_width / 2
if remaining > DEADZONE then if remaining > DEADZONE then
local elapsed = S.raTimerMax - remaining pfUI.swingtimer.ranged:SetStatusBarColor(raR, raG, raB, raA)
local phase1dur = S.raTimerMax - DEADZONE pfUI.swingtimer.ranged:SetValue((remaining - DEADZONE) / (S.raTimerMax - DEADZONE))
local p = elapsed / phase1dur
local w = halfW * (1 - p)
if w < 1 then w = 1 end
pfUI.swingtimer.ranged.left:Show()
pfUI.swingtimer.ranged.left:SetWidth(w)
pfUI.swingtimer.ranged.left:SetTexCoord(0, (1 - p) * 0.5, 0, 1)
pfUI.swingtimer.ranged.left:SetVertexColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.right:Show()
pfUI.swingtimer.ranged.right:SetWidth(w)
pfUI.swingtimer.ranged.right:SetTexCoord(1 - (1 - p) * 0.5, 1, 0, 1)
pfUI.swingtimer.ranged.right:SetVertexColor(raR, raG, raB, raA)
pfUI.swingtimer.ranged.warn:Hide()
else else
local p = 1 - (remaining / DEADZONE) pfUI.swingtimer.ranged:SetStatusBarColor(rwR, rwG, rwB, rwA)
local w = sw_width * p pfUI.swingtimer.ranged:SetValue(1 - (remaining / DEADZONE))
if w < 1 then w = 1 end
pfUI.swingtimer.ranged.left:Hide()
pfUI.swingtimer.ranged.right:Hide()
pfUI.swingtimer.ranged.warn:SetWidth(w)
pfUI.swingtimer.ranged.warn:Show()
end end
if sw_showtext then if sw_showtext then
if remaining <= 0.5 then if remaining <= 0.5 then
@@ -647,14 +594,7 @@ pfUI:RegisterModule("swingtimer", function ()
end end
end end
else else
local progress = 1 - (remaining / S.raTimerMax) pfUI.swingtimer.ranged:SetValue(1 - (remaining / S.raTimerMax))
local w = sw_width * progress
if w < 1 then w = 1 end
pfUI.swingtimer.ranged.left:Show()
pfUI.swingtimer.ranged.left:SetWidth(w)
pfUI.swingtimer.ranged.left:SetTexCoord(0, progress, 0, 1)
pfUI.swingtimer.ranged.right:Hide()
pfUI.swingtimer.ranged.warn:Hide()
if sw_showtext then if sw_showtext then
pfUI.swingtimer.ranged.text:SetFormattedText("%.1f", math.floor(remaining * 10) / 10) pfUI.swingtimer.ranged.text:SetFormattedText("%.1f", math.floor(remaining * 10) / 10)
end end
@@ -695,25 +635,6 @@ pfUI:RegisterModule("swingtimer", function ()
end end
end) end)
-- SPELL_GO hook via libdebuff: an on-next-swing ability (HS / Cleave /
-- Maul) resolving consumes the queue, so drop the queued color.
pfUI.libdebuff_spell_go_hooks = pfUI.libdebuff_spell_go_hooks or {}
pfUI.libdebuff_spell_go_hooks["swingtimer"] = function(spellId)
if IsOnSwingSpell(spellId) then
S.hsQueued = false; S.cleaveQueued = false; S.maulQueued = false
end
end
-- SPELL_CAST_EVENT hook: HS/Cleave/Maul queue tracking
pfUI.libdebuff_spell_cast_hooks = pfUI.libdebuff_spell_cast_hooks or {}
pfUI.libdebuff_spell_cast_hooks["swingtimer"] = function(success, spellId)
local kind = ClassifyOnSwingSpell(spellId)
if not kind then return end
S.useSpellQueueEvent = true
SetQueuedKind(kind)
end
local events = CreateFrame("Frame") local events = CreateFrame("Frame")
events:RegisterEvent("PLAYER_SWING") events:RegisterEvent("PLAYER_SWING")
events:RegisterEvent("PLAYER_ENTERING_WORLD") events:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -721,7 +642,9 @@ pfUI:RegisterModule("swingtimer", function ()
events:RegisterEvent("PLAYER_REGEN_DISABLED") events:RegisterEvent("PLAYER_REGEN_DISABLED")
events:RegisterEvent("PLAYER_REGEN_ENABLED") events:RegisterEvent("PLAYER_REGEN_ENABLED")
events:RegisterEvent("ACTIONBAR_SLOT_CHANGED") events:RegisterEvent("ACTIONBAR_SLOT_CHANGED")
events:RegisterUnitEvent("UNIT_DIED", UnitGUID("player")) events:RegisterEvent("PLAYER_DEAD")
events:RegisterUnitEvent("UNIT_SPELLCAST_SENT", "player")
events:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
events:RegisterEvent("SPELL_QUEUE_EVENT") events:RegisterEvent("SPELL_QUEUE_EVENT")
events:RegisterEvent("START_AUTOATTACK") events:RegisterEvent("START_AUTOATTACK")
events:RegisterEvent("STOP_AUTOATTACK") events:RegisterEvent("STOP_AUTOATTACK")
@@ -739,6 +662,21 @@ pfUI:RegisterModule("swingtimer", function ()
StartRanged(arg1) StartRanged(arg1)
end end
elseif event == "UNIT_SPELLCAST_SENT" then
-- arg4 = spellID: an on-next-swing ability (HS / Cleave / Maul) queued
local kind = ClassifyOnSwingSpell(arg4)
if kind then
S.useSpellQueueEvent = true
SetQueuedKind(kind)
end
elseif event == "UNIT_SPELLCAST_SUCCEEDED" then
-- arg3 = spellID: the on-next-swing ability resolved, which consumes
-- the queue, so drop the queued color
if IsOnSwingSpell(arg3) then
S.hsQueued = false; S.cleaveQueued = false; S.maulQueued = false
end
elseif event == "SPELL_QUEUE_EVENT" then elseif event == "SPELL_QUEUE_EVENT" then
local eventCode = arg1 or -1 local eventCode = arg1 or -1
local spellId = arg2 or 0 local spellId = arg2 or 0
@@ -788,10 +726,8 @@ pfUI:RegisterModule("swingtimer", function ()
S.cleaveQueued = false S.cleaveQueued = false
S.maulQueued = false S.maulQueued = false
elseif event == "UNIT_DIED" then elseif event == "PLAYER_DEAD" then
if IsPlayerGuid(arg1) then ResetAll()
ResetAll()
end
end end
end) end)
+2 -26
View File
@@ -866,9 +866,6 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
if C.thirdparty.supermacro.enable == "0" then return end if C.thirdparty.supermacro.enable == "0" then return end
if not pfUI.bars then return end if not pfUI.bars then return end
-- skin game menu button
SkinButton(GameMenuButtonSuperMacro)
-- hook events to include SuperMacro refreshs -- hook events to include SuperMacro refreshs
local ButtonFullUpdate = pfUI.bars.ButtonFullUpdate local ButtonFullUpdate = pfUI.bars.ButtonFullUpdate
pfUI.bars.ButtonFullUpdate = function(button) pfUI.bars.ButtonFullUpdate = function(button)
@@ -1175,21 +1172,9 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
end) end)
local EnableHealComm = function() local EnableHealComm = function()
-- hook healcomm's addon message to parse single-player events -- HealComm-1.0 already broadcasts this player's casts: keep libpredict
-- tracking them, but stop it sending a second copy
if AceLibrary and AceLibrary:HasInstance("HealComm-1.0") and pfUI.api.libpredict then if AceLibrary and AceLibrary:HasInstance("HealComm-1.0") and pfUI.api.libpredict then
local HealComm = AceLibrary("HealComm-1.0")
-- use pfUI frames to draw healComm predictions
local pfHookHealCommSendAddonMessage = HealComm.SendAddonMessage
function HealComm.SendAddonMessage(this, msg)
if not IsInGroup() then
libpredict:ParseChatMessage(UnitName("player"), msg, "HealComm")
end
pfHookHealCommSendAddonMessage(this, msg)
end
-- disable pfUI predictions
pfUI.api.libpredict.sender:UnregisterAllEvents()
pfUI.api.libpredict.sender.enabled = nil pfUI.api.libpredict.sender.enabled = nil
end end
end end
@@ -1197,16 +1182,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
HookAddonOrVariable("LunaUnitFrames", EnableHealComm) HookAddonOrVariable("LunaUnitFrames", EnableHealComm)
HookAddonOrVariable("NotGrid", EnableHealComm) HookAddonOrVariable("NotGrid", EnableHealComm)
HookAddonOrVariable("MoveAnything", function()
SkinButton(GameMenuButtonMoveAnything)
end)
HookAddonOrVariable("MCP", function()
SkinButton(GameMenuButtonAddOns)
end)
HookAddonOrVariable("HardcoreDeath", function() HookAddonOrVariable("HardcoreDeath", function()
SkinButton(GameMenuButtonHardcoreDeathLogGUI)
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 20) GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 20)
end) end)
+2 -1
View File
@@ -113,8 +113,9 @@ pfUI:RegisterModule("totems", function ()
self.bar[i].cdbg = self.bar[i].cdbg or CreateFrame("Frame", nil, self.bar[i]) self.bar[i].cdbg = self.bar[i].cdbg or CreateFrame("Frame", nil, self.bar[i])
self.bar[i].cdbg:SetSize(self.iconsize - 3, self.iconsize - 3) self.bar[i].cdbg:SetSize(self.iconsize - 3, self.iconsize - 3)
self.bar[i].cdbg:SetPoint("CENTER", self.bar[i], "CENTER", 0, 0) self.bar[i].cdbg:SetPoint("CENTER", self.bar[i], "CENTER", 0, 0)
self.bar[i].cd = self.bar[i].cd or CreateFrame("Model", "pfTotemsBar"..i.."Cooldown", self.bar[i].cdbg, "CooldownFrameTemplate") self.bar[i].cd = self.bar[i].cd or CreateFrame("Cooldown", "pfTotemsBar"..i.."Cooldown", self.bar[i].cdbg, "CooldownFrameTemplate")
self.bar[i].cd.pfCooldownStyleAnimation = 1 self.bar[i].cd.pfCooldownStyleAnimation = 1
self.bar[i].cd.pfCooldownReverse = tonumber(pfUI_config.totems.cooldown_reverse) or 0
self.bar[i].cd.pfCooldownType = "ALL" self.bar[i].cd.pfCooldownType = "ALL"
self.bar[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp") self.bar[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp")
+12 -19
View File
@@ -30,10 +30,18 @@ pfUI:RegisterModule("tracking", function ()
pfUI.tracking:SetWidth(size) pfUI.tracking:SetWidth(size)
pfUI.tracking:SetHeight(size) pfUI.tracking:SetHeight(size)
pfUI.tracking.icon = pfUI.tracking:CreateTexture("BACKGROUND") pfUI.tracking.icon = pfUI.tracking:CreateTexture(nil, "BACKGROUND")
pfUI.tracking.icon:SetTexCoord(.08, .92, .08, .92) pfUI.tracking.icon:SetTexCoord(.08, .92, .08, .92)
pfUI.tracking.icon:SetAllPoints(pfUI.tracking) pfUI.tracking.icon:SetAllPoints(pfUI.tracking)
-- Pulses the icon while no tracking spell is active
pfUI.tracking.pulse = pfUI.tracking.icon:CreateAnimationGroup()
pfUI.tracking.pulse:SetLooping("BOUNCE")
local fade = pfUI.tracking.pulse:CreateAnimation("Alpha")
fade:SetChange(-.5)
fade:SetDuration(.5)
fade:SetSmoothing("IN_OUT")
pfUI.tracking.menu = CreateFrame("Frame", "pfUIDropDownMenuTracking", nil, "UIDropDownMenuTemplate") pfUI.tracking.menu = CreateFrame("Frame", "pfUIDropDownMenuTracking", nil, "UIDropDownMenuTemplate")
pfUI.tracking:RegisterEvent("PLAYER_ENTERING_WORLD") pfUI.tracking:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -48,19 +56,6 @@ pfUI:RegisterModule("tracking", function ()
this:RefreshMenu() this:RefreshMenu()
end) end)
pfUI.tracking:SetScript("OnUpdate", function()
if this.pulse then
local _,_,_,alpha = this.icon:GetVertexColor()
local fpsmod = GetFramerate() / 30
if not alpha or alpha >= 0.9 then
this.modifier = -0.03 / fpsmod
elseif alpha <= .5 then
this.modifier = 0.03 / fpsmod
end
this.icon:SetVertexColor(1,1,1,alpha + this.modifier)
end
end)
pfUI.tracking:RegisterForClicks("LeftButtonUp", "RightButtonUp") pfUI.tracking:RegisterForClicks("LeftButtonUp", "RightButtonUp")
pfUI.tracking:SetScript("OnClick", function() pfUI.tracking:SetScript("OnClick", function()
if arg1 == "RightButton" then if arg1 == "RightButton" then
@@ -113,20 +108,18 @@ pfUI:RegisterModule("tracking", function ()
local texture = GetTrackingTexture() local texture = GetTrackingTexture()
if texture and texture ~= state.texture then if texture and texture ~= state.texture then
state.texture = texture state.texture = texture
pfUI.tracking.pulse = nil pfUI.tracking.pulse:Stop()
pfUI.tracking.icon:SetTexture(texture) pfUI.tracking.icon:SetTexture(texture)
pfUI.tracking.icon:SetVertexColor(1,1,1,1)
pfUI.tracking:Show() pfUI.tracking:Show()
elseif not texture then elseif not texture then
state.texture = nil state.texture = nil
if pulse and next(state.spells) ~= nil then if pulse and next(state.spells) ~= nil then
pfUI.tracking.pulse = true
pfUI.tracking.icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark") pfUI.tracking.icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
pfUI.tracking.icon:SetVertexColor(1,1,1,1) if not pfUI.tracking.pulse:IsPlaying() then pfUI.tracking.pulse:Play() end
pfUI.tracking:Show() pfUI.tracking:Show()
else else
pfUI.tracking.pulse = nil pfUI.tracking.pulse:Stop()
pfUI.tracking:Hide() pfUI.tracking:Hide()
end end
end end
+2 -4
View File
@@ -98,11 +98,9 @@ pfUI:RegisterModule("turtle-wow", function ()
GameMenuButtonOptions:ClearAllPoints() GameMenuButtonOptions:ClearAllPoints()
GameMenuButtonOptions:SetPoint("TOP", GameMenuButtonShop, "BOTTOM", 0, -16) GameMenuButtonOptions:SetPoint("TOP", GameMenuButtonShop, "BOTTOM", 0, -16)
-- apply pfUI skin to the new shop button -- match the shop button's text to the other skinned menu buttons
if pfUI.skin["Game Menu"] and pfUI_config["disabled"]["skin_Game Menu"] ~= "1" then if pfUI.skin["Game Menu"] and pfUI_config["disabled"]["skin_Game Menu"] ~= "1" then
local font = GameMenuButtonShop:GetFontString() GameMenuButtonShop:GetFontString():SetTextColor(1,1,1,1)
font:SetTextColor(1,1,1,1)
SkinButton(GameMenuButtonShop)
end end
end end
+11 -12
View File
@@ -130,15 +130,6 @@ pfUI:RegisterModule("unlock", function ()
return frames return frames
end end
local function DraggerOnUpdate()
this.text:SetAlpha(this.text:GetAlpha() -0.05)
if this.text:GetAlpha() < 0.1 then
this.text:SetText(strsub(this:GetParent():GetName(),3))
this.text:SetAlpha(1)
this:SetScript("OnUpdate", function() return end)
end
end
local function SaveScale(frame, scale) local function SaveScale(frame, scale)
frame:SetScale(scale) frame:SetScale(scale)
@@ -148,9 +139,8 @@ pfUI:RegisterModule("unlock", function ()
C.position[frame:GetName()]["scale"] = scale C.position[frame:GetName()]["scale"] = scale
frame.drag.text:SetText(T["Scale"] .. ": " .. scale) frame.drag.text:SetText(T["Scale"] .. ": " .. scale)
frame.drag.text:SetAlpha(1) frame.drag.fade:Stop()
frame.drag.fade:Play()
frame.drag:SetScript("OnUpdate", DraggerOnUpdate)
end end
local function SavePosition(frame) local function SavePosition(frame)
@@ -455,6 +445,15 @@ pfUI:RegisterModule("unlock", function ()
d.text:SetPoint("CENTER", 0, 0) d.text:SetPoint("CENTER", 0, 0)
d.text:SetFontObject(GameFontWhite) d.text:SetFontObject(GameFontWhite)
-- Fades out the scale readout, then puts the frame name back
d.fade = d.text:CreateAnimationGroup()
local fade = d.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(.3)
d.fade:SetScript("OnFinished", function()
d.text:SetText(strsub(f:GetName(),3))
end)
d.frame = f d.frame = f
d.fname = fname d.fname = fname
d.label = label d.label = label
+21
View File
@@ -34,4 +34,25 @@ pfUI:RegisterModule("unusable", function ()
hooksecurefunc("BankFrameItemButton_UpdateLock", function() hooksecurefunc("BankFrameItemButton_UpdateLock", function()
pfUI.unusable:UpdateSlot(-1, this:GetID()) pfUI.unusable:UpdateSlot(-1, this:GetID())
end) end)
-- requirement changes (level, proficiency/skill, required spell, reputation,
-- honor rank) don't touch the bags; queue a full rebag through pfUI.bag's
-- coalesced delay, whose UpdateSlot resets the tint before we reapply it
local refresh = CreateFrame("Frame")
refresh:RegisterEvent("PLAYER_LEVEL_UP")
refresh:RegisterEvent("SKILL_LINES_CHANGED")
refresh:RegisterEvent("SPELLS_CHANGED")
refresh:RegisterEvent("FACTION_STANDING_CHANGED")
refresh:RegisterEvent("PLAYER_PVP_RANK_CHANGED")
refresh:SetScript("OnEvent", function()
for _, bag in pairs(pfUI.BACKPACK) do
pfUI.bag.delay.UpdateBag[bag] = true
end
-- the bank frame is only created on first bank visit
if pfUI.bag.left and pfUI.bag.left:IsShown() then
for _, bag in pairs(pfUI.BANK) do
pfUI.bag.delay.UpdateBag[bag] = true
end
end
end)
end) end)
+29 -9
View File
@@ -63,9 +63,16 @@ pfUI:RegisterModule("xpbar", function ()
end end
end) end)
-- Cancel a running fade-out and show the bar at full alpha
local function Reveal(self)
self.fade:Stop()
self:SetAlpha(1)
end
local function OnLeave(self) local function OnLeave(self)
local self = self or this local self = self or this
self.hover = nil
self.tick = GetTime() + 3.00 self.tick = GetTime() + 3.00
GameTooltip:Hide() GameTooltip:Hide()
end end
@@ -82,7 +89,8 @@ local function OnEnter(self)
mode = "REP" mode = "REP"
end end
self:SetAlpha(1) self.hover = true
Reveal(self)
if mode == "XP" then if mode == "XP" then
local xp, xpmax, exh = UnitXP("player"), UnitXPMax("player"), GetXPExhaustion() local xp, xpmax, exh = UnitXP("player"), UnitXPMax("player"), GetXPExhaustion()
@@ -183,13 +191,15 @@ end
local self = self or this local self = self or this
if self.text_mouse == "1" then if self.text_mouse == "1" then
self.bar.text:SetShown(MouseIsOver(self)) self.bar.text:SetShown(self.hover)
end end
if self.always then return end if self.always then return end
if self:GetAlpha() == 0 or MouseIsOver(self) then return end -- Hover comes from OnEnter/OnLeave, the same mouse focus that reveals the
if ( self.tick or 1) > GetTime() then return else self.tick = GetTime() + .01 end -- bar, so the fade can't restart under the cursor
self:SetAlpha(self:GetAlpha() - .05) if self:GetAlpha() == 0 or self.hover or self.fade:IsPlaying() then return end
if ( self.tick or 1) > GetTime() then return end
self.fade:Play()
end end
local function OnEvent(self) local function OnEvent(self)
@@ -210,7 +220,7 @@ end
end end
if self.always then if self.always then
self:SetAlpha(1) Reveal(self)
self:Show() self:Show()
end end
@@ -220,7 +230,7 @@ end
if mode == "XP" then if mode == "XP" then
self.enabled = true self.enabled = true
self:SetAlpha(1) Reveal(self)
self.bar:SetMinMaxValues(0, UnitXPMax("player")) self.bar:SetMinMaxValues(0, UnitXPMax("player"))
self.bar:SetValue(UnitXP("player")) self.bar:SetValue(UnitXP("player"))
if GetXPExhaustion() then if GetXPExhaustion() then
@@ -246,7 +256,7 @@ end
elseif mode == "PETXP" then elseif mode == "PETXP" then
self.restedbar:Hide() self.restedbar:Hide()
self.enabled = true self.enabled = true
self:SetAlpha(1) Reveal(self)
local currXP, nextXP = GetPetExperience() local currXP, nextXP = GetPetExperience()
self.bar:SetMinMaxValues(min(0, currXP), nextXP) self.bar:SetMinMaxValues(min(0, currXP), nextXP)
@@ -264,7 +274,7 @@ end
local name, standingID, barMin, barMax, barValue = GetRepDisplay(self.factionID) local name, standingID, barMin, barMax, barValue = GetRepDisplay(self.factionID)
if name then if name then
self.enabled = true self.enabled = true
self:SetAlpha(1) Reveal(self)
barMax = barMax - barMin barMax = barMax - barMin
barValue = barValue - barMin barValue = barValue - barMin
@@ -342,6 +352,7 @@ end
local cr, cg, cb, ca = pfUI.api.GetStringColor(b.xp_color) local cr, cg, cb, ca = pfUI.api.GetStringColor(b.xp_color)
b.bar:SetStatusBarColor(cr,cg,cb,ca) b.bar:SetStatusBarColor(cr,cg,cb,ca)
b.bar:SetOrientation(b.mode) b.bar:SetOrientation(b.mode)
b.bar:SetRotatesTexture(b.mode == "VERTICAL")
b.bar.text = b.bar.text or b.bar:CreateFontString() b.bar.text = b.bar.text or b.bar:CreateFontString()
b.bar.text:SetPoint("CENTER", b, "CENTER", 0, b.text_off_y) b.bar.text:SetPoint("CENTER", b, "CENTER", 0, b.text_off_y)
@@ -358,10 +369,19 @@ end
local cr, cg, cb, ca = pfUI.api.GetStringColor(b.rest_color) local cr, cg, cb, ca = pfUI.api.GetStringColor(b.rest_color)
b.restedbar:SetStatusBarColor(cr,cg,cb,ca) b.restedbar:SetStatusBarColor(cr,cg,cb,ca)
b.restedbar:SetOrientation(b.mode) b.restedbar:SetOrientation(b.mode)
b.restedbar:SetRotatesTexture(b.mode == "VERTICAL")
-- auto hide -- auto hide
b:EnableMouse(true) b:EnableMouse(true)
if not b.fade then
b.fade = b:CreateAnimationGroup()
local fade = b.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(.3)
b.fade:SetScript("OnFinished", function() b:SetAlpha(0) end)
end
b:RegisterEvent("FACTION_STANDING_CHANGED") b:RegisterEvent("FACTION_STANDING_CHANGED")
b:RegisterUnitEvent("UNIT_PET", "player") b:RegisterUnitEvent("UNIT_PET", "player")
b:RegisterUnitEvent("UNIT_LEVEL", "player") b:RegisterUnitEvent("UNIT_LEVEL", "player")
-15
View File
@@ -497,19 +497,4 @@ function pfUI.SetupCVars()
UIParentLoadAddOn("Blizzard_CombatText") UIParentLoadAddOn("Blizzard_CombatText")
end end
do -- RunMacroText
local obj = setmetatable({ ["GetText"] = function(self) return self.text end }, {
__index = function(tab,key)
local value = function() return end
rawset(tab,key,value)
return value
end
})
function RunMacroText(text)
obj.text = text
ChatEdit_ParseText(obj, 1)
end
end
_G.PLAYER_BUFF_START_ID = -1 _G.PLAYER_BUFF_START_ID = -1
+1 -1
View File
@@ -5,7 +5,7 @@
## Notes-ruRU: Полная замена пользовательского интерфейса. ## Notes-ruRU: Полная замена пользовательского интерфейса.
## Version: @project-version@ ## Version: @project-version@
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache, pfUI_throttle ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache, pfUI_throttle
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB, pfUI_eqmgr
## X-Website: https://github.com/brues-code/pfUI ## X-Website: https://github.com/brues-code/pfUI
# ClassicAPI-less fallback. ClassicAPI redirects this read to pfUI_Turtle.toc # ClassicAPI-less fallback. ClassicAPI redirects this read to pfUI_Turtle.toc
+1 -1
View File
@@ -5,7 +5,7 @@
## Notes-ruRU: Полная замена пользовательского интерфейса. ## Notes-ruRU: Полная замена пользовательского интерфейса.
## Version: @project-version@ ## Version: @project-version@
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache, pfUI_throttle ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache, pfUI_throttle
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB, pfUI_eqmgr
## X-Website: https://github.com/brues-code/pfUI ## X-Website: https://github.com/brues-code/pfUI
# Selected by ClassicAPI on every non-Turtle client. Turtle clients get # Selected by ClassicAPI on every non-Turtle client. Turtle clients get
+1 -1
View File
@@ -5,7 +5,7 @@
## Notes-ruRU: Полная замена пользовательского интерфейса. ## Notes-ruRU: Полная замена пользовательского интерфейса.
## Version: @project-version@ ## Version: @project-version@
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache, pfUI_throttle ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache, pfUI_throttle
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB, pfUI_eqmgr
## X-Website: https://github.com/brues-code/pfUI ## X-Website: https://github.com/brues-code/pfUI
# Selected by ClassicAPI on Turtle WoW, where it wins over pfUI_ClassicAPI.toc. # Selected by ClassicAPI on Turtle WoW, where it wins over pfUI_ClassicAPI.toc.
+2 -2
View File
@@ -8,8 +8,8 @@ pfUI:RegisterSkin("Friends", function ()
CreateBackdropShadow(FriendsFrame) CreateBackdropShadow(FriendsFrame)
FriendsFrame.backdrop:SetPoint("TOPLEFT", 8, -10) FriendsFrame.backdrop:SetPoint("TOPLEFT", 8, -10)
FriendsFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 74) FriendsFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 72)
FriendsFrame:SetHitRectInsets(8,32,10,74) FriendsFrame:SetHitRectInsets(8,32,10,72)
EnableMovable("FriendsFrame") EnableMovable("FriendsFrame")
SkinCloseButton(FriendsFrameCloseButton, FriendsFrame.backdrop, -6, -6) SkinCloseButton(FriendsFrameCloseButton, FriendsFrame.backdrop, -6, -6)
+11 -15
View File
@@ -19,24 +19,20 @@ pfUI:RegisterSkin("Game Menu", function ()
pfUI.gui:Show() pfUI.gui:Show()
HideUIPanel(GameMenuFrame) HideUIPanel(GameMenuFrame)
end) end)
SkinButton(pfUIButton)
local point, relativeTo, relativePoint, xOffset, yOffset = GameMenuButtonOptions:GetPoint() local point, relativeTo, relativePoint, xOffset, yOffset = GameMenuButtonOptions:GetPoint()
GameMenuButtonOptions:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset - 22) GameMenuButtonOptions:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset - 22)
local buttons = { -- skin every button on the menu, including ones other addons add later
GameMenuButtonOptions, local function SkinMenuButtons()
GameMenuButtonSoundOptions, for _, child in pairs({GameMenuFrame:GetChildren()}) do
GameMenuButtonUIOptions, if child:GetFrameType() == "Button" and not child._pfMenuSkinned then
GameMenuButtonKeybindings, SkinButton(child)
GameMenuButtonMacros, child._pfMenuSkinned = true
GameMenuButtonRatings, end
GameMenuButtonLogout, end
GameMenuButtonQuit,
GameMenuButtonContinue,
}
for _, button in pairs(buttons) do
if button then SkinButton(button) end
end end
SkinMenuButtons()
GameMenuFrame:HookScript("OnShow", SkinMenuButtons)
end) end)
+49
View File
@@ -0,0 +1,49 @@
pfUI:RegisterSkin("Options - Interface", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
local cr, cg, cb = PFUI_CLASS_COLORS[UnitClassBase("player")]:GetRGB()
StripTextures(InterfaceOptionsFrame)
CreateBackdrop(InterfaceOptionsFrame, nil, nil, .75)
CreateBackdropShadow(InterfaceOptionsFrame)
local title = GetNoNameObject(InterfaceOptionsFrame, "FontString", "ARTWORK", ADDON_OPTIONS)
title:ClearAllPoints()
title:SetPoint("TOP", InterfaceOptionsFrame, "TOP", 0, -10)
CreateBackdrop(InterfaceOptionsFrameAddOns, nil, true, .75)
CreateBackdrop(InterfaceOptionsFramePanelContainer, nil, true, .75)
SkinScrollbar(InterfaceOptionsFrameAddOnsListScrollBar)
for _, button in ipairs(InterfaceOptionsFrameAddOns.buttons) do
button:GetHighlightTexture():SetTexture(cr, cg, cb, .25)
-- the list update swaps plus/minus textures on the toggle by path
local toggle = _G[button:GetName() .. "Toggle"]
SkinCollapseButton(toggle)
toggle:SetPushedTexture("")
toggle:SetHighlightTexture("")
toggle.SetPushedTexture = function() end
end
-- ClassicAPI's own pages (Options\Panel.lua) number their controls
local i = 1
while _G["ClassicAPIOptionsControl" .. i] do
local control = _G["ClassicAPIOptionsControl" .. i]
local ctype = control:GetFrameType()
if ctype == "CheckButton" then
SkinCheckbox(control)
elseif ctype == "Slider" then
SkinSlider(control)
else
SkinDropDown(control, nil, nil, nil, true)
end
i = i + 1
end
SkinButton(InterfaceOptionsFrameDefaults)
SkinButton(InterfaceOptionsFrameCancel)
SkinButton(InterfaceOptionsFrameOkay)
InterfaceOptionsFrameOkay:ClearAllPoints()
InterfaceOptionsFrameOkay:SetPoint("RIGHT", InterfaceOptionsFrameCancel, "LEFT", -2*bpad, 0)
end)
+2 -2
View File
@@ -28,12 +28,12 @@ pfUI:RegisterSkin("Petition", function ()
local texture = "StationeryTest" local texture = "StationeryTest"
if date("%m%d") == "0223" then texture = "Stationery_Val" end if date("%m%d") == "0223" then texture = "Stationery_Val" end
local tex_Left = PetitionFrame:CreateTexture("BACKGROUND") local tex_Left = PetitionFrame:CreateTexture(nil, "BACKGROUND")
tex_Left:SetTexture("Interface\\Stationery\\"..texture.."1") tex_Left:SetTexture("Interface\\Stationery\\"..texture.."1")
tex_Left:SetPoint("TOPLEFT", 23, -81) tex_Left:SetPoint("TOPLEFT", 23, -81)
tex_Left:SetWidth(tex_Left:GetWidth() + 10) tex_Left:SetWidth(tex_Left:GetWidth() + 10)
tex_Left:SetHeight(330) tex_Left:SetHeight(330)
local tex_Right = PetitionFrame:CreateTexture("BACKGROUND") local tex_Right = PetitionFrame:CreateTexture(nil, "BACKGROUND")
tex_Right:SetTexture("Interface\\Stationery\\"..texture.."2") tex_Right:SetTexture("Interface\\Stationery\\"..texture.."2")
tex_Right:SetPoint("LEFT", tex_Left, "RIGHT", 0, 0) tex_Right:SetPoint("LEFT", tex_Left, "RIGHT", 0, 0)
tex_Right:SetWidth(tex_Right:GetWidth() + 10) tex_Right:SetWidth(tex_Right:GetWidth() + 10)
+9 -9
View File
@@ -2,19 +2,19 @@ pfUI:RegisterSkin("Quest Log", function ()
local rawborder, border = GetBorderSize() local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel() local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
_G.QUESTS_DISPLAYED = 23 _G.QUESTS_DISPLAYED = 22
_G.MAX_WATCHABLE_QUESTS = 20 -- TODO _G.MAX_WATCHABLE_QUESTS = 20 -- TODO
do -- quest log frame do -- quest log frame
QuestLogQuestCount:ClearAllPoints() QuestLogQuestCount:ClearAllPoints()
QuestLogQuestCount:SetPoint("TOPRIGHT", -10, -30) QuestLogQuestCount:SetPoint("TOPRIGHT", -10, -30)
hooksecurefunc("QuestLog_OnShow", function() -- let the panel manager anchor this doublewide panel at 10, -114
QuestLogFrame:ClearAllPoints() UIPanelWindows["QuestLogFrame"].xoffset = 10
QuestLogFrame:SetPoint("TOPLEFT", 10, -104) UIPanelWindows["QuestLogFrame"].yoffset = -10
end)
QuestLogFrame:SetSize(676, 440) -- match the 430px height and top edge of the other skinned panels
QuestLogFrame:SetSize(676, 430)
QuestLogFrame:DisableDrawLayer("BACKGROUND") QuestLogFrame:DisableDrawLayer("BACKGROUND")
StripTextures(QuestLogFrame, true) StripTextures(QuestLogFrame, true)
@@ -144,7 +144,7 @@ pfUI:RegisterSkin("Quest Log", function ()
end end
QuestLogListScrollFrame:SetPoint("TOPLEFT", 10, -54) QuestLogListScrollFrame:SetPoint("TOPLEFT", 10, -54)
QuestLogListScrollFrame:SetHeight(350) QuestLogListScrollFrame:SetHeight(340)
hooksecurefunc("QuestLog_Update", function() hooksecurefunc("QuestLog_Update", function()
local numEntries = GetNumQuestLogEntries() local numEntries = GetNumQuestLogEntries()
@@ -181,8 +181,8 @@ pfUI:RegisterSkin("Quest Log", function ()
QuestLogDetailScrollFrame:ClearAllPoints() QuestLogDetailScrollFrame:ClearAllPoints()
QuestLogDetailScrollFrame:SetPoint("TOPLEFT", QuestLogListScrollFrame, "TOPRIGHT", 35, 0) QuestLogDetailScrollFrame:SetPoint("TOPLEFT", QuestLogListScrollFrame, "TOPRIGHT", 35, 0)
QuestLogDetailScrollFrame:SetHeight(376) QuestLogDetailScrollFrame:SetHeight(366)
QuestLogDetailScrollChildFrame:SetHeight(376) QuestLogDetailScrollChildFrame:SetHeight(366)
local bg = QuestLogDetailScrollFrame:CreateTexture(nil, "BACKGROUND") local bg = QuestLogDetailScrollFrame:CreateTexture(nil, "BACKGROUND")
bg:SetAllPoints() bg:SetAllPoints()
+2 -2
View File
@@ -6,9 +6,9 @@ pfUI:RegisterSkin("Spellbook", function ()
CreateBackdrop(SpellBookFrame, nil, nil, .75) CreateBackdrop(SpellBookFrame, nil, nil, .75)
CreateBackdropShadow(SpellBookFrame) CreateBackdropShadow(SpellBookFrame)
SpellBookFrame.backdrop:SetPoint("TOPLEFT", 12, -12) SpellBookFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
SpellBookFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72) SpellBookFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72)
SpellBookFrame:SetHitRectInsets(12,30,12,72) SpellBookFrame:SetHitRectInsets(10,30,10,72)
EnableMovable(SpellBookFrame) EnableMovable(SpellBookFrame)
SpellBookTitleText:ClearAllPoints() SpellBookTitleText:ClearAllPoints()
+17 -9
View File
@@ -22,19 +22,27 @@ pfUI:RegisterSkin("Pet Stable Master", function ()
PetStablePetInfo:ClearAllPoints() PetStablePetInfo:ClearAllPoints()
PetStablePetInfo:SetPoint("TOPLEFT", PetStableModel, "TOPLEFT", 10, 0) PetStablePetInfo:SetPoint("TOPLEFT", PetStableModel, "TOPLEFT", 10, 0)
local buttons = {"PetStableCurrentPet", "PetStableStabledPet1", "PetStableStabledPet2"} -- Servers differ in stable size (Turtle WoW has 4 slots), so collect
for _,v in pairs(buttons) do -- every PetStableStabledPetN the client created.
local button = _G[v] local buttons = { PetStableCurrentPet }
local i = 1
while _G["PetStableStabledPet"..i] do
table.insert(buttons, _G["PetStableStabledPet"..i])
i = i + 1
end
for _, button in pairs(buttons) do
StripTextures(button) StripTextures(button)
SkinButton(button, nil, nil, nil, _G[button:GetName().."IconTexture"]) SkinButton(button, nil, nil, nil, _G[button:GetName().."IconTexture"])
button.Enable = function() local b = button
button:SetBackdropColor() b.Enable = function()
button.locked = false b:SetBackdropColor()
b.locked = false
end end
button.Disable = function() b.Disable = function()
button:SetBackdropColor(1, .1, .1, .3) b:SetBackdropColor(1, .1, .1, .3)
button.locked = true b.locked = true
end end
end end