Signed-off-by: His Dad <John@hisdad.org>

His Dad [03-10-21 - 23:08]
Signed-off-by: His Dad <John@hisdad.org>
Filename
Doc/Changelog.txt
HistOffline.lua
history.lua
history.txt
diff --git a/Doc/Changelog.txt b/Doc/Changelog.txt
index a568586..a9d77be 100644
--- a/Doc/Changelog.txt
+++ b/Doc/Changelog.txt
@@ -1,3 +1,18 @@
+Version 80
+Rage Quit Edition
+With update 29 they reset all Skill points.
+For no particular reason.
+So I'm now facing reassigning 360 skill points to 9 chars.
+No, I'm not. I have Closed my Eso+ Subs and deleted the program.
+I don't expect to be back within the next few years.
+
+The in game part of this should remain compatible with future game updates.
+Thanks for using History.
+
+
+version 79
+Minor cleanup in game module.
+
 2021-02-01 version 78
 Added Flames of Ambition. 2 Dungeons
 Api bump
diff --git a/HistOffline.lua b/HistOffline.lua
index c00774d..75772af 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -27,7 +27,7 @@ end


 -- ========================
-version= "78"
+version= "80"
 require( "iuplua" )
 require( "iupluacontrols" )

@@ -266,7 +266,7 @@ load_visibility()

 	detail_name = iup.label {title="",expand = "HORIZONTAL"}
 	detail_desc = iup.label {title="",expand = "HORIZONTAL"}
-	Status_bar = iup.label{title=L.Welcome .. " " .. L.Version .. " " .. version .. ".", expand = "HORIZONTAL"}
+	Status_bar = iup.label{title=L.Welcome .. " " .. L.Version .. " " .. version .. "  Rage Quit Edition.", expand = "HORIZONTAL"}
 	iup.Append(accounts[acc].mode_zbox, accounts[acc].dung_tabs)


diff --git a/history.lua b/history.lua
index 4bf7385..13b92c2 100644
--- a/history.lua
+++ b/history.lua
@@ -1,6 +1,6 @@
 hist = {
 	name = "history",
-	version = 75,
+	version = 79,
 	initialised = false,
 	SV={},
 	L={},
@@ -103,16 +103,19 @@ hist.SV.log = {}
 log("Cleared")
 end
 function load_history()
--- load up historic Achievements.
+-- load up  Achievements.
 -- Note some achievements like "Level 40 Hero" have become obsolete. CategoryID is nil
 	if hist.debug then
-		log("Request to load historic Dungeon Achievements")
+		log("Request to load  Dungeon Achievements")
 	end
 	--local name,points,description,completed,adate,atime
 	local count = 0
 	local reject = 0
 	local flag = 0

+	hist.me.ach = {}		-- Delete existing a load from scratch- Updates old formats
+
+
 	for i,_ in pairs (hist.IDs) do

 			local name,description,points,_,completed,adate,atime= GetAchievementInfo(i)
@@ -141,7 +144,7 @@ function load_history()
 			end --Keep
 	end	--for
 	if count > 0 then
-		log("Added " .. tostring(count) .. " historic achievements.")
+		log("Added " .. tostring(count) .. " achievements.")
 	end
 end

@@ -167,6 +170,7 @@ local function Activated()
 		hist.me.levels[hist.me.level].time = hist.me.timeplayed
 	end

+
 	if hist.world.CP_Level > 0 and hist.world.CP[hist.world.CP_Level] ~= nil then
 		if hist.me.timeplayed_last == nil then	-- is nil on new chars
 			hist.me.timeplayed_last = 0
@@ -188,8 +192,8 @@ local function levelup(_, unitTag,_)
 		return
 	end

-	hist.me.base_level = GetUnitLevel("player")
-	hist.me.veteran_level =  GetUnitVeteranRank("player")
+	hist.me.level = GetUnitLevel("player")
+

 	-- Duplication of info, but easier to work with
 	local map = new_map()
@@ -197,13 +201,11 @@ local function levelup(_, unitTag,_)
 		hist.me.maps[map].timeslevel = 1
 		hist.me.maps[map].firstlevel = hist.me.level
 	else
-	hist.me	.maps[map].timeslevel = hist.me.maps[map].timeslevel + 1
+	hist.me.maps[map].timeslevel = hist.me.maps[map].timeslevel + 1
 	end


---	if hist.me.veteran_level > 0 then return end

-	hist.me.level = hist.me.base_level + hist.me.veteran_level
 	if hist.debug then
 		log("Level up to " .. hist.me.level)
 	end
@@ -212,7 +214,8 @@ local function levelup(_, unitTag,_)
 		begin = GetTimeStamp(),
 		time  = 0,		-- Accumulated time in Minutes
 		Ach_Points = GetEarnedAchievementPoints(),
-		deaths = 0
+		deaths = 0,
+		timeplayed = hist.me.timeplayed
 		}

 	--Update Level data with map
