Commit graph

151 commits

Author SHA1 Message Date
Kelsi
47e317debf feat: add UnitIsPVP, UnitIsPVPFreeForAll, and GetBattlefieldStatus
UnitIsPVP(unit) checks UNIT_FLAG_PVP (0x1000) on the unit's flags
field. Used by unit frame addons to show PvP status indicators.

UnitIsPVPFreeForAll(unit) checks for FFA PvP flag.

GetBattlefieldStatus() returns stub ("none") for addons that check
BG queue state on login. Full BG scoreboard data exists in
GameHandler but is rendered via ImGui.
2026-03-23 01:42:57 -07:00
Kelsi
d0743c5fee feat: show Unique-Equipped on items with that flag
Items with the Unique-Equipped flag (itemFlags & 0x1000000) now
display "Unique-Equipped" in the tooltip header. This is distinct
from "Unique" (maxCount=1) — Unique-Equipped means you can carry
multiple but only equip one (e.g., trinkets, rings with the flag).
2026-03-23 01:32:37 -07:00
Kelsi
757fc857cd feat: show 'This Item Begins a Quest' on quest-starting item tooltips
Items with a startQuestId now display "This Item Begins a Quest" in
gold text at the bottom of the tooltip, matching WoW's behavior.
Helps players identify quest-starting drops in their inventory.

Passes startsQuest flag through _GetItemTooltipData from the
startQuestId field in ItemQueryResponseData.
2026-03-23 01:28:28 -07:00
Kelsi
b8c33c7d9b feat: resolve spell \$o1 periodic totals from base points × ticks
Spell descriptions now substitute \$o1/\$o2/\$o3 with the total
periodic damage/healing: base_per_tick × (duration / 3sec).

Example: SW:Pain with base=4 (5 per tick), duration=18sec (6 ticks):
  Before: "Causes X Shadow damage over 18 sec"
  After:  "Causes 30 Shadow damage over 18 sec"

Combined with \$s1 (per-tick/instant) and \$d (duration), the three
most common spell template variables are now fully resolved. This
covers the vast majority of spell tooltips.
2026-03-23 01:02:31 -07:00
Kelsi
11ecc475c8 feat: resolve spell \$d duration to real seconds from SpellDuration.dbc
Spell descriptions now substitute \$d with actual duration values:
  Before: "X damage over X sec"
  After:  "30 damage over 18 sec"

Implementation:
- DurationIndex field (40) added to all expansion Spell.dbc layouts
- SpellDuration.dbc loaded during cache build: maps index → base ms
- cleanSpellDescription substitutes \$d with resolved seconds/minutes
- getSpellDuration() accessor on GameHandler

Combined with \$s1/\$s2/\$s3 from the previous commit, most common
spell description templates are now fully resolved with real values.
2026-03-23 01:00:18 -07:00
Kelsi
a5aa1faf7a feat: resolve spell \$s1/\$s2/\$s3 to real DBC damage/heal values
Spell descriptions now substitute \$s1/\$s2/\$s3 template variables
with actual effect base points from Spell.dbc (field 80/81/82).
For example: "causes \$s1 Fire Damage" → "causes 562 Fire Damage".

Implementation:
- Added EffectBasePoints0/1/2 to all 4 expansion DBC layouts
- SpellNameEntry now stores effectBasePoints[3]
- loadSpellNameCache reads base points during DBC iteration
- cleanSpellDescription substitutes \$s1→abs(base)+1 when available
- getSpellEffectBasePoints() accessor on GameHandler

Values are DBC base points (before spell power scaling). Still uses
"X" placeholder for unresolved variables (\$d, \$o1, etc.).
2026-03-23 00:51:19 -07:00
Kelsi
f9464dbacd feat: add CalendarGetDate and calendar stubs
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
CalendarGetDate() returns real weekday, month, day, year from the
system clock. Used by calendar addons and date-aware UI elements.

