========================================
  CHANGELOG - WARLOCK PREP
========================================



----------------------------------------
[2.1.0] - 2026-02-15
----------------------------------------

Fixed:
  - "Use Soulstone" tooltip incorrectly displayed "(need pet)" instead
    of "(no soulstone)" when no soulstone was in bags. Tooltip and
    status now show the correct skip reason per task.
  - Shift-click no longer casts a spell while opening the options dialog.
    PreClick handler now passes modifier state to the secure handler,
    which clears the macrotext when shift is held.

Added:
  - Imp fallback: when preferred pet requires a Soul Shard and none are
    available, the addon offers Summon Imp instead (no shard needed).
    Displays as "Pet: Imp (no shards)" in tooltip and button label.
  - Demonic Sacrifice detection: if a sacrifice buff is active
    (Burning Wish, Fel Stamina, Touch of Shadow, Fel Energy), the pet
    task is marked as done and no pet summon is offered.
  - Incubus added to pet options dialog, slash commands, and help text.

Changed:
  - Settings are now per-character (SavedVariablesPerCharacter) instead
    of per-account. New or recreated characters always start with
    default settings (Imp as preferred pet).


----------------------------------------
[2.0.4] - 2025-02-08
----------------------------------------

Fixed:
  - "Use Soulstone" now correctly hidden when the soulstone item is
    on cooldown.  Previous versions checked GetSpellCooldown on the
    Create Soulstone spell, but that spell has no cooldown -- only
    the soulstone ITEM goes on a 30-min cooldown after being used.
    Now uses GetContainerItemCooldown to check the actual item in bags.

Added:
  - IsBagItemOnCooldown helper (checks item cooldown via bag slot)


----------------------------------------
[2.0.3] - 2025-02-08
----------------------------------------

Fixed:
  - Healthstone and Soulstone tasks now find the highest known rank
    (same pattern as armor spells): e.g. Create Fel Healthstone >
    Create Master Healthstone > ... > Create Minor Healthstone
  - This also fixes casting the wrong (lower) rank of these spells


----------------------------------------
[2.0.2] - 2025-02-08
----------------------------------------

Fixed:
  - Soulstone cooldown detection made more robust:
    1. Tries base spell name
    2. Tries ranked variants from spellbook cache
    3. Falls back to spellbook index lookup
    All calls wrapped in pcall for client compatibility
  - Added SPELL_UPDATE_COOLDOWN event to refresh visuals
    when cooldown states change
  - Fixed crash in /wlprep debug when task has no spell (Use Soulstone)


----------------------------------------
[2.0.1] - 2025-02-08
----------------------------------------

Fixed:
  - Minimap button icon and border now properly aligned
  - Soulstone task split into two steps:
    1. Create Soulstone (if not in bags and no buff)
    2. Use Soulstone on self (if in bags but Soulstone Resurrection
       buff not active) - automatically targets player

Added:
  - Raw macro support for item-use tasks (/use [@player] Soulstone)
  - GetBagItemName helper to find actual item name for any rank


----------------------------------------
[2.0.0] - 2025-02-08
----------------------------------------

Added:
  - Minimap button with warlock class icon
  - Left-click minimap button to show/hide the prep button
  - Right-click minimap button to open options dialog
  - Drag minimap button to reposition around minimap edge
  - /wlprep minimap command to toggle minimap button visibility
  - Minimap button position saved between sessions

Changed:
  - /wlprep reset now also resets minimap button position


----------------------------------------
[1.1.1] - 2025-02-08
----------------------------------------

Changed:
  - Replaced dropdown menu with proper Options dialog panel
  - Options dialog: pet selection + Detect Invisibility toggle
  - Open via Shift+click on button or /wlprep options
  - Unknown pets greyed out in dialog based on spellbook
  - Dialog closeable with Escape key or X button
  - Removed unreliable right-click menu (SecureActionButton conflict)

Added:
  - /wlprep options command


----------------------------------------
[1.1.0] - 2025-02-08
----------------------------------------

Added:
  - Right-click options menu on button
  - Pet selection via right-click menu (remembered between sessions)
  - Detect Invisibility toggle (on/off) in right-click menu
  - Custom circular glow border replacing square border
  - Circular icon mask for polished appearance

Fixed:
  - Armor spell detection: now correctly picks highest known rank
    (Fel Armor > Demon Armor > Demon Skin) instead of assuming Fel Armor
  - IsUsableSpell false-positive: false ~= nil is true in Lua,
    caused unlearned spells to be detected as known
  - Right-click pet menu now works via SecureHandler + PostClick
  - Taint-safe attribute setting via SecureHandlerWrapScript

Changed:
  - Button right-click opens options menu instead of only dragging
  - Tooltip updated to reflect right-click options menu


----------------------------------------
[1.0.1] - 2025-02-08
----------------------------------------

Fixed:
  - Tooltip symbols showing as raw text (xe2x9cx93 etc.)
    Replaced with ASCII markers [+] [-] [>>] for Lua 5.1 compatibility
  - Click not casting spells: switched to macro-based secure action,
    pre-set macrotext in UpdateVisuals, registered AnyDown/AnyUp clicks
  - Added C_SpellBook API support for newer Anniversary client builds
  - Added IsUsableSpell fallback for spell detection

Changed:
  - Button auto-hides when all preparations are complete
  - Button auto-shows when a buff drops or item is used

Added:
  - /wlprep debug command for in-game troubleshooting
  - Click feedback prints casting info to chat


----------------------------------------
[1.0.0] - 2025-02-08
----------------------------------------

Added:
  - Initial release
  - One-click preparation button with SecureActionButton support
  - Automatic spell checking: Armor buff, Detect Invisibility, Pet summon,
    Soul Link, Healthstone, Soulstone
  - Smart priority system - skips completed tasks, checks requirements
    (Soul Shards, active pet)
  - Dynamic button icon showing next spell to cast
  - Remaining-count badge on button
  - Green/yellow/red border indicators for ready/pending/combat states
  - Hover tooltip with full checklist and colour-coded status
  - Right-click drag to reposition button (position saved between sessions)
  - Saved variables for persistent settings (WarlockPrepDB)
  - Slash commands: /wlprep, /warlockprep
      - show / hide     Toggle button visibility
      - reset           Reset position and settings
      - status          Print checklist to chat
      - pet <name>      Set preferred demon (imp, voidwalker, succubus,
                         felhunter, felguard)
  - Auto-hide for non-Warlock characters
  - Combat lockdown handling (no attribute changes during combat)
  - Periodic 2-second refresh and event-driven updates
    (UNIT_AURA, BAG_UPDATE, UNIT_PET, SPELLS_CHANGED)
  - Bag API compatibility layer (C_Container and legacy fallback)
