From 0954d3c826f23bd9701b7c4d088e46814c2ec1ab Mon Sep 17 00:00:00 2001 From: Anch Date: Wed, 3 Aug 2022 21:45:32 +1200 Subject: [PATCH] started to add atlas map system into atlasloot --- AtlasLoot/Core/AtlasIntegration.lua | 88 ------------------- AtlasLoot/Core/AtlasLoot.lua | 2 - AtlasLoot/Core/Search.lua | 1 - .../DefaultFrame/AtlaslootDefaultFrame.lua | 4 + .../AtlaslootDefaultFrameCreate.lua | 15 +++- AtlasLoot/DefaultFrame/Atlasloot_Maps.lua | 0 6 files changed, 18 insertions(+), 92 deletions(-) delete mode 100644 AtlasLoot/Core/AtlasIntegration.lua create mode 100644 AtlasLoot/DefaultFrame/Atlasloot_Maps.lua diff --git a/AtlasLoot/Core/AtlasIntegration.lua b/AtlasLoot/Core/AtlasIntegration.lua deleted file mode 100644 index 4a94ab2..0000000 --- a/AtlasLoot/Core/AtlasIntegration.lua +++ /dev/null @@ -1,88 +0,0 @@ ---[[ -This file contains all the Atlas specific functions -]] - -local AL = LibStub("AceLocale-3.0"):GetLocale("AtlasLoot"); - ---[[ -AtlasLoot_SetupForAtlas: -This function sets up the Atlas specific XML objects -]] -function AtlasLoot_SetupForAtlas() - --Position the frame with the AtlasLoot version details in the Atlas frame - AtlasLootInfo:ClearAllPoints(); - AtlasLootInfo:SetParent(AtlasFrame); - AtlasLootInfo:SetPoint("TOPLEFT", "AtlasFrame", "TOPLEFT", 546, -3); - - --Anchor the bottom panel to the Atlas frame - AtlasLootPanel:ClearAllPoints(); - AtlasLootPanel:SetParent(AtlasFrame); - AtlasLootPanel:SetPoint("TOP", "AtlasFrame", "BOTTOM", 0, 9); - - --Anchor the loot table to the Atlas frame - AtlasLoot_SetItemInfoFrame(); - AtlasLootItemsFrame:Hide(); - AtlasLoot_AnchorFrame = AtlasFrame; -end - ---[[ -AtlasLootBoss_OnClick: -Invoked whenever a boss line in Atlas is clicked -Shows a loot page if one is associated with the button -]] -function AtlasLootBoss_OnClick(name) - - - - local zoneID = ATLAS_DROPDOWNS[AtlasOptions.AtlasType][AtlasOptions.AtlasZone]; - local id = this.idnum; - - - --If the loot table was already shown and boss clicked again, hide the loot table and fix boss list icons - if getglobal(name.."_Selected"):IsVisible() then - getglobal(name.."_Selected"):Hide(); - getglobal(name.."_Loot"):Show(); - AtlasLootItemsFrame:Hide(); - AtlasLootItemsFrame.activeBoss = nil; - else - --If an loot table is associated with the button, show it. Note multiple tables need to be checked due to the database structure - if (AtlasLootBossButtons[zoneID] ~= nil and AtlasLootBossButtons[zoneID][id] ~= nil and AtlasLootBossButtons[zoneID][id] ~= "") then - if AtlasLoot_IsLootTableAvailable(AtlasLootBossButtons[zoneID][id]) then - getglobal(name.."_Selected"):Show(); - getglobal(name.."_Loot"):Hide(); - local _,_,boss = string.find(getglobal(name.."_Text"):GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX']*[%) ]*(.*[^%,])[%,]?$"); - AtlasLoot_ShowBossLoot(AtlasLootBossButtons[zoneID][id], boss, AtlasFrame); - AtlasLootItemsFrame.activeBoss = id; - AtlasLoot_AtlasScrollBar_Update(); - AtlasLoot_Lastboss = AtlasLootBossButtons[zoneID][id]; - AtlasLoot_Hold = false; - end - elseif (AtlasLootWBBossButtons[zoneID] ~= nil and AtlasLootWBBossButtons[zoneID][id] ~= nil and AtlasLootWBBossButtons[zoneID][id] ~= "") then - if AtlasLoot_IsLootTableAvailable(AtlasLootWBBossButtons[zoneID][id]) then - getglobal(name.."_Selected"):Show(); - getglobal(name.."_Loot"):Hide(); - local _,_,boss = string.find(getglobal(name.."_Text"):GetText(), "|c%x%x%x%x%x%x%x%x%s*[%dX]*[%) ]*(.*[^%,])[%,]?$"); - AtlasLoot_ShowBossLoot(AtlasLootWBBossButtons[zoneID][id], boss, AtlasFrame); - AtlasLootItemsFrame.activeBoss = id; - AtlasLoot_AtlasScrollBar_Update(); - end - elseif (AtlasLootBattlegrounds[zoneID] ~= nil and AtlasLootBattlegrounds[zoneID][id] ~= nil and AtlasLootBattlegrounds[zoneID][id] ~= "") then - if AtlasLoot_IsLootTableAvailable(AtlasLootBattlegrounds[zoneID][id]) then - getglobal(name.."_Selected"):Show(); - getglobal(name.."_Loot"):Hide(); - local _,_,boss = string.find(getglobal(name.."_Text"):GetText(), "|c%x%x%x%x%x%x%x%x%s*[%wX]*[%) ]*(.*[^%,])[%,]?$"); - AtlasLoot_ShowBossLoot(AtlasLootBattlegrounds[zoneID][id], boss, AtlasFrame); - AtlasLootItemsFrame.activeBoss = id; - AtlasLoot_AtlasScrollBar_Update(); - end - end - end - - --This has been invoked from Atlas, so we remove any claim external mods have on the loot table - AtlasLootItemsFrame.externalBoss = nil; - - --Hide the AtlasQuest frame if present so that the AtlasLoot items frame is not stuck under it - if (AtlasQuestInsideFrame) then - HideUIPanel(AtlasQuestInsideFrame); - end -end diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index 41bba72..55b7312 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -66,8 +66,6 @@ local PURPLE = "|cff9F3FFF"; local BLUE = "|cff0070dd"; local ORANGE = "|cffFF8400"; -notPattern = false; - --Search panel open and close save variables --dataID, dataSource, boss, pFrame, tablenumber SearchPrevData = {"", "", "", "", ""}; diff --git a/AtlasLoot/Core/Search.lua b/AtlasLoot/Core/Search.lua index 7a5b838..94bf93f 100644 --- a/AtlasLoot/Core/Search.lua +++ b/AtlasLoot/Core/Search.lua @@ -639,7 +639,6 @@ local function DoSearch(searchText) if type(itemId) == "number" and itemId > 0 then local itemIdBackup = itemId; itemId = AL_FindId(itemId, ItemindexID) or 2; - --itemDetails[8] = ItemindexID; local item = Item:CreateFromID(itemId); item:ContinueOnLoad(function(itemId) local function GetItemDetails(itemId, atlasName) diff --git a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua index 3072b4c..dd76253 100644 --- a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua +++ b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua @@ -292,11 +292,15 @@ function AtlasLoot_SetNewStyle(style) "AtlasLootDefaultFrameLastResultButton", "AtlasLootDefaultFrameWishListButton", "AtlasLootDefaultFrameAdvancedSearchButton", +<<<<<<< Updated upstream "AtlasLootDefaultFrame_AdvancedSearchPanel_EquipButton", "AtlasLootDefaultFrame_AdvancedSearchPanel_EquipSubButton", "AtlasLootDefaultFrame_AdvancedSearchPanel_QualityButton", "AtlasLootDefaultFrame_AdvancedSearchPanel_SearchButton", "AtlasLootDefaultFrame_AdvancedSearchPanel_ClearButton", +======= + "AtlasLootDefaultFrame_MapButton", +>>>>>>> Stashed changes } if style == "new" then diff --git a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua index 07c9903..1afd5bf 100644 --- a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua +++ b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrameCreate.lua @@ -364,7 +364,7 @@ local MAX_ROWS2 = 26; -- How many rows can be shown at once? local subtableFrame = CreateFrame("Frame", "Atlasloot_SubTableFrame", AtlasLootDefaultFrame); subtableFrame:EnableMouse(true); subtableFrame:SetSize(265, ROW_HEIGHT * MAX_ROWS2 + 23); - subtableFrame:SetPoint("LEFT","Atlasloot_Difficulty_ScrollFrame","LEFT",0,-273); + subtableFrame:SetPoint("BOTTOMLEFT","Atlasloot_Difficulty_ScrollFrame",0,-446); subtableFrame:SetBackdrop({ bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", tile = true, tileSize = 16, edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 16, @@ -435,3 +435,16 @@ local rows2 = setmetatable({}, { __index = function(t, i) end }) subtableFrame.rows = rows2 + +-- Map Button +local mapbtn = CreateFrame("Button","AtlasLootDefaultFrame_MapButton", AtlasLootDefaultFrame,"UIPanelButtonTemplate2"); + mapbtn:SetSize(95,32); + mapbtn:SetPoint("BOTTOMLEFT",Atlasloot_SubTableFrame,0,-30); + mapbtn:SetScript("OnShow", function(self) + self:SetText("Map"); + self:SetFrameLevel( (self:GetParent()):GetFrameLevel() + 1 ); + end) + mapbtn:SetScript("OnClick", function() + AtlasLoot_AdvancedSearchShow(); + AtlasLootDefaultFrameSearchBox:ClearFocus(); + end) diff --git a/AtlasLoot/DefaultFrame/Atlasloot_Maps.lua b/AtlasLoot/DefaultFrame/Atlasloot_Maps.lua new file mode 100644 index 0000000..e69de29