The deconstruction tab is bundled to the SMITHING global variable, and in there to the panels, like this:
Code:
SMITHING.deconstructionPanel
You can use merTorchbug improved and inspect that ingame by typing /tb SMITHING and then you see all the panels in the list, like
creationPanel, deconstructionPanel, improvementPanel etc.
If you want to know if the panel changes from e.g. refine to deconstruction, you need to PostHook the function "SetMode" in SMITHING.
But attention: As many addons already hook into the "class" ZO_Smithing, and not the "object" SMITHING (like AdvancedFilters and others do) you better should also hook the "class" ZO_Smithing function directly to make all addons compatible!
Code:
local function HookSmithingSetMode(objectVar, mode)
-[[
--Smithing modes
SMITHING_MODE_ROOT = 0
SMITHING_MODE_REFINMENT = 1
SMITHING_MODE_CREATION = 2
SMITHING_MODE_DECONSTRUCTION = 3
SMITHING_MODE_IMPROVEMENT = 4
SMITHING_MODE_RESEARCH = 5
SMITHING_MODE_RECIPES = 6
]]
if mode == SMITHING_MODE_DECONSTRUCTION then
--do your stuff
end
end
SecurePostHook(ZO_SMITHING, "SetMode", HookSmithingSetMode)
These panels got an inventory and that inventory got a "ChangeFilter" function which controls if you switched between "Armor" and "Weapon" e.g.
A PreHook to these function or a postHook, may help you to do your extra stuff you want there.
If you do a Prehook you might have to wait a few milliseconds (15 was a good for the start) so that all was done properly there in vanilla code.
A PostHook shuld be fine to use without the zo_callLater !
Code:
local function ChangeFilterCrafting(smithingObject, filterData)
...
end
ZO_PreHook(SMITHING.deconstructionPanel.inventory, "ChangeFilter", function(...) zo_callLater(ChangeFilterCrafting, 15) end)
--or
ZO_PosthHook(SMITHING.deconstructionPanel.inventory, "ChangeFilter", ChangeFilterCrafting)
Remember to do that AFTER or IN your EVENT_ADD_ON_LOADED callback and not somewhere else or before!
The universal deconstruction NPC's UI is quite different, so if you want to support that too it get's more complicated and you should learn how normal smithing class and functions work first!