NextBest

Per-character macros that stay in sync with your bags: each profile has a priority list of items, and the macro /uses the first one you actually have.

File Details

1.3.2

  • R
  • May 3, 2026
  • 18.74 KB
  • 2
  • 2.5.5
  • Classic TBC

File Name

NextBest.zip

Supported Versions

  • 2.5.5
# NextBest Changelog

## [1.3.2] - 2026-05-03

### Added
- Priority list: **hover** the item **icon or name** for a full **GameTooltip** when the item is cached (`GetItemInfo`).

### Changed
- Window title shows **addon version** beside "NextBest" (from metadata).
- **Profiles** label is inset to match **Create macro** on the main frame.
- **^** / **v** sit directly **left of** the priority-row **X**; **Add**, priority **X**, profile-row **X**, and the window **close** control share the same **6px** inset from the right edge.
- **Active** priority row remains **green** without a leading **\***; **`list`** slash output no longer includes a **\*** column.

## [1.3.1] - 2026-05-03

### Fixed
- **Duplicate-name items (Healthstones, etc.):** when a priority entry is stored
as `itemID:NNN`, the generated macro now uses `item:NNN` in both
`#showtooltip` and `/use`, so reordering Healthstone ranks in the priority
list actually changes which rank the macro tooltips and uses. Previously the
macro fell back to `/use Healthstone` and WoW always picked the first rank in
your bag.

### Added
- Macro fallback: when no priority item is in your bags, the per-character macro
becomes `#showtooltip` of the highest-priority list entry, so the action bar
still shows that item's icon/tooltip until you loot one.

### Changed
- Profile rows: the icon and name now have real spacing, and the selected row
is highlighted with a tinted background instead of a 4 px left stripe.
- Right panel: removed the duplicate macro icon next to "Priority for:". The
Add input now flexes between the "Add item:" label and a right-pinned Add
button, and each priority row's X sits flush against the panel's right edge.

## [1.3.0] - 2026-05-03

### Added
- **Profile list:** each row shows the macro icon; **drag** the row (icon + name) to the action bar like the macro UI (`PickupMacro`).
- **Per-profile delete:** **X** on each profile row opens a Blizzard **StaticPopup** confirm, then removes the profile and its character macro.
- **Help** panel (**Help** next to **Create macro**) with usage, Add-item syntax, and duplicate-name (Healthstone) guidance.
- **`ChatEdit_InsertLink` hook:** shift-click an item link into chat while the **Add item** field is focused inserts the link into that field.

### Changed
- **Add item** row is **above** the priority list (under **Priority for:**).
- Removed the bottom **Delete profile** / timed confirm bar in favor of per-row delete + popup.

## [1.2.1] - 2026-05-03

### Added
- **`Name#itemID` syntax** in Add (slash and UI): e.g. `Major Healthstone#22104` is stored as `itemID:22104` with a readable label, so duplicate tooltip names (Healthstones) work without a shift-click.

### Changed
- **Plain item names:** after bracket/`itemID:` handling, if `GetItemInfo(name)` returns a link for a cached item, the entry is stored as **`itemID:NNN`** instead of a fragile plain name.
- After each successful add, chat shows either confirmation for id-based storage or a **tip** to use `name#itemID`, `itemID:NNN`, or shift-click when only a plain name was stored.

## [1.2.0] - 2026-05-03

### Added
- **Management window:** Two-column UI (profiles list + priority list for the selected profile) with **Create macro** strip, **Add item** field (supports shift-click links like the slash commands), **^ / v / X** per priority row, and **Delete profile** with inline confirm. Open with **`/nextbest`** with no arguments or **left-click the minimap button**.
- **Minimap button** (`INV_Holiday_BrewfestBuff_01`): Draggable orbit around the minimap using the same **round/square/corner** placement math as GuildWorkshop (`GetMinimapShape`, `Minimap:OnSizeChanged`, delayed init). Position stored in `NextBestDB.minimap.angle`. **Right-click** prints slash help. Tooltip explains click/drag.
- **`SlashCmdList.NEXTBEST`:** Empty **`/nextbest`** toggles the window; **`/nextbest <args>`** still forwards to the same handler as `/citem` for backwards compatibility.
- **SavedVariables:** `NextBestDB.minimap`, `NextBestDB.uiSelected`, `NextBestDB.uiAnchor` (window position).

