183 Commits

Author SHA1 Message Date
Brues a3ff20782d Use table.wipe and table.insert for tables
Replace custom wipe implementation with a call to table.wipe in api/api.lua and update its doc comment to explain behavior (resets Lua 5.0 length via luaL_setn, advises using table.insert). Replace manual table.getn(t)+1 array appends with table.insert in modules/loot.lua (two sites). Makes table operations safer and more idiomatic, avoiding manual metatable handling and getn-based append idioms.
2026-07-20 21:16:12 -05:00
Brues e28a7e5606 Optimize isempty function using next() 2026-07-20 18:46:09 -05:00
Brues 1c0c9dc019 Replace librange's position scan with ClassicAPI's UnitInRange
librange was a per-frame position scanner: it swept party/raid unit
tokens, cached each one's distance via UnitPosition, and answered range
queries from that cache. All of it existed only because 1.12 had no cheap
way to check an arbitrary unit's distance. ClassicAPI's UnitInRange does
exactly that C-side (fixed 40y healing range, position miss reported via
the second return), so the whole library collapses to a direct call.

Wins from dropping the cache:
- No staleness. The scanner's zone-death and roster-reindex bugs simply
  can't exist without a cache to go stale, so this supersedes the
  keep-alive fixes from 756e8840.
- All classes get target-frame range fading. The old target path faked a
  40y check via IsActionInRange on a healing spell found on the action
  bar, so classes without such a spell (GetRangeSlot returned nil) never
  had a working target range check.

The rangecheck == "0" master switch used to be enforced by hiding the
scanner; with no scanner, move that gate into pfUI.api.UnitInRange so
disabling the check still means nothing fades. Threshold is now 40y (the
ClassicAPI constant) rather than the old 45y. Drop the now-dead
rangechecki (Range Check Interval) setting, its GUI row, and migration.
2026-07-20 16:54:27 -05:00
Brues 801935130e Update GetItemLinkByName to use C_Item API
Replace vanilla GetItemInfo and manual link construction with C_Item.GetItemNameByID and C_Item.GetItemInfo
2026-07-20 15:11:50 -05:00
Brues 8cdced5ec0 Simplify modf function
Delegate to ClassicAPI
2026-07-20 15:10:31 -05:00
Brues 13a08b0ea3 Restore hooksecurefunc 2026-07-09 23:01:52 -05:00
Brues a2177fbf49 Restore HookScript 2026-07-09 22:55:26 -05:00
Brues 9cd83e90ad Added GetNoNameObject debugging 2026-07-09 22:31:58 -05:00
Brues 59ce6d9e74 Use a single shared frame for HookAddonOrVariable
Every HookAddonOrVariable call created its own lurker frame with three
event registrations. Share one frame across all hooks: they accumulate
in a pending list the single OnEvent handler walks, firing and dropping
each whose addon/variable is available, and unregistering events once the
list empties.

Behavior is preserved and slightly hardened: foundConfig now persists on
the shared frame (set on VARIABLES_LOADED and PLAYER_ENTERING_WORLD, both
of which imply config is ready), so a hook registered after config load
fires immediately if its addon is already loaded rather than waiting for
the next event.
2026-07-09 17:54:09 -05:00
Brues 967487e283 Utilizing ClassicAPI 1.6.0
commit d63057474083aa67fda2aa28ee6301334ffc4fdf
Author: Brues <5278969+brues-code@users.noreply.github.com>
Date:   Mon Jul 6 00:59:17 2026 -0500

    Use C_Map.GetMapOverlays instead of hardcoded pfMapOverlayData

    ClassicAPI's C_Map.GetMapOverlays reads WorldMapOverlay.dbc directly and
    returns the full overlay list for a zone (explored + unexplored) — the
    data vanilla's GetMapOverlayInfo withholds. mapreveal now iterates it
    straight (named fields: textureName/texturePath/width/height/offsets),
    dropping unpack_hash and the pfMapOverlayData tables entirely.

    Also fixes the explored-check: it compared the full texture path against
    GetMapOverlayInfo's bare-name keys, so the magnifying glass never
    suppressed on explored overlays. Now matches on the bare name.

    Removes ~870 lines of hand-measured overlay data (base + Turtle).

