Add T4/T6 phase data, phase selector bar, and latest-phase progress

Data: T4 (Karazhan/Gruul/Magtheridon) and T6 (Black Temple/Hyjal) BiS
lists for all 9 classes x 3 specs, sourced from wowtbc.gg page-data
JSON. Phase registry gains PHASE_ORDER-driven ordering, GetLatestPhase
and ResolvePhase fallback. Stat scanning takes MAX across all alias-key
stats (spell damage schools, healing, haste/crit/mp5 ratings).

UI: horizontal phase selector bar between title and summary with a
progress fill that measures completion against the latest available
phase regardless of the selected phase. CompareGear returns latestPhase
and latestCompletionRatio; GetCompletionRatio delegates to a new
StatRatio helper. Default phase switched to T6.
This commit is contained in:
dfj committed 2026-10-11 15:59:32 +02:00
1 parent 5ff421bd09
commit c59a705d05
4 files changed
+1140 -37

No files matched your search

+13 -6
View File
@@ -10,23 +10,30 @@ Amibis/
├── Amibis.lua # Core: DB init, item scanning, stat aggregation, gear comparison, slash commands
├── Data/
│ └── BISLists.lua # BIS data store (class → spec → phase → slot)
└── UI/
└── ComparisonFrame.lua # Main UI frame, slot rows, stats panel
├── UI/
│ └── ComparisonFrame.lua # Main UI frame, slot rows, stats panel, phase selector bar
└── Tests/ # Offline test suite (NOT in .toc — dev machine only)
├── run.lua # Entry point: lua5.4 Amibis/Tests/run.lua
├── harness.lua # describe/it/expect micro-framework
├── wow_mocks.lua # WoW API stubs + scriptable item fixtures
├── test_*.lua # Suites: data integrity, stat scanning, gear comparison
└── README.md # Coverage, layout, how to add tests
```
## Key facts
- **Load order** is defined in `Amibis.toc`: `Amibis.lua` → `Data/BISLists.lua` → `UI/ComparisonFrame.lua`
- **Slash command**: `/amibis` toggles the UI; `/amibis spec <SpecName>` overrides auto-detected spec; `/amibis spec clear` resets override
- **Slash command**: `/amibis` toggles the UI; `/amibis spec <SpecName>` overrides auto-detected spec; `/amibis spec clear` resets override. Phase is selected by clicking phase segments in the phase bar (T4 | T5 | T6).
- **SavedVariables**: `AmibisDB` (account-wide, stores selected phase), `AmibisCharDB` (per-character, stores frame position + spec override)
- **Namespace pattern**: `local addonName, ns = ...` — all modules attach to `ns`
- **No build/test/lint tooling** — tested in-game via WoW client
- **Currently**: Only T5 data populated
- **Tests**: offline suite in `Tests/` (mocked WoW API, no client needed) — run `lua5.4 Amibis/Tests/run.lua` from the repo root; see `Tests/README.md`. UI still verified in-game.
- **Currently**: T4 (Phase 1) and T6 (Phase 3) populated for all 9 classes; T5 (Phase 2) populated for the original specs (Druid Feral Combat + Paladin Protection/Retribution have T4/T6 only). Default phase is T6. Phase-progress bar measures completion against the **latest** available phase regardless of which phase is selected.
## Adding new BIS data
1. Add a `local CLASS_T5 = { ... }` table in `Data/BISLists.lua` following the existing `PRIEST_T5` structure
1. Add a `local CLASS_T4 = { ... }` table in `Data/BISLists.lua` following the existing `PRIEST_T4` structure
2. Register it in `BIS_DATA` under the appropriate class/spec/phase key
3. Each slot entry: `{ itemID, name, source, enchant? }`
4. Ensure class name matches WoW's English class constant (e.g. `"WARRIOR"`, not `"Warrior"`)
5. Phases are ordered via `PHASE_ORDER = { "T4", "T5", "T6" }` — T4 = Phase 1 (Karazhan/Gruul/Magtheridon), T5 = Phase 2 (SSC/TK), T6 = Phase 3 (Black Temple/Hyjal). T4/T6 data is sourced from wowtbc.gg `page-data` JSON (the per-phase `bis` variants, group/raid-flagged).
## UI conventions
- ElvUI-style dark backdrop (`{0.07, 0.07, 0.07}`, alpha 0.95)