From c84ea5d9f5c9294491ffbc8bdd3705c40342a415 Mon Sep 17 00:00:00 2001 From: Ashish Khatri Date: Thu, 30 Jan 2020 18:56:38 -0600 Subject: [PATCH] add deletes and deletedby to loot and dkp history exports --- Modules/exportDKP.lua | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Modules/exportDKP.lua b/Modules/exportDKP.lua index d2db3873..440e3db8 100644 --- a/Modules/exportDKP.lua +++ b/Modules/exportDKP.lua @@ -130,7 +130,21 @@ local function GenerateDKPTables(table, format) ExportString = "\n"; for i=1, numrows do - ExportString = ExportString.." \n "..MonDKP_DKPHistory[i].players.."\n "..MonDKP_DKPHistory[i].dkp.."\n "..MonDKP_DKPHistory[i].date.."\n "..MonDKP_DKPHistory[i].reason.."\n \n"; + local deletes; + local deletedby; + if MonDKP_DKPHistory[i].deletes == nil then + deletes = '' + else + deletes = MonDKP_DKPHistory[i].deletes + end + + if MonDKP_DKPHistory[i].deletedby == nil then + deletedby = '' + else + deletedby = MonDKP_DKPHistory[i].deletedby + end + + ExportString = ExportString.." \n "..MonDKP_DKPHistory[i].players.."\n "..MonDKP_DKPHistory[i].dkp.."\n "..MonDKP_DKPHistory[i].date.."\n "..MonDKP_DKPHistory[i].reason.."\n "..deletes.."\n "..deletedby.."\n \n"; end ExportString = ExportString..""; elseif table == MonDKP_Loot then @@ -148,7 +162,21 @@ local function GenerateDKPTables(table, format) local itemNumber = strsub(cur, string.find(cur, "Hitem:")+6, string.find(cur, ":", string.find(cur, "Hitem:")+6)-1) local itemName = strsub(cur, string.find(cur, "::|h%[")+5, string.find(cur, "%]", string.find(cur, "::|h%[")+5)-1) - ExportString = ExportString.." \n "..MonDKP_Loot[i].player.."\n "..itemName.."\n "..itemNumber.."\n "..MonDKP_Loot[i].zone.."\n "..MonDKP_Loot[i].boss.."\n "..MonDKP_Loot[i].date.."\n "..MonDKP_Loot[i].cost.."\n \n"; + local deletes; + local deletedby; + if MonDKP_Loot[i].deletes == nil then + deletes = '' + else + deletes = MonDKP_Loot[i].deletes + end + + if MonDKP_Loot[i].deletedby == nil then + deletedby = '' + else + deletedby = MonDKP_Loot[i].deletedby + end + + ExportString = ExportString.." \n "..MonDKP_Loot[i].player.."\n "..itemName.."\n "..itemNumber.."\n "..MonDKP_Loot[i].zone.."\n "..MonDKP_Loot[i].boss.."\n "..MonDKP_Loot[i].date.."\n "..MonDKP_Loot[i].cost.."\n "..deletes.."\n "..deletedby.."\n \n"; end ExportString = ExportString..""; end