Skip to content

Commit

Permalink
Remove current category from the "Add to Category" dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Lardeck committed Mar 17, 2023
1 parent 6cf27e0 commit a4d5fcf
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions ImprovedTalentLoadouts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1696,20 +1696,24 @@ local function LoadoutDropdownInitialize(_, level, menu, ...)
end
end
elseif menu == "addToCategory" then
local isCategory = type(L_UIDROPDOWNMENU_MENU_VALUE) == "table"

for _, categoryInfo in spairs(TalentLoadouts.globalDB.categories[currentSpecID],
function(t, a, b) if t[a] and t[b] and t[a].name and t[b].name then return t[a].name < t[b].name end end) do
LibDD:UIDropDownMenu_AddButton(
{
arg1 = categoryInfo,
arg2 = L_UIDROPDOWNMENU_MENU_VALUE,
colorCode = "|cFFab96b3",
text = categoryInfo.name,
minWidth = 170,
fontObject = dropdownFont,
notCheckable = 1,
func = AddToCategory,
},
level)
if not isCategory or categoryInfo.key ~= L_UIDROPDOWNMENU_MENU_VALUE.key then
LibDD:UIDropDownMenu_AddButton(
{
arg1 = categoryInfo,
arg2 = L_UIDROPDOWNMENU_MENU_VALUE,
colorCode = "|cFFab96b3",
text = categoryInfo.name,
minWidth = 170,
fontObject = dropdownFont,
notCheckable = 1,
func = AddToCategory,
},
level)
end
end
elseif menu == "removeFromCategory" then
for _, categoryKey in ipairs(L_UIDROPDOWNMENU_MENU_VALUE.parents) do
Expand Down

0 comments on commit a4d5fcf

Please sign in to comment.