Fix merge

His Dad [07-03-15 - 20:01]
Fix merge
Filename
Doc/Changelog.txt
Doc/Description.txt
Doc/Help-Missing_Achievements.txt
HistOffline.lua
Screenshots/Char-Trials.jpg
Screenshots/Dung-Public Dungeons.jpg
Screenshots/Dung-Trials.jpg
Screenshots/Public Dungeons.jpg
Screenshots/Trials.jpg
data/de.lua
data/en.lua
data/fr.lua
history.lua
diff --git a/Doc/Changelog.txt b/Doc/Changelog.txt
index 39cac98..182efbf 100644
--- a/Doc/Changelog.txt
+++ b/Doc/Changelog.txt
@@ -1,7 +1,12 @@
-2015-07-01 version 12
+2015-07-04 version 12
 	A significant update, adding a "Dungeons" mode.
+	In Character Mode:
 	Split Trials Away from vet dungeons, as they are quite different.
+	Trials show details for achievements.
 	Characters which aren't Veteran won't get Vet Dungeon or Trial Tabs.
+
+	History Addon:
+	added slash command to delete old data.  (/hostdelold)
 	UPGRADE
 	Nothing special required.

diff --git a/Doc/Description.txt b/Doc/Description.txt
index 0dcabbe..f4226c8 100644
--- a/Doc/Description.txt
+++ b/Doc/Description.txt
@@ -14,7 +14,7 @@ The game does not have to be running to use histoffline.

 Game information is updated when your character logs out.

-Histoffline presents information on your Dungeon achievements and leveling stats.
+Histoffline presents information on your Dungeon achievements and levelling stats.
 It is ideal for seeing which dungeons you haven't completed.

 When installed for the first time, it will load your achievement list, which populates the Dungeon panels.
@@ -23,6 +23,7 @@ The Level and Location panels are only populated going forward. The game itself

 If more than one account is used on the computer, you have an option to select the account you wish to view.

+[SIZE=3]New! Can show Dungeons for Characters or Characters for Dungeons![/SIZE]

 [SIZE=4]Dungeon Achievements[/SIZE]
 [LIST]
@@ -33,7 +34,7 @@ If more than one account is used on the computer, you have an option to select t
 [*]Undaunted pledges. As far as I can see, there is no difference between a Undaunted pledge Dungeon and the Dungeon at other times.
 [/LIST]

-[SIZE=4]Leveling[/SIZE]
+[SIZE=4]Levelling[/SIZE]
 [LIST]
 [*]Refer to the Screenshot. One line per level. Play time is Accumulative.
 [*]L27 "First Death" is missing, because the addon was still in development at that time.
@@ -44,7 +45,7 @@ If more than one account is used on the computer, you have an option to select t
 [*]Visits are counted on load screens (Activation). Sometimes maps change without Activation, leaving a city for example. This is not captured at the moment.
 [*]"First Visited",  a date. Again mostly blank because the addon was still in development at that time.
 [*]"First Level" means level at first visit
-[*]"Times Leveled" means number of times you leveled up in that map.
+[*]"Times Levelled" means number of times you levelled up in that map.
 [*]"First Death" your level when you first snuffed it.
 [*]"Deaths" How many times you died there.
 [*]Known bug. Non english users may see corrupted text as the app is not unicode compatible.
diff --git a/Doc/Help-Missing_Achievements.txt b/Doc/Help-Missing_Achievements.txt
index d58c20e..e33aa8f 100644
--- a/Doc/Help-Missing_Achievements.txt
+++ b/Doc/Help-Missing_Achievements.txt
@@ -3,6 +3,6 @@ If you think you are missing something, in game, in the chat window, enter

 /histload

-Any additions will show in the system log.
+Any additions will show in the histoffline system log.

 When you logout.
diff --git a/HistOffline.lua b/HistOffline.lua
index 15217d2..d8aa9e2 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -301,7 +301,7 @@ end
 		me.timeplayed = math.floor(thischar.levels[level].time/60)

 		-- Generate the leveling box.  ============================
