Commit graph

2520 commits

Author SHA1 Message Date
Kelsi
0a6fdfb8b1 feat: add GetNumSkillLines and GetSkillLineInfo for profession addons
Implement skill line API functions that profession and tradeskill addons
need to display player skills:
- GetNumSkillLines() returns count of player skills
- GetSkillLineInfo(index) returns full 12-value tuple: name, isHeader,
  isExpanded, rank, tempPoints, modifier, maxRank, isAbandonable, etc.

Data comes from SMSG_SKILLS_INFO update fields and SkillLine.dbc names.
2026-03-21 02:18:25 -07:00
Kelsi
855f00c5b5 feat: add LibStub and CallbackHandler-1.0 for Ace3 addon compatibility
Implement LibStub — the universal library version management system that
virtually every WoW addon framework depends on (Ace3, LibDataBroker,
LibSharedMedia, etc.). Without LibStub, most popular addons fail to load.

Also implement CallbackHandler-1.0 — the standard event callback library
used by Ace3-based addons for inter-module communication. Supports
RegisterCallback, UnregisterCallback, UnregisterAllCallbacks, and Fire.

These two libraries unlock the entire Ace3 addon ecosystem.
2026-03-21 02:15:50 -07:00
Kelsi
c20db42479 feat: fire UNIT_SPELLCAST_SENT and UNIT_SPELLCAST_STOP events
Fire UNIT_SPELLCAST_SENT when the player initiates a spell cast (before
server confirms), enabling cast bar addons like Quartz to show latency.
Includes target name and spell ID as arguments.

Fire UNIT_SPELLCAST_STOP whenever a cast bar should disappear:
- On successful cast completion (SMSG_SPELL_GO)
- On cast failure (SMSG_CAST_RESULT with error)
- On spell interrupt (SMSG_SPELL_FAILURE/SMSG_SPELL_FAILED_OTHER)
- On manual cast cancel

These events are essential for cast bar replacement addons to properly
track when casts begin and end.
2026-03-21 02:10:09 -07:00
Kelsi
6e863a323a feat: add UseAction, CancelUnitBuff, and CastSpellByID Lua functions
Implement 3 critical gameplay Lua API functions:
- UseAction(slot) activates an action bar slot (spell/item), enabling
  action bar addons like Bartender/Dominos to fire abilities
- CancelUnitBuff("player", index) cancels a buff by index, enabling
  auto-cancel and buff management addons
- CastSpellByID(id) casts a spell by numeric ID, enabling macro addons
  and spell queuing systems
2026-03-21 02:03:51 -07:00
Kelsi
45850c5aa9 feat: add targeting Lua API functions for addon and macro support
Implement 8 targeting functions commonly used by unit frame addons,
targeting macros, and click-casting addons:
- TargetUnit(unitId) / ClearTarget()
- FocusUnit(unitId) / ClearFocus()
- AssistUnit(unitId) — target the given unit's target
- TargetLastTarget() — return to previous target
- TargetNearestEnemy() / TargetNearestFriend() — tab-targeting
2026-03-21 01:58:03 -07:00
Kelsi
3ae18f03a1 feat: fire UNIT_HEALTH/POWER/AURA events for party members; fix closeLoot event
Fire UNIT_HEALTH, UNIT_POWER, and UNIT_AURA events from
SMSG_PARTY_MEMBER_STATS with proper unit IDs (party1..4, raid1..40).
Previously, health/power changes for party members via the stats packet
were silent — raid frame addons never got notified.

Also fix closeLoot() not firing LOOT_CLOSED event when the loot window
is closed by the player (only handleLootReleaseResponse fired it).
2026-03-21 01:55:30 -07:00
Kelsi
00a97aae3f fix: remove Lua stubs overriding C implementations; add GameTooltip and frame factories
Fix GetScreenWidth/GetScreenHeight/GetNumLootItems/GetFramerate being
overridden by hardcoded Lua stubs that ran after the C functions were
registered. Now the real C implementations correctly take effect.

Add GameTooltip global frame with 20+ methods (SetOwner, ClearLines,
AddLine, AddDoubleLine, SetText, NumLines, GetText, SetHyperlink, etc.)
and ShoppingTooltip1/2 — critical for virtually all WoW addons.

Add frame:CreateTexture() and frame:CreateFontString() methods returning
stub objects with common API methods, enabling UI creation addons.

Add real GetFramerate() returning actual FPS from ImGui.
2026-03-21 01:52:59 -07:00
Kelsi
ce26284b90 feat: add GetCursorPosition, screen size queries, and frame positioning methods
Add global Lua API functions:
- GetCursorPosition() returns mouse x,y screen coordinates
- GetScreenWidth()/GetScreenHeight() return window dimensions

