mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-01 16:36:56 +00:00
Drive range, offline, aggro and combat state from events
Every unit frame re-checked its range fade, offline state, combat and aggro glow and indicator icons on a 0.2-0.5s tick, and infight polled aggro every 0.3s. Each now comes from an event. Aggro: the 270-token scan and its cache are gone. UNIT_TARGET fires for every unit in view (SuperWoW registers them all), so a table of which hostile unit attacks which friendly one, by GUID, follows every attacker, including ones no token reaches. A unit that comes into view mid-fight is noted when a token first reaches it (target, focus, mouseover, a nameplate, a member's target). A read drops attackers that left view, where nothing fires, and a loading screen resets the table. Changes go out as "aggro:changed" with the old and the new victim, so only the frames showing those redraw; infight listens too. Combat square and glow follow UNIT_FLAGS. Range fade follows ClassicAPI's UNIT_IN_RANGE_UPDATE, registered only by frames that fade, by GUID for a chained unit; with the 40y check off, frames fade by sight through UNIT_DISTANCE_CHECK_UPDATE, which also swaps a portrait's question mark for the model. A UnitXP threshold has no event and keeps its poll. UNIT_CONNECTION refreshes a member who goes offline or comes back; the PARTY_MEMBER_ENABLE/DISABLE branches were never registered. A full refresh now draws the indicator icons and combat state, so a new unit brings its own. UNIT_FACTION redraws the PvP icon and reaction colour; its "pvp" refresh step drew nothing. Unlock mode and /pftest re-apply the fade on entry and exit. What stays on the tick: the pet frames and the UnitXP range check.
This commit is contained in:
@@ -490,6 +490,9 @@ pfUI:RegisterModule("unlock", function ()
|
||||
frame:Show()
|
||||
end
|
||||
|
||||
-- lift the range and offline fade while unlocked
|
||||
pfUI.uf:UpdateAllVisibility()
|
||||
|
||||
local txt = T["Unlock Mode allows you to move, scale and reset frames:\n\n|cff33ffcc[Left Click]|r Drag Frame\n|cff33ffcc[Middle Click]|r Reset Frame\n|cff33ffcc[Right Click]|r Option Box\n\nHold |cff33ffcc[Shift]|r to select all frames of the same kind\nHold |cff33ffcc[Ctrl]|r to select all frames of the same group\n\n|cff33ffcc[Scroll]|r to change the scale of a frame\n\n|cff33ffcc[Click]|r on an empty area or press |cff33ffcc[Esc]|r to exit\n"]
|
||||
CreateInfoBox(txt, 15, pfUI.unlock, 180)
|
||||
pfUI.gui:Hide()
|
||||
|
||||
Reference in New Issue
Block a user