---		local leveling_box = {}
+
 		me.leveling_box = iup.matrix {numcol=6, numcol_visible=6,  widthdef=60}
 		me.leveling_box:setcell(0,1, L.Level)
 		me.leveling_box:setcell(0,2, L.PTime)
@@ -391,7 +391,7 @@ end
 				me.Grp_box:setcell(L, C, grp_names[key])
 		end

-		me.Grp_box.Redraw= "ALL"
+--		me.Grp_box.Redraw= "ALL"

 		-- Create Pub Dungeon Achievements Box==========================
 		me.Pub_box = iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=90}
@@ -514,7 +514,8 @@ end
 		Trials_Info={}

 		for line,key in ipairs (trial2key) do  -- Load Dungeons Name. Info LC is the Dungeon Identifier
-				Trials_Info[key] = {count = 0,
+				Trials_Info[key] = {count = 0,  -- number of Ach we have.
+									nAch = 0,	-- number of entries in Ach below
 									Ach = {}	-- Achievement IDs in form id=bool
 									}
 				me.Trials_box:setcell(line,0, trial_names[key])
@@ -524,6 +525,7 @@ end
 		for id,detail in pairs(trial_dat) do
 		    key = detail.key
 			Trials_Info[key].Ach[id]=false		-- set them all to not done
+			Trials_Info[key].nAch = Trials_Info[key].nAch + 1
 		end


@@ -532,26 +534,31 @@ end
 				local L = trial_dat[id].L
 				local C = trial_dat[id].C
 				--Set colour of LC
-				local colour = "FGCOLOR" .. L .. ":" .. C
-				iup.SetAttribute(me.Trials_box, colour, FG_Colour_Complete)
+				local fgcolour = "FGCOLOR" .. L .. ":" .. C
+				local bgcolour = "BGCOLOR" .. L .. ":" .. C
+				iup.SetAttribute(me.Trials_box, fgcolour, FG_Colour_Complete)

 				key = trial_dat[id].key
 				dname = trial_names[key]
 				Trials_Info[key].Ach[id]=true		-- Mark as known
 				-- Increment count and display
 				Trials_Info[key].count = Trials_Info[key].count+1
-				me.Trials_box:setcell(L,C, " (" .. Trials_Info[key].count ..")")
+				me.Trials_box:setcell(L,C, " (" .. Trials_Info[key].count .."/" .. Trials_Info[key].nAch ..")")

+				-- Trial Background to green for all achievements
+				if Trials_Info[key].count >= Trials_Info[key].nAch then
+				iup.SetAttribute(me.Trials_box, bgcolour, BG_Colour_Complete)
+				end
 				-- Add char to dungeon
 				dung.trials[key][char] = "Y"
 			end
 		end

-
+--[[
 		if thischar.ach[1139] ~= nil 	then -- Craglorn all special.
-			iup.SetAttribute(me.Trials_box, "BGCOLOR0:5", Colour_Heading_Complete)
+			iup.SetAttribute(me.Trials_box, "BGCOLOR0:5", Colour_Heading_Complete) -- not useful
 		end
-
+--]]
 -- Create Trials Achievements Detail Boxes=======================

 		me.Trials_Detail_box = {}
@@ -559,22 +566,19 @@ end

 		local name, link
 		for key, info in pairs(Trials_Info) do	-- for each trial
-			me.Trials_Detail_box[key]= iup.matrix {numcol=2, numcol_visible=2,  numlin=0}
-
+			me.Trials_Detail_box[key]= iup.matrix {numcol=1, numcol_visible=1, numlin=0}
 			local Line = 1
 			me.Trials_Detail_box[key]:setcell(0,0, L.Ach_ID)
 			me.Trials_Detail_box[key]:setcell(0,1, L.Name)
-			me.Trials_Detail_box[key]:setcell(0,2, L.Link)
 			iup.SetAttribute(me.Trials_Detail_box[key], "READONLY", "YES")
 			iup.SetAttribute(me.Trials_Detail_box[key], "ALIGNMENT0", "ACENTER")
 			iup.SetAttribute(me.Trials_Detail_box[key], "ALIGNMENTLIN0", "ALEFT")
 			iup.SetAttribute(me.Trials_Detail_box[key], "ALIGNMENT1", "ALEFT")
-			iup.SetAttribute(me.Trials_Detail_box[key], "ALIGNMENT2", "ALEFT")
 			iup.SetAttribute(me.Trials_Detail_box[key],"WIDTH0", "30")
 			iup.SetAttribute(me.Trials_Detail_box[key],"WIDTH1", "150")
-			iup.SetAttribute(me.Trials_Detail_box[key],"WIDTH2", "250")
-			for id,done in ipairs (info) do	-- get the achicements of the trial
-				me.Trials_Detail_box[key].numlin = Line
+
+			for id,done in pairs (info.Ach) do	-- get the achievements of the trial
+			 	me.Trials_Detail_box[key].numlin = Line
 				me.Trials_Detail_box[key]:setcell(Line,0, tostring(id))

 				if Ach_Detail[id] == nil then
@@ -582,25 +586,19 @@ end
 				else
 					name = Ach_Detail[id].name
 				end
-			--	link = SQ_dat[id].link1
+
+				me.Trials_Detail_box[key]:setcell(Line,0, id)
 				me.Trials_Detail_box[key]:setcell(Line,1, name)
-			--	me.Trials_Detail_box[key]:setcell(Line,2, link)
+
 				-- Set Detail Colours on achievement
 				if done  then
 					iup.SetAttribute(me.Trials_Detail_box[key],"FGCOLOR" .. tostring(Line) .. ":*", FG_Colour_Complete)
-				end
-				Line= Line+1
-			end
-		-- Click on Link,
---[[		local thisTrialsDetail = me.Trials_Detail_box[key]	-- The function def below doesn't like the [key]
-		function thisTrialsDetail:click_cb(L,C)
-				if C == 2 then
-					iup.Help(self:getcell(L,C))		-- Launch Browser
 				else
-					return IUP_IGNORE
+					iup.SetAttribute(me.Trials_Detail_box[key],"FGCOLOR" .. tostring(Line) .. ":*", FG_Colour_Not_Complete)
 				end
+				Line= Line+1
 			end
---]]
+
 			iup.Append(me.Trials_Detail_Zbox, me.Trials_Detail_box[key])
 		end

@@ -737,7 +735,7 @@ end

 		me.SQ_box= iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=110}
 		me.SQ_Info = {}