## [1.1.0] - 2026-05-03

### Added
- Slash item arguments for `add`, `remove`, and `move` now accept **shift-clicked item links** from chat or from the command line; the list stores them as `itemID:NNN` so duplicate display names (e.g. multiple Healthstone ranks) stay distinct in priority.
- **`[Item Name]` bracket stripping:** lone bracket-wrapped names are normalized to the inner text.
- **`/citem <profile> list`** shows a resolved item name for `itemID:NNN` rows when `GetItemInfo` has data (e.g. `Master Healthstone (itemID:22105)`), falling back to the raw entry when not cached.

## [1.0.4] - 2026-05-03

### Fixed
- Newly-created macros landed on the **General Macros** tab instead of the per-character tab. The Anniversary `C_Macro.CreateMacro` requires a real boolean for `perCharacter`; passing the legacy numeric `1` was being interpreted as "general". The flag is now `true`.
- One-shot migration in `writeMacro`: if a macro with the profile's name already exists on the general tab, NextBest deletes it (out of combat) and recreates it on the per-character tab, so existing users automatically end up on the right tab on the next bag scan or reload.

## [1.0.3] - 2026-05-03

### Fixed
- `/citem create <name>` reported success but the macro never appeared on either macro tab. Switched the macro API to the modern `C_Macro.*` namespace (with legacy `CreateMacro` / `EditMacro` / `DeleteMacro` / `GetMacroIndexByName` globals as fallback) and changed the icon argument from the legacy texture name `"INV_Misc_QuestionMark"` to the universal fileID `134400`, which is what the current Anniversary client expects.
- `writeMacro` now re-queries `GetMacroIndexByName` after `CreateMacro` and surfaces a real error to chat if the macro wasn't actually registered, instead of silently claiming success.

## [1.0.2] - 2026-05-03

### Fixed
- Bag scan crashed with `attempt to call global 'GetContainerNumSlots' (a nil value)` on the current TBC Classic Anniversary client; now uses `C_Container.GetContainerNumSlots` / `C_Container.GetContainerItemLink` with a fallback to the legacy globals.

## [1.0.1] - 2026-05-03

### Fixed
- Lua load error in `normalizeProfileArg`: mismatched quotes in the reserved profile name error string (`unfinished string near '" is reserved...'`).

## [1.0.0] - 2026-05-03

### Added
- Initial release for WoW TBC Classic (Anniversary), Interface `20504`: self-contained addon (no external libraries).
- **Profiles:** Each profile is a named priority list and a **per-character macro** with the same name (≤ 16 characters; reserved: `help`, `create`, `delete`, `profiles`).
- **Bag-driven updates:** One scan of all bags per refresh; each profile’s macro is set to `#showtooltip` + `/use` for the first list entry that exists in bags, or a placeholder when nothing matches.
- **Events:** Rescan on `PLAYER_LOGIN`, `BAG_UPDATE`, and after combat if an update was deferred (`PLAYER_REGEN_ENABLED`). Optional `C_Timer.After(1)` retry when item info is not cached yet.
- **Slash commands:** `/citem` and `/nextbest` — `help`, `profiles`, `create`, `delete`, and per-profile `add`, `remove`, `list`, `move … up|down`. Profile names are matched case-insensitively.
- **Priority list entries:** Plain item names (case-insensitive vs bags) or `itemID:12345` for an explicit id match.
- **Persistence:** `SavedVariablesPerCharacter: NextBestDB` with `profiles[<name>] = { priority, lastItem }`.
- **Macros:** `CreateMacro` / `EditMacro` / `DeleteMacro` for character-only macros; macros are recreated if missing while the profile still exists.