Commit Graph

245 Commits

Author SHA1 Message Date
brues-code ed06968fa3 C_NamePlate (#1)
* nameplates: drive discovery + GUID lookup via C_NamePlate

ClassicAPI now provides the modern C_NamePlate API and the matching
NAME_PLATE_CREATED / NAME_PLATE_UNIT_ADDED / NAME_PLATE_UNIT_REMOVED
events. Replace the WorldFrame:GetChildren polling + manual GUID
dictionary with event-driven plumbing.

- Drop the per-tick WorldFrame:GetNumChildren / GetChildren scan
- Delete IsNamePlate() border-texture filter (events only deliver
  nameplate frames)
- Delete the guidRegistry table + its OnShow/OnUpdate maintenance;
  every lookup now goes through C_NamePlate.GetNamePlateForGUID
- Move per-GUID cache cleanup (debuffCache / threatMemory /
  combatColorCache / libdebuff_casts) from the OnUpdate visibility
  scan to a NAME_PLATE_UNIT_REMOVED handler — fires exactly once
  per unit going out of range
- NAME_PLATE_CREATED drives nameplates.OnCreate; NAME_PLATE_UNIT_ADDED
  sets cachedGuid and drives nameplates.OnShow (so OnCreate no longer
  calls OnShow directly and no longer HookScripts the parent)
- visiblePlateCount uses table.getn(C_NamePlate.GetNamePlates())

Net -64 lines, with a meaningful reduction in per-tick CPU (no more
WorldFrame child iteration + region/texture filter every 50ms).

* nameplates: switch UNIT_ADDED/REMOVED handlers to nameplateN tokens

ClassicAPI's NAME_PLATE_UNIT_ADDED / _REMOVED events now ship the
"nameplateN" unit token as arg1 (matching modern WoW) instead of the
GUID string.

- UNIT_ADDED: resolve plate via C_NamePlate.GetNamePlateForUnit(arg1);
  derive the cache-key GUID via UnitGUID(arg1)
- UNIT_REMOVED: same lookup pattern; compute UnitGUID(arg1) inside the
  handler before the slot recycles (per docs guarantee)

The other six GetNamePlateForGUID call sites (libdebuff aura callbacks,
UNIT_FLAGS_GUID, PLAYER_TARGET_CHANGED, combo-point handler, castbar
frame) stay on the GUID flavor — they receive real GUIDs from other
event paths.

---------

Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
2026-05-27 00:40:31 -05:00
Brues 710be52f35 phase 3 removing tbc
Drop the now-vestigial expansion plumbing.

- Delete modules/thirdparty-tbc.lua + its xml Include
- Strip 10 tbc-tagged CreateConfig calls in modules/gui.lua
- Drop the expansion arg from CreateConfig() signature + the disabled-
  entry rendering path that depended on it
- Drop the showdisabled GUI toggle + its default
- Simplify pfUI:RegisterModule / pfUI:RegisterSkin to (name, func) only
- Strip the leading version arg ("vanilla:tbc", etc.) from all 114
  Register call sites
- Delete the pfUI.expansion variable
2026-05-25 18:50:53 -05:00
Brues ba566cdd53 phase 2 removing tbc
Strip dead pfUI.client > 11200 and pfUI.expansion == "tbc" branches now
that vanilla is the only supported client.

- pfUI.lua: hardcode expansion = "vanilla"; collapse force_region matrix
- compat/vanilla.lua, libs/{libcast,libdebuff,libtotem,libunitscan,
  focus}: drop always-false early-returns
- api/unitframes.lua: delete TargetBuffOnUpdate poller + tbc visibility
  and secure-template branches; click-cast keeps only vanilla path
- api/ui-widgets.lua: unconditional EffectiveScale divide
- env/tables.lua: drop unused focus/focustarget pfValidUnits entries
- modules/actionbar.lua: simplify EnablePaging, drop ButtonSwitch/
  petvisibility, unwrap prowl block, single keybind-remap path
- modules/{castbar,chat,cooldown,loot,questitem,totems}: unwrap
  always-true conditionals
- modules/nameplates.lua: cfg-only fake-cooldown gate, unwrap overlap/
  clickthrough + mouselook blocks
- modules/friends.lua + skins/blizzard/friends.lua: maxtab = 4
- skins/blizzard/{help,game_menu,questlog}: drop tbc-only branches
2026-05-25 18:40:17 -05:00
Brues 1d27f7bed3 class color cleanup 2026-05-23 02:56:00 -05:00
Brues b18e6ffa67 refresh buff durations on player 2026-05-21 02:35:46 -05:00
Meow 6fb45b3971 nameplate fixes
- fixed raidicon to bug out if nameplates for specific unit types are hidden
- fixed raidicon to NOT be behind the nameplate when nameplates are shown
2026-04-04 00:28:11 +02:00
Meow d1692288f4 raid icon fix 2026-04-03 01:15:25 +02:00
Meow a0e3fbb00d taking over nameplates.lua from experiment branch 2026-04-02 06:07:50 +02:00
Meow 22968b6c23 added back throttle control for players in pfui 2026-04-02 04:55:29 +02:00
Meow 136aca02c5 Performance update for nameplates: optimize update loop, combat detection and debuff rendering
- Decouple OnValueChanged from OnDataChanged to prevent expensive
  full updates on every HP tick

- Replace UnitAffectingCombat(guid) with GetUnitField(flags) bitcheck
  and add 0.2s per-GUID throttle cache for GetCombatStateColor

- Gate HP bar SetMinMaxValues/SetValue and text formatting behind
  hp/hpmax change detection

- Inline castbar update into per-plate OnUpdate loop, remove dedicated
  castbarFrame overhead

- Switch debuff slot cache from name-keyed to slot-index-keyed to fix
  timer reset bug when debuffs shift after expiry

- Add raidGuidCache (rebuilt on RAID_ROSTER_UPDATE/PARTY_MEMBERS_CHANGED)
  for O(1) offtank target-name lookup

- Add UNIT_FLAGS_GUID event support for instant combat flag notification
  (Nampower)

- Extract RebuildOfftanks() to ensure offtanks table is populated at
  startup, not only on config change

- Reuse childs table across scan ticks to reduce GC pressure

- Add zoominstant config option to skip zoom animation

- Add combatColorCache cleanup on plate hide and combat leave

Please report any bugs that appear after this change, since it is a huge change.
2026-04-02 04:15:18 +02:00
Meow aa2cb95ec2 Several changes
Fix stale debuff icons/tooltips on target frame after target swap
Fix debuffs not showing on nameplates for timer-less spells (e.g. Hurricane)
Fix buffwatch timer visually speeding up when another debuff fades
Remove 50ms aura cache (slotMapCache/auraFC) - caused stale debuff data
Remove "Show Only Own Debuffs" from unitframes and nameplates GUI
Force selfdebuff=0 for unitframes/nameplates on login to reset old SavedVariables
2026-03-31 19:51:36 +02:00
Meow 88c8968158 Adjusted raidicons to be in FRONT of the health bar, not behind it 2026-03-31 02:52:00 +02:00
Meow 491fcd51c8 New option to pick Original or pfui raid marks! 2026-03-31 02:20:53 +02:00
Meow 91590b5025 Changed the raid icons to use the original Blizzard icons! 2026-03-31 01:43:05 +02:00
Meow 77f50fbf9b possible fix for timers vanishing on nameplates. 2026-03-30 16:20:42 +02:00
Meow c1c9b4b55e fixed castbar being not smooth for some rare case players on nameplates 2026-03-29 01:30:47 +01:00
Meow f43b7c7342 changed nameplate castbars to look more smooth 2026-03-26 13:30:48 +01:00
acid9000 637970bd66 Update nameplates.lua - raid icons always visible
<img width="660" height="441" alt="20260323 raid icon persist example" src="https://github.com/user-attachments/assets/095243fe-9904-4cf5-b210-4857aaa945ec" />


Changing parent from nameplate.health to plate allows raid icons to be shown even when nameplate health bar isn't shown. 

Particularly useful if you have friendly nameplate healthbars disabled and friendlies have raid marks (e.g. tanks, marked player to stack on, etc)
2026-03-24 15:41:17 -04:00
Meow c04d795704 possible fix for nameplate debuffs not showing up 2026-03-23 12:57:38 +01:00
Meow 2ef9c5ee1e Refactor nameplate cast tracking to be fully GUID-based
Problem:
Since a recent Turtle-WoW update, nameplates would show the same castbar on all mobs sharing a name (e.g. multiple "Defias Rogue Wizard"). Additionally, a targeted mob that was not casting would incorrectly display the castbar of a nearby mob with the same name.

Changes:
**`modules/nameplates.lua`**
- Removed `hasNampower` version-sniffing entirely. Nampower is a hard requirement for pfUI; all related guards have been removed and the code runs unconditionally.
- Castbar lookup now always uses `nameplate.cachedGuid` directly — never `GetUnitGUID("target")` or a unit name string.
- Removed dead fallback block using `UnitCastingInfo("target")`.
- Restored fallback via `pfGetCastInfo(cachedGuid)` / `pfGetChannelInfo(cachedGuid)` (see libcast changes below) for casts not tracked by libdebuff (e.g. already-in-progress casts on login).

**`libs/libcast.lua`**
- Renamed `UnitCastingInfo` → `pfGetCastInfo` and `UnitChannelInfo` → `pfGetChannelInfo` to avoid confusion with the Blizzard API of the same name, which does not exist in Vanilla.
- Name-based fallback lookup (`libcast.db[unitName]`) is now skipped when a GUID is available. This prevents cast bleed between mobs that share a name.

**`libs/libpredict.lua`, `modules/castbar.lua`, `modules/afkcam.lua`**
- Updated all call sites to use the renamed `pfGetCastInfo` / `pfGetChannelInfo`.
2026-03-23 10:47:42 +01:00
Meow cd4a3343cb Revert "this should fix no-target mobs casting with the same name"
This reverts commit 35ec17d9a0.
2026-03-22 17:07:52 +01:00
Meow 35ec17d9a0 this should fix no-target mobs casting with the same name 2026-03-22 17:06:18 +01:00
Meow 68ff49be24 fixed castbar for channeling units 2026-03-22 10:38:53 +01:00
Meow aced71a75f full control over castbar nameplate throttle 2026-03-22 01:29:10 +01:00
Meow f6d0cf7ba1 added a 100fps throttle for nameplates internally 2026-03-21 13:31:01 +01:00
Meow a7bfff5d33 Added new throttle option for nameplate castbar 2026-03-21 08:05:45 +01:00
Meow 4fb4035f0c fixed a rare case where debuffs not been shown for nameplates 2026-03-04 03:02:26 +01:00
Meow 3922d9879e fixed typos and cleaned up comments 2026-03-02 19:13:45 +01:00
Meow c7aca0de99 GUID replacements
* Replace all `local _, guid = UnitExists(unit)` with `GetUnitGUID(unit)` (Nampower 3.0.0+)
* Bump minimum required Nampower version to 3.0.0
2026-03-02 10:41:49 +01:00
Meow cfbc1644fe removed superwow checkups, not required anymore
removed superwow checkups, not required anymore
2026-02-28 21:47:19 +01:00
Meow bd36d91189 added option to show debuffs only for enemys OR friendly nameplates
added option to show debuffs only for enemys OR friendly nameplates
2026-02-28 21:32:17 +01:00
Meow 988dfc7079 fix for nameplates and castbars
Removed SuperWoW dependency from castbar and nameplate cast detection. Cast interrupts (sidestep, spell failed) now correctly stop the castbar by setting event = "FAIL" / event = "CAST" on the libdebuff cache entry instead of nil-ing it — preventing stale local references from keeping the castbar alive. UnitCastingInfo fallback is retained for non-Nampower environments but no longer overrides Nampower cast state.
2026-02-28 10:18:30 +01:00
Meow 236a2fce6c perf/fix: port experimental optimizations + focus rework + raidmarkers
Performance optimizations ported from experimental:
- libdebuff: replace 5s startup timer with next-frame defer
- libdebuff: use arg6 auraSlot directly (Nampower 2.29+) instead of GetDebuffSlotMap lookup
- libdebuff: invalidate slotMapCache on PLAYER_TARGET_CHANGED
- nameplates: detect Nampower 2.27.2+ for GUID-based nameplate lookup

Raidmarkers module ported from experimental:
- added raidmarkers.lua
- added config defaults and GUI section
- registered in modules.xml

focus.lua rework:
- removed CastSpellByNameNoQueue (Nampower's CastSpellByName now supports unit tokens/GUIDs natively)
- /focus Name: TargetByName with correct previous target restore + ClearTarget() fallback
- /focus Name: prefix match via SlashCmdList.TARGET when exact match fails
- suppress UI_ERROR_MESSAGE during targeting attempts

swingtimer fixes:
- non-Hunter ranged bar now fills left->right like MH/OH
- fix 1px artifact on Hunter bar center by using Hide() instead of SetWidth(0.1)
2026-02-22 19:08:37 +01:00
Meow 7165be5636 fix for nameplates sometimes not showing casttimes of mobs
fix for nameplates sometimes not showing casttimes of mobs
2026-02-18 13:37:40 +01:00
Meow 68c2b2d1dc nameplates alpha fix
nameplates alpha fix
2026-02-08 14:17:47 +01:00
Meow 37beca7103 New throttling menu
New throttling menu
2026-02-06 08:07:33 +01:00
Meow 54355c9019 enhanced merge into master
Final release!
2026-02-04 22:48:30 +01:00
Meow df550cf9e2 nameplate animation
- If debuff animation timer is loaded it loads "COOLDOWN_FRAME_TYPE" (more heave for performance)
- If  debuff animation disabled it loads normal frames for the timer display.
2026-01-29 06:17:06 +01:00
Meow 7c91ccf360 small update
Please read the readme to see what has been changed.
2026-01-27 07:32:16 +01:00
Meow 7898895cf4 timer animation fix
timer animation fix
2026-01-24 02:33:17 +01:00
Meow 8af8809ada new nameplate feature
new nameplate feature
2026-01-21 20:58:38 +01:00
Meow 7ba168f7da nameplates performance fix
nameplates performance fix
2026-01-19 03:40:53 +01:00
Meow 56fe278285 removed duplicate
removed duplcate queue update on visual target update
2026-01-14 18:10:33 +01:00
Meow 5408270324 nameplate level update
fixed nameplates with same names taking their levelfrom a database. Level is taken from database only if "??"
2026-01-14 08:46:00 +01:00
Meow cade338791 - Nameplate fix
- Fixed Inactive Nameplate Alpha not working properly.
2026-01-14 02:36:31 +01:00
Meow b1540c4b4c tick.time adjustments
tick.time adjustments
2026-01-11 00:09:08 +01:00
Meow 10a1def220 4 possibles fixes.
1. Healpredict working properly together with Healcomm users.
2. Hots duration timers shared across all pfui users in the raid/group
3. Fix for nameplates vibrating when zoom is activve.
2026-01-10 00:37:23 +01:00
Meow 56d4e95868 Fix for bug report #6
- Fixes castbar not showing up properly when "ZOOM factor" in nameplates is activated.
- Possible fix for nampower error appearing.
2026-01-09 18:38:43 +01:00
Meow 7598dce76d Nameplate updates
- An other nameplate improvement, should improve FPS with lots of nameplates close.
2026-01-09 00:20:35 +01:00
Meow e83ff80538 Version 6.1.1 - Chat & Nameplate Level Fixes
Bugfixes:
- Fixed targeting high-level players overwriting known level with -1
- Chat now shows "??" instead of -1 for unknown levels
- Nameplates now use stored level from database after reload
- Nameplate level color now uses difficulty color when loaded from DB

Config Changes:
- Chat player level display now disabled by default
2026-01-08 19:02:02 +01:00