@@ -243,9 +246,7 @@ local function CP_Levelup(_,unitTag, _, _)
 	hist.world.CP[hist.world.CP_Level].deaths =0
 	hist.world.CP[hist.world.CP_Level].time=0

-	hist.me.base_level = GetUnitLevel("player")
-	hist.me.veteran_level =  GetUnitVeteranRank("player")
-	hist.me.level = hist.me.base_level + hist.me.veteran_level
+	hist.me.evel = GetUnitLevel("player")

 	log("CP_Level up to " .. hist.world.CP_Level)

@@ -276,9 +277,8 @@ local function setup_char()
 	hist.me.Class = zo_strformat("<<C:1>>",GetUnitClass("player"))
 	hist.me.Race = zo_strformat("<<C:1>>",GetUnitRace("player"))
 	hist.me.Gender = gendertext()
-	hist.me.base_level = GetUnitLevel("player")
-	hist.me.veteran_level =  GetUnitVeteranRank("player")
-	hist.me.level = hist.me.base_level + hist.me.veteran_level
+	hist.me.level = GetUnitLevel("player")
+
 	hist.me.world = GetWorldName()
 	hist.me.Alliance = zo_strformat("<<C:1>>",GetAllianceName(GetUnitAlliance("player")))
 	hist.me.ach={}
@@ -290,7 +290,8 @@ local function setup_char()
 		begin = GetTimeStamp(),
 		time  = 0,		-- Accumulated time in Minutes
 		Ach_Points = GetEarnedAchievementPoints(),
-		deaths = 0
+		deaths = 0,
+		timeplayed = 0
 		}  -- end of defaults
 	hist.me["LoadTime"] = GetTimeStamp()
 	load_history()
@@ -439,9 +440,8 @@ if (hist.name ~= addOnName) then return end
 	hist.me = hist.SV.data[hist.playerID]


-	hist.me.base_level = GetUnitLevel("player")
-	hist.me.veteran_level =  GetUnitVeteranRank("player")
-	hist.me.level = hist.me.base_level + hist.me.veteran_level
+	hist.me.level = GetUnitLevel("player")
+
 	hist.me.world = GetWorldName()

 	if 	hist.me.levels == nil then
@@ -517,20 +517,27 @@ if (hist.name ~= addOnName) then return end
 		hist.me.Gender = gendertext()
 	end

-	if (hist.SV.this_version == nil) then hist.SV.this_version = 0 end
+	if (hist.SV.this_version == nil) then
+		hist.SV.this_version = hist.version
+	end

 	if (type(hist.SV.this_version) == "string") then
 		hist.SV.this_version = tonumber(hist.SV.this_version)
 	end


-	if (hist.SV.this_version <55) then
-		log("Erasing Achievements ready for format 55.")
-		hist.me.ach = {}
-		hist.me.craft = nil
-		hist.SV.old = nil
-		hist.SV.cleaned1 = nil
-		load_history()
+	hist.me.craft = nil
+	hist.SV.old = nil
+	hist.SV.cleaned1 = nil
+
+
+	-- Old data from veteran days
+	if hist.me.veteran_level ~= nil then
+		hist.me.veteran_level = nil
+	end
+
+	if hist.me.baselevel ~= nil then
+		hist.me.base_level = nil
 	end

 	hist.SV.this_version = hist.version
@@ -540,9 +547,8 @@ if (hist.name ~= addOnName) then return end
 	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_LEVEL_UPDATE, levelup)
 	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_CHAMPION_POINT_UPDATE, CP_Levelup)
 	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_CHAMPION_LEVEL_ACHIEVED , CP_Achieved)
-	--	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_VETERAN_RANK_UPDATE, levelup)
 	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_PLAYER_ACTIVATED, Activated)
-	--	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_PLAYER_DEACTIVATED, Activated)
+--	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_PLAYER_DEACTIVATED, Activated)
 	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_PLAYER_DEAD, Dead)
 	EVENT_MANAGER:RegisterForEvent(hist.name, EVENT_ZONE_CHANGED, new_map)
 	hist.initialised = true
diff --git a/history.txt b/history.txt
index 1a6a399..856cbcf 100644
--- a/history.txt
+++ b/history.txt
@@ -1,6 +1,6 @@
-## Title: Dad's History 78
+## Title: Dad's History, Rage Quit Edition
 ## APIVersion: 100033 100034
-## Version: 78
+## Version: 80
 ## Author: HisDad
 ## Description: Record progress of all characters for offline viewing. No in-game interface.
 ## SavedVariables: History_SV