Craglorn boxes partly working.

His Dad [02-01-17 - 09:00]
Craglorn boxes partly working.
Mouseover not correct
Filename
HistOffline.lua
data/Group1.lua
data/Group2.lua
diff --git a/HistOffline.lua b/HistOffline.lua
index 8586f65..d807e12 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -313,6 +313,8 @@ end
 	dung.Grp[i]= {}
 	dung.Grp[i].key ={}   -- key lookup
 	dung.Grp[i].box = iup.matrix {numcol=#accounts[acc].playerIDs,  numlin=_size(Grp_Dat[i].id), widthdef=100}
+	iup.SetAttribute(dung.Grp[i].box, "READONLY", "YES")
+
 	dung.Grp[i].tab = iup.vbox {
 						["tabtitle"] =L.Grp_TabName[i],
 						dung.Grp[i].box,
@@ -335,7 +337,7 @@ end
 		dung.Grp[i].box:setcell(0, col, playerNames[playerID])
 	end

-	iup.SetAttribute(dung.Grp[i].box, "READONLY", "YES")
+
   end

   -- a table for each dungeon to which we add characters
@@ -362,6 +364,8 @@ end
 		dung.Craglorn[i]= {}
 		dung.Craglorn[i].key ={}   -- key lookup
 		dung.Craglorn[i].box = iup.matrix {numcol=#accounts[acc].playerIDs,  numlin=_size(Craglorn_Dat[i].id), widthdef=100}
+		iup.SetAttribute(dung.Craglorn[i].box, "READONLY", "YES")
+
 		dung.Craglorn[i].tab = iup.vbox {
 							["tabtitle"] =L.Crag_TabName[i],
 							dung.Craglorn[i].box,
@@ -383,7 +387,7 @@ end
 		dung.Craglorn[i].box:setcell(0, col, playerNames[playerID])
 	end

-	iup.SetAttribute(dung.Craglorn[i].box, "READONLY", "YES")
+

     -- a table for each dungeon to which we add characters
 	for _,key in ipairs(Craglorn2key[i]) do
@@ -461,7 +465,9 @@ end
 		for _, i in ipairs(Grp_Order) do		-- For Each Grp Dungeon
 			me.Grp[i] = {}						--  Dungeon data storage
 			me.Grp[i].vet = Grp_Dat[i].vet
-			me.Grp[i].box = iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=100}
+			me.Grp[i].box = iup.matrix {numcol=4, numcol_visible=4,  numlin=Grp_Dat[i].lines, widthdef=100}
+			iup.SetAttribute(me.Grp[i].box, "READONLY", "YES")
+
 			me.Grp[i].box.dat = Grp_Dat[i]		-- for mouseover
 			me.Grp[i].box.mousemove_cb = box_mousemove_funct

@@ -470,7 +476,7 @@ end
 				me.Grp[i].box:setcell(0,j, Area_names[j].long)
 			end

-			iup.SetAttribute(me.Grp[i].box, "READONLY", "YES")
+
 			-- set all text to red
 			iup.SetAttribute(me.Grp[i].box,  "FGCOLOR*:1", FG_Colour_Not_Complete)
 			iup.SetAttribute(me.Grp[i].box,  "FGCOLOR*:2", FG_Colour_Not_Complete)
@@ -482,8 +488,10 @@ end
 			for id, Gdat in pairs (Grp_Dat[i].id) do
 				local colour,key
 				if thischar.ach[id] ~= nil then
-					colour = "FGCOLOR" .. Gdat.L .. ":" .. Gdat.C
-					iup.SetAttribute(me.Grp[i].box, colour, FG_Colour_Complete)
+					fgcolour = "FGCOLOR" .. Gdat.L .. ":" .. Gdat.C
+					bgcolour = "BGCOLOR" .. Gdat.L .. ":" .. Gdat.C
+					iup.SetAttribute(me.Grp[i].box, fgcolour, FG_Colour_Complete)
+					iup.SetAttribute(me.Grp[i].box, bgcolour, BG_Colour_Complete)
 					-- Add char to dungeon
 					key = tostring(Gdat.L .. Gdat.C)
 					dung.Grp[i].key[key][playerID] = true
@@ -525,32 +533,30 @@ end
 		for _, i in ipairs(Craglorn_Order) do		-- For Each Dungeon
 			me.Craglorn[i] = {}						-- Dungeon data storage
 			me.Craglorn[i].vet = Craglorn_Dat[i].vet
-			me.Craglorn[i].box = iup.matrix {numcol=1, numcol_visible=4,  numlin=5, widthdef=100}
+			me.Craglorn[i].box = iup.matrix {numcol=1,  numlin=_size(Craglorn_Dat[i].id), widthdef=100}
+			iup.SetAttribute(me.Craglorn[i].box, "READONLY", "YES")
+			me.Craglorn[i].box.dat = Craglorn_Dat[i]		-- for mouseover
+			me.Craglorn[i].box.mousemove_cb = box_mousemove_funct

 			--Set Column titles in box
-
 			for line,key in ipairs (Craglorn2key[i]) do  -- Load Dungeons Name. Info LC is the Dungeon Identifier
-					me.Craglorn[i].box:setcell(line,0, Craglorn_Names[key])
+					me.Craglorn[i].box:setcell(line,0, Craglorn_Names[i][key])
 			end


-			iup.SetAttribute(me.Craglorn[i].box, "READONLY", "YES")
-			-- set all text to red
-			iup.SetAttribute(me.Craglorn[i].box,  "FGCOLOR*:1", FG_Colour_Not_Complete)
-			iup.SetAttribute(me.Craglorn[i].box,  "FGCOLOR*:2", FG_Colour_Not_Complete)
-			iup.SetAttribute(me.Craglorn[i].box,  "FGCOLOR*:3", FG_Colour_Not_Complete)
-			iup.SetAttribute(me.Craglorn[i].box,  "FGCOLOR*:4", FG_Colour_Not_Complete)
-
-			-- set text to black if achievement found.
+			iup.SetAttribute(me.Craglorn[i].box,  "BGCOLOR*:1", BG_Colour_Not_Complete)

+			-- set text if achievement found and change background
 			for id, Gdat in pairs (Craglorn_Dat[i].id) do
 				local colour,key
 				if thischar.ach[id] ~= nil then
-					colour = "FGCOLOR" .. Gdat.L .. ":" .. Gdat.C
-					iup.SetAttribute(me.Craglorn[i].box, colour, FG_Colour_Complete)
+					bgcolour = "BGCOLOR" .. Gdat.L .. ":" .. Gdat.C
+					me.Craglorn[i].box:setcell(Gdat.L,Gdat.C, L.YesLabel)
+					iup.SetAttribute(me.Craglorn[i].box, bgcolour, BG_Colour_Complete)
 					-- Add char to dungeon
-					key = tostring(Gdat.L .. Gdat.C)
-					dung.Craglorn[i].key[key][playerID] = true
+					dung.Craglorn[i].key[Gdat.key][playerID] = true
+				else
+					me.Craglorn[i].box:setcell(Gdat.L,Gdat.C, L.NoLabel)
 				end
 			end

@@ -914,6 +920,10 @@ end
 --========== DLC

 		me.DLC_box= iup.matrix {numcol=2, numcol_visible=2,  numlin=4, widthdef=100}
+		iup.SetAttribute(me.DLC_box, "READONLY", "YES")
+		me.DLC_box.dat = DLC_Dat
+		me.DLC_box.mousemove_cb = box_mousemove_funct
+
 		--Set Column titles

 		me.DLC_box:setcell(0,1, DLC_names[1].long)	-- Orsinium
@@ -927,7 +937,7 @@ end
 		me.DLC_box:setcell(4,0, L.Trial)
 --]]

-		iup.SetAttribute(me.DLC_box, "READONLY", "YES")
+

 		-- set all text to red
 		iup.SetAttribute(me.DLC_box,  "FGCOLOR*:1", FG_Colour_Not_Complete)
diff --git a/data/Group1.lua b/data/Group1.lua
index 0a0d6ed..bfebb85 100644
--- a/data/Group1.lua
+++ b/data/Group1.lua
@@ -23,6 +23,7 @@ Grp_Dat["1N"].id = {
 [570]= {L=5, C=4},		-- "Vaults of Madness Vanquisher"
 }
 Grp_Dat["1N"].vet = false
+Grp_Dat["1N"].lines = 5		-- Number of lines in Grid
 Grp_Dat["1N"].key=grp1tokey	-- from keys.lua file


@@ -48,6 +49,7 @@ Grp_Dat["1V"].id = {
 [1653]= {L=5, C=4},		-- "Vaults of Madness Conqueror"
 }
 Grp_Dat["1V"].vet = true
+Grp_Dat["1V"].lines = 5		-- Number of lines in Grid
 Grp_Dat["1V"].key=grp1tokey	-- from keys.lua file

 --Hard Mode
@@ -74,4 +76,5 @@ Grp_Dat["1VH"].id = {
 }

 Grp_Dat["1VH"].vet = true
+Grp_Dat["1VH"].lines = 5		-- Number of lines in Grid
 Grp_Dat["1VH"].key=grp1tokey	-- from keys.lua file
diff --git a/data/Group2.lua b/data/Group2.lua
index a8052af..1bf008d 100644
--- a/data/Group2.lua
+++ b/data/Group2.lua
@@ -25,6 +25,7 @@ Grp_Dat["2N"].id = {
 -- [570]= {L=5, C=4},		-- "Vaults of Madness Vanquisher"
 }
 Grp_Dat["2N"].vet = false
+Grp_Dat["2N"].lines = 3		-- Number of lines in Grid
 Grp_Dat["2N"].key=grp2tokey	-- from keys.lua file

 Grp_Dat["2V"].id = {
@@ -49,6 +50,7 @@ Grp_Dat["2V"].id = {
 -- [570]= {L=5, C=4},		-- "Vaults of Madness Vanquisher"
 }
 Grp_Dat["2V"].vet = true
+Grp_Dat["2V"].lines = 3		-- Number of lines in Grid
 Grp_Dat["2V"].key=grp2tokey	-- from keys.lua file

 -- Hard Mode Activated
@@ -74,4 +76,5 @@ Grp_Dat["2VH"].id = {
 -- [570]= {L=5, C=4},		-- "Vaults of Madness Vanquisher"
 }
 Grp_Dat["2VH"].vet = true
+Grp_Dat["2VH"].lines = 3		-- Number of lines in Grid
 Grp_Dat["2VH"].key=grp2tokey	-- from keys.lua file