WIP, use zo_strformat()

His Dad [04-29-15 - 19:48]
WIP, use zo_strformat()
Filename
history.lua
diff --git a/history.lua b/history.lua
index 721ccdb..ea9acda 100644
--- a/history.lua
+++ b/history.lua
@@ -66,8 +66,8 @@ local function Achievement(_, name, points, id, link)
 		["Category"] = category_name,
 		["time"] = GetTimeStamp(),
 		["points"] = points,
-		["name"] = name,
-		["description"] = description,
+		["name"] = zo_strformat(name),
+		["description"] = zo_strformat(description),
 		["link"] = link
 		}

@@ -102,8 +102,8 @@ function load_history()
 							["Category"] = category_name,
 							["time"] = (luatz_esodate(adate .. " " .. atime)+ hist.tz_offset),
 							["points"] = points,
-							["name"] = name,
-							["description"] = description,
+							["name"] = zo_strformat(name),
+							["description"] = zo_strformat(description),
 							["link"] = GetAchievementLink(i)
 							}
 						count = count + 1
@@ -124,13 +124,14 @@ local description
 		local category_name =GetAchievementCategoryInfo(category_id)
 		hist.me.ach[i]["Category_ID"] = category_id
 		hist.me.ach[i]["Category"] = category_name
-		hist.me.ach[i]["description"] = description
+		hist.me.ach[i]["description"] = zo_strformat(description)
 		hist.me.ach[i]["link"] = GetAchievementLink(i)
  end
+
 end

 local function new_map()
-    local map = GetMapName()
+    local map = zo_strformat(GetMapName())
 	if hist.me.maps[map] == nil then
 		hist.me.maps[map] = {}
 		hist.me.maps[map].firstvisitdate = GetTimeStamp()
@@ -171,10 +172,10 @@ local function levelup(_, unitTag,_)
 	if hist.me.levels[hist.me.level].map == nil then
 		hist.me.levels[hist.me.level].map = map

-		local msg = "First Levelup in map " ..map
+		local msg = "First Levelup in map " .. map
 		log (msg)
 		if hist.debug then
-			d("First Levelup  in map " ..map)
+			d(msg)
 		end
 	end

@@ -215,11 +216,11 @@ local function setup_char()
 		hist.SV.data[hist.player] = {}		-- initialise data for current char
 		hist.me = hist.SV.data[hist.player]

-		hist.me.Class = GetUnitClass("player")
-		hist.me.Race = GetUnitRace("player")
+		hist.me.Class = zo_strformat(GetUnitClass("player")))
+		hist.me.Race = zo_strformat(GetUnitRace("player"))
 		hist.me.Gender = gendertext()
 		hist.me.level = GetUnitLevel("player") + GetUnitVeteranRank("player")
-		hist.me.Alliance = GetAllianceName(GetUnitAlliance("player"))
+		hist.me.Alliance = zo_strformat(GetAllianceName(GetUnitAlliance("player")))
 		hist.me.ach={}
 		hist.me.maps={}
 		hist.me.levels = {}
@@ -311,15 +312,15 @@ function hist.Initialise(_, addOnName)

 		    if hist.debug then
 					log("Begin Duplicate tests, Saved  -- Calculated" )
-					log("Alliance test: " .. hist.me.Alliance .. " -- " .. GetAllianceName(GetUnitAlliance("player")))
-					log("Race test: " .. hist.me.Race .. " -- " .. GetUnitRace("player"))
-					log("Class test: "  .. hist.me.Class .. " -- " .. GetUnitClass("player"))
+					log("Alliance test: " .. hist.me.Alliance .. " -- " .. zo_strformat(GetAllianceName(GetUnitAlliance("player"))))
+					log("Race test: " .. hist.me.Race .. " -- " .. zo_strformat(GetUnitRace("player")))
+					log("Class test: "  .. hist.me.Class .. " -- " .. zo_strformat(GetUnitClass("player")))
 					log("Gender test: " .. hist.me.Gender .. " -- " .. gendertext())
 					log("Level Lower: " .. hist.me.level .. " -- " .. level)
 			end
-		if hist.me.Alliance  ~=  GetAllianceName(GetUnitAlliance("player")) or
-			hist.me.Race ~= GetUnitRace("player") or
-			hist.me.Class ~= GetUnitClass("player") or
+		if hist.me.Alliance  ~=  zo_strformat(GetAllianceName(GetUnitAlliance("player"))) or
+			hist.me.Race ~= zo_strformat(GetUnitRace("player")) or
+			hist.me.Class ~= zo_strformat(GetUnitClass("player")) or
 			hist.me["Gender"] ~= gendertext() or
 			hist.me.level > level
 			then -- must be different with same name