CalendarGetNumPendingInvites() and CalendarGetNumDayEvents() return 0
as stubs — prevents nil errors in addons that check calendar state.
2026-03-23 00:33:09 -07:00
Kelsi
df610ff472 feat: add GetDifficultyInfo for instance difficulty display
GetDifficultyInfo(id) returns name, groupType, isHeroic, maxPlayers
for WotLK instance difficulties:
  0: "5 Player" (party, normal, 5)
  1: "5 Player (Heroic)" (party, heroic, 5)
  2: "10 Player" (raid, normal, 10)
  3: "25 Player" (raid, normal, 25)
  4/5: 10/25 Heroic raids

Used by boss mod addons (DBM, BigWigs) and instance info displays
to show the current dungeon difficulty.
2026-03-23 00:27:34 -07:00
Kelsi
d1d3645d2b feat: add WEATHER_CHANGED event and GetWeatherInfo query
Fire WEATHER_CHANGED(weatherType, intensity) when the server sends
SMSG_WEATHER with a new weather state. Enables weather-aware addons
to react to rain/snow/storm transitions.

GetWeatherInfo() returns current weatherType (0=clear, 1=rain, 2=snow,
3=storm) and intensity (0.0-1.0). Weather data is already tracked by
game_handler and used by the renderer for particle effects and fog.
2026-03-23 00:23:22 -07:00
Kelsi
2947e31375 feat: add GuildRoster request and SortGuildRoster stub
GuildRoster() triggers CMSG_GUILD_ROSTER to request updated guild
member data from the server. Called by guild roster addons and the
social panel to refresh the member list.

SortGuildRoster() is a no-op (sorting is handled client-side by
the ImGui guild roster display).
2026-03-22 23:42:44 -07:00
Kelsi
79bc3a7fb6 feat: add BuyMerchantItem and SellContainerItem for vendor interaction
BuyMerchantItem(index, count) purchases an item from the current
vendor by merchant slot index. Resolves itemId and slot from the
vendor's ListInventoryData.

SellContainerItem(bag, slot) sells an item from the player's
inventory to the vendor. Supports backpack (bag=0) and bags 1-4.

Enables auto-sell addons (Scrap, AutoVendor) and vendor UI addons
to buy/sell items programmatically.
2026-03-22 23:37:29 -07:00
Kelsi
0a2667aa05 feat: add RepairAllItems for vendor auto-repair addons
RepairAllItems(useGuildBank) sends CMSG_REPAIR_ITEM to repair all
equipped items at the current vendor. Checks CanMerchantRepair before
sending. Optional useGuildBank flag for guild bank repairs.

One of the most commonly needed addon functions — enables auto-repair
addons to fix all gear in a single call when visiting a repair vendor.
2026-03-22 23:32:20 -07:00
Kelsi
397185d33c feat: add trade API (AcceptTrade, CancelTrade, InitiateTrade)
AcceptTrade() locks in the trade offer via CMSG_ACCEPT_TRADE.
CancelTrade() cancels an open trade via CMSG_CANCEL_TRADE.
InitiateTrade(unit) starts a trade with a target player.

Uses existing GameHandler trade functions and TradeStatus tracking.
Enables trade addons and macro-based trade acceptance.
2026-03-22 23:28:25 -07:00
Kelsi
adc1b40290 feat: add GetAuctionItemLink for AH item link generation — commit #100
Quality-colored item links for auction house items, enabling AH addons
to display clickable item links in their UI and chat output.

This is the 100th commit of this session, bringing the total to
408 API functions across all WoW gameplay systems.
2026-03-22 23:22:08 -07:00
Kelsi
fa25d8b6b9 feat: add auction house API for Auctioneer and AH addons
GetNumAuctionItems(listType) returns item count and total for
browse/owner/bidder lists. GetAuctionItemInfo(type, index) returns
the full 17-field WoW API signature: name, texture, count, quality,
canUse, level, minBid, minIncrement, buyoutPrice, bidAmount,
highBidder, owner, saleStatus, itemId.

