From 3c442882a11d1568f3a5f394f01fedaaef5118ef Mon Sep 17 00:00:00 2001 From: Spit <19otari98@gmail.com> Date: Thu, 28 Nov 2024 16:13:50 +0300 Subject: [PATCH] minor tweaks tooltip source should be more consistent now attempt to stop error messages from wishlist some text edits --- Core/Tooltip.lua | 27 +++++++++++---------------- Core/WishList.lua | 9 +++++---- Instances/instances.en.lua | 12 ++++++------ Sets/sets.lua | 4 ++-- TableRegister/loottables.en.lua | 2 +- 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Core/Tooltip.lua b/Core/Tooltip.lua index 9291d63..0d9219e 100644 --- a/Core/Tooltip.lua +++ b/Core/Tooltip.lua @@ -132,21 +132,16 @@ function GameTooltip.SetTradeTargetItem(self, index) return HookSetTradeTargetItem(self, index) end -local lastItemName, lastItemID, lastSourceStr, lastDropRate +local lastItemID, lastSourceStr, lastDropRate function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) if AtlasLootCharDB.ShowSource ~= true then return end local originalTooltip = {} local itemName = getglobal(tooltipTypeStr .. "TextLeft1"):GetText() local line2 = getglobal(tooltipTypeStr .. "TextLeft2") local craftSpell, source, sourceStr, dropRate - local isCraft = false - local isWBLoot = false - local isPvP = false - local isRepReward = false - local isSetPiece = false - local isWorldEvent = false + local isCraft, isWBLoot, isPvP, isRepReward, isSetPiece, isWorldEvent = false, false, false, false, false, false if itemName and itemName ~= "Fashion Coin" and tooltip.itemID then - if itemName ~= lastItemName or tooltip.itemID ~= lastItemID then + if tooltip.itemID ~= lastItemID then for row = 1, 30 do local tooltipRowLeft = getglobal(tooltipTypeStr .. 'TextLeft' .. row) if tooltipRowLeft then @@ -207,7 +202,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) if not isCraft then for k1,v1 in pairs(AtlasLoot_Data["AtlasLootWBItems"]) do for k2,v2 in pairs(AtlasLoot_Data["AtlasLootWBItems"][k1]) do - if v2[1] == tonumber(tooltip.itemID) and string.find(v2[3], itemName, 1, true) then + if v2[1] == tonumber(tooltip.itemID) then source = k1 isWBLoot = true if v2[5] then @@ -224,7 +219,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) if not isCraft and not isWBLoot then for k1,v1 in pairs(AtlasLoot_Data["AtlasLootGeneralPvPItems"]) do for k2,v2 in pairs(AtlasLoot_Data["AtlasLootGeneralPvPItems"][k1]) do - if v2[1] == tonumber(tooltip.itemID) and string.find(v2[3], itemName, 1, true) then + if v2[1] == tonumber(tooltip.itemID) then source = k1 isPvP = true lastDropRate = nil @@ -237,7 +232,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) if not isCraft and not isWBLoot and not isPvP then for k1,v1 in pairs(AtlasLoot_Data["AtlasLootBGItems"]) do for k2,v2 in pairs(AtlasLoot_Data["AtlasLootBGItems"][k1]) do - if v2[1] == tonumber(tooltip.itemID) and string.find(v2[3], itemName, 1, true) then + if v2[1] == tonumber(tooltip.itemID) then source = k1 isRepReward = true if v2[5] then @@ -252,7 +247,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) -- factions for k1,v1 in pairs(AtlasLoot_Data["AtlasLootRepItems"]) do for k2,v2 in pairs(AtlasLoot_Data["AtlasLootRepItems"][k1]) do - if v2[1] == tonumber(tooltip.itemID) and string.find(v2[3], itemName, 1, true) then + if v2[1] == tonumber(tooltip.itemID) then source = k1 isRepReward = true if v2[5] and source ~= "Darkmoon" and not string.find(source, "Cenarion",1,true) then @@ -269,7 +264,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) if not isCraft and not isWBLoot and not isPvP and not isRepReward then for k1,v1 in pairs(AtlasLoot_Data["AtlasLootSetItems"]) do for k2,v2 in pairs(AtlasLoot_Data["AtlasLootSetItems"][k1]) do - if v2[1] == tonumber(tooltip.itemID) and string.find(v2[3], itemName, 1, true) then + if v2[1] == tonumber(tooltip.itemID) then source = k1 isSetPiece = true if (source == "SpiritofEskhandar" or @@ -316,7 +311,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) for k1,v1 in pairs(AtlasLoot_Data["AtlasLootItems"]) do for k2,v2 in pairs(AtlasLoot_Data["AtlasLootItems"][k1]) do if v2[1] ~= 0 then - if v2[1] == tonumber(tooltip.itemID) and string.find(v2[3], itemName,1,true) then + if v2[1] == tonumber(tooltip.itemID) then if k1 ~= "VanillaKeys" then source = k1 end @@ -331,7 +326,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) end end end - lastItemName = itemName + lastItemID = tooltip.itemID if not source then lastSourceStr = nil @@ -363,7 +358,7 @@ function AtlasLootTip.extendTooltip(tooltip, tooltipTypeStr) end end - elseif itemName == lastItemName and tooltip.itemID == lastItemID then + elseif tooltip.itemID == lastItemID then if lastSourceStr then if line2:GetText() then if lastDropRate then diff --git a/Core/WishList.lua b/Core/WishList.lua index cc0e094..58ec62e 100644 --- a/Core/WishList.lua +++ b/Core/WishList.lua @@ -257,13 +257,14 @@ function AtlasLoot_CategorizeWishList(wlTable) if ((table.getn(result) + 1) - math.floor((table.getn(result) + 1)/15)*15) == 0 then table.insert(result, { 0, "", "", "" }) end -- Subheading - --[[ some debug code that I've used to fix WishList errors before due to people adding drops to AtlasLoot incorrectly. + -- some debug code that I've used to fix WishList errors before due to people adding drops to AtlasLoot incorrectly. local box = k or "Unknown" local cat = categories[k][1][5] or "Unknown" - print("box: "..box.." - cat: "..cat) - table.insert(result, { 0, "INV_Box_01", "=q6="..box, "=q0="..GetLootTableParent(strsplit("|", cat)) });]]-- + local parent = GetLootTableParent(strsplit("|", cat)) or "Unknown" + --print("box: "..box.." - cat: "..cat) + table.insert(result, { 0, "INV_Box_01", "=q6="..box, "=q0="..parent }); - table.insert(result, { 0, "INV_Box_01", "=q6="..k, "=q0="..GetLootTableParent(strsplit("|", categories[k][1][5])) }); + --table.insert(result, { 0, "INV_Box_01", "=q6="..k, "=q0="..GetLootTableParent(strsplit("|", categories[k][1][5])) }); -- Sort first then add items table.sort(v, AtlasLoot_WishListSortCheck); -- not works? for i = 1, table.getn(v) do table.insert(result, v[i]) end diff --git a/Instances/instances.en.lua b/Instances/instances.en.lua index 301a149..0ebfaa2 100644 --- a/Instances/instances.en.lua +++ b/Instances/instances.en.lua @@ -1003,7 +1003,7 @@ AtlasLoot_Data["AtlasLootItems"] = { { 16911, "INV_Bracer_02", "=q4=Bloodfang Bracers", "=ds=#s8#, #a2# =q12=#c6#", "11%" }, { 16904, "INV_Bracer_03", "=q4=Stormrage Bracers", "=ds=#s8#, #a2# =q13=#c1#", "11%" }, { 16935, "INV_Bracer_17", "=q4=Dragonstalker's Bracers", "=ds=#s8#, #a3# =q14=#c2#", "11%" }, - { 16943, "INV_Bracer_16", "=q4=Bracers of Ten Storms", "=ds=#s8#, #a3# =q15=#c7#", "11%" }, + { 16943, "INV_Bracer_16", "=q4=Bindings of Ten Storms", "=ds=#s8#, #a3# =q15=#c7#", "11%" }, { 16951, "INV_Bracer_18", "=q4=Judgement Bindings", "=ds=#s8#, #a4# =q16=#c4#", "11%" }, { 16959, "INV_Bracer_19", "=q4=Bracelets of Wrath", "=ds=#s8#, #a4# =q17=#c9#", "11%" }, { 0,"","","" }, @@ -1305,7 +1305,7 @@ AtlasLoot_Data["AtlasLootItems"] = { { 16812, "INV_Gauntlets_14", "=q4=Gloves of Prophecy", "=ds=#s9#, #a1# =q9=#c5#", "25%" }, { 16826, "INV_Gauntlets_21", "=q4=Nightslayer Gloves", "=ds=#s9#, #a2# =q12=#c6#", "25%" }, { 16849, "INV_Boots_Chain_13", "=q4=Giantstalker's Boots", "=ds=#s12#, #a3# =q14=#c2#", "25%" }, - { 16839, "INV_Gauntlets_11", "=q4=Earthfury Gauntlets", "=ds=#s9#, #a3# =q15=#c7#", "25%" }, + { 16839, "INV_Gauntlets_11", "=q4=Earthfury Gloves", "=ds=#s9#, #a3# =q15=#c7#", "25%" }, { 16860, "INV_Gauntlets_29", "=q4=Lawbringer Gauntlets", "=ds=#s9#, #a4# =q16=#c4#", "25%" }, { 16862, "INV_Boots_Plate_04", "=q4=Sabatons of Might", "=ds=#s12#, #a4# =q17=#c9#", "25%" }, { 0,"","","" }, @@ -1423,7 +1423,7 @@ AtlasLoot_Data["AtlasLootItems"] = { { 16820, "INV_Chest_Cloth_07", "=q4=Nightslayer Chestpiece", "=ds=#s5#, #a2# =q12=#c6#", "25%" }, { 16833, "INV_Chest_Cloth_06", "=q4=Cenarion Vestments", "=ds=#s5#, #a2# =q13=#c1#", "20%" }, { 16845, "INV_Chest_Chain_03", "=q4=Giantstalker's Breastplate", "=ds=#s5#, #a3# =q14=#c2#", "20%" }, - { 16841, "INV_Chest_Chain_11", "=q4=Earthfury Vestments", "=ds=#s5#, #a3# =q15=#c7#", "20%" }, + { 16841, "INV_Chest_Chain_11", "=q4=Earthfury Chestpiece", "=ds=#s5#, #a3# =q15=#c7#", "20%" }, { 16853, "INV_Chest_Plate03", "=q4=Lawbringer Chestguard", "=ds=#s5#, #a4# =q16=#c4#", "20%" }, { 16865, "INV_Chest_Plate16", "=q4=Breastplate of Might", "=ds=#s5#, #a4# =q17=#c9#", "20%" }, { 0,"","","" }, @@ -1717,7 +1717,7 @@ AtlasLoot_Data["AtlasLootItems"] = { { 0,"","","" }, { 0,"","","" }, { 0,"","","" }, - { 19872, "Ability_Mount_Raptor", "=q4=Swift Razzashi Raptor", "=ds=#e7#", "2%" }, + { 19872, "Ability_Mount_Raptor", "=q4=Armored Razzashi Raptor", "=ds=#e7#", "2%" }, { 20038, "INV_Waepon_Bow_ZulGrub_D_01", "=q4=Mandokir's Sting", "=ds=#w2#", "8%" }, { 19867, "INV_Sword_54", "=q4=Bloodlord's Defender", "=ds=#h3#, #w10#", "8%" }, { 19866, "INV_Sword_55", "=q4=Warblade of the Hakkari", "=ds=#h4#, #w10#", "8%" }, @@ -1945,7 +1945,7 @@ AtlasLoot_Data["AtlasLootItems"] = { { 19711, "INV_Bijou_Green", "=q3=Green Hakkari Bijou", "=ds=#m39#", "2%" }, { 19710, "INV_Bijou_Orange", "=q3=Orange Hakkari Bijou", "=ds=#m39#", "2%" }, { 19712, "INV_Bijou_Purple", "=q3=Purple Hakkari Bijou", "=ds=#m39#", "2%" }, - { 19707, "INV_Bijou_Red", "=q3=Red aHakkari Bijou", "=ds=#m39#", "2%" }, + { 19707, "INV_Bijou_Red", "=q3=Red Hakkari Bijou", "=ds=#m39#", "2%" }, { 19714, "INV_Bijou_Silver", "=q3=Silver Hakkari Bijou", "=ds=#m39#", "2%" }, { 19709, "INV_Bijou_Yellow", "=q3=Yellow Hakkari Bijou", "=ds=#m39#", "2%" }, }; @@ -2023,7 +2023,7 @@ AtlasLoot_Data["AtlasLootItems"] = { { 20888, "INV_Qiraj_RingCeremonial", "=q3=Qiraji Ceremonial Ring", "=q14=#c2#=ds=, =q12=#c6#=ds=, =q9=#c5#=ds=, =q11=#c8#", "25%" }, { 20884, "INV_Qiraj_RingMagisterial", "=q3=Qiraji Magisterial Ring", "=q17=#c9#=ds=, =q16=#c4#=ds=, =q15=#c7#=ds=, =q10=#c3#=ds=, =q13=#c1#", "25%" }, { 0, "", "", "" }, - { 81004, "inv_weapon_shortblade_27", "=q3=Sandswept Obsidian Dagger", "=ds=#h1#, #w4#", "10%" }, + { 81004, "inv_weapon_shortblade_27", "=q4=Sandswept Obsidian Dagger", "=ds=#h1#, #w4#", "10%" }, }; AQ20Moam = { { 21472, "INV_Helmet_62", "=q4=Dustwind Turban", "=ds=#s1#, #a1#", "25%" }, diff --git a/Sets/sets.lua b/Sets/sets.lua index 44cb2ce..81e5ee3 100644 --- a/Sets/sets.lua +++ b/Sets/sets.lua @@ -899,7 +899,7 @@ AtlasLoot_Data["AtlasLootSetItems"] = { { 16844, "INV_Shoulder_29", "=q4=Earthfury Epaulets", "=ds=#s3#, #a3# =q7=#db29#" }, { 16841, "INV_Chest_Chain_11", "=q4=Earthfury Vestments", "=ds=#s5#, #a3# =q7=#db32#" }, { 16840, "INV_Bracer_16", "=q4=Earthfury Bracers", "=ds=#s8#, #a3# =q7=#x34# #z1#" }, - { 16839, "INV_Gauntlets_11", "=q4=Earthfury Gauntlets", "=ds=#s9#, #a3# =q7=#db27#" }, + { 16839, "INV_Gauntlets_11", "=q4=Earthfury Gloves", "=ds=#s9#, #a3# =q7=#db27#" }, { 16838, "INV_Belt_14", "=q4=Earthfury Belt", "=ds=#s10#, #a3# =q7=#x34# #z1#" }, { 16843, "INV_Pants_03", "=q4=Earthfury Legguards", "=ds=#s11#, #a3# =q7=#db26#" }, { 16837, "INV_Boots_Plate_06", "=q4=Earthfury Boots", "=ds=#s12#, #a3# =q7=#db25#" }, @@ -1630,7 +1630,7 @@ AtlasLoot_Data["AtlasLootSetItems"] = { { 21176, "INV_Misc_QirajiCrystal_05", "=q5=Black Qiraji Resonating Crystal", "=ds=#e7#" }, { 0, "", "", "" }, { 13335, "Ability_Mount_Undeadhorse", "=q4=Deathcharger's Reins", "=ds=#e7#" }, - { 19872, "Ability_Mount_Raptor", "=q4=Swift Razzashi Raptor", "=ds=#e7#" }, + { 19872, "Ability_Mount_Raptor", "=q4=Armored Razzashi Raptor", "=ds=#e7#" }, { 19902, "Ability_Mount_JungleTiger", "=q4=Swift Zulian Tiger", "=ds=#e7#" }, { 13086, "Ability_Mount_PinkTiger", "=q4=Reins of the Winterspring Frostsaber", "=ds=#e7#" }, { 23720, "Ability_Hunter_Pet_Turtle", "=q4=Riding Turtle", "=ds=#e7#" }, diff --git a/TableRegister/loottables.en.lua b/TableRegister/loottables.en.lua index 48b8d1e..ece56aa 100644 --- a/TableRegister/loottables.en.lua +++ b/TableRegister/loottables.en.lua @@ -112,7 +112,7 @@ AtlasLoot_TableNames = { ["DMCookie"] = { AL["The Deadmines"].." - "..AL["Cookie"], "AtlasLootItems" }, ["DMCaptainGreenskin"] = { AL["The Deadmines"].." - "..AL["Captain Greenskin"], "AtlasLootItems" }, ["DMVanCleef"] = { AL["The Deadmines"].." - "..AL["Edwin VanCleef"], "AtlasLootItems" }, - ["DMTrash"] = { AL["The Deadmines"].." - "..AL["Trash Mobs"] .. " (" .. AL["The Deadmines"] .. ")", "AtlasLootItems" }, + ["DMTrash"] = { AL["The Deadmines"].." - "..AL["Trash Mobs"], "AtlasLootItems" }, --Dire Maul East ["DMEPusillin"] = { AL["Dire Maul (East)"].." - "..AL["Pusillin"], "AtlasLootItems" }, ["DMEZevrimThornhoof"] = { AL["Dire Maul (East)"].." - "..AL["Zevrim Thornhoof"], "AtlasLootItems" },