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.
This commit is contained in:
bepis
2026-10-19 21:28:51 +11:00
parent 9a30efa170
commit f7e32111f1
3 changed files with 128 additions and 12 deletions
Regular → Executable
+69 -7
View File
@@ -7,15 +7,14 @@
- [x] 2. DB init
- [x] 3. Money tracking
- [x] 4. Frame
- [x] 5. Drag and save position
- [x] 6. Reset button
- [x] 7. Slash command
- [x] 8. Lifetime total
## In Progress
- [ ] 5. Drag and save position
## Pending
- [ ] 6. Reset button
- [ ] 7. Slash command
- [ ] 8. Lifetime total
- [ ] 9. Polish
@@ -25,9 +24,8 @@
|---|---|---|
| `GetMoney()` | PlayerScriptDocumentation.lua | ✅ VERIFIED |
| `GetTime()` | SystemTimeDocumentation.lua | ✅ VERIFIED |
| `MONEY_DISPLAY_UPDATING` | — | ❌ NOT FOUND (unverified) |
| `PLAYER_LOGIN` | SystemDocumentation.lua | ✅ VERIFIED |
| `PLAYER_MONEY` | CurrencyInfoDocumentation.lua | ✅ VERIFIED |
| `PLAYER_LOGIN` | SystemDocumentation.lua | ✅ VERIFIED |
| `PLAYER_LOGOUT` | SystemDocumentation.lua | ✅ VERIFIED |
| `CreateFrame` | FrameAPI docs | ✅ VERIFIED |
| `frame:SetMovable(true)` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
@@ -38,9 +36,13 @@
| `frame:GetPoint()` | SimpleScriptRegionResizingAPIDocumentation.lua | ✅ VERIFIED |
| `frame:SetPoint()` | SimpleScriptRegionResizingAPIDocumentation.lua | ✅ VERIFIED |
| `frame:SetClampedToScreen(true)` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `frame:IsShown()` | SimpleScriptRegionAPIDocumentation.lua | ✅ VERIFIED |
| `frame:Show()` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `frame:Hide()` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `SlashCmdList` / `SLASH_GT1` | SlashCommandsRegistry.lua.annotated.lua | ✅ VERIFIED |
| `GetMoneyString()` | QuestInfo.lua, MerchantFrame.lua, etc. | ✅ VERIFIED |
| `SecondsToTime()` | SharedBasicControls.lua, Blizzard_TimeManager.lua | ✅ VERIFIED |
| `UIPanelButtonTemplate` | Blizzard_UIPanelTemplates.lua | ✅ VERIFIED (standard template) |
## Design Decisions
@@ -52,3 +54,63 @@
## Known Issues
(None yet)
# SessionGoldTracker — STATUS.md
## Completed Steps
- [x] 1. Skeleton
- [x] 2. DB init
- [x] 3. Money tracking
- [x] 4. Frame
- [x] 5. Drag and save position
- [x] 6. Reset button
- [x] 7. Slash command
## In Progress
## Pending
- [ ] 8. Lifetime total
- [ ] 9. Polish
## API Verification Status
| API | Source | Verified? |
|---|---|---|
| `GetMoney()` | PlayerScriptDocumentation.lua | ✅ VERIFIED |
| `GetTime()` | SystemTimeDocumentation.lua | ✅ VERIFIED |
| `PLAYER_MONEY` | CurrencyInfoDocumentation.lua | ✅ VERIFIED |
| `PLAYER_LOGIN` | SystemDocumentation.lua | ✅ VERIFIED |
| `PLAYER_LOGOUT` | SystemDocumentation.lua | ✅ VERIFIED |
| `CreateFrame` | FrameAPI docs | ✅ VERIFIED |
| `frame:SetMovable(true)` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `frame:EnableMouse(true)` | SimpleScriptRegionAPIDocumentation.lua | ✅ VERIFIED |
| `frame:RegisterForDrag("LeftButton")` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `frame:SetScript("OnDragStart", ...)` | Frame scripts | ✅ VERIFIED |
| `frame:SetScript("OnDragStop", ...)` | Frame scripts | ✅ VERIFIED |
| `frame:GetPoint()` | SimpleScriptRegionResizingAPIDocumentation.lua | ✅ VERIFIED |
| `frame:SetPoint()` | SimpleScriptRegionResizingAPIDocumentation.lua | ✅ VERIFIED |
| `frame:SetClampedToScreen(true)` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `frame:IsShown()` | SimpleScriptRegionAPIDocumentation.lua | ✅ VERIFIED |
| `frame:Show()` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `frame:Hide()` | SimpleFrameAPIDocumentation.lua | ✅ VERIFIED |
| `SlashCmdList` / `SLASH_GT1` | SlashCommandsRegistry.lua.annotated.lua | ✅ VERIFIED |
| `GetMoneyString()` | QuestInfo.lua, MerchantFrame.lua, etc. | ✅ VERIFIED |
| `SecondsToTime()` | SharedBasicControls.lua, Blizzard_TimeManager.lua | ✅ VERIFIED |
| `UIPanelButtonTemplate` | Blizzard_UIPanelTemplates.lua | ✅ VERIFIED (standard template) |
## Design Decisions
- **Gold per hour**: Shows "---" until 60 seconds have elapsed
- **Frame visible on login**: No — hidden by default, toggled with `/gt`
- **Session survives /reload**: Yes — restored from `lastSession` in SavedVariables
- **Lifetime total**: Accumulated on every positive money change (not only at logout), so Reset doesn't lose gold earned before reset
## Known Issues
(None yet)