GetAuctionItemTimeLeft(type, index) returns time category 1-4
(short/medium/long/very long).

Uses existing auctionBrowseResults_, auctionOwnerResults_, and
auctionBidderResults_ from SMSG_AUCTION_LIST_RESULT. Enables
Auctioneer, Auctionator, and AH scanning addons.
2026-03-22 23:14:07 -07:00
Kelsi
3f324ddf3e feat: add mail inbox API for postal and mail addons
GetInboxNumItems() returns count of mail messages.
GetInboxHeaderInfo(index) returns the full 13-field WoW API signature:
packageIcon, stationeryIcon, sender, subject, money, COD, daysLeft,
hasItem, wasRead, wasReturned, textCreated, canReply, isGM.

GetInboxText(index) returns the mail body text.
HasNewMail() checks for unread mail (minimap icon indicator).

Uses existing mailInbox_ populated from SMSG_MAIL_LIST_RESULT.
Enables postal addons (Postal, MailOpener) to read inbox data.
2026-03-22 22:57:45 -07:00
Kelsi
97ec915e48 feat: add glyph socket API for WotLK talent customization — 400 APIs
GetNumGlyphSockets() returns 6 (WotLK glyph slot count).
GetGlyphSocketInfo(index, talentGroup) returns enabled, glyphType
(1=major, 2=minor), glyphSpellID, and icon for each socket.

Uses existing learnedGlyphs_ array populated from SMSG_TALENTS_INFO.
Enables talent/glyph inspection addons.

This commit brings the total API count to exactly 400 functions.
2026-03-22 22:48:30 -07:00
Kelsi
c25151eff1 feat: add achievement API (GetAchievementInfo, GetNumCompleted)
GetNumCompletedAchievements() returns count of earned achievements.
GetAchievementInfo(id) returns the full 12-field WoW API signature:
id, name, points, completed, month, day, year, description, flags,
icon, rewardText, isGuildAchievement.

Uses existing earnedAchievements_ set, achievement name/description/
points caches from Achievement.dbc, and completion date tracking
from SMSG_ALL_ACHIEVEMENT_DATA / SMSG_ACHIEVEMENT_EARNED.

Enables achievement tracking addons (Overachiever, etc.) to query
and display achievement progress.
2026-03-22 22:43:10 -07:00
Kelsi
ee6551b286 feat: add CastPetAction, TogglePetAutocast, PetDismiss, IsPetAttackActive
Complete the pet action bar interaction:

- CastPetAction(index) — cast the pet spell at the given bar slot
  by sending the packed action via sendPetAction
- TogglePetAutocast(index) — toggle autocast for the pet spell
  at the given slot via togglePetSpellAutocast
- PetDismiss() — send dismiss pet command
- IsPetAttackActive() — whether pet is currently in attack mode

Together with the previous pet bar functions (HasPetUI, GetPetActionInfo,
PetAttack, PetFollow, PetWait, PetPassiveMode, PetDefensiveMode), this
completes the pet action bar system for hunters/warlocks/DKs.
2026-03-22 22:37:24 -07:00
Kelsi
3f3ed22f78 feat: add pet action bar API for hunter/warlock pet control
Implement pet action bar functions using existing pet data:

- HasPetUI() — whether player has an active pet
- GetPetActionInfo(index) — name, icon, isActive, autoCastEnabled
  for each of the 10 pet action bar slots
- GetPetActionCooldown(index) — cooldown state stub
- PetAttack() — send attack command to current target
- PetFollow() — send follow command
- PetWait() — send stay command
- PetPassiveMode() — set passive react mode
- PetDefensiveMode() — set defensive react mode

