Files
SessionGoldTracker/NOTES.md
T
bepis f7e32111f1 feat: add lifetime total tracking (step 8)
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.
2026-10-19 21:28:51 +11:00

49 lines
2.1 KiB
Markdown
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 `/gt` slash command: `/gt` toggles the frame, `/gt reset` resets 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.
1. **Skeleton:** TOC files, empty Lua, SavedVariables declared, no errors on load. ✅ DONE
2. **DB init:** `PLAYER_LOGIN` handler, default DB, log starting gold to chat with `print()`. Verify money is a number. ✅ DONE
3. **Money tracking:** Register `PLAYER_MONEY`, compute delta, accumulate `sessionGross`. Log each delta. ✅ DONE
4. **Frame:** Movable frame with labels for earned gold and per-hour rate. No drag yet. ✅ DONE
5. **Drag and save position:** Drag support + save point on `OnDragStop` + restore on login.
6. **Reset button:** On-frame button that zeroes session counters and resets `sessionStart`.
7. **Slash command:** `/gt` toggle, `/gt reset` wired to the same reset logic. ✅ DONE
8. **Lifetime total:** Accumulate `lifetimeTotal` on every positive `PLAYER_MONEY` delta (robust against Reset), persist to SavedVariables. ✅ DONE
9. **Polish:** Format display cleanly, add a tooltip, test across a /reload.