diff --git a/core.lua b/core.lua index ae1c035..1535d76 100644 --- a/core.lua +++ b/core.lua @@ -279,7 +279,7 @@ function private.AuctionFrameAuctions_OnEvent(...) end function private.SetItemRef(...) - if arg[3] ~= 'RightButton' or not m.index(m.active_tab.module[1], 'CLICK_LINK') or not strfind(arg[1], '^item:%d+') then + if arg[3] ~= 'RightButton' or not m.index(m.active_tab(), 'module', 1, 'CLICK_LINK') or not strfind(arg[1], '^item:%d+') then return m.orig.SetItemRef(unpack(arg)) end for _, item_info in {m.info.item(tonumber(({strfind(arg[1], '^item:(%d+)')})[3]))} do diff --git a/gui.lua b/gui.lua index 887a66b..9746d47 100644 --- a/gui.lua +++ b/gui.lua @@ -45,32 +45,54 @@ public.inline_color = aux.index_function(function(self, key) return format('|c%02X%02X%02X%02X', unpack(color)) end) +--/run aux.gui.menu('kek', 'kuk', 'kok', function() end) do local dropdown function public.menu(...) - UIDropDownMenu_Initialize(dropdown, function() - for i=1,arg.n-1 do - UIDropDownMenu_AddButton{ - text = arg[i], - value = i, - func = function() - return arg[arg.n](this.value) - end, - } - end - end, 'MENU') + local mythis = this + this = dropdown + UIMenu_Initialize() + for i=1,arg.n-1 do + UIMenu_AddButton( + arg[i], + i, + function() + return arg[arg.n](this.value) + end + ) + end dropdown:SetPoint('BOTTOMLEFT', GetCursorPosition()) - ToggleDropDownMenu(nil, nil, dropdown, nil, 0, 0) + dropdown:Show() + this = mythis end +-- function public.menu(...) +-- UIDropDownMenu_Initialize(dropdown, function() +-- for i=1,arg.n-1 do +-- UIDropDownMenu_AddButton{ +-- text = arg[i], +-- value = i, +-- func = function() +-- return arg[arg.n](this.value) +-- end, +-- } +-- end +-- end, 'MENU') +-- dropdown:SetPoint('BOTTOMLEFT', GetCursorPosition()) +-- ToggleDropDownMenu(nil, nil, dropdown, nil, 0, 0) +-- end + +-- function private.initialize_menu() +-- dropdown = CreateFrame('Frame', 'aux_frame'..aux.id(), UIParent, 'UIDropDownMenuTemplate') +-- dropdown:SetWidth(1) +-- dropdown:SetHeight(1) +-- dropdown:SetAlpha(0) +-- end + function private.initialize_menu() - dropdown = CreateFrame('Frame', 'aux_frame'..aux.id(), UIParent, 'UIDropDownMenuTemplate') - dropdown:SetWidth(1) - dropdown:SetHeight(1) - dropdown:SetAlpha(0) + dropdown = CreateFrame('Frame', 'aux_frame'..aux.id(), UIParent, 'UIMenuTemplate') end - end function m.LOAD()