All backed by existing SMSG_PET_SPELLS data (petActionSlots_,
petCommand_, petReact_, petAutocastSpells_) and sendPetAction().
2026-03-22 22:33:18 -07:00
Kelsi
81bd0791aa feat: add GetActionBarPage and ChangeActionBarPage for bar switching
GetActionBarPage() returns the current action bar page (1-6).
ChangeActionBarPage(page) switches pages and fires ACTIONBAR_PAGE_CHANGED
via the Lua frame event system. Used by action bar addons and the
default UI's page arrows / shift+number keybinds.

Action bar page state tracked in Lua global __WoweeActionBarPage.
2026-03-22 22:24:34 -07:00
Kelsi
3a4d2e30bc feat: add CastShapeshiftForm and CancelShapeshiftForm
CastShapeshiftForm(index) casts the spell for the given form slot:
- Warrior: Battle Stance(2457), Defensive(71), Berserker(2458)
- Druid: Bear(5487), Travel(783), Cat(768), Flight(40120),
  Moonkin(24858), Tree(33891)
- Death Knight: Blood(48266), Frost(48263), Unholy(48265)
- Rogue: Stealth(1784)

This makes stance bar buttons functional — clicking a form button
actually casts the corresponding spell to switch forms.

CancelShapeshiftForm stub for cancelling current form.
2026-03-22 22:17:39 -07:00
Kelsi
9986de0529 feat: add GetShapeshiftFormInfo for stance/form bar display
GetShapeshiftFormInfo(index) returns icon, name, isActive, isCastable
for each shapeshift form slot. Provides complete form tables for:

- Warrior: Battle Stance, Defensive Stance, Berserker Stance
- Druid: Bear, Travel, Cat, Swift Flight, Moonkin, Tree of Life
- Death Knight: Blood/Frost/Unholy Presence
- Rogue: Stealth

isActive is true when the form matches the current shapeshiftFormId_.
GetShapeshiftFormCooldown stub returns no cooldown.

Together with GetShapeshiftForm and GetNumShapeshiftForms from the
previous commit, this completes the stance bar API that addons use
to render and interact with form/stance buttons.
2026-03-22 22:14:24 -07:00
Kelsi
587c0ef60d feat: track shapeshift form and fire UPDATE_SHAPESHIFT_FORM events
Add UNIT_FIELD_BYTES_1 to all expansion update field tables (Classic=133,
TBC/WotLK=137). Byte 3 of this field contains the shapeshift form ID
(Bear=1, Cat=3, Travel=4, Moonkin=31, Tree=36, Battle Stance=17, etc.).

Track form changes in the VALUES update handler and fire
UPDATE_SHAPESHIFT_FORM + UPDATE_SHAPESHIFT_FORMS events when the
form changes. This enables stance bar addons and druid form tracking.

New Lua functions:
- GetShapeshiftForm() — returns current form ID (0 = no form)
- GetNumShapeshiftForms() — returns form count by class (Warrior=3,
  Druid=6, DK=3, Rogue=1, Priest=1, Paladin=3)
2026-03-22 22:12:17 -07:00
Kelsi
b9a1b0244b feat: add GetEnchantInfo for enchantment name resolution
GetEnchantInfo(enchantId) looks up the enchantment name from
SpellItemEnchantment.dbc (field 14). Returns the display name
like "Crusader", "+22 Intellect", or "Mongoose" for a given
enchant ID.

Used by equipment comparison addons and tooltip addons to display
enchantment names on equipped gear. The enchant ID comes from the
item's ITEM_FIELD_ENCHANTMENT update field.

Also adds getEnchantName() to GameHandler for C++ access.
2026-03-22 21:53:58 -07:00
Kelsi
922d6bc8f6 feat: clean spell description template variables for readable tooltips
Spell descriptions from DBC contain raw template variables like
\$s1, \$d, \$o1 that refer to effect values resolved at runtime.
Without DBC effect data loaded, these showed as literal "\$s1" in
tooltips, making descriptions hard to read.