Add frame methods for UI layout:
- SetPoint, SetSize, SetWidth, SetHeight, GetWidth, GetHeight, GetCenter
- SetAlpha, GetAlpha, SetParent, GetParent

These enable UI customization addons to query cursor position, screen
dimensions, and manage frame layout — fundamental for unit frames,
action bars, and tooltip addons.
2026-03-21 01:44:59 -07:00
Kelsi
8555c80aa2 feat: add loot window Lua API for addon compatibility
Implement 6 loot-related WoW Lua API functions:
- GetNumLootItems() returns count of items in loot window
- GetLootSlotInfo(slot) returns texture, name, quantity, quality, locked
- GetLootSlotLink(slot) returns item link string
- LootSlot(slot) takes an item from loot
- CloseLoot() closes the loot window
- GetLootMethod() returns current group loot method

These pair with the LOOT_OPENED/LOOT_CLOSED events to enable loot
addons (AutoLoot, loot filters, master loot helpers).
2026-03-21 01:42:03 -07:00
Kelsi
7459f27771 feat: add targettarget, focustarget, pettarget, mouseovertarget unit IDs
Support compound unit IDs that resolve an entity's current target via
UNIT_FIELD_TARGET_LO/HI update fields. This enables addons to query
target-of-target info (e.g., UnitName("targettarget"), UnitHealth("focustarget"))
which is essential for threat meters and unit frame addons.
2026-03-21 01:37:44 -07:00
Kelsi
74125b7340 feat: fire LOOT/GOSSIP/QUEST/TRAINER addon events on window open/close
Fire the following events for addon compatibility:
- LOOT_OPENED, LOOT_CLOSED on loot window open/close
- GOSSIP_SHOW, GOSSIP_CLOSED on gossip/quest-list window open/close
- QUEST_DETAIL when quest details are shown to the player
- QUEST_COMPLETE when quest offer reward dialog opens
- TRAINER_SHOW, TRAINER_CLOSED on trainer window open/close
2026-03-21 01:35:18 -07:00
Kelsi
fe8950bd4b feat: add action bar, combo points, reaction, and connection Lua API functions
Implement 10 new WoW Lua API functions for addon compatibility:
- GetComboPoints, UnitReaction, UnitIsConnected for unit frames/raid addons
- HasAction, GetActionTexture, IsCurrentAction, IsUsableAction, GetActionCooldown
  for action bar addons (Bartender, Dominos, etc.)
