6 Commits

Author SHA1 Message Date
Brues 94268b1162 Add option to always show equipment slot flyouts
The per-slot popout arrows previously appeared only while the equipment
manager sidecar was open. Add a "Always Show Equipment Slot Flyouts"
option under Character -> Inventory (character.inventory.equipflyout,
off by default) that instead ties them to the paperdoll, so gear can be
swapped without opening the equipment manager.

Centralize the show/hide in a single UpdatePopouts(): by default the
arrows follow the sidecar, with the option on they follow PaperDollFrame.
Both the sidecar OnShow/OnHide and new PaperDollFrame OnShow/OnHide hooks
route through it, and the flyout hides whenever the arrows go inactive.
2026-08-06 20:28:32 -05:00
brues-code 41b77a5728 Add the macro icon picker and improve the equipment manager (#35)
* Add pfUI-native macro icon picker

Replace Blizzard's MacroPopupFrame (the name + icon dialog) with a
custom pfUI picker driven by IconDataProviderMixin, so the full spell +
item + loose icon set is available instead of the stock spell-only list.
It has a searchable, filterable icon grid and saves through
C_Macro.CreateMacro / C_Macro.EditMacro, which take the icon as a texture
string -- so arbitrary icons (including index-less INV_* item icons)
persist. The macro-frame API is identical on the modern (Turtle/Octo)
and stock-vanilla macro UIs, so the picker works on both with no client
detection.

The new macroicons module takes over the New / Change-Icon buttons and
retires the stock popup; the blizzard macro skin now only skins
MacroPopupFrame when that module is disabled.

* Gate the macro icon hook behind a config flag

Run the Blizzard_MacroUI hook only when C.disabled["macroicons"] is
"1".

* Add search to the icon pickers and fix set editing

Equipment manager:
- Move the OK button next to Cancel at the bottom-right.
- Add an icon search box in the freed bottom-left space.
- Shift the popup contents up and shrink the window after the title
  was removed.
- Show the current icon when you edit a set. Keep a full icon path as
  is instead of adding a second prefix, and match grid icons by name.
- Close the name/icon popup when the manager frame closes. Remove the
  duplicate OnHide hook.

Both pickers now use Blizzard global strings for the labels and the
icon filters.

* Replace the row hover poll with OnLeave handlers

The gear button sits inside the set row's rectangle, so MouseIsOver(row)
is true for both. Show the gear on row enter. Hide it from a shared
OnLeave on the row and the gear when the cursor leaves the row. This
removes the per-frame OnUpdate poll.

* Handle missing C_Macro.CreateMacro API

Add guards to detect if C_Macro.CreateMacro is unavailable. The macroicons module now returns early if the API doesn't exist, and turtle-wow.lua uses the alternative Blizzard_MacroUI fallback path in such cases.

* Remove the macro picker title and shrink the window

Delete the title font string and its SetText calls. Move every
top-anchored element up 14px and shrink the window height from 498 to
484. The OK, Cancel, and search controls are bottom-anchored, so they
keep their spacing to the grid.

* bump ClassicAPI min version to 1.9.3

* Extract a shared icon picker widget

The macro icon picker and the equipment manager's name/icon popup carried
near-identical copies of the icon grid, All/Spells/Items filter, name search,
and the IconDataProvider state machine. Pull that into a single
pfUI.api.CreateIconPicker helper; each module keeps only its own frame shell,
buttons, and save flow.

Also fix the grid tooltip: pass white to GameTooltip:SetText (it defaults to
red) and derive the icon name with the case-insensitive basename key so
mixed-case provider paths show a clean name instead of the full path.
2026-08-05 22:33:37 -05:00
Brues 967487e283 Utilizing ClassicAPI 1.6.0
commit d63057474083aa67fda2aa28ee6301334ffc4fdf
Author: Brues <5278969+brues-code@users.noreply.github.com>
Date:   Mon Jul 6 00:59:17 2026 -0500

    Use C_Map.GetMapOverlays instead of hardcoded pfMapOverlayData

    ClassicAPI's C_Map.GetMapOverlays reads WorldMapOverlay.dbc directly and
    returns the full overlay list for a zone (explored + unexplored) — the
    data vanilla's GetMapOverlayInfo withholds. mapreveal now iterates it
    straight (named fields: textureName/texturePath/width/height/offsets),
    dropping unpack_hash and the pfMapOverlayData tables entirely.

    Also fixes the explored-check: it compared the full texture path against
    GetMapOverlayInfo's bare-name keys, so the magnifying glass never
    suppressed on explored overlays. Now matches on the bare name.

    Removes ~870 lines of hand-measured overlay data (base + Turtle).

commit ad12c8209a80cd1211fe08e83f7013d24b5efd2d
Author: Brues <5278969+brues-code@users.noreply.github.com>
Date:   Sun Jul 5 23:45:09 2026 -0500

    utilize HookScript from ClassicAPI
2026-07-09 00:56:06 -05:00
Brues 9706a74d16 UNIT_INVENTORY_CHANGED -> PLAYER_EQUIPMENT_CHANGED 2026-07-05 14:32:25 -05:00
Brues 38b0c74363 cleanup 2026-05-31 13:13:48 -05:00
brues-code 013fcc6c90 add equipment manager (#3)
* equipmentmanager

* use BAG_UPDATE_DELAYED

* CharacterFrame.backdrop doesn't on creation so check onShow

* adjust button positioning

* Show Equipment Set tooltip

* fix icon select scrolling issue

* Equip Set on double click

* slot tooltips: use location-aware GameTooltip methods

Branch on EquipmentManager_GetLocationData: SetBagItem for bagged items,
SetInventoryItem for equipped, fall back to SetInventoryItemByID for
missing or unresolved entries. Surfaces durability/charges/enchants in
the tooltip when the item is reachable.

Also cache C_EquipmentSet.GetItemLocations once per Refresh and store
it on each slot button instead of re-fetching inside the missing-item
border branch.

* purg esome comments

* use GameTooltip_Hide from !!!classicapi

* moved flyout to character frame

* ignore item icon shows on item slots now

* defer ignored-slot toggles until Save

Toggling a slot's ignored state in the flyout no longer immediately
calls SaveEquipmentSet. Instead the change is recorded in a per-set
pendingIgnoredToggles table; the overlay reflects the effective
state (persisted XOR pending) so the user sees the visual change
right away, and Save commits the toggles by replaying them into
ClassicAPI's session ignored list before SaveEquipmentSet.

Pending toggles clear on Save (committed) and on set deletion.

* overhaul icon picker

* fixed width

* fixed issue where selected icon got cleared out

* correct flyout button order

* backport more equipment manager icons

* refactor window

* fixed gear menu

* remove set cap

* bump minimum classicapi version

* bump minimum version to 1.3.3

* row menu: close on outside click

GLOBAL_MOUSE_DOWN fires regardless of which frame absorbs the click
and (unlike a veil frame) doesn't consume the original event, so
clicking another row's gear closes the old menu and opens the new
one in a single click. The gear's own OnClick handles the same-row
toggle close, since GLOBAL_MOUSE_DOWN's anchorBtn check excludes it.

Bumps minimum ClassicAPI to 1.3.4 for GLOBAL_MOUSE_DOWN /
IsMouseButtonDown.

* use pfUI.path

* comment cleanup

* bump min classicapi version

---------

Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
2026-05-31 12:56:30 -05:00