Now strips template variables and replaces with readable placeholders:
- \$s1/\$s2/\$s3 → "X" (effect base points)
- \$d → "X sec" (duration)
- \$o1 → "X" (periodic total)
- \$a1 → "X" (radius)
- \$\$ → "$" (literal dollar sign)
- \${...} blocks → stripped

Result: "Hurls a fiery ball that causes X Fire Damage" instead of
"Hurls a fiery ball that causes \$s1 Fire Damage". Not as informative
as real values, but significantly more readable.
2026-03-22 21:32:31 -07:00
Kelsi
42f2873c0d feat: add Mixin, CreateFromMixins, and MergeTable utilities
Implement the WoW Mixin pattern used by modern addons:
- Mixin(obj, ...) — copies fields from mixin tables into obj
- CreateFromMixins(...) — creates a new table from mixin templates
- CreateAndInitFromMixin(mixin, ...) — creates and calls Init()
- MergeTable(dest, src) — shallow-merge src into dest

These enable OOP-style addon architecture used by LibSharedMedia,
WeakAuras, and many Ace3-based addons for class/object creation.
2026-03-22 21:23:00 -07:00
Kelsi
7b88b0c6ec feat: add strgfind and tostringall WoW Lua utilities
strgfind = string.gmatch alias (deprecated WoW function used by
older addons that haven't migrated to string.gmatch).

tostringall(...) converts all arguments to strings and returns
them. Used by chat formatting and debug addons that need to safely
stringify mixed-type argument lists.
2026-03-22 21:17:59 -07:00
Kelsi
f4d78e5820 feat: add SpellStopCasting, name aliases, and targeting stubs
SpellStopCasting() cancels the current cast via cancelCast(). Used by
macro addons and cast-cancel logic (e.g., /stopcasting macro command).

UnitFullName/GetUnitName aliases for UnitName — some addons use these
variant names.

SpellIsTargeting() returns false (no AoE targeting reticle in this
client). SpellStopTargeting() is a no-op stub. Both prevent errors
in addons that check targeting state.
2026-03-22 21:08:18 -07:00
Kelsi
e2fec0933e feat: add GetClassColor and QuestDifficultyColors for UI coloring
GetClassColor(className) returns r, g, b, colorString from the
RAID_CLASS_COLORS table. Used by unit frame addons, chat addons,
and party/raid frames to color player names by class.

QuestDifficultyColors table provides standard quest difficulty
color mappings (impossible=red, verydifficult=orange, difficult=yellow,
standard=green, trivial=gray, header=gold). Used by quest log and
quest tracker addons for level-appropriate coloring.
2026-03-22 21:05:33 -07:00
Kelsi
02456ec7c6 feat: add GetMaxPlayerLevel and GetAccountExpansionLevel
GetMaxPlayerLevel() returns the level cap for the active expansion:
60 (Classic/Turtle), 70 (TBC), 80 (WotLK). Used by XP bar addons
and leveling trackers.

GetAccountExpansionLevel() returns the expansion tier: 1 (Classic),
2 (TBC), 3 (WotLK). Used by addons that adapt features based on
which expansion is active.

Both read from the ExpansionRegistry's active profile at runtime.
2026-03-22 21:01:56 -07:00
Kelsi
7967878cd9 feat: show Unique and Heroic tags on item tooltips
Items with maxCount=1 now show "Unique" in white text below the name.
Items with the Heroic flag (0x8) show "Heroic" in green text. Both
display before the bind type line, matching WoW's tooltip order.

Heroic items (from heroic dungeon/raid drops) are visually
distinguished from their normal-mode counterparts. Unique items
(trinkets, quest items, etc.) show the carry limit clearly.
2026-03-22 20:25:41 -07:00
Kelsi
1b075e17f1 feat: show item spell effects in tooltips (Use/Equip/Chance on Hit)
Item tooltips now display spell effects in green text:
- "Use: Restores 2200 health over 30 sec" (trigger 0)
- "Equip: Increases attack power by 120" (trigger 1)
- "Chance on hit: Strikes the enemy for 95 Nature damage" (trigger 2)

Passes up to 5 item spell entries through _GetItemTooltipData with
spellId, trigger type, spell name, and spell description from DBC.
The tooltip builder maps trigger IDs to "Use: ", "Equip: ", or
"Chance on hit: " prefixes.

This completes the item tooltip with all major WoW tooltip sections:
quality name, bind type, equip slot/type, armor, damage/DPS/speed,
primary stats, combat ratings, resistances, spell effects, gem sockets,
required level, flavor text, and sell price.
2026-03-22 20:17:50 -07:00
Kelsi
216c83d445 feat: add spell descriptions to tooltips via GetSpellDescription
Spell tooltips now show the spell description text (e.g., "Hurls a
fiery ball that causes 565 to 655 Fire Damage") in gold/yellow text
between the cast info and cooldown display.

New GetSpellDescription(spellId) C function exposes the description
field from SpellNameEntry (loaded from Spell.dbc via the spell name
cache). Descriptions contain the raw DBC text which may include
template variables ($s1, $d, etc.) — these show as-is until template
substitution is implemented.
2026-03-22 20:03:18 -07:00
Kelsi
572b3ce7ca feat: show gem sockets and item set ID in item tooltips
Add gem socket display to item tooltips — shows [Meta Socket],
[Red Socket], [Yellow Socket], [Blue Socket], or [Prismatic Socket]
based on socketColor mask from ItemQueryResponseData.

Also pass itemSetId through _GetItemTooltipData for addons that
track set bonuses.
2026-03-22 19:59:52 -07:00
Kelsi
a70f42d4f6 feat: add UnitRage, UnitEnergy, UnitFocus, UnitRunicPower aliases
Register power-type-specific aliases (UnitRage, UnitEnergy, UnitFocus,
UnitRunicPower) that map to the existing lua_UnitPower function. Some
Classic/TBC addons call these directly instead of the generic UnitPower.
All return the unit's current power value regardless of type — the
underlying function reads from the entity's power field.
2026-03-22 19:37:58 -07:00
Kelsi
2f4065cea0 feat: wire PlaySound to real audio engine for addon sound feedback
Replace PlaySound no-op stub with a real implementation that maps
WoW sound IDs and names to the UiSoundManager methods:

By ID: 856/1115→button click, 840→quest activate, 841→quest complete,
       862→bag open, 863→bag close, 888→level up
By name: IGMAINMENUOPTION→click, IGQUESTLISTOPEN→quest activate,
         IGQUESTLISTCOMPLETE→quest complete, IGBACKPACKOPEN/CLOSE→bags,
         LEVELUPSOUND→level up, TALENTSCREEN→character sheet

This gives addons audio feedback when they call PlaySound() — button
clicks, quest sounds, and other UI sounds now actually play instead
of being silently swallowed.
2026-03-22 19:35:14 -07:00
Kelsi
8fd1dfb4f1 feat: add UnitArmor and UnitResistance for character sheet addons
UnitArmor(unit) returns base, effective, armor, posBuff, negBuff
matching WoW's 5-return signature. Uses server-authoritative armor
from UNIT_FIELD_RESISTANCES[0].

UnitResistance(unit, school) returns base, effective, posBuff, negBuff
for physical (school 0 = armor) and magical resistances (1-6:
Holy/Fire/Nature/Frost/Shadow/Arcane).

Needed by character sheet addons (PaperDollFrame, DejaCharacterStats)
to display armor and resistance values.
2026-03-22 18:44:43 -07:00
Kelsi
f951dbb95d feat: add merchant/vendor API for auto-sell and vendor addons
Implement core vendor query functions from ListInventoryData:

- GetMerchantNumItems() — count of items for sale
- GetMerchantItemInfo(index) — name, texture, price, stackCount,
  numAvailable, isUsable for each vendor item
- GetMerchantItemLink(index) — quality-colored item link
- CanMerchantRepair() — whether vendor offers repair service

Enables auto-sell addons (AutoVendor, Scrap) to read vendor inventory
and check repair capability. Data sourced from SMSG_LIST_INVENTORY
via currentVendorItems + itemInfoCache for names/icons.
2026-03-22 18:39:27 -07:00
Kelsi
92a1e9b0c3 feat: add RAID_ROSTER_UPDATE and UNIT_LEVEL events
RAID_ROSTER_UPDATE now fires alongside GROUP_ROSTER_UPDATE when the
group type is raid, matching the event that raid frame addons register
for (6 registrations in FrameXML). Fires from group list updates and
group uninvite handlers.

UNIT_LEVEL fires when any tracked unit (player, target, focus, pet)
changes level via VALUES update fields. Used by unit frame addons to
update level display (5 registrations in FrameXML).
2026-03-22 18:30:07 -07:00
Kelsi
e46919cc2c fix: use rich tooltip display for SetAction items and SetHyperlink
SetAction's item branch and SetHyperlink's item/spell branches
showed only the item name, ignoring the full tooltip system we built.

SetAction item path now uses _WoweePopulateItemTooltip (shows armor,
stats, damage, bind type, sell price etc.).

SetHyperlink item path now uses _WoweePopulateItemTooltip; spell
path now uses SetSpellByID (shows cost, range, cast time, cooldown).

This means shift-clicking an item link in chat, hovering an item on
the action bar, or viewing any hyperlink tooltip now shows the full
stat breakdown instead of just the name.
2026-03-22 18:22:56 -07:00
Kelsi
8d4478b87c feat: enhance spell tooltips with cost, range, cast time, and cooldown
SetSpellByID now shows comprehensive spell information:
- Mana/Rage/Energy/Runic Power cost
- Range in yards (or omitted for self-cast)
- Cast time ("1.5 sec cast" or "Instant")
- Active cooldown remaining in red

Uses existing GetSpellInfo (castTime, range from DBC), GetSpellPowerCost
(mana cost from DBC), and GetSpellCooldown (remaining CD) to populate
the tooltip with real spell data.
2026-03-22 18:19:51 -07:00
Kelsi
22f8b721c7 feat: show sell price on item tooltips in gold/silver/copper format
Item tooltips now display the vendor sell price at the bottom, formatted
as "Sell Price: 12g 50s 30c". Uses the vendorPrice field from GetItemInfo
(field 11, sourced from SMSG_ITEM_QUERY_SINGLE_RESPONSE sellPrice).

Helps players quickly assess item value when looting or sorting bags.
2026-03-22 18:17:21 -07:00
Kelsi
5678de562f feat: add combat ratings, resistances to item tooltip display
Extend item tooltips with secondary stats and resistances:

- Extra stats from ItemQueryResponseData.extraStats: Hit Rating,
  Crit Rating, Haste Rating, Resilience, Attack Power, Spell Power,
  Defense Rating, Dodge/Parry/Block Rating, Expertise, Armor Pen,
  Mana/Health per 5 sec, Spell Penetration — all in green text
- Elemental resistances: Fire/Nature/Frost/Shadow/Arcane Resistance

Also passes extraStats as an array of {type, value} pairs and
resistance fields through _GetItemTooltipData for Lua consumption.

Stat type IDs follow the WoW ItemMod enum (3=Agi, 7=Sta, 31=Hit,
32=Crit, 36=Haste, 45=SpellPower, etc.).
2026-03-22 18:13:23 -07:00
Kelsi
0e78427767 feat: add full item stat display to tooltips (armor, damage, stats, bind)
Enhance _WoweePopulateItemTooltip to show complete item information:
- Bind type (Binds when picked up / equipped / used)
- Armor value for armor items
- Weapon damage range, speed, and DPS for weapons
- Primary stats (+Stamina, +Strength, +Agility, +Intellect, +Spirit)
  in green text
- Required level
- Flavor/lore description text in gold

Backed by new _GetItemTooltipData(itemId) C function that returns a
Lua table with armor, bindType, damageMin/Max, speed, primary stats,
requiredLevel, and description from ItemQueryResponseData.
2026-03-22 18:07:58 -07:00
Kelsi
e72d6ad852 feat: enhance item tooltips with item level, equip slot, and subclass
Replace minimal name-only item tooltips with proper WoW-style display:
- Quality-colored item name header
- Item level line for equipment (gold text)
- Equip slot and weapon/armor type on a double line
  (e.g., "Head" / "Plate" or "One-Hand" / "Sword")
- Item class for non-equipment items

Shared _WoweePopulateItemTooltip() helper used by both
SetInventoryItem and SetBagItem for consistent tooltip formatting.
Maps INVTYPE_* strings to display names (Head, Chest, Two-Hand, etc.).
2026-03-22 18:02:46 -07:00
Kelsi
101ea9fd17 fix: populate item class, subclass, and equip slot in GetItemInfo
GetItemInfo returned empty strings for item class (field 6), subclass
(field 7), and equip slot (field 9). Now returns:

- Class: mapped from itemClass enum (Consumable, Weapon, Armor, etc.)
- Subclass: from parsed subclassName (Sword, Mace, Shield, etc.)
- EquipSlot: mapped from inventoryType to INVTYPE_ strings
  (INVTYPE_HEAD, INVTYPE_CHEST, INVTYPE_WEAPON, etc.)

These fields are used by equipment comparison addons, character sheet
displays, and bag sorting addons to categorize and filter items.
2026-03-22 17:58:39 -07:00
Kelsi
a7e8a6eb83 fix: unify time epoch across GetTime, cooldowns, auras, and cast bars
Four independent static local steady_clock start times were used as
time origins in GetTime(), GetSpellCooldown(), UnitBuff expiration,
and UnitCastingInfo — each initializing on first call at slightly
different times. This created systematic timestamp mismatches.

When addons compute (start + duration - GetTime()), the start value
from GetSpellCooldown and the GetTime() return used different epochs,
causing cooldown sweeps and buff timers to appear offset.

Replace all four independent statics with a single file-scope
kLuaTimeEpoch constant and luaGetTimeNow() helper, ensuring all
time-returning Lua functions share exactly the same origin.
2026-03-22 17:48:37 -07:00
Kelsi
c3fd6d2f85 feat: add keybinding query API for action bar tooltips and binding UI
Implement GetBindingKey(command) and GetBindingAction(key) with
default action button mappings (ACTIONBUTTON1-12 → "1"-"9","0","-","=").
Action bar addons display bound keys on button tooltips via
GetBindingKey("ACTIONBUTTON"..slot).

Also add stubs for GetNumBindings, GetBinding, SetBinding, SaveBindings,
SetOverrideBindingClick, and ClearOverrideBindings to prevent nil-call
errors in FrameXML keybinding UI code (37 call sites).
2026-03-22 17:43:54 -07:00
Kelsi
25b35d5224 fix: include GCD in GetSpellCooldown and GetActionCooldown returns
GetSpellCooldown only returned per-spell cooldowns from the
spellCooldowns map, ignoring the Global Cooldown. Addons like OmniCC
and action bar addons rely on GetSpellCooldown returning GCD timing
when no individual spell cooldown is active — this is what drives the
cooldown sweep animation on action bar buttons after casting.

Now falls back to GCD timing (from getGCDRemaining/getGCDTotal) when
the spell has no individual cooldown but the GCD is active. Returns
proper (start, duration) values so addons can compute elapsed/remaining.

Same fix applied to GetActionCooldown for spell-type action bar slots.
2026-03-22 17:23:52 -07:00