WIP

John Huttley [01-10-17 - 21:27]
WIP
Filename
HistOffline.lua
diff --git a/HistOffline.lua b/HistOffline.lua
index 7b48285..423d8c1 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -315,7 +315,7 @@ end
 -- Mouseover
 	dung.Grp[i].box.dat=Grp_Dat[i]
 	dung.Grp[i].box.mousemove_cb = box_mousemove_funct(self,l,c)
-
+
 		--set lines Heading
 	dung.Grp[i].box:setcell(0,0, L.Location)
 	--Set Line titles
@@ -363,7 +363,7 @@ end

 	dung.Craglorn[i].box.dat=Craglorn_Dat[i]
 	dung.Craglorn[i].box.mousemove_cb = box_mousemove_funct(self,l,c)
-
+
 	--set lines Heading
 	dung.Craglorn[i].box:setcell(0,0, L.Location)
 	--Set Line titles
@@ -509,6 +509,56 @@ end
 			end
 		end

+		-- Create Craglorn Dungeon Boxes ====================================
+		me.Craglorn ={}		-- Put them all together
+
+		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=4, numcol_visible=4,  numlin=5, widthdef=100}
+
+			--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])
+			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.
+
+			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)
+					-- Add char to dungeon
+					key = tostring(Gdat.L .. Gdat.C)
+					dung.Craglorn[i].key[key][playerID] = true
+				end
+			end
+
+			-- Create display tab
+			me.Craglorn[i].tab = iup.vbox {
+						["tabtitle"] =L.Crag_TabName[i],
+						me.Craglorn[i].box,
+						iup.fill{},
+				}
+		end
+
+
+		for _,i in ipairs(Craglorn_Order) do
+			for _, id in pairs (Craglorn_Dat[i].id) do
+				local key = tostring(id.L).. tostring(id.C)	-- make name key
+				me.Craglorn[i].box:setcell(id.L, id.C, Craglorn_Names[key])
+			end
+		end

 		-- Create Pub Dungeon Achievements Box==========================
 		me.Pub_box = iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=100}
@@ -516,12 +566,6 @@ end
 			me.Pub_box:setcell(0,i, Area_names[i].long)
 		end

-		me.Pub_box:setcell(0,0, L.Level)
-		me.Pub_box:setcell(1,0, "12-15")
-		me.Pub_box:setcell(2,0, "20-23")
-		me.Pub_box:setcell(3,0, "35-36")
-		me.Pub_box:setcell(4,0, "40-43")
-		me.Pub_box:setcell(5,0, "47-50")

 		iup.SetAttribute(me.Pub_box, "READONLY", "YES")

@@ -931,6 +975,14 @@ end
 			end
 		end

+		-- All Craglorn Dungeons
+		for _,i in ipairs (Craglorn_Order) do
+			if me.isvet or me.Craglorn[i].vet == false then
+				-- non vet chars only see non-vet dungeons
+				iup.Append(me.data_tabs, me.Craglorn[i].tab)
+			end
+		end
+
 		iup.Append(me.data_tabs,	iup.vbox {	["tabtitle"] =L.PubDungeon,
 												iup.label{title=L.PubLab,expand="HORIZONTAL"},
 												me.Pub_box,
@@ -1141,7 +1193,7 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab)
 		dung.Trials.box = iup.matrix {numcol=0,  numlin=#trial2key, widthdef=100}
 	dung.Trials.box.dat=Trial_Dat
 	dung.Trials.box.mousemove_cb = box_mousemove_funct(self,l,c)
-
+