minor tweaks

tooltip source should be more consistent now
attempt to stop error messages from wishlist
some text edits
This commit is contained in:
Spit
2024-11-28 16:13:50 +03:00
parent 630d072697
commit 3c442882a1
5 changed files with 25 additions and 29 deletions
+11 -16
View File
@@ -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
+5 -4
View File
@@ -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