diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index d2540c9..e9247b8 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -400,9 +400,9 @@ function AtlasLoot:CreateToken(dataID) item:ContinueOnLoad(function(itemID) if itemType == select(9, GetItemInfo(itemID)) or itemType2 == select(9, GetItemInfo(itemID)) then table.insert(AtlasLoot_TokenData[orgID][1], {#AtlasLoot_TokenData[orgID][1] + 1, v[2], v[3], v[4], t.Name}); - if #AtlasLoot_Data[dataID] == n and #t == c then - AtlasLoot:ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]); - end + end + if #AtlasLoot_Data[dataID] == n and #t == c then + AtlasLoot:ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]); end end) end @@ -743,17 +743,15 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum) _G["AtlasLootItemsFrame_BACK"]:Hide(); _G["AtlasLootItemsFrame_NEXT"]:Hide(); _G["AtlasLootItemsFrame_PREV"]:Hide(); - _G["AtlasLootItemsFrame_Wishlist_EDIT"]:Hide(); - _G["AtlasLootItemsFrame_Wishlist_DELETE"]:Hide(); - _G["AtlasLootItemsFrame_Wishlist_ADD"]:Hide(); + _G["AtlasLootItemsFrame_Wishlist_Options"]:Hide(); _G["AtlasLootItemsFrame_Wishlist_Share"]:Hide(); + -- Show Wishlist buttons when a wishlist in showing if dataSource_backup == "AtlasLootWishList" then - _G["AtlasLootItemsFrame_Wishlist_EDIT"]:Show(); - _G["AtlasLootItemsFrame_Wishlist_DELETE"]:Show(); - _G["AtlasLootItemsFrame_Wishlist_ADD"]:Show(); + _G["AtlasLootItemsFrame_Wishlist_Options"]:Show(); _G["AtlasLootItemsFrame_Wishlist_Share"]:Show(); end + local tablebase = {dataID, dataSource_backup}; if dataID == "FilterList" then tablebase = {AtlasLootItemsFrame.refreshOri[1],AtlasLootItemsFrame.refreshOri[2]}; diff --git a/AtlasLoot/Core/WishList.lua b/AtlasLoot/Core/WishList.lua index 622de59..f6da4a6 100644 --- a/AtlasLoot/Core/WishList.lua +++ b/AtlasLoot/Core/WishList.lua @@ -5,7 +5,6 @@ Functions: AtlasLoot_AddToWishlist(itemID, itemTexture, itemName, lootPage, sourcePage) AtlasLoot_DeleteFromWishList(itemID) AtlasLoot_WishListCheck(itemID, all) -AtlasLoot_CheckWishlistItem(itemID ,[playerName ,[wishlist] ]) ClearLines() AddWishListOptions(parrent,name,icon,xxx,tabname,tab2) @@ -19,12 +18,14 @@ local BabbleFaction = AtlasLoot_GetLocaleLibBabble("LibBabble-Faction-3.0") local ALModule = AtlasLoot:NewModule("WishList", "AceSerializer-3.0", "AceComm-3.0") AtlasLoot_WishListDrop = AceLibrary("Dewdrop-2.0"); +AtlasLoot_WishListOptions = AceLibrary("Dewdrop-2.0"); AtlasLoot_WishList = nil; local playerName = UnitName("player"); local itemID, itemTexture, itemName, lootPage, sourcePage, xtyp, xarg2, xarg3, difficulty; local OptionsLoadet = false; -local curaddicon, curaddname, curtablenum = "","",""; +local curaddicon, curaddname = "",""; +local curtable = {"","",""}; local editName = false; AtlasLootWishList = {} @@ -54,7 +55,6 @@ function AtlasLoot_WishListAddDropClick(typ, arg2, arg3, arg4) else xtyp = typ xarg2 = arg2 - xarg3 = arg3 if typ == "addOwn" then if AtlasLoot_WishListCheck(itemID) then DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..AtlasLoot_FixText(itemName)..RED..AL[" already in the WishList!"]..WHITE.." ("..AtlasLootWishList["Own"][arg2].Name..")"); @@ -65,11 +65,11 @@ function AtlasLoot_WishListAddDropClick(typ, arg2, arg3, arg4) AtlasLoot_WishListDrop:Close(1) elseif typ == "addShared" then if AtlasLoot_WishListCheck(itemID) then - DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..AtlasLoot_FixText(itemName)..RED..AL[" already in the WishList!"]..WHITE.." ("..AtlasLootWishList["Shared"][arg2].Name.." - "..arg2..")"); + DEFAULT_CHAT_FRAME:AddMessage(BLUE..AL["AtlasLoot"]..": "..AtlasLoot_FixText(itemName)..RED..AL[" already in the WishList!"]..WHITE.." ("..AtlasLootWishList["Shared"][arg2].Name); return; end - table.insert(AtlasLootWishList["Shared"][arg2][arg3], { 0, itemID, itemTexture, itemName, lootPage, "", "", sourcePage, [AtlasLoot_Difficulty.DIF_SEARCH] = difficulty}); - DEFAULT_CHAT_FRAME:AddMessage(RED..AL["AtlasLoot"]..": "..AtlasLoot_FixText(itemName)..GREY..AL[" added to the WishList."]..WHITE.." ("..AtlasLootWishList["Shared"][arg2].Name.." - "..arg2..")"); + table.insert(AtlasLootWishList["Shared"][arg2], { #AtlasLootWishList["Shared"][arg2] + 1, itemID, itemTexture, itemName, lootPage, "", "", sourcePage}); + DEFAULT_CHAT_FRAME:AddMessage(RED..AL["AtlasLoot"]..": "..AtlasLoot_FixText(itemName)..GREY..AL[" added to the WishList."]..WHITE.." ("..AtlasLootWishList["Shared"][arg2].Name..")"); AtlasLoot_WishListDrop:Close(1) end end @@ -105,6 +105,20 @@ function AtlasLoot:AddWishList() AtlasLoot_WishListDrop:Close(1); end +-- Clones a shared wishlist to personal table +function AtlasLoot:CloneSharedWishList() + table.insert(AtlasLootWishList["Own"],AtlasLootWishList[AtlasLootItemsFrame.refresh[1]][AtlasLootItemsFrame.refresh[3]]); + AtlasLoot_WishListDrop:Close(1); +end + +-- Clones a shared wishlist to personal table +function AtlasLoot:SetDefaultWishList() + if AtlasLootItemsFrame.refresh[1] == "Own" then + AtlasLootWishList["Options"][playerName]["DefaultWishList"] = {AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]}; + end + AtlasLoot_WishListDrop:Close(1); +end + -- Deletes current wishlist function AtlasLoot:DeleteWishList() if AtlasLootItemsFrame.refresh[2] == "AtlasLootWishList" then @@ -118,111 +132,105 @@ function AtlasLoot:ShareWishList() StaticPopup_Show ("ATLASLOOT_SEND_WISHLIST",AtlasLootWishList["Own"][AtlasLootItemsFrame.refresh[3]].Name); end + +--[[ +AtlasLoot:WishListButton +Main panel wishlist button + ]] +function AtlasLoot:WishListButton(xitemID, xitemTexture, xitemName, xlootPage, xsourcePage, button, show, buttonclick) + if buttonclick == "RightButton" then + AtlasLoot_ShowWishListDropDown(xitemID, xitemTexture, xitemName, xlootPage, xsourcePage, button, show, "Enable") + elseif buttonclick == "LeftButton" then + AtlasLoot_WishListAddDropClick("addOwn", AtlasLootWishList["Options"][playerName]["DefaultWishList"][3] or 1, "", show) + end +end + --[[ AtlasLoot_ShowWishListDropDown(xitemID, xitemTexture, xitemName, xlootPage, xsourcePage, button, show) Show the dropdownlist with the wishlists ]] -function AtlasLoot_ShowWishListDropDown(xitemID, xitemTexture, xitemName, xlootPage, xsourcePage, button, show) +function AtlasLoot_ShowWishListDropDown(xitemID, xitemTexture, xitemName, xlootPage, xsourcePage, button, show, panelButton) itemID, itemTexture, itemName, lootPage, sourcePage = xitemID, xitemTexture, xitemName, xlootPage, xsourcePage - if AtlasLootWishList["Options"][playerName]["UseDefaultWishlist"] == false then - if AtlasLoot_WishListDrop:IsOpen(button) then - AtlasLoot_WishListDrop:Close(1); - else - local setOptions = function(level, value) - if level == 1 then - AtlasLoot_WishListDrop:AddLine( - "text", AL["Own Wishlists"], - "tooltipTitle", AL["Own Wishlists"], - "value", "OwnWishlists", - "arg1", "1", - "hasArrow", true, - "func", AtlasLoot_WishListAddDropClick, - "notCheckable", true - ); - AtlasLoot_WishListDrop:AddLine( - "text", AL["Shared Wishlists"], - "tooltipTitle", AL["Shared Wishlists"], - "value", "SharedWishlists", - "arg1", "1", - "hasArrow", true, - "func", AtlasLoot_WishListAddDropClick, - "notCheckable", true - ); - AtlasLoot_WishListDrop:AddLine( - "text", AL["Add Wishlist"], - "func", function() AtlasLoot:AddWishList() end, - "notCheckable", true - ); - AtlasLoot_WishListDrop:AddLine( - "text", AL["Close"], - "func", function() AtlasLoot_WishListDrop:Close(1) end, - "notCheckable", true - ); - elseif level == 2 then - if value == "OwnWishlists" then - for k,v in pairs(AtlasLootWishList["Own"]) do - if type(v) == "table" then - AtlasLoot_WishListDrop:AddLine( - "text", v.Name, - "tooltipTitle", v.Name, - "func", AtlasLoot_WishListAddDropClick, - "arg1", "addOwn", - "arg2", k, - "arg3", "", - "arg4", show, - "notCheckable", true - ); - end - end - elseif value == "SharedWishlists" then - for k,v in pairs(AtlasLootWishList["Shared"]) do - if type(v) == "table" then - AtlasLoot_WishListDrop:AddLine( - "text", v.Name, - "tooltipTitle", v.Name, - "func", AtlasLoot_WishListAddDropClick, - "arg1", "addShared", - "arg2", k, - "arg3", "", - "arg4", show, - "notCheckable", true - ); - end - end + if AtlasLootWishList["Options"][playerName]["UseDefaultWishlist"] == true and panelButton ~= "Enable" then + AtlasLoot_WishListAddDropClick("addOwn", AtlasLootWishList["Options"][playerName]["DefaultWishList"][3], "", nil) + return + else + if AtlasLoot_WishListDrop:IsOpen(button) then + AtlasLoot_WishListDrop:Close(1); + else + local setOptions = function(level, value) + if level == 1 then + AtlasLoot_WishListDrop:AddLine( + "text", AL["Own Wishlists"], + "tooltipTitle", AL["Own Wishlists"], + "value", "OwnWishlists", + "arg1", "1", + "hasArrow", true, + "func", AtlasLoot_WishListAddDropClick, + "notCheckable", true + ); + AtlasLoot_WishListDrop:AddLine( + "text", AL["Shared Wishlists"], + "tooltipTitle", AL["Shared Wishlists"], + "value", "SharedWishlists", + "arg1", "1", + "hasArrow", true, + "func", AtlasLoot_WishListAddDropClick, + "notCheckable", true + ); + AtlasLoot_WishListDrop:AddLine( + "text", AL["Add Wishlist"], + "func", function() AtlasLoot:AddWishList() end, + "notCheckable", true + ); + AtlasLoot_WishListDrop:AddLine( + "text", AL["Close"], + "func", function() AtlasLoot_WishListDrop:Close(1) end, + "notCheckable", true + ); + elseif level == 2 then + if value == "OwnWishlists" then + for k,v in pairs(AtlasLootWishList["Own"]) do + if type(v) == "table" then + AtlasLoot_WishListDrop:AddLine( + "text", v.Name, + "tooltipTitle", v.Name, + "func", AtlasLoot_WishListAddDropClick, + "arg1", "addOwn", + "arg2", k, + "arg3", "", + "arg4", show, + "notCheckable", true + ); + end + end + elseif value == "SharedWishlists" then + for k,v in pairs(AtlasLootWishList["Shared"]) do + if type(v) == "table" then + AtlasLoot_WishListDrop:AddLine( + "text", v.Name, + "tooltipTitle", v.Name, + "func", AtlasLoot_WishListAddDropClick, + "arg1", "addShared", + "arg2", k, + "arg3", "", + "arg4", show, + "notCheckable", true + ); end end end - AtlasLoot_WishListDrop:Open(button, - "point", function(parent) - return "TOPLEFT", "TOPRIGHT"; - end, - "children", setOptions - ); - end - else - for k,v in pairs(AtlasLootWishList["Own"][playerName]) do - if AtlasLootWishList["Own"][playerName][k]["info"] then - if AtlasLootWishList["Own"][playerName][k]["info"][2][playerName] == true then - AtlasLoot_WishListAddDropClick("addOwn", k, "", show) - return end end + AtlasLoot_WishListDrop:Open(button, + "point", function(parent) + return "TOP", "BOTTOM"; + end, + "children", setOptions + ); end - - for k,v in pairs(AtlasLootWishList["Own"]) do - if AtlasLootWishList["Own"][k] then - for i,j in pairs(AtlasLootWishList["Own"][k]) do - if AtlasLootWishList["Own"][k][i]["info"] then - if AtlasLootWishList["Own"][k][i]["info"][2][playerName] == true then - AtlasLoot_WishListAddDropClick("addOther", k, i, show) - return - end - end - end - end - end - - DEFAULT_CHAT_FRAME:AddMessage(RED..AL["AtlasLoot"]..": "..AL["Please set a default Wishlist."]); + + -- DEFAULT_CHAT_FRAME:AddMessage(RED..AL["AtlasLoot"]..": "..AL["Please set a default Wishlist."]); end end @@ -322,81 +330,56 @@ function AtlasLoot_WishListCheck(itemID, all) end --[[ -AtlasLoot_CheckWishlistItem(itemID ,[playerName ,[wishlist] ]) -Returns a Table with infos about the item. -itemID -> Enter a ItemID -[playerName] -> Enter a PlayerName, needed if you want to check only wishlists from a particular player (if you need to check all players, enter nil) -[wishlist] -> Checks only this wishlist (playerName can be nil) - -return: -table = { - [index] = { - [1] = "playerName", - [2] = "WishListName" - } -} +AtlasLoot:WishListOptionsRegister: +Constructs the wishlist options category menu. ]] -function AtlasLoot_CheckWishlistItem(itemID, playerName, wishList) - if not itemID then return nil end - local returnTable = {} - local returnIndex = 1 - - if playerName and not wishList then - if not AtlasLootWishList["Own"][playerName] then return nil end - for listIndex,_ in pairs(AtlasLootWishList["Own"][playerName]) do - for itemIndex,_ in pairs(AtlasLootWishList["Own"][playerName][listIndex]) do - if AtlasLootWishList["Own"][playerName][listIndex][itemIndex][2] == itemID then - returnTable[returnIndex] = {} - returnTable[returnIndex][1] = playerName - returnTable[returnIndex][2] = AtlasLootWishList["Own"][playerName][listIndex]["info"][1] - returnIndex = returnIndex + 1 - break +function AtlasLoot:WishListOptionsRegister() + AtlasLoot_WishListOptions:Register(AtlasLootItemsFrame_Wishlist_Options, + 'point', function(parent) + return "TOP", "BOTTOM" + end, + 'children', function(level, value) + AtlasLoot_WishListOptions:AddLine( + "text", AL["Add Wishlist"], + "func", function() AtlasLoot:AddWishList() end, + "notCheckable", true + ); + AtlasLoot_WishListOptions:AddLine( + "text", AL["Edit Wishlist"], + "func", function() AtlasLoot:EditWishList() end, + "notCheckable", true + ); + if AtlasLootItemsFrame.refresh[1] == "Shared" then + AtlasLoot_WishListOptions:AddLine( + "text", AL["Copy Wishlist To Own"], + "func", function() AtlasLoot:CloneSharedWishList() end, + "notCheckable", true + ); end - end - end - elseif wishList then - for name,_ in pairs(AtlasLootWishList["Own"]) do - for listIndex,_ in pairs(AtlasLootWishList["Own"][name]) do - if wishList ~= AtlasLootWishList["Own"][name][listIndex]["info"][1] then break end - for itemIndex,_ in pairs(AtlasLootWishList["Own"][name][listIndex]) do - if AtlasLootWishList["Own"][name][listIndex][itemIndex][2] == itemID then - if playerName and playerName == name then - returnTable[returnIndex] = {} - returnTable[returnIndex][1] = name - returnTable[returnIndex][2] = AtlasLootWishList["Own"][name][listIndex]["info"][1] - returnIndex = returnIndex + 1 - break - elseif not playerName then - returnTable[returnIndex] = {} - returnTable[returnIndex][1] = name - returnTable[returnIndex][2] = AtlasLootWishList["Own"][name][listIndex]["info"][1] - returnIndex = returnIndex + 1 - break - end - end + if AtlasLootItemsFrame.refresh[1] == "Own" then + AtlasLoot_WishListOptions:AddLine( + "text", AL["Make Default Wishlist"], + "func", function() AtlasLoot:SetDefaultWishList() end, + "notCheckable", true + ); end - end - end - else - for name,_ in pairs(AtlasLootWishList["Own"]) do - for listIndex,_ in pairs(AtlasLootWishList["Own"][name]) do - for itemIndex,_ in pairs(AtlasLootWishList["Own"][name][listIndex]) do - if AtlasLootWishList["Own"][name][listIndex][itemIndex][2] == itemID then - returnTable[returnIndex] = {} - returnTable[returnIndex][1] = name - returnTable[returnIndex][2] = AtlasLootWishList["Own"][name][listIndex]["info"][1] - returnIndex = returnIndex + 1 - break - end - end - end - end - end - if type(returnTable) == "table" and #returnTable < 1 then - return nil - else - return returnTable - end + AtlasLoot_WishListOptions:AddLine( + "text", AL["Delete Wishlist"], + "func", function() AtlasLoot:DeleteWishList() end, + "notCheckable", true + ); + --Close button + AtlasLoot_WishListOptions:AddLine( + 'text', AL["Close Menu"], + 'textR', 0, + 'textG', 1, + 'textB', 1, + 'func', function() AtlasLoot_WishListOptions:Close() end, + 'notCheckable', true + ); + end, + 'dontHook', true + ) end -- ********************************************************************** @@ -429,6 +412,7 @@ StaticPopupDialogs["ATLASLOOT_DELETE_WISHLIST"] = { end, OnAccept = function() table.remove(AtlasLootWishList[AtlasLootItemsFrame.refresh[1]], AtlasLootItemsFrame.refresh[3]); + AtlasLootWishList["Options"][playerName]["DefaultWishList"][3] = 1; if AtlasLootWishList[AtlasLootItemsFrame.refresh[1]][1] == nil then AtlasLoot:ShowItemsFrame("EmptyTable", "AtlasLoot_Data", 1); else @@ -855,7 +839,7 @@ function ALModule:OnCommReceived(prefix, message, distribution, sender) elseif message == "FinishSend" then SpamFilter[string.lower(sender)] = GetTime() elseif message == "AcceptWishlist" then - local wsltable = CloneTable(AtlasLootWishList["Own"][curtablenum]); + local wsltable = CloneTable(_G[curtable[2]][curtable[1]][curtable[3]]); for i,v in ipairs(wsltable) do v[4] = "" local dataID, dataSource, dataPage = strsplit("|", v[8]) @@ -916,7 +900,7 @@ StaticPopupDialogs["ATLASLOOT_SEND_WISHLIST"] = { else if SpamProtect(string.lower(name)) then - curtablenum = AtlasLootItemsFrame.refresh[3]; + curtable = {AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]}; ALModule:SendCommMessage("AtlasLootWishlist", "WishlistRequest", "WHISPER", name); else local _,_,timeleft = string.find( 10-(GetTime() - SpamFilter[string.lower(name)]), "(%d+)%.") diff --git a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua index ae23bf6..cc761b7 100644 --- a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua +++ b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua @@ -21,7 +21,6 @@ local BabbleZone = AtlasLoot_GetLocaleLibBabble("LibBabble-Zone-3.0") AtlasLoot_Dewdrop = AceLibrary("Dewdrop-2.0"); AtlasLoot_DewdropSubMenu = AceLibrary("Dewdrop-2.0"); AtlasLoot_DewdropExpansionMenu = AceLibrary("Dewdrop-2.0"); -AtlasLoot_DifficultyAtlas = AceLibrary("Dewdrop-2.0"); ItemindexID = 2; @@ -47,6 +46,7 @@ function AtlasLootDefaultFrame_OnShow() AtlasLoot:ShowItemsFrame(lastboss[1], "AtlasLoot_Data", lastboss[3]); AtlasLoot_DewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu); AtlasLoot:DewdropSubMenuRegister(AtlasLoot_SubMenus[lastboss[5]]); + AtlasLoot:WishListOptionsRegister(); else AtlasLoot:ShowItemsFrame("EmptyTable", "AtlasLoot_Data", 1); end @@ -144,7 +144,6 @@ function AtlasLoot:DewdropExpansionMenuRegister() for k,v in ipairs(AtlasLoot_ExpansionMenu) do if type(v) == "table" then --If a link to show a expansion menu - local checked = false; AtlasLoot_Dewdrop:AddLine( 'text', v[1], 'textR', 1, @@ -236,7 +235,6 @@ function AtlasLoot:DewdropRegister() if AtlasLoot_Modules then for k,v in ipairs(AtlasLoot_Modules) do --If a link to show a submenu - local checked = false; AtlasLoot_Dewdrop:AddLine( 'text', v[1], 'textR', 1, diff --git a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua index 39910ae..406c65e 100644 --- a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua +++ b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua @@ -57,6 +57,11 @@ local lootbground = CreateFrame("Frame", "AtlasLootDefaultFrame_LootBackground", elseif AtlasLootDefaultFrame_AdvancedSearchPanel:IsVisible() and button == "RightButton" then AtlasLoot_AdvancedSearchClose(); end + AtlasLoot_Dewdrop:Close(); + AtlasLoot_DewdropSubMenu:Close(); + AtlasLoot_DewdropExpansionMenu:Close(); + AtlasLoot_WishListDrop:Close(); + AtlasLoot_WishListOptions:Close(); end); ----------------------------------- Item Loot Panel ------------------------------------------- @@ -172,30 +177,22 @@ local backbtn = CreateFrame("Button", "AtlasLootItemsFrame_BACK", AtlasLootItems backbtn:SetScript("OnClick", function(self) AtlasLoot:BackButton_OnClick() end) backbtn:Hide(); - -- Wishlist Edit button -local editbtn = CreateFrame("Button", "AtlasLootItemsFrame_Wishlist_EDIT", AtlasLootItemsFrame, "OptionsButtonTemplate"); - editbtn:SetPoint("BOTTOM", "AtlasLootItemsFrame", "BOTTOM",-50,4); - editbtn:SetText(AL["Edit"]); - editbtn:SetScript("OnClick", function() AtlasLoot:EditWishList() end) - editbtn:Hide(); - - -- Wishlist Add button -local addbtn = CreateFrame("Button", "AtlasLootItemsFrame_Wishlist_ADD", AtlasLootItemsFrame, "OptionsButtonTemplate"); - addbtn:SetPoint("BOTTOM", "AtlasLootItemsFrame_Wishlist_EDIT", "BOTTOM",-100,0); - addbtn:SetText(AL["Add"]); - addbtn:SetScript("OnClick", function() AtlasLoot:AddWishList() end) - addbtn:Hide(); - - -- Wishlist Delete button -local deletebtn = CreateFrame("Button", "AtlasLootItemsFrame_Wishlist_DELETE", AtlasLootItemsFrame, "OptionsButtonTemplate"); - deletebtn:SetPoint("BOTTOM", "AtlasLootItemsFrame_Wishlist_EDIT", "BOTTOM",100,0); - deletebtn:SetText(AL["Delete"]); - deletebtn:SetScript("OnClick", function() AtlasLoot:DeleteWishList() end) - deletebtn:Hide(); + -- Wishlist Options button +local optionsbtn = CreateFrame("Button", "AtlasLootItemsFrame_Wishlist_Options", AtlasLootItemsFrame, "OptionsButtonTemplate"); + optionsbtn:SetPoint("BOTTOM", "AtlasLootItemsFrame", "BOTTOM",-50,4); + optionsbtn:SetText(AL["Options"]); + optionsbtn:SetScript("OnClick", function(self) + if AtlasLoot_WishListOptions:IsOpen() then + AtlasLoot_WishListOptions:Close(); + else + AtlasLoot_WishListOptions:Open(self); + end + end); + optionsbtn:Hide(); -- Wishlist Share button local sharebtn = CreateFrame("Button", "AtlasLootItemsFrame_Wishlist_Share", AtlasLootItemsFrame, "OptionsButtonTemplate"); - sharebtn:SetPoint("BOTTOM", "AtlasLootItemsFrame_Wishlist_DELETE", "BOTTOM",100,0); + sharebtn:SetPoint("BOTTOM", "AtlasLootItemsFrame_Wishlist_Options", "BOTTOM",100,0); sharebtn:SetText(AL["Share"]); sharebtn:SetScript("OnClick", function() AtlasLoot:ShareWishList() end) sharebtn:Hide(); @@ -313,7 +310,8 @@ local expansionmenubtn = CreateFrame("Button", "AtlasLootDefaultFrame_ExpansionM local wishbtn = CreateFrame("Button", "AtlasLootDefaultFrameWishListButton", AtlasLootDefaultFrame, "OptionsButtonTemplate"); wishbtn:SetPoint("BOTTOMLEFT", "AtlasLootDefaultFrame", "BOTTOMLEFT", 40, 63); wishbtn:SetSize(105,20); - wishbtn:SetScript("OnClick", function(self)AtlasLoot_ShowWishListDropDown("","","","","",self,true) end); + wishbtn:RegisterForClicks("LeftButtonDown","RightButtonDown"); + wishbtn:SetScript("OnClick", function(self, btnclick)AtlasLoot:WishListButton("","","","","",self,true,btnclick) end); wishbtn:SetText(AL["Wishlist"]); --Quick Look Buttons diff --git a/AtlasLoot/Locales/constants.en.lua b/AtlasLoot/Locales/constants.en.lua index c431dde..da8981b 100644 --- a/AtlasLoot/Locales/constants.en.lua +++ b/AtlasLoot/Locales/constants.en.lua @@ -299,6 +299,9 @@ if AL then AL["Always use default Wishlist"] = true; AL["Add Wishlist"] = true; AL["Edit Wishlist"] = true; + AL["Copy Wishlist To Own"] = true; + AL["Make Default Wishlist"] = true; + AL["Delete Wishlist"] = true; AL["Show More Icons"] = true; AL["Wishlist name:"] = true; AL["Delete"] = true;