View Single Post
02/12/22, 09:31 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
As information:
The new UNIVERSAL_DECONSTRUCTION.deconstructionPanel (and the gamepad one) will get a callback for when the filters (that are: tabs e.g. all/armor/weapon/jewelry/enchantments) or the chosen multiselect dropdown filters change

Lua Code:
  1. function TestOnFilterChanged(tab, craftingTypes, includeBanked)
  2.     d("Filter changed:")
  3.     d("Tab.key:")
  4.     d( tab.key )
  5. --tab.key will identify the selecte filter table of global ZO_UNIVERSAL_DECONSTRUCTION_FILTER_TYPES, which are enchantments, jewelry, armor, weapons, all
  6.     d("Crafting Types:")
  7.     d(craftingTypes)
  8.     df("%s banked items", includeBanked and "Include" or "Exclude")
  9. end
  10.  
  11.  
  12. UNIVERSAL_DECONSTRUCTION.deconstructionPanel:RegisterCallback("OnFilterChanged", TestOnFilterChanged)
  13. UNIVERSAL_DECONSTRUCTION_GAMEPAD.deconstructionPanel:RegisterCallback("OnFilterChanged", TestOnFilterChanged)

You will be able to detect the currently active tab via:
UNIVERSAL_DECONSTRUCTION.deconstructionPanel:GetCurrentFilter() which returns the filter table of ZO_UNIVERSAL_DECONSTRUCTION_FILTER_TYPES, so UNIVERSAL_DECONSTRUCTION.deconstructionPanel:GetCurrentFilter().key shows you the key of that tab currently being active

It hits PTS when it's done
Thanks ZOS_DanBatson and Cardinal05, very appreciated you work on my feedback and will add this. It will help a lot!
  Reply With Quote