From a70a8ef3024707d8255a5e5091ed9580ca3d385a Mon Sep 17 00:00:00 2001 From: Spit <19otari98@gmail.com> Date: Mon, 27 Jan 2025 17:58:54 +0300 Subject: [PATCH] 3.0.8 fixed bug causing questlog colors to change added missing transmutes to Alchemy --- AtlasLoot.toc | 2 +- Core/AtlasLoot.lua | 176 ++++++++------------------------------- Core/Spells.lua | 26 ++++++ Core/WishList.lua | 29 +++++++ Crafting/crafting.en.lua | 4 + 5 files changed, 94 insertions(+), 143 deletions(-) diff --git a/AtlasLoot.toc b/AtlasLoot.toc index 0e66e49..57f2a44 100644 --- a/AtlasLoot.toc +++ b/AtlasLoot.toc @@ -3,7 +3,7 @@ ## Notes: Shows possible loot from dungeon bosses and other sources. ## Author: Shagu (pfUI update code), Lexie (Turtle WoW fixes/updates), Otari (overhaul/revamp, menu changes, bugfixes/updates) ## LegacyAuthor: Daviesh, Pompa (Turtle WoW World Bosses), Xerron (Turtle WoW World Bosses), Gurky (Turtle WoW 1.16/1.16.1 Dungeons) -## Version: 3.0.8 +## Version: 3.0.9 ## SavedVariables: AtlasLoot_updateavailable ## SavedVariablesPerCharacter: AtlasLootCharDB ## OptionalDeps: Alphamap, AtlasLoader, LootLink, ItemSync, HewdropLib, Ace2, EquipCompare, EQCompare diff --git a/Core/AtlasLoot.lua b/Core/AtlasLoot.lua index a5037a3..3871f35 100644 --- a/Core/AtlasLoot.lua +++ b/Core/AtlasLoot.lua @@ -110,6 +110,35 @@ AtlasLoot_MenuList = { "JEWELCRAFTMENU" }; +local function strsplit(delim, str, maxNb, onlyLast) + -- Eliminate bad cases... + if string.find(str, delim) == nil then + return { str } + end + if maxNb == nil or maxNb < 1 then + maxNb = 0 + end + local result = {} + local pat = "(.-)" .. delim .. "()" + local nb = 0 + local lastPos + for part, pos in string.gfind(str, pat) do + nb = nb + 1 + result[nb] = part + lastPos = pos + if nb == maxNb then break end + end + -- Handle the last field + if nb ~= maxNb then + result[nb+1] = string.sub(str, lastPos) + end + if onlyLast then + return result[nb+1] + else + return result[1], result[2] + end +end + --[[ AtlasLootDefaultFrame_OnShow: Called whenever the loot browser is shown and sets up buttons and loot tables @@ -2107,35 +2136,6 @@ function AtlasLootMinimapButton_SetPosition(v) AtlasLootMinimapButton_UpdatePosition(); end -function strsplit(delim, str, maxNb, onlyLast) - -- Eliminate bad cases... - if string.find(str, delim) == nil then - return { str } - end - if maxNb == nil or maxNb < 1 then - maxNb = 0 - end - local result = {} - local pat = "(.-)" .. delim .. "()" - local nb = 0 - local lastPos - for part, pos in string.gfind(str, pat) do - nb = nb + 1 - result[nb] = part - lastPos = pos - if nb == maxNb then break end - end - -- Handle the last field - if nb ~= maxNb then - result[nb+1] = string.sub(str, lastPos) - end - if onlyLast then - return result[nb+1] - else - return result[1], result[2] - end -end - --This is a multi-layer table defining the main loot listing. --Entries have the text to display, loot table or sub table to link to and if the link is to a loot table or sub table AtlasLoot_HewdropDown = { @@ -3629,15 +3629,15 @@ function AtlasLoot_ShowContainerFrame() itemButton.extraInfo = containerTable[i][j][2] local _,_,quality,_,_,_,_,_,tex = GetItemInfo(itemID) local icon = getglobal("AtlasLootContainerItem"..buttonIndex.."Icon") - local color = { r = 1, g = 1, b = 1} + local r, g, b = 1, 1, 1 if quality then - color.r, color.g, color.b = GetItemQualityColor(quality) + r, g, b = GetItemQualityColor(quality) end if not tex then tex = "Interface\\Icons\\INV_Misc_QuestionMark" end itemButton:SetPoint("TOPLEFT", AtlasLootItemsFrameContainer, (col * 35) + 5, -(row * 35) - 5) - itemButton:SetBackdropBorderColor(color.r, color.g, color.b) + itemButton:SetBackdropBorderColor(r, g, b) itemButton:SetID(itemID) itemButton:Show() icon:SetTexture(tex) @@ -3674,9 +3674,9 @@ function AtlasLoot_AddContainerItemTooltip(frame ,itemID) if icon:GetTexture() == "Interface\\Icons\\INV_Misc_QuestionMark" then local _,_,quality,_,_,_,_,_,tex = GetItemInfo(itemID) if tex and quality then - color.r, color.g, color.b = GetItemQualityColor(quality) + local r, g, b = GetItemQualityColor(quality) icon:SetTexture(tex) - this:SetBackdropBorderColor(color.r, color.g, color.b) + this:SetBackdropBorderColor(r, g, b) end end end) @@ -3887,111 +3887,3 @@ function AtlasLoot_GetChatLink(id) local e = string.sub(d, 2) return "\124"..e.."\124H"..b.."\124h["..a.."]\124h\124r" end ---[[ ---pfUI.api.strsplit --Uses code borrowed from pfUI by Shagu -local function AtlasLoot_strsplit(delimiter, subject) - if not subject then return nil end - local delimiter, fields = delimiter or ":", {} - local pattern = string.format("([^%s]+)", delimiter) - string.gsub(subject, pattern, function(c) fields[table.getn(fields)+1] = c end) - return unpack(fields) -end - ---Update announcing code taken from pfUI by Shagu -local major, minor, fix = AtlasLoot_strsplit(".", tostring(GetAddOnMetadata("AtlasLoot", "Version"))) -local alreadyshown = false -local localversion = tonumber(major*10000 + minor*100 + fix) -local remoteversion = tonumber(AtlasLoot_updateavailable) or 0 -local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" } -local groupchannels = { "BATTLEGROUND", "RAID" } - -AtlasLoot_updater = CreateFrame("Frame") -AtlasLoot_updater:RegisterEvent("CHAT_MSG_ADDON") -AtlasLoot_updater:RegisterEvent("CHAT_MSG_CHANNEL") -AtlasLoot_updater:RegisterEvent("PLAYER_ENTERING_WORLD") ---AtlasLoot_updater:RegisterEvent("PARTY_MEMBERS_CHANGED") --Remove some unnecessary addon spam and allow different AtlasLoot branches to coexist -AtlasLoot_updater:RegisterEvent("CHAT_MSG_CHANNEL_JOIN") - -AtlasLootUserCounter = {} -PlayerCounter = {} - -AtlasLoot_updater:SetScript("OnEvent", function() - if event == "CHAT_MSG_ADDON" and arg1 == "AtlasLoot" then - local v, remoteversion, remotetitle = AtlasLoot_strsplit(":", arg2) - local _,title = GetAddOnInfo("AtlasLoot") - local remoteversion = tonumber(remoteversion) - if remoteversion >= 40000 then remoteversion = 0 end --Block for people using some version from another version of WoW. - if v == "VERSION" and remoteversion and title == remotetitle then - if remoteversion > localversion then - AtlasLoot_updateavailable = remoteversion - if not alreadyshown then - DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasLoot]|r New version available! https://github.com/Otari98/AtlasLoot") - alreadyshown = true - end - end - end - end - - if event == "CHAT_MSG_CHANNEL_JOIN" then - local name = arg2 - if not PlayerCounter[name] then - PlayerCounter[name] = 1 - end - end - - if event == "CHAT_MSG_CHANNEL" then - local _,_,source = string.find(arg4,"(%d+)%.") - if source then - _,name = GetChannelName(source) - end - if not name then return end - if string.upper(name) == "LFT" then - local msg, v, remoteversion, remotetitle = AtlasLoot_strsplit(":", arg1) - if msg == "Atlasloot" then - local remoteversion = tonumber(remoteversion) or 0 - local _,title = GetAddOnInfo("AtlasLoot") - if remoteversion >= 40000 then remoteversion = 0 end --Block for people using some version from another version of WoW. - if v == "VERSION" and remoteversion and title == remotetitle then - if remoteversion > localversion then - AtlasLoot_updateavailable = remoteversion - if not alreadyshown then - DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasLoot]|r New version available! https://github.com/Otari98/AtlasLoot") - alreadyshown = true - end - end - end - local name = arg2 - if not AtlasLootUserCounter[name] then - AtlasLootUserCounter[name] = 1 - end - end - end - end - - local _,title = GetAddOnInfo("AtlasLoot") - if event == "PARTY_MEMBERS_CHANGED" then - local groupsize = GetNumRaidMembers() > 0 and GetNumRaidMembers() or GetNumPartyMembers() > 0 and GetNumPartyMembers() or 0 - if ( this.group or 0 ) < groupsize then - for _, chan in pairs(groupchannels) do - SendAddonMessage("AtlasLoot", "VERSION:" .. localversion..":"..title, chan) - end - end - this.group = groupsize - end - - if event == "PLAYER_ENTERING_WORLD" then - if not alreadyshown and localversion < remoteversion then - DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasLoot]|r New version available! https://github.com/Otari98/AtlasLoot") - AtlasLoot_updateavailable = localversion - alreadyshown = true - end - - for _, chan in pairs(loginchannels) do - SendAddonMessage("AtlasLoot", "VERSION:" .. localversion..":"..title, chan) - end - if GetChannelName("LFT") ~= 0 then - SendChatMessage("Atlasloot:VERSION:" .. localversion..":"..title, "CHANNEL", nil, GetChannelName("LFT")) - end - end - end) -]] \ No newline at end of file diff --git a/Core/Spells.lua b/Core/Spells.lua index 437e54b..af6e420 100644 --- a/Core/Spells.lua +++ b/Core/Spells.lua @@ -6882,6 +6882,32 @@ GetSpellInfoAtlasLootDB = { [2] = {2320, 3}, }, }, + [57557] = { + ["name"] = "Transmute: Elemental Water", + ["requires"] = "", + ["tools"] = {9149}, + ["castTime"] = 43, + ["text"] = "Transmutes a Globe of Water into three Elemental Water.", + ["craftItem"] = 7070, + ["craftQuantityMin"] = 3, + ["craftQuantityMax"] = "", + ["reagents"] = { + [1] = {7079}, + }, + }, + [57555] = { + ["name"] = "Transmute: Elemental Earth", + ["requires"] = "", + ["tools"] = {9149}, + ["castTime"] = 43, + ["text"] = "Transmutes a Core of Earth into three Elemental Earth.", + ["craftItem"] = 7067, + ["craftQuantityMin"] = 3, + ["craftQuantityMax"] = "", + ["reagents"] = { + [1] = {7075}, + }, + }, [2329] = { ["name"] = "Alchemy: Elixir of Lion's Strength", ["requires"] = "", diff --git a/Core/WishList.lua b/Core/WishList.lua index 375f6aa..6b1c004 100644 --- a/Core/WishList.lua +++ b/Core/WishList.lua @@ -14,6 +14,35 @@ local PURPLE = "|cff9F3FFF"; local BLUE = "|cff0070dd"; local ORANGE = "|cffFF8400"; +local function strsplit(delim, str, maxNb, onlyLast) + -- Eliminate bad cases... + if string.find(str, delim) == nil then + return { str } + end + if maxNb == nil or maxNb < 1 then + maxNb = 0 + end + local result = {} + local pat = "(.-)" .. delim .. "()" + local nb = 0 + local lastPos + for part, pos in string.gfind(str, pat) do + nb = nb + 1 + result[nb] = part + lastPos = pos + if nb == maxNb then break end + end + -- Handle the last field + if nb ~= maxNb then + result[nb+1] = string.sub(str, lastPos) + end + if onlyLast then + return result[nb+1] + else + return result[1], result[2] + end +end + --[[ AtlasLoot_ShowWishList() Displays the WishList diff --git a/Crafting/crafting.en.lua b/Crafting/crafting.en.lua index a6b7657..a4f7a4c 100644 --- a/Crafting/crafting.en.lua +++ b/Crafting/crafting.en.lua @@ -395,6 +395,8 @@ AtlasLoot_Data["AtlasLootCrafting"] = { { "s24368", "inv_potion_80", "=q1=Major Troll's Blood Potion", "=ds=#sr# =so1=290 =so2=305 =so3=325 =so4=345" }, { "s17580", "inv_potion_76", "=q1=Major Mana Potion", "=ds=#sr# =so1=295 =so2=310 =so3=330 =so4=350" }, { "s25146", "spell_fire_fire", "=q1=Transmute: Elemental Fire", "=ds=#sr# =so1=300 =so2=301 =so3=305 =so4=310" }, + { "s57555", "INV_Ore_Iron_01", "=q1=Transmute: Elemental Earth", "=ds=#sr# =so1=300 =so2=315 =so3=322 =so4=330" }, + { "s57557", "INV_Potion_03", "=q1=Transmute: Elemental Water", "=ds=#sr# =so1=300 =so2=315 =so3=322 =so4=330" }, { "s22732", "inv_potion_47", "=q1=Major Rejuvenation Potion", "=ds=#sr# =so1=300 =so2=310 =so3=320 =so4=330" }, { "s17638", "inv_potion_48", "=q1=Flask of Chromatic Resistance", "=ds=#sr# =so1=300 =so2=315 =so3=322 =so4=330" }, { "s17636", "inv_potion_97", "=q1=Flask of Distilled Wisdom", "=ds=#sr# =so1=300 =so2=315 =so3=322 =so4=330" }, @@ -465,6 +467,8 @@ AtlasLoot_Data["AtlasLootCrafting"] = { { "s17564", "spell_shadow_shadetruesight", "=q2=Transmute: Water to Undeath", "=ds=#sr# =so1=275 =so2=275 =so3=282 =so4=290" }, { "s17187", "inv_misc_stonetablet_05", "=q2=Transmute: Arcanite", "=ds=#sr# =so1=275 =so2=275 =so3=282 =so4=290" }, { "s25146", "spell_fire_fire", "=q1=Transmute: Elemental Fire", "=ds=#sr# =so1=300 =so2=301 =so3=305 =so4=310" }, + { "s57555", "INV_Ore_Iron_01", "=q1=Transmute: Elemental Earth", "=ds=#sr# =so1=300 =so2=315 =so3=322 =so4=330" }, + { "s57557", "INV_Potion_03", "=q1=Transmute: Elemental Water", "=ds=#sr# =so1=300 =so2=315 =so3=322 =so4=330" }, }; AlchemyDefensive1 = { { "s7183", "inv_potion_63", "=q1=Elixir of Minor Defense", "=ds=#sr# =so1=1 =so2=55 =so3=75 =so4=95" },