commit ad12c8209a80cd1211fe08e83f7013d24b5efd2d
Author: Brues <5278969+brues-code@users.noreply.github.com>
Date:   Sun Jul 5 23:45:09 2026 -0500

    utilize HookScript from ClassicAPI
2026-07-09 00:56:06 -05:00
Brues 31c95606d0 Refactor turtle/Nampower checks and libdebuff cleanup
Replace ad-hoc Turtle/Nampower detection with global TURTLE_WOW_VERSION and EventUtil startup flow. Remove legacy IsTurtleWoW and manual PLAYER_ENTERING_WORLD frame; use EventUtil.ContinueOnPlayerLogin. Clean up libdebuff by removing combo-point capture, GetEnhancedDebuffs API, and noisy startup messages; rely on Nampower/AURA_CAST and database fallback for durations. Fix tooltip compare shift handling (cache shift state and pass through). Update xpbar to use TURTLE_WOW_VERSION. Purpose: simplify startup, avoid duplicated logic, and rely on modern APIs for accurate durations.
2026-07-05 23:47:39 -05:00
Brues 439d5a397a eqcompare: numeric InventoryType lookup, drop bagtypes/itemtypes locales
Both sub-tables carried per-locale strings only so pfUI's own code could
match against localized text. ClassicAPI's numeric item APIs replace
both:

- GetBagFamily now reads classID/subClassID from C_Item.GetItemInfoInstant
  and switches on the numbers (class 1 = Container, class 11 = Quiver).
- eqcompare pulls the itemID from GameTooltip:GetItem(), fetches the
  numeric invType via C_Item.GetItemInventoryTypeByID, and looks up the
  destination slot(s) in a numeric slotTable keyed by Enum.InventoryType.
  Pair-slot invtypes (finger / trinket / one-hand weapon) list both
  destinations directly, so the "_other" string-concat hack is gone.

Removes the setglobal INVTYPE_* injection, the tooltip text scan, and
the itemtypes + bagtypes locale sub-tables across all 7 files.
2026-07-01 15:43:03 -05:00
Brues 28de6fd835 finish UnitInRaid("player") → IsInRaid() sweep
Four more sites: GetUnbuffedRoster + SendChatMessageWide in api.lua,
the loot menu's inRaid local, and the raid module's early-return
guard. Same intent, named helper.
2026-06-27 18:57:21 -05:00
Brues d6951b386e unitframes/buffwatch/libpredict: route aura reads through C_UnitAuras
ClassicAPI's recent C_UnitAuras additions (sourceUnit / sourceGUID /
non-player expirationTime / the PLAYER filter token) finally cover
everything libdebuff:UnitDebuff and :UnitOwnDebuff were doing — caster
attribution, accurate timing for non-player units, and the own-debuffs
filter. Migrating the remaining callers off the libdebuff readers.

- api/unitframes.lua: collapses the debuff render path's three-branch
  if/else into a single C_UnitAuras.GetAuraDataByIndex with a HARMFUL
  or HARMFUL|PLAYER filter selected by the selfdebuff config; tooltip
  slot-finders match by sourceGUID instead of libdebuff's caster flag;
  custom-debuff indicator scan unifies the same way.
- modules/buffwatch.lua: GetBuffData drops the libdebuff fallback;
  tooltip slot-finder mirrors the unitframes pattern.
- libs/libpredict.lua: drops the orphaned UnitHasBuff slot-loop (no
  callers left).
- api/api.lua: pfUI.api.UnitHasBuff tightens from a HELPFUL iteration
  to a single GetAuraDataBySpellName lookup.

Each site that builds a cooldown ring from expirationTime carries the
talent-extension guard — when expirationTime exceeds the dbc base
duration (e.g. Shadow Affinity → SW:P), clamp start to now and use the
remaining time as the effective duration so CooldownFrame_SetTimer
doesn't get a future start it treats as "not yet begun".
2026-06-24 22:41:13 -05:00
Brues ed5ecb1f93 character: durability % per inventory slot
Adds a Fizzle-style durability label to each character pane slot.
Renders at the bottom of the slot icon as "N%" colored by the existing
DURABILITY_THRESHOLD_COLORS table (red < orange < yellow < invasion <
green), or hidden when the item has no durability stat (necks, rings,
trinkets) or the slot is empty.

