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

His Dad [09-18-16 - 02:33]
Signed-off-by: His Dad <John@hisdad.org>
Filename
HistOffline.lua
diff --git a/HistOffline.lua b/HistOffline.lua
index 7b0b20f..a63c858 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -242,7 +242,7 @@ end
   dung.grp1VH = {}
   dung.grp2N = {}
   dung.grp2V = {}
-  dung.grp2VH = {}
+  dung.grp2VH = {}

   dung.trials = {}
   dung.DLC = {}
@@ -286,7 +286,7 @@ end
 			me.name = thischar.name
 		end
 		playerNames[playerID]=me.name
-
+
 		-- == Gender
 		if thischar.Gender =="M" then
 			me.gender = L.Male
@@ -342,13 +342,56 @@ end
 				me.leveling_box:setcell(i,6, thischar.levels[j].map)
 			end
 		end
-		-- Create Grp1 Normal Dungeon Achievements Box=========================
-		me.Grp1N_box = {}
-		me.Grp1N_box = iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=100}
-		--Set Column titles
-		for i=1, 4 do
-			me.Grp1N_box:setcell(0,i, Area_names[i].long)
+		-- Create Grp Dungeon Boxes ====================================
+		me.Grp ={}		-- Put them all together
+		me.Grp_Display_Order ={}	-- Store also in here for display by ipairs
+		me.Grp["1N"]  = {}
+		me.Grp["1N"].vet = false
+		me.Grp["1N"].name= L.Grp1N
+		table.insert(me.Grp_Display_Order, me.Grp["1N"])
+
+		me.Grp["1V"]  = {}
+		me.Grp["1V"].vet = true
+		me.Grp["1V"].name= L.Grp1V
+		table.insert(me.Grp_Display_Order, me.Grp["1V"])
+
+		me.Grp["1VH"] = {}
+		me.Grp["1VH"].vet = true
+		me.Grp["1VH"].name= L.Grp1VH
+		table.insert(me.Grp_Display_Order, me.Grp["1VH"])
+
+		me.Grp["2N"]  = {}
+		me.Grp["2N"].vet = false
+		me.Grp["2N"].name= L.Grp2N
+		table.insert(me.Grp_Display_Order, me.Grp["2N"])
+
+		me.Grp["2V"]  = {}
+		me.Grp["2V"].vet = true
+		me.Grp["2V"].name= L.Grp2V
+		table.insert(me.Grp_Display_Order, me.Grp["2V"])
+
+		me.Grp["2VH"] = {}
+		me.Grp["2VH"].vet = true
+		me.Grp["2VH"].name= L.Grp2VH
+		table.insert(me.Grp_Display_Order, me.Grp["2VH"])
+
+		for _,i in pairs (me.Grp) do
+			i.box= iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=100}
+			--Set Column titles
+			for j=1, 4 do
+				i.box:setcell(0,j, Area_names[j].long)
+			end
+
+			iup.SetAttribute(i.box, "READONLY", "YES")
+			-- set all text to red
+			iup.SetAttribute(i.box,  "FGCOLOR*:1", FG_Colour_Not_Complete)
+			iup.SetAttribute(i.box,  "FGCOLOR*:2", FG_Colour_Not_Complete)
+			iup.SetAttribute(i.box,  "FGCOLOR*:3", FG_Colour_Not_Complete)
+			iup.SetAttribute(i.box,  "FGCOLOR*:4", FG_Colour_Not_Complete)
+
 		end
+
+--[[
 		--set lines
 		me.Grp1N_box:setcell(0,0, L.Level)
 		me.Grp1N_box:setcell(1,0, "10+")
@@ -357,13 +400,15 @@ end
 		me.Grp1N_box:setcell(4,0, "31+")
 		me.Grp1N_box:setcell(5,0, "38+")

-		iup.SetAttribute(me.Grp1N_box, "READONLY", "YES")
+		me.Grp2N_box:setcell(0,0, L.Level)
+		me.Grp2N_box:setcell(1,0, "10+")
+		me.Grp2N_box:setcell(2,0, "17+")
+		me.Grp2N_box:setcell(3,0, "24+")
+		me.Grp2N_box:setcell(4,0, "31+")
+		me.Grp2N_box:setcell(5,0, "38+")
+
+]]

-		-- set all text to red
-		iup.SetAttribute(me.Grp1N_box,  "FGCOLOR*:1", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.Grp1N_box,  "FGCOLOR*:2", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.Grp1N_box,  "FGCOLOR*:3", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.Grp1N_box,  "FGCOLOR*:4", FG_Colour_Not_Complete)


 		-- set text to black if achievement found.
@@ -371,7 +416,7 @@ end
 			local colour,key
 			if thischar.ach[id] ~= nil then
 				colour = "FGCOLOR" .. grp1N_dat[id].L .. ":" .. grp1N_dat[id].C
-				iup.SetAttribute(me.Grp1N_box, colour, FG_Colour_Complete)
+				iup.SetAttribute(me.Grp["1N"].box, colour, FG_Colour_Complete)
 				-- Add char to dungeon
 				key = tostring(grp1N_dat[id].L .. grp1N_dat[id].C)
 				dung.grp1N[key][playerID] = "Y"
