From c50b45b0a415dd2a9d2d248d8aad987c5ac4e7fc Mon Sep 17 00:00:00 2001 From: telkar-rg Date: Sat, 25 Nov 2023 15:22:50 +0100 Subject: [PATCH] adds more robust loot table formating --- Altoholic-Addon/Altoholic/Loots.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Altoholic-Addon/Altoholic/Loots.lua b/Altoholic-Addon/Altoholic/Loots.lua index ff14585..d83f08b 100644 --- a/Altoholic-Addon/Altoholic/Loots.lua +++ b/Altoholic-Addon/Altoholic/Loots.lua @@ -68,12 +68,12 @@ function ns:setupLootTable() end if not lootTableRev_Multi[item_id] then - lootTableRev_Multi[item_id] = format("%s, %s", zName, encounterName) + lootTableRev_Multi[item_id] = format("%s\1%s", zName, encounterName) else if lastZone[item_id] and lastZone[item_id] == zName then - lootTableRev_Multi[item_id] = format("%s/ %s", lootTableRev_Multi[item_id], encounterName) + lootTableRev_Multi[item_id] = format("%s\1\1%s", lootTableRev_Multi[item_id], encounterName) else - lootTableRev_Multi[item_id] = format("%s; %s, %s", lootTableRev_Multi[item_id], zName, encounterName) + lootTableRev_Multi[item_id] = format("%s\1\1\1%s\1%s", lootTableRev_Multi[item_id], zName, encounterName) end end lastZone[item_id] = zName @@ -92,12 +92,12 @@ function ns:setupLootTable() end if not lootTableRev_Multi[item_id] then - lootTableRev_Multi[item_id] = format("%s, %s", zName, encounterName) + lootTableRev_Multi[item_id] = format("%s\1%s", zName, encounterName) else if lastZone[item_id] and lastZone[item_id] == zName then - lootTableRev_Multi[item_id] = format("%s/ %s", lootTableRev_Multi[item_id], encounterName) + lootTableRev_Multi[item_id] = format("%s\1\1%s", lootTableRev_Multi[item_id], encounterName) else - lootTableRev_Multi[item_id] = format("%s; %s, %s", lootTableRev_Multi[item_id], zName, encounterName) + lootTableRev_Multi[item_id] = format("%s\1\1\1%s\1%s", lootTableRev_Multi[item_id], zName, encounterName) end end lastZone[item_id] = zName @@ -151,7 +151,13 @@ end function ns:GetSource_multi(searchedID) -- LootSourceTooltipDB.multi - return LootSourceTooltipDB.multi[searchedID] + if LootSourceTooltipDB.multi[searchedID] then + local txt = LootSourceTooltipDB.multi[searchedID] + txt = gsub(txt, "\1\1\1","; ") + txt = gsub(txt, "\1\1","/ ") + txt = gsub(txt, "\1",", ") + return txt + end end function ns:GetSource_OLD(searchedID) -- old version