api/api.lua: new pfUI.api.CreateFontString(f, key, layer, size, flags,
font) helper following the CreateBackdrop pattern — idempotent
get-or-create that attaches the FontString to the parent frame as the
named field. Defaults to pfUI.font_default at C.global.font_size with
OUTLINE on the OVERLAY layer.

skins/blizzard/character.lua: scoreText migrated from the inline
"if not frame.scoreText then ..." block to the new helper as a working
example; new durabilityText created the same way at BOTTOM/size 10.
Durability render added to RefreshCharacterSlot — runs on every
PaperDollItemSlotButton_Update so equip/unequip/repair/damage all
refresh automatically.

api/config.lua + modules/gui.lua: new C.character.inventory.durability
toggle (default "1"). GUI lives under a new top-level "Character" tab
→ "Inventory" sub-tab, leaving room for future "Reputation" / "Skills"
sub-tabs at the same level.
2026-05-29 18:31:58 -05:00
Brues 1fd7895ca7 move away from RAID_CLASS_COLORS dependency 2026-05-28 13:06:00 -05:00
Brues b99f650694 Cap rested xp at 113% on turtle wow 2026-05-27 23:11:44 -05:00
Brues 58609b8c5c phase 1 removing tbc 2026-05-25 18:16:02 -05:00
Brues 1d27f7bed3 class color cleanup 2026-05-23 02:56:00 -05:00
Brues 8e635afeed GetItemCount via C_Item, reagents via C_Spell.GetSpellReagents
Drops the legacy pfUI.api.GetItemCount wrapper (name-based bag walk +
GetItemInfo per slot) entirely — both call sites switch to direct
C_Item.GetItemCount(itemID) calls.

actionbar reagent counter: drops the SPELL_REAGENTS tooltip-scan +
libtipscan dependency. UpdateSlot now does GetActionInfo(slot) →
spellID → C_Spell.GetSpellReagents → reagent itemID, stored per slot.
Counts update via C_Item.GetItemCount(itemID). reagent_counts is
keyed by itemID instead of localized name string. Multi-reagent
spells now resolve cleanly (only first reagent counted, matching old
single-name behavior). Macro and bag-item actions skip cleanly.

