Skip to content

Commit 01d3f16

Browse files
committed
Fix EasyMenu for Retail
1 parent 8b91a76 commit 01d3f16

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

Baggins-Options.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3753,7 +3753,7 @@ function Baggins:DoBagMenu()
37533753
func = openBagCategoryConfig,
37543754
notCheckable = true,
37553755
})
3756-
EasyMenu(menu, bagDropdownMenuFrame, "cursor", 0, 0, "MENU")
3756+
Baggins:EasyMenu(menu, bagDropdownMenuFrame, "cursor", 0, 0, "MENU")
37573757
end
37583758
end
37593759

Baggins.lua

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ local ldbdata = {
324324
if message == "RightButton" then
325325
tooltip:Hide()
326326
updateMenu()
327-
EasyMenu(ldbDropDownMenu, ldbDropDownFrame, "cursor", 0, 0, "MENU")
327+
Baggins:EasyMenu(ldbDropDownMenu, ldbDropDownFrame, "cursor", 0, 0, "MENU")
328328
-- Baggins:OpenConfig()
329329
else
330330
Baggins:OnClick()
@@ -2478,7 +2478,7 @@ do
24782478
return
24792479
end
24802480
makeMenu(bag, slot)
2481-
EasyMenu(menu, itemDropdownFrame, "cursor", 0, 0, "MENU")
2481+
Baggins:EasyMenu(menu, itemDropdownFrame, "cursor", 0, 0, "MENU")
24822482
-- make sure we restore the original scroll-wheel behavior for the DropdownList2-Frame
24832483
-- when the item-dropdown is closed
24842484
Baggins:SecureHookScript(DropDownList1, "OnHide", function()
@@ -2510,7 +2510,7 @@ do
25102510
return
25112511
end
25122512
makeMenu(bag, slot)
2513-
EasyMenu(menu, itemDropdownFrame, "cursor", 0, 0, "MENU")
2513+
Baggins:EasyMenu(menu, itemDropdownFrame, "cursor", 0, 0, "MENU")
25142514
-- make sure we restore the original scroll-wheel behavior for the DropdownList2-Frame
25152515
-- when the item-dropdown is closed
25162516
Baggins:SecureHookScript(DropDownList1, "OnHide", function()
@@ -3604,7 +3604,7 @@ function BagginsOnAddonCompartmentClick(_,button)
36043604
if button == "RightButton" then
36053605
--tooltip:Hide()
36063606
updateMenu()
3607-
EasyMenu(ldbDropDownMenu, ldbDropDownFrame, "cursor", 0, 0, "MENU")
3607+
Baggins:EasyMenu(ldbDropDownMenu, ldbDropDownFrame, "cursor", 0, 0, "MENU")
36083608
-- Baggins:OpenConfig()
36093609
else
36103610
Baggins:OnClick()
@@ -4331,3 +4331,20 @@ local function GetItemUpgradeLevel(itemLink)
43314331
end
43324332

43334333
end
4334+
4335+
local function EasyMenu_Initialize(frame, level, menuList)
4336+
for index = 1, #menuList do
4337+
local value = menuList[index]
4338+
if value.text then value.index = index; UIDropDownMenu_AddButton(value, level) end
4339+
end
4340+
end
4341+
4342+
function Baggins:EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay)
4343+
if Baggins:IsRetailWow() then
4344+
if displayMode=='MENU' then menuFrame.displayMode = displayMode end
4345+
UIDropDownMenu_Initialize(menuFrame, EasyMenu_Initialize, displayMode, nil, menuList)
4346+
ToggleDropDownMenu(1, nil, menuFrame, anchor, x, y, menuList, nil, autoHideDelay)
4347+
else
4348+
EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay)
4349+
end
4350+
end

src/filters/PeriodicTable.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ local AddOn = _G[AddOnName]
1313
local pairs, type, tonumber, wipe, ceil =
1414
pairs, type, tonumber, wipe, ceil
1515
local GetContainerItemLink = C_Container and C_Container.GetContainerItemLink or GetContainerItemLink
16-
local EasyMenu = EasyMenu
1716
local tinsert, tsort =
1817
tinsert, table.sort
1918

@@ -128,7 +127,7 @@ local function showPTDropdown(info)
128127
local attr = info[#info] --luacheck: ignore 211
129128
currentRule = info.arg --luacheck: ignore 111
130129
local menu = buildMenu(ptsets)
131-
EasyMenu(menu, ptdropdownFrame, "cursor", 0, 0, "MENU")
130+
AddOn:EasyMenu(menu, ptdropdownFrame, "cursor", 0, 0, "MENU")
132131
end
133132

134133
-- Test for match

0 commit comments

Comments
 (0)