- UnitMana/UnitManaMax as Classic-era aliases for UnitPower/UnitPowerMax
2026-03-21 01:31:34 -07:00
Kelsi
32a51aa93d feat: add mouseover unit ID support and fire UPDATE_MOUSEOVER_UNIT/PLAYER_FOCUS_CHANGED events
Add "mouseover" as a valid unit ID in resolveUnitGuid so Lua API functions
like UnitName("mouseover"), UnitHealth("mouseover") etc. work for addons.
Fire UPDATE_MOUSEOVER_UNIT event when the mouseover target changes, and
PLAYER_FOCUS_CHANGED event when focus is set or cleared.
2026-03-21 01:26:37 -07:00
Kelsi
22798d1c76 feat: fire MAIL_SHOW/CLOSED and AUCTION_HOUSE_SHOW/CLOSED events
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Fire MAIL_SHOW when mailbox opens (SMSG_SHOW_MAILBOX) and MAIL_CLOSED
when it closes. Fire AUCTION_HOUSE_SHOW when AH opens and AUCTION_HOUSE_CLOSED
when it closes. Used by mail addons (Postal) and AH addons (Auctionator).
2026-03-20 22:43:29 -07:00
Kelsi
395d6cdcba feat: fire BANKFRAME_OPENED and BANKFRAME_CLOSED events for bank addons
Fire BANKFRAME_OPENED when bank window opens and BANKFRAME_CLOSED when
it closes. Used by bank management addons (Bagnon, BankItems) to detect
when the player is interacting with their bank.
2026-03-20 22:32:21 -07:00
Kelsi
8cc90a69e8 feat: fire MERCHANT_SHOW and MERCHANT_CLOSED events for vendor addons
Fire MERCHANT_SHOW when vendor window opens (SMSG_LIST_INVENTORY) and
MERCHANT_CLOSED when vendor is closed. Used by vendor price addons and
auto-sell addons that need to detect vendor interaction state.
2026-03-20 22:22:36 -07:00
Kelsi
37a5b4c9d9 feat: fire ACTIONBAR_SLOT_CHANGED event on action bar updates
Fire when SMSG_ACTION_BUTTONS populates the action bar on login and when
SMSG_SUPERCEDED_SPELL upgrades spell ranks on the bar. Used by action bar
addons (Bartender, Dominos) to refresh their displays.
2026-03-20 22:13:57 -07:00
Kelsi
fc182f8653 feat: fire SKILL_LINES_CHANGED event when player skills update
Detect changes in player skill values after extractSkillFields() and fire
SKILL_LINES_CHANGED when any skill value changes. Used by profession
tracking addons and skill bar displays.
2026-03-20 21:57:27 -07:00
Kelsi
d68ef2ceb6 feat: fire CHAT_MSG_MONEY and CHAT_MSG_COMBAT_XP_GAIN events
Fire CHAT_MSG_MONEY when gold is looted (used by gold tracking addons
like MoneyFu, Titan Panel). Fire CHAT_MSG_COMBAT_XP_GAIN when XP is
earned (used by XP tracking addons and leveling speed calculators).
2026-03-20 21:47:39 -07:00
Kelsi
44d2b80998 feat: fire CHAT_MSG_LOOT event when items are looted
Fire CHAT_MSG_LOOT addon event from SMSG_ITEM_PUSH_RESULT with the loot
message text, item ID, and count. Used by loot tracking addons (AutoLootPlus,
Loot Appraiser) and damage meters that track loot distribution.
2026-03-20 21:27:04 -07:00
Kelsi
0885f885e8 feat: fire PLAYER_FLAGS_CHANGED event when player flags update
Fires when AFK/DND status, PvP flag, ghost state, or other player flags
change via PLAYER_FLAGS update field. Enables addons that track player
status changes (FlagRSP, TRP3, etc.).
2026-03-20 21:18:25 -07:00
Kelsi
3dcd489e81 feat: show random suffix names in auction owner sold/expired notifications
Parse randomPropertyId from SMSG_AUCTION_OWNER_NOTIFICATION to display
full item names in sold/bid/expired messages like "Your auction of
Gloves of the Monkey has sold!" Completes suffix resolution across
all 9 item display contexts.
2026-03-20 21:02:12 -07:00
Kelsi
9f49f543f6 feat: show random suffix names in auction outbid and expired notifications
Apply getRandomPropertyName() to SMSG_AUCTION_BIDDER_NOTIFICATION and
SMSG_AUCTION_REMOVED_NOTIFICATION so outbid/expired messages show full
item names like "You have been outbid on Leggings of the Eagle" instead
of just "Leggings". Completes suffix name resolution across all AH contexts.
2026-03-20 20:57:23 -07:00
Kelsi
df55242c50 feat: add GetCoinTextureString/GetCoinText Lua money formatting utility
Formats copper amounts into "Xg Ys Zc" strings for addon display.
GetCoinText is aliased to GetCoinTextureString. Used by money display
addons (Titan Panel, MoneyFu) and auction/vendor price formatting.
2026-03-20 20:44:59 -07:00
Kelsi
b659ab9caf feat: add GetPlayerInfoByGUID Lua API for damage meter player identification
Returns (class, englishClass, race, englishRace, sex, name, realm) for a
GUID string. Resolves player name from entity cache. Returns class/race
info for the local player. Used by Details!, Recount, and Skada to
identify players in COMBAT_LOG_EVENT_UNFILTERED data.
2026-03-20 20:22:15 -07:00
Kelsi
8be8d31b85 feat: add GetItemLink Lua API for clickable item links from item IDs
Returns WoW-format quality-colored item link for any item ID from the
item info cache. Used by loot addons, tooltip addons, and chat formatting
to create clickable item references.
2026-03-20 20:07:45 -07:00
Kelsi
6d2a94a844 feat: add GetSpellLink Lua API for clickable spell links in chat
Returns WoW-format spell link string "|cff71d5ff|Hspell:ID|h[Name]|h|r"
for a spell ID or name. Used by damage meters, chat addons, and WeakAuras
to create clickable spell references in chat messages.
2026-03-20 19:57:13 -07:00
Kelsi
bc4ff501e2 feat: show random suffix names in AH bids and seller auction tabs
Extend random property name resolution to the Bids tab and Your Auctions
(seller) tab. All three auction house tabs now display items with their
full suffix names (e.g., "Gloves of the Monkey" instead of "Gloves").
2026-03-20 19:37:17 -07:00
Kelsi
a13dfff9a1 feat: show random suffix names in auction house item listings
Append suffix name from getRandomPropertyName() to auction browse results
so items display as "Leggings of the Eagle" instead of just "Leggings"
in the auction house search table. Uses the randomPropertyId field from
the SMSG_AUCTION_LIST_RESULT packet data.
2026-03-20 19:33:01 -07:00
Kelsi
99f4ded3b5 feat: show random suffix names in loot roll popup and roll-won messages
Apply getRandomPropertyName() to SMSG_LOOT_START_ROLL and SMSG_LOOT_ROLL_WON
handlers so items with random suffixes display correctly in group loot
contexts (e.g., "Leggings of the Eagle" in the Need/Greed popup and
"Player wins Leggings of the Eagle (Need 85)" in chat).
2026-03-20 19:22:59 -07:00
Kelsi
4b3e377add feat: resolve random property/suffix names for item display
Load ItemRandomProperties.dbc and ItemRandomSuffix.dbc lazily to resolve
suffix names like "of the Eagle", "of the Monkey" etc. Add
getRandomPropertyName(id) callback on GameHandler wired through Application.
Append suffix to item names in SMSG_ITEM_PUSH_RESULT loot notifications
so items display as "Leggings of the Eagle" instead of just "Leggings".
2026-03-20 19:18:30 -07:00
Kelsi
23a7d3718c fix: return WoW-standard (start, duration, enabled) from GetSpellCooldown
Previously returned (0, remaining) which broke addons computing remaining
time as start + duration - GetTime(). Now returns (GetTime(), remaining, 1)
when on cooldown and (0, 0, 1) when off cooldown, plus the third 'enabled'
value that WoW always returns. Fixes cooldown display in OmniCC and similar.
2026-03-20 19:03:34 -07:00
Kelsi
3a4d59d584 feat: add GetXPExhaustion and GetRestState Lua APIs for rested XP tracking
GetXPExhaustion() returns rested XP pool remaining (nil if none).
GetRestState() returns 1 (normal) or 2 (rested) based on inn/city state.
Used by XP bar addons like Titan Panel and XP tracking WeakAuras.
2026-03-20 18:53:56 -07:00
Kelsi
2b99011cd8 fix: cap gossipPois_ vector growth and add soft frame rate limiter
Cap gossipPois_ at 200 entries (both gossip POI and quest POI paths) to
prevent unbounded memory growth from rapid gossip/quest queries. Add soft
240 FPS frame rate limiter when vsync is off to prevent 100% CPU usage —
sleeps for remaining frame budget when frame completes in under 4ms.
2026-03-20 18:51:05 -07:00
Kelsi
4bd237b654 feat: add IsUsableSpell Lua API for spell usability checks
Returns (usable, noMana) tuple. Checks if the spell is known and not on
cooldown. Accepts spell ID or name. Used by action bar addons and
WeakAuras for conditional spell display (greyed out when unusable).
2026-03-20 18:42:33 -07:00
Kelsi
ce128990d2 feat: add IsInInstance, GetInstanceInfo, and GetInstanceDifficulty Lua APIs
IsInInstance() returns whether player is in an instance and the type.
GetInstanceInfo() returns map name, instance type, difficulty index/name,
and max players. GetInstanceDifficulty() returns 1-based difficulty index.
Critical for raid/dungeon addons like DBM for instance detection.
2026-03-20 18:33:44 -07:00
Kelsi
2a9a7fe04e feat: add UnitClassification Lua API for nameplate and boss mod addons
Returns WoW-standard classification strings: "normal", "elite", "rareelite",
"worldboss", or "rare" based on creature rank from CreatureCache. Used by
nameplate addons (Plater, TidyPlates) and boss mods (DBM) to detect elite/
boss/rare mobs for special handling.
2026-03-20 18:25:39 -07:00
Kelsi
180990b9f1 feat: play minimap ping sound when party members ping the map
Add playMinimapPing() to UiSoundManager with MapPing.wav (falls back to
target select sound). Play the ping sound in MSG_MINIMAP_PING handler
when the sender is not the local player. Provides audio feedback for
party member map pings, matching WoW behavior.
2026-03-20 18:21:34 -07:00
Kelsi
f03ed8551b feat: add GetGameTime, GetServerTime, UnitXP, and UnitXPMax Lua APIs
GetGameTime() returns server game hours and minutes from the day/night
cycle. GetServerTime() returns Unix timestamp. UnitXP("player") and
UnitXPMax("player") return current and next-level XP values. Used by
XP tracking addons and time-based conditionals.
2026-03-20 18:16:12 -07:00
Kelsi
71837ade19 feat: show zone name on loading screen during world transitions
Add setZoneName() to LoadingScreen and display the map name from Map.dbc
as large gold text with drop shadow above the progress bar. Shown in both
render() and renderOverlay() paths. Zone name is resolved from gameHandler's
getMapName(mapId) during world load. Improves feedback during zone transitions.
2026-03-20 18:12:23 -07:00
Kelsi
ff1840415e fix: invoke despawn callbacks on disconnect to prevent renderer leaks
Mirror the zone-transition cleanup in disconnect(): fire despawn callbacks
for all entities before clearing the entity manager. Prevents M2 instances
and character models from leaking when the player disconnects and reconnects
quickly (e.g., server kick, network recovery).
2026-03-20 18:07:00 -07:00
Kelsi
922177abe0 fix: invoke despawn callbacks during zone transitions to release renderer resources
handleNewWorld() previously called entityManager.clear() directly without
notifying the renderer, leaving stale M2 instances and character models
allocated. Now iterates all entities and fires creatureDespawnCallback,
playerDespawnCallback, and gameObjectDespawnCallback before clearing.
Also clears player caches (visible items, cast states, aura cache,
combat text) to prevent state leaking between zones.
2026-03-20 18:05:09 -07:00
Kelsi
1d7eaaf2a0 fix: compute aura expirationTime for addon countdown timers
The expirationTime field (7th return value of UnitBuff/UnitDebuff/UnitAura)
was hardcoded to 0. Now returns GetTime() + remaining seconds, matching
WoW's convention where addons compute remaining = expirationTime - GetTime().
Enables buff/debuff timer addons like OmniCC and WeakAuras.
2026-03-20 18:00:57 -07:00
Kelsi
5adb9370d2 fix: return caster unit ID from UnitBuff/UnitDebuff/UnitAura
The caster field (8th return value) was always nil. Now returns the
caster's unit ID ("player", "target", "focus", "pet") or hex GUID
string for other units. Enables addons to identify who applied a
buff/debuff for filtering and tracking purposes.
2026-03-20 17:58:53 -07:00
Kelsi
ffe16f5cf2 feat: add equipment slot Lua API for gear inspection addons
Add GetInventoryItemLink(unit, slotId), GetInventoryItemID(unit, slotId),
and GetInventoryItemTexture(unit, slotId) for WoW inventory slots 1-19
(Head through Tabard). Returns quality-colored item links with WoW format.
Enables gear inspection and item level calculation addons.
2026-03-20 17:56:20 -07:00
Kelsi
3f0b152fe9 fix: return debuff type string from UnitBuff/UnitDebuff/UnitAura
The debuffType field (5th return value) was always nil. Now resolves
dispel type from Spell.dbc via getSpellDispelType(): returns "Magic",
"Curse", "Disease", or "Poison" for debuffs. Enables dispel-focused
addons like Decursive and Grid to detect debuff categories.
2026-03-20 17:53:01 -07:00
Kelsi
7c5bec50ef fix: increase world packet size limit from 16KB to 32KB
The 0x4000 (16384) limit was too conservative and could disconnect the
client when the server sends large packets such as SMSG_GUILD_ROSTER
with 500+ members (~30KB) or SMSG_AUCTION_LIST with many results.
Increase to 0x8000 (32768) which covers all normal gameplay while still
protecting against framing desync from encryption errors.
2026-03-20 17:49:49 -07:00
Kelsi
f712d3de94 feat: add quest log Lua API for quest tracking addons
Add GetNumQuestLogEntries(), GetQuestLogTitle(index), GetQuestLogQuestText(index),
and IsQuestComplete(questID). GetQuestLogTitle returns WoW-compatible 8 values
including title, isComplete flag, and questID. Enables quest tracking addons
like Questie and QuestHelper to access the player's quest log.
2026-03-20 17:37:35 -07:00
Kelsi
ee59c37b83 feat: add loot method change notifications and CRITERIA_UPDATE event
Show "Loot method changed to Master Looter/Round Robin/etc." in chat when
group loot method changes via SMSG_GROUP_LIST. Fire CRITERIA_UPDATE addon
event with criteria ID and progress when achievement criteria progress
changes, enabling achievement tracking addons.
2026-03-20 17:33:34 -07:00
Kelsi
c44e1bde0a feat: fire UPDATE_FACTION, QUEST_ACCEPTED, and QUEST_LOG_UPDATE events
Fire UPDATE_FACTION when reputation standings change (SMSG_SET_FACTION_STANDING).
Fire QUEST_ACCEPTED with quest ID when a new quest is added to the log.
Fire QUEST_LOG_UPDATE on both quest acceptance and quest completion.
Enables reputation tracking and quest log addons.
2026-03-20 17:28:28 -07:00