questitem: switches to hooksecurefunc("SetItemRef", ...) + the
modern GameTooltip:HasItem / :GetItem pair instead of monkey-patching
_G.SetItemRef and string.find-parsing the "item:NNN" out of the link.
Drops the libtooltip indirection for the regular tooltip path —
GameTooltip:GetItem returns name + itemID directly. AddTooltip
extended to accept the itemID (both callers already had it and were
discarding it).
2026-05-21 16:20:19 -05:00
Brues 82743b0f9a UnitAUra cleanup 2026-05-18 23:42:51 -05:00
Brues 67146ef3a4 begin utilizing ClassicAPI 2026-05-16 13:02:38 -05:00
Meow 9128f02133 Add fill order option for actionbars
- "Row-first" fills buttons left-to-right, top-to-bottom (1,2,3 / 4,5,6)
- "Column-first" fills top-to-bottom, left-to-right (1,3,5 / 2,4,6)
- "Auto" preserves the original behavior based on uneven orientation
2026-04-10 16:33:06 +02:00
Meow 5f9e69933f Revert "Added a fillmode variant to actionbars"
This reverts commit 0838c6ec3a.
2026-04-10 15:26:18 +02:00
Meow 0838c6ec3a Added a fillmode variant to actionbars 2026-04-10 15:24:39 +02:00
Meow 9b97414beb small fix for actionbars to allign properly on uneven numbers. 2026-04-09 20:34:11 +02:00
Meow 7dcac8104f hotfix
use useUiScale CVar to calculate pixel perfect borders
2026-04-01 11:46:57 +02:00
Meow df532862b6 added some nil checks for api.lua 2026-03-31 04:29:39 +02:00
Meow 3ecc52e4cc Revert "Fix for bar layout+alternatives+uneven orientation" 2026-03-30 18:53:48 +02:00
Player-Doite 9e9688072d Fix for bar layout+alternatives+uneven orientation
Fix for bar layout+alternatives+uneven orientation
2026-03-26 19:43:06 +01:00
Player-Doite c29b69d469 Added and fixed form layout+ uneven orientation
Stance/Form/Aura bar layout fix (before wrong), plus support for uneven rows.
2026-03-26 19:06:25 +01:00
Meow 1402818e62 added missing nil check for api.lua 2026-03-20 23:15:14 +01:00
Meow 313f01f191 fixed a rare NaN lua error 2026-03-11 05:14:35 +01:00
Meow fa7e4f8b40 Range Check: UnitXP mode
Added Range Check Mode dropdown (Vanilla / UnitXP) and UnitXP Range Threshold input field under the 40y-Range Check settings in the GUI
In UnitXP mode, UnitInRange bypasses librange entirely and queries UnitXP("distanceBetween") directly with the configured yard threshold
librange scan loop is disabled when UnitXP mode is active — no TargetUnit cycling, no spellbook scanning, no combat interruption
Fixed UnitInRange referencing librange as an undefined local instead of pfUI.api.librange, which caused silent nil returns
2026-03-04 02:27:11 +01:00
Meow def000a7c4 Refactoring: Nampower Integration & SuperWoW Cleanup
* Replaced SuperWoW GUID with native Turtle WoW GUID in focus system
* Added memoization API for `/pfcast` and `/castfocus` performance boost
* Moved Druid mana bar from superwow.lua to nampower.lua
* Cleaned up superwow.lua - removed duplicate/migrated code
* Updated GUI: "Druid Settings" replaces "SuperWoW Settings" header
* Focus system now standalone - no SuperWoW dependency required
2026-02-16 14:20:31 +01:00
Meow 54355c9019 enhanced merge into master
Final release!
2026-02-04 22:48:30 +01:00
Meow 34f5c3eb02 Version 6.1.0 - Raid/Party Frame Fixes
Bugfixes:
- Fixed 40-yard range check not working for raid/party frames
- Fixed aggro indicator not displaying properly on raid/party frames
- Improved aggro cache to only cache positive results for instant detection
- Fixed HP/Mana not updating with "Use Raid Frames for group" enabled
- Added SuperWoW nil-check for SpellInfo
- Added missing events: PARTY_MEMBER_ENABLE, PARTY_MEMBER_DISABLE, PLAYER_UPDATE_RESTING

UI Improvements:
- Share/Hoverbind buttons now show warning when module is disabled
2026-01-08 12:25:18 +01:00
Meow 5d0e195d1e performance update
performance update
2026-01-03 12:58:31 +01:00
shagu 6e9f1d6b89 api: ignore and skip invalid frame anchors 2025-07-08 21:49:10 +02:00
shagu 3c44018726 api: always write capture index cache 2025-07-07 15:27:12 +02:00
shagu 099c7e1982 api: reduce frame shadow offsets 2025-06-05 22:16:42 +02:00
shagu 8b91fb4ccc api: put custom border onto default backdrop 2025-06-05 22:16:00 +02:00
shagu 48eaf7e875 ui-widgets: increase frame level of blizz borders 2025-06-05 19:29:45 +02:00
shagu 5790ef71b6 api: cache color values for time strings 2024-05-14 08:29:28 +02:00
shagu c6766eeca1 api: set both backdrop border colors in blizz mode 2024-01-06 01:42:43 +01:00
shagu 17ebeb7dc9 api: add function to determine empty tables 2023-11-03 15:10:42 +01:00
shagu ffdbb63110 api: reuse several string variables in cmatch 2023-10-03 13:21:42 +02:00
shagu cea8e750d2 api: make sure anchor exists before aligning to it 2023-02-28 19:09:04 +01:00
shagu 3d9547c340 api: update time string comments 2022-07-02 14:29:14 +02:00
shagu 1bd358eb13 api: use correct combat events for autohide 2022-06-14 19:16:01 +02:00