Accumulate lifetimeTotal on every positive PLAYER_MONEY delta and persist to SavedVariables so it survives /reload and Reset. Display a 'Lifetime: Xg Ys Zc' label on the HUD frame. Also fix missing closing 'end' in SlashCmdList closure.
2.1 KiB
Executable File
2.1 KiB
Executable File
SessionGoldTracker — Project Notes
Spec
A small, movable HUD frame for WoW Forever beta (interface 16001, Midnight-era retail API).
What it does
- Tracks gold earned in the current play session (positive deltas only — spending does not count against the total).
- Displays: session gold earned, gold per hour rate, and time elapsed since session start or last reset.
- Provides a reset button on the frame that zeroes the session counters.
- Provides a
/gtslash command:/gttoggles the frame,/gt resetresets the session counters. - Saves frame position (point, x, y) and lifetime total gold earned across sessions via SavedVariables.
- Does NOT act on items, mail, trades, the auction house, or any unit data.
What it does NOT do
- No combat log parsing.
- No item selling, deleting, or using.
- No auction house or mail interaction.
- No unit-targeted API calls.
Target
| Key | Value |
|---|---|
| Game | WoW Forever (beta) |
| Interface | 16001 |
| TOC suffix | _Camelot |
| API style | Midnight-era retail (C_* namespaces where they exist) |
| SavedVariables | SessionGoldTrackerDB |
File Layout
Build Order
Each step should be independently testable in game before moving on.
- Skeleton: TOC files, empty Lua, SavedVariables declared, no errors on load. ✅ DONE
- DB init:
PLAYER_LOGINhandler, default DB, log starting gold to chat withprint(). Verify money is a number. ✅ DONE - Money tracking: Register
PLAYER_MONEY, compute delta, accumulatesessionGross. Log each delta. ✅ DONE - Frame: Movable frame with labels for earned gold and per-hour rate. No drag yet. ✅ DONE
- Drag and save position: Drag support + save point on
OnDragStop+ restore on login. - Reset button: On-frame button that zeroes session counters and resets
sessionStart. - Slash command:
/gttoggle,/gt resetwired to the same reset logic. ✅ DONE - Lifetime total: Accumulate
lifetimeTotalon every positivePLAYER_MONEYdelta (robust against Reset), persist to SavedVariables. ✅ DONE - Polish: Format display cleanly, add a tooltip, test across a /reload.