-		for i=1, 4 do  -- Load headings, not craglorn
+		for i=1, 4 do  -- Load headings
 			me.SQ_box:setcell(0,i, Area_names[i].long)
 		end
 		me.SQ_box:setcell(0,0, L.Zone)
@@ -797,7 +795,6 @@ end

 		local name, link
 		for key, info in pairs(SQ_Info) do	-- for each zone
-		--	print ("LAng: "..lang .. "  " ..key, dump(info))
 			me.SQ_Detail_box[key]= iup.matrix {numcol=2, numcol_visible=2,  numlin=0}

 			local Line = 1
@@ -889,8 +886,10 @@ end
 											})

 		iup.Append(me.data_tabs, iup.vbox {	["tabtitle"] =L.Trials,
-											--	iup.label{title=L.TrailLab,expand="HORIZONTAL"},
+												iup.label{title=L.TrialLab,expand="HORIZONTAL"},
 												me.Trials_box,
+												iup.label{title=L.Detail},
+												me.Trials_Detail_Zbox,
 												iup.fill{}
 											})

diff --git a/Screenshots/Char-Trials.jpg b/Screenshots/Char-Trials.jpg
new file mode 100644
index 0000000..b6f5f8f
Binary files /dev/null and b/Screenshots/Char-Trials.jpg differ
diff --git a/Screenshots/Dung-Public Dungeons.jpg b/Screenshots/Dung-Public Dungeons.jpg
new file mode 100644
index 0000000..5c5da3d
Binary files /dev/null and b/Screenshots/Dung-Public Dungeons.jpg differ
diff --git a/Screenshots/Dung-Trials.jpg b/Screenshots/Dung-Trials.jpg
new file mode 100644
index 0000000..8caf4ae
Binary files /dev/null and b/Screenshots/Dung-Trials.jpg differ
diff --git a/Screenshots/Public Dungeons.jpg b/Screenshots/Public Dungeons.jpg
deleted file mode 100644
index 5c5da3d..0000000
Binary files a/Screenshots/Public Dungeons.jpg and /dev/null differ
diff --git a/Screenshots/Trials.jpg b/Screenshots/Trials.jpg
deleted file mode 100644
index 8caf4ae..0000000
Binary files a/Screenshots/Trials.jpg and /dev/null differ
diff --git a/data/de.lua b/data/de.lua
index 0371272..ed3ab79 100644
--- a/data/de.lua
+++ b/data/de.lua
@@ -62,11 +62,11 @@ Area_names = {
 		Dungeons = "Verliese",
 		Mode = "Anzeige fuer",
 		Grp = "Gruppen",
-		Pub = "Offene",
+		Pub = "Offenee",
 		Vet = "Veteranen",
 		Trials = "Pruefungen",
 		Achievements = "Errungenschaften",
-		TrialLab = "Errungenschaften der Pruefungen. Fuer Details anklicken",
+		TrialLab = "Trial Achievements. Click for Detail",
 	}

 pub_names = {
@@ -112,7 +112,7 @@ grp_names = {
 	["43"]= "Orkaninsel",
 	["53"]= "Selenes Netz",
 --Coldharbour
-	["54"]= "Kammern des Wahnsinns",
+--	["54"]= "Kammern des Wahnsinns",
 }
 trial_names = {
 --Craglorn
diff --git a/data/en.lua b/data/en.lua
index a19ab43..8cca5f5 100644
--- a/data/en.lua
+++ b/data/en.lua
@@ -20,14 +20,14 @@ Area_names = {
 		GrpDungeon = "Grp Dungeon",
 		PubDungeon = "Pub Dungeon",
 		VetDungeon = "Vet Dungeon",
-		Leveling  = "Leveling",
+		Leveling  = "Levelling",
 		Male = "Male",
 		Female = "Female",
 		LLog = "Last Login: ",
 		TPlayed = "Time Played: ",
 		Hrs = "Hours.",
 		Level = "Level",
-		TimesLeveled = "Times Leveled",
+		TimesLeveled = "Times Levelled",
 		FirstLevel = "First Level",
 		Visits = "Visits",
 		FirstVisited = "First Visited",
@@ -64,6 +64,7 @@ Area_names = {
 		Vet = "Veteran",
 		Trials = "Trials",
 		Achievements = "Achievements",
+		TrialLab = "Trial Achievements. Click for Detail",
 	}

 pub_names = {
diff --git a/data/fr.lua b/data/fr.lua
index 57113e9..ec6e5af 100644
--- a/data/fr.lua
+++ b/data/fr.lua
@@ -62,6 +62,7 @@ Area_names = {
 		Vet = "Veteran",
 		Trials = "Trials",
 		Achievements = "Achievements",
+		TrialLab = "Trial Achievements. Click for Detail",
 	}

 pub_names = {
diff --git a/history.lua b/history.lua
index 06a65bb..72f267c 100644
--- a/history.lua
+++ b/history.lua
@@ -7,7 +7,7 @@ hist = {
 	me = {},
 	player = "",
 	tz_offset =0,
-	debug = true
+	debug = false
 }

 local function log_truncate(max)