From d3f3cc3808e09903696874117b535f77ec45c91e Mon Sep 17 00:00:00 2001 From: "solidity0815@gmail.com" Date: Fri, 1 Apr 2022 00:44:07 +0200 Subject: [PATCH] added scrollframe with all logged items and data for 7 day period --- CraftLog.lua | 46 ++++++++++++++++++++++++++++++++++++++++++---- CraftLog.xml | 11 +++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/CraftLog.lua b/CraftLog.lua index 3d6d5fa..3f6eded 100644 --- a/CraftLog.lua +++ b/CraftLog.lua @@ -1,5 +1,6 @@ -- get reference to main frame local f = CraftLogFrame +local sc = scScroll -- settings local debugToggle = false @@ -242,7 +243,7 @@ function GetItemStats() local t = {} -- temp table local r = {} -- return table -- structure of r {} - -- t { + -- r { -- { itemlink=link, ilvl=ilvl, used7day=7day, used14day=14day, used30day=30day, usedtotal=total, crafted7day=7day, crafted14day=14day, crafted30day=30day, craftedtotal=total}, -- { ... } --} @@ -316,10 +317,10 @@ function GetItemStats() if (t[kLink][kIlvl]["-"]["30day"] == nil) then used30day = 0 else used30day = t[kLink][kIlvl]["-"]["30day"] end if (t[kLink][kIlvl]["-"]["total"] == nil) then usedtotal = 0 else usedtotal = t[kLink][kIlvl]["-"]["total"] end end - table.insert(r, {itemLink=kLink, ilvl=kIlvl, used7day=used7day, used14day=used14day, used30day=used30day, crafted7day=crafted7day, crafted14day=crafted14day, crafted30day=crafted30day, craftedtotal=craftedtotal}) + table.insert(r, {itemlink=kLink, ilvl=kIlvl, used7day=used7day, used14day=used14day, used30day=used30day, crafted7day=crafted7day, crafted14day=crafted14day, crafted30day=crafted30day, craftedtotal=craftedtotal}) end end - table.sort(r, function(a,b) return a.itemLink + + + + + + + + + + +