mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-28 14:40:53 +00:00
Add equipment manager auto-switching and "Unused" items panel (#70)
* Add equipment manager auto-switching and "Unused" items panel Equipment manager (modules/equipmentmanager.lua): - Add automatic set switching: ordered triggers (mounted, swimming, eating/drinking, shapeshift form/stance, zone, instance type, time of day, resting, stealthed, targeting a boss) equip a set; topmost matching trigger wins, with a 0.5s debounce - Never swap gear in combat, while dead or casting; optionally restore the previous gear via a hidden "pfUI Auto-Restore" set - Add an "Unused" side panel listing equippable items in bags, bank and paperdoll that no set uses, with an ignore list (tools and quest disguises pre-ignored), bank snapshot and bag highlighting - Persist triggers, ignore list and bank snapshot in new per-character SavedVariable pfUI_eqmgr (all three .toc files) - Add Character > Equipment Manager options (autoswitch, announce, minimum item quality, include bank) in gui.lua and config.lua - Hide ignored-slot overlays when the manager frame is closed Add frFR translations for the new equipment manager strings. * equipmentmanager: lean on ClassicAPI for unused scan and autoswitch - Unused panel: list items via GetInventoryItemsForSlot instead of hand-packing locations and walking the bags. - Bank snapshot: record set membership while the bank is open. GetItemLocations reports bank items as missing once it closes, so set items in the bank were listed as unused. - Autoswitch: check CanUseEquipmentSets and the UseEquipmentSet result before marking a trigger applied, and retry when the swap is blocked. - Drive the engine from events (aura, form, zone, resting, target, regen) instead of a 4 Hz ticker; poll only swimming, time and eating. - Detect eating/drinking by the localized names of the Food (433) and Drink (430) auras instead of hardcoded locale strings and icon paths. - Drop presence guards on APIs that always exist; use strsplittable and strtrim for trigger values. * equipmentmanager: wake the dining trigger on player health/mana events Drop dining from the poll: listen to UNIT_HEALTH/UNIT_MANA for the player while a dining trigger is enabled, so taking the set off once full is event-driven. Register UNIT_AURA for the player only. * equipmentmanager: split trigger values with strsplit strsplittable needs ClassicAPI 1.17.11; strsplit has been there since 1.7.3, so this keeps the minimum where it is. * equipmentmanager: let the trigger hint wrap --------- Co-authored-by: Duciel <336374+Duciel@users.noreply.github.com> Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
This commit is contained in:
+1284
-3
File diff suppressed because it is too large
Load Diff
@@ -2428,6 +2428,21 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(nil, T["Always Show Equipment Slot Flyouts"], C.character.inventory, "equipflyout", "checkbox")
|
||||
end)
|
||||
|
||||
CreateGUIEntry(T["Character"], T["Equipment Manager"], function()
|
||||
CreateConfig(nil, T["Automatic Set Switching"], nil, nil, "header")
|
||||
CreateConfig(U["equipmentmanager"], T["Enable Automatic Set Switching"], C.equipmentmanager, "autoswitch", "checkbox")
|
||||
CreateConfig(U["equipmentmanager"], T["Announce Automatic Set Switches In Chat"], C.equipmentmanager, "announce", "checkbox")
|
||||
CreateConfig(nil, T["Items Not In Any Set"], nil, nil, "header")
|
||||
CreateConfig(U["equipmentmanager"], T["Minimum Item Quality"], C.equipmentmanager, "unusedquality", "dropdown", {
|
||||
"0:" .. ITEM_QUALITY0_DESC,
|
||||
"1:" .. ITEM_QUALITY1_DESC,
|
||||
"2:" .. ITEM_QUALITY2_DESC,
|
||||
"3:" .. ITEM_QUALITY3_DESC,
|
||||
"4:" .. ITEM_QUALITY4_DESC,
|
||||
})
|
||||
CreateConfig(U["equipmentmanager"], T["Include Bank Items"], C.equipmentmanager, "unusedbank", "checkbox")
|
||||
end)
|
||||
|
||||
CreateGUIEntry(T["Character"], T["Reputation"], function()
|
||||
CreateConfig(nil, T["Show Reputation Remaining"], C.character.reputation, "repRequired", "checkbox")
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user