@@ -380,15 +425,15 @@ end

 		--Set background of heading if all done
 		if thischar.ach[1073] ~= nil then  --EP Vanquisher
-				iup.SetAttribute(me.Grp1N_box,  "BGCOLOR0:1", Colour_Heading_Complete)
+				iup.SetAttribute(me.Grp["1N"].box,  "BGCOLOR0:1", Colour_Heading_Complete)
 		end

 		if thischar.ach[1074] ~= nil then  --DC Vanquisher
-				iup.SetAttribute(me.Grp1N_box,  "BGCOLOR0:2", Colour_Heading_Complete)
+				iup.SetAttribute(me.Grp["1N"].box ,  "BGCOLOR0:2", Colour_Heading_Complete)
 		end

 		if thischar.ach[1075] ~= nil then  --AD Vanquisher
-				iup.SetAttribute(me.Grp1N_box,  "BGCOLOR0:3", Colour_Heading_Complete)
+				iup.SetAttribute(me.Grp["1N"].box ,  "BGCOLOR0:3", Colour_Heading_Complete)
 		end

 --		local key = ""
@@ -396,7 +441,7 @@ end
 				local L = grp1N_dat[id].L
 				local C = grp1N_dat[id].C
 				local key = tostring(L).. tostring(C)	-- make name key
-				me.Grp1N_box:setcell(L, C, grp_names[key])
+				me.Grp["1N"].box:setcell(L, C, grp_names[key])
 		end

 --		me.Grp1N_box.Redraw= "ALL"
@@ -865,12 +910,13 @@ end

 		me.data_tabs = iup.tabs{} --Data tabs for Char

-		iup.Append(me.data_tabs, iup.vbox {	["tabtitle"] =L.GrpDungeon,
-												iup.label{title=L.GrpLab,expand="HORIZONTAL"},
-												me.Grp1N_box,
-												iup.fill{}
-											})
-
+		for _,i in ipairs (me.Grp_Display_Order) do
+			iup.Append(me.data_tabs, iup.vbox {	["tabtitle"] =i.name,
+													iup.label{title=L.GrpLab,expand="HORIZONTAL"},
+													i.box,
+													iup.fill{}
+												})
+		end
 		iup.Append(me.data_tabs,	iup.vbox {	["tabtitle"] =L.PubDungeon,
 												iup.label{title=L.PubLab,expand="HORIZONTAL"},
 												me.Pub_box,
@@ -1018,7 +1064,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 		end
 	end

-
+

 	-- Create Grp1N Dungeon Tab ==================================
 	dung.Grp1N_tab = iup.vbox {
@@ -1027,7 +1073,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 						iup.fill{},
 				}
 	iup.Append(accounts[acc].dung_tabs, dung.Grp1N_tab)
-
+
 	-- Create Grp1V Dungeon Character Box=========================

 	dung.Grp1V_box = {}
@@ -1059,7 +1105,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 		end
 	end

-
+

 	-- Create Grp1V Dungeon Tab ==================================
 	dung.Grp1V_tab = iup.vbox {
@@ -1068,7 +1114,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 						iup.fill{},
 				}
 	iup.Append(accounts[acc].dung_tabs, dung.Grp1V_tab)
-
+
 	-- Create Grp1VH Dungeon Character Box=========================

 	dung.Grp1VH_box = {}
@@ -1100,7 +1146,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 		end
 	end

-
+

 	-- Create Grp1VH Dungeon Tab ==================================
 	dung.Grp1VH_tab = iup.vbox {
@@ -1109,9 +1155,9 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 						iup.fill{},
 				}
 	iup.Append(accounts[acc].dung_tabs, dung.Grp1VH_tab)
-
-
-
+
+
+
 	-- Create Grp2N Dungeon Character Box=========================

 	dung.Grp2N_box = {}
@@ -1181,7 +1227,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 			end
 		end
 	end
-
+
 	-- Create Grp2V Dungeon Character Box=========================

 	dung.Grp2V_box = {}
@@ -1213,7 +1259,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 		end
 	end

-
+

 	-- Create Grp2V Dungeon Tab ==================================
 	dung.Grp2V_tab = iup.vbox {
@@ -1222,7 +1268,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 						iup.fill{},
 				}
 	iup.Append(accounts[acc].dung_tabs, dung.Grp2V_tab)
-
+
 	-- Create Grp2VH Dungeon Character Box=========================

 	dung.Grp2VH_box = {}
@@ -1254,7 +1300,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 		end
 	end

-
+

 	-- Create Grp2VH Dungeon Tab ==================================
 	dung.Grp2VH_tab = iup.vbox {
@@ -1263,9 +1309,9 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 						iup.fill{},
 				}
 	iup.Append(accounts[acc].dung_tabs, dung.Grp2VH_tab)
-
-
-
+
+
+
 	-- Create DLC Dungeon Tab ==================================
 	dung.DLC_tab = iup.vbox {
 						["tabtitle"] =L.DLC,