Skip to content

refactor: stabilize init, UI, and macro flow; schema-driven options; …#91

Draft
tuxx wants to merge 2 commits intoollidiemaus:mainfrom
tuxx:refactor
Draft

refactor: stabilize init, UI, and macro flow; schema-driven options; …#91
tuxx wants to merge 2 commits intoollidiemaus:mainfrom
tuxx:refactor

Conversation

@tuxx
Copy link
Copy Markdown
Contributor

@tuxx tuxx commented Aug 12, 2025

…env/constants

  • Init and DB safety

    • Hardened clean-install path: getHealingSpells() falls back to ham.defaults.activatedSpells when HAMDB is nil; options now refresh via ham.refreshOptions() on load/reset.
    • Normalized event/debounce usage with ham.defer.
  • Macro architecture

    • Split build vs apply: ham.buildMacro(), ham.buildBandageMacro(), ham.applyMacro(name, code).
    • Extracted MegaMacro integration into Core/Macro.lua (checkAddonReady, apply).
    • Macro item/spell string building uses helpers and table.concat.
  • Env/constants

    • Centralized env checks via ham.env; added event constants (ham.EVT_*) and slot IDs.
    • Replaced magic strings/numbers in event registration and tinker slots.
  • UI and UX

    • Fixed stray icons: frames are now children of settings content, guarded by panel init.
    • Added tooltip helpers; unified icon retrieval with ham.getSpellTexture/ham.getItemIcon.
    • Schema-driven options UI: generates behavior and item toggles from schema; reset updates all via registry.
    • getSpellName used for spell labels.
  • Potions/Bandages data cleanup

    • Consolidated lists by environment (retail/classic/wrath/cata/mop) with ham.getEnvKey() and ham.copyList(); applied context filters (BG rules, options) centrally.

This reduces duplication, hardens startup, and keeps UI artifacts scoped to the settings panel.

Tuxx and others added 2 commits August 12, 2025 19:25
…env/constants

- Init and DB safety
  - Hardened clean-install path: `getHealingSpells()` falls back to `ham.defaults.activatedSpells` when `HAMDB` is nil; options now refresh via `ham.refreshOptions()` on load/reset.
  - Normalized event/debounce usage with `ham.defer`.

- Macro architecture
  - Split build vs apply: `ham.buildMacro()`, `ham.buildBandageMacro()`, `ham.applyMacro(name, code)`.
  - Extracted MegaMacro integration into `Core/Macro.lua` (`checkAddonReady`, `apply`).
  - Macro item/spell string building uses helpers and `table.concat`.

- Env/constants
  - Centralized env checks via `ham.env`; added event constants (`ham.EVT_*`) and slot IDs.
  - Replaced magic strings/numbers in event registration and tinker slots.

- UI and UX
  - Fixed stray icons: frames are now children of settings content, guarded by panel init.
  - Added tooltip helpers; unified icon retrieval with `ham.getSpellTexture`/`ham.getItemIcon`.
  - Schema-driven options UI: generates behavior and item toggles from schema; reset updates all via registry.
  - `getSpellName` used for spell labels.

- Potions/Bandages data cleanup
  - Consolidated lists by environment (retail/classic/wrath/cata/mop) with `ham.getEnvKey()` and `ham.copyList()`; applied context filters (BG rules, options) centrally.

This reduces duplication, hardens startup, and keeps UI artifacts scoped to the settings panel.
@tuxx
Copy link
Copy Markdown
Contributor Author

tuxx commented Aug 12, 2025

Started refactoring some stuff, checking if i can do some more refactoring. Let me know what u think @ollidiemaus 👍

@ollidiemaus
Copy link
Copy Markdown
Owner

I haven’t had a lot of time to check it out but was the merge from main really fine ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants