Hello, everyone!
I've been trying to add new buttons to the Wardrobe sets filter dropdown menu. I have had little success thus far and figure I'd reach out to see if anyone could help. I should add that I'm attempting to do this through WeakAuras, to act like a plug-in.
I found the code that adds the existing filter options in the wardrobe set filter dropdown menu. The id of the dropdown menu is "WardrobeFilterDropDown". That code is below:
Lua Code:
function WardrobeFilterDropDown_InitializeBaseSets(self, level)
local filterSystem = {
onUpdate = WardrobeResetFiltersButton_UpdateVisibility,
filters = {
{ type = FilterComponent.Checkbox, text = COLLECTED, filter = LE_TRANSMOG_SET_FILTER_COLLECTED, set = WardrobeFilterDropDown_SetBaseSetCollectedShown, isSet = WardrobeFilterDropDown_GetBaseSetCollectedShown },
{ type = FilterComponent.Checkbox, text = NOT_COLLECTED, filter = LE_TRANSMOG_SET_FILTER_UNCOLLECTED, set = WardrobeFilterDropDown_SetBaseSetUncollectedShown, isSet = WardrobeFilterDropDown_GetBaseSetUncollectedShown },
{ type = FilterComponent.Separator },
{ type = FilterComponent.Checkbox, text = TRANSMOG_SET_PVE, filter = LE_TRANSMOG_SET_FILTER_PVE, set = WardrobeFilterDropDown_SetBaseSetPVEShown, isSet = WardrobeFilterDropDown_GetBaseSetPVEShown },
{ type = FilterComponent.Checkbox, text = TRANSMOG_SET_PVP, filter = LE_TRANSMOG_SET_FILTER_PVP, set = WardrobeFilterDropDown_SetBaseSetPVPShown, isSet = WardrobeFilterDropDown_GetBaseSetPVPShown },
{ type = FilterComponent.Separator },
},
};
FilterDropDownSystem.Initialize(self, filterSystem, level);
end
This is the first attempt. It worked but some of the new buttons were indented while others weren't.
Lua Code:
function(e,addonName)
if (e ~= "ADDON_LOADED") then
return
end
if (addonName == "Blizzard_Collections") then
WardrobeCollectionFrame.FilterButton:HookScript("OnMouseUp",
function(self,button)
UIMenu_AddButton(DropDownList1,"New Button",nil,function() print("Clicked New Button!") end,false)
end)
end
end
This is another attempt that I tried based on online documentation but was unsuccessful:
Lua Code:
function(e,addonName)
if (e ~= "ADDON_LOADED") then
return
end
if (addonName == "Blizzard_Collections") then
UIDropDownMenu_Initialize(WardrobeFilterDropDown, WardrobeFilterDropDown_Initialize, "MENU");
UIDropDownMenu_AddSeparator()
local info = UIDropDownMenu_CreateInfo();
info.text = "New Button";
info.isTitle = true;
info.notCheckable = true;
UIDropDownMenu_AddButton(info, 1);
end
end