diff --git a/HistOffline.lua b/HistOffline.lua
index 7a9f9b0..99bcdd3 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -99,7 +99,7 @@ local names = {} display = {}
--print (dump(display))
function print_old()
for i,j in pairs (History_SV["Default"][myaccount]["$AccountWide"]["old"]) do
- print (i .. " .. " .. j)
+ print (i .. " .. " .. dump(j))
end
end
@@ -361,8 +361,9 @@ end
local logtable =iup.matrix{numcol=1, numcol_visible=1, numlin=0}
- logtable:setcell(0,1, L.TStamp)
- iup.SetAttribute(logtable, "WIDTH0", 0)
+ logtable:setcell(0,0, L.TStamp)
+ iup.SetAttribute(logtable, "ALIGNMENT0", "ACENTER")
+ iup.SetAttribute(logtable, "WIDTH0", 80)
iup.SetAttribute(logtable, "WIDTH1", 200)
@@ -371,17 +372,20 @@ function Load_Log()
then return
end
local Line=0
+ local TimeStr = ""
logtable.numlin = Line
for i,j in ipairs (History_SV["Default"][myaccount]["$AccountWide"]["log"]) do
Line= Line +1
logtable.numlin = Line
- logtable:setcell( Line,1, j)
+ TimeStr = os.date(dateformat,j["TimeStamp"])
+ logtable:setcell( Line,0, TimeStr)
+ logtable:setcell( Line,1, j["text"])
end
end
-- Load the log first time
Load_Log()
-print_old()
+--print_old()
btn_eraselog=iup.button{title=L.EraseButton, FGCOLOR = "#FF0000"}
@@ -407,7 +411,7 @@ end
-- Add to end of Characters
iup.Append(Chartabs, log_box)
-local panelsize = (#names*80+100) .. "x250"
+local panelsize = (#names*60+450) .. "x250"
-- Create dialog
dlg = iup.dialog{iup.vbox{Chartabs,
diff --git a/history.lua b/history.lua
index 9679d17..aab7ff2 100644
--- a/history.lua
+++ b/history.lua
@@ -1,6 +1,6 @@
hist = {
name = "History",
- version = "1",
+ version = 2,
initialised = false,
SV={},
L={},
@@ -14,8 +14,10 @@ hist = {
local function log(text)
- local nowstring = GetTimeString()
- table.insert(hist.SV.log,nowstring .. ": " .. text)
+
+ table.insert(hist.SV.log,{["TimeStamp"]=GetTimeStamp(),
+ ["text"] = text
+ })
end
local function Achievement(_, name, points, id, link)
local description
@@ -164,8 +166,11 @@ function hist.Initialise(_, addOnName)
local level = GetUnitLevel("player") + GetUnitVeteranRank("player")
-- Load the saved variables
hist.SV = ZO_SavedVars:NewAccountWide("History_SV", 1, nil, nil)
+
if hist.SV.log == nil
then hist.SV.log = {}
+ elseif hist.SV.log[1]["TimeStamp"] == nil -- Remove Old Log Formats
+ then log_clear()
end
if (hist.SV.data == nil ) then
diff --git a/history.txt b/history.txt
index 5f77d42..f2b5b92 100644
--- a/history.txt
+++ b/history.txt
@@ -4,6 +4,7 @@
## Author: HisDad
## Description: Record progress of all characters
## SavedVariables: History_SV
+## OptionalDependsOn: TestAddon
timetable.lua
history.lua