WB Improvments

His Dad [05-18-18 - 07:14]
WB Improvments
Signed-off-by: His Dad <John@hisdad.org>
Filename
HistOffline.lua
data/de/de.lua
data/en/en.lua
data/fr/fr.lua
data/ids.lua
diff --git a/HistOffline.lua b/HistOffline.lua
index c3e3cf5..010ffe3 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -86,7 +86,7 @@ end



---SQ_Dat loaded  from data.lua
+--SQ_Dat loaded  from Quest.lua
 SQ_Info= {} -- keyed by "LC" string as the  ZONE Identifier
 for id,_ in pairs (SQ_dat) do  -- Load all Quest Data by Achievement ID
 		local L = SQ_dat[id].L
@@ -95,11 +95,27 @@ for id,_ in pairs (SQ_dat) do  -- Load all Quest Data by Achievement ID

 		if SQ_Info[key] == nil then
 			SQ_Info[key] = {}
-			SQ_Info[key].quests = {}
+			SQ_Info[key].ids = {}	--Array of Achievement ID's
 		end
-		table.insert(SQ_Info[key].quests,id)
+		table.insert(SQ_Info[key].ids,id)
 end

+--WB_Dat loaded  from WB.lua
+WB_Info= {} -- keyed by "LC" string as the  ZONE Identifier
+for id,_ in pairs (WB_dat) do  -- Load all WB Data by Achievement ID
+		local L = WB_dat[id].L
+		local C = WB_dat[id].C
+		local key = tostring(L) .. tostring(C)	-- make name key
+
+		if WB_Info[key] == nil then
+			WB_Info[key] = {}
+			WB_Info[key].ids = {}	--Array of Achievement ID's
+		end
+		table.insert(WB_Info[key].ids,id)
+end
+
+
+

 accounts = {}
 accounts_list = {}		-- String list for selection dialog
@@ -692,26 +708,27 @@ end


 		-- Need to keep track of multiple achievements for WB in Zones. Index them by zone LineColumn.
-		WB_Info={}
 		WB_Area={}
-    local dname, key
+    local dname, key, count
+
 		for id,_ in pairs (WB_dat) do  -- Load World Boss Name. Info LC is the ZONE Identifier
 				local L = WB_dat[id].L
 				local C = WB_dat[id].C
 				local key = tostring(L) .. tostring(C)	-- make name key
 				dname = Locations[key]				-- Zone Locations
 				if dname == nil then
-					dname = "key " .. key .." not found"
+					dname = "key " .. key .." not found in WB_Dat"
 				end
-				WB_Info[key] = {count = 0}
 				WB_Area[C] =0
 				me.WB_box:setcell(L,C,dname .. " (0)")
 		end
-
+		count= {}
 		for id,_ in pairs (WB_dat) do  -- For Achievements we have..
 			if thischar.ach[id] ~= nil then
 				local L = WB_dat[id].L
 				local C = WB_dat[id].C
+
+
 				--Set colour of LC
 				local bgcolour = "BGCOLOR" .. L .. ":" .. C

@@ -721,27 +738,88 @@ end
 					dname = "WB key " .. key .." not found"
 				end
 				-- Increment count and display
-				WB_Info[key].count = WB_Info[key].count+1
-				me.WB_box:setcell(L,C,dname .. " (" .. WB_Info[key].count ..")")
+				if count[key] == nil then
+					count[key] = 0
+				end
+				count[key] = count[key]+1
+
+				me.WB_box:setcell(L,C,dname .. " (" .. count[key] ..")")
 				--Check if done
-				if  WB_Info[key].count >= 6 then
+				if  (count[key] == #WB_Info[key].ids)  then
 					iup.SetAttribute(me.WB_box, bgcolour , BG_Colour_Complete)
 				end
 				--Add to Area Completion
 				WB_Area[C] = WB_Area[C] +1
 			end
 		end
+
+
+
+
+
 		--Set Column Colours if 30 done.
 		for i,j in pairs (WB_Area) do
 			if j > 29 then
 				iup.SetAttribute(me.WB_box,  "BGCOLOR0:".. tostring(i), Colour_Heading_Complete)
 			end
 		end
+-- Create WorldBoss Achievements Detail Boxes=======================
+
+		me.WB_Detail_box = {}
+		me.WB_Detail_Zbox = iup.zbox{}
+
+
+		for key, dat  in pairs(WB_Info) do	-- for each zone
+			me.WB_Detail_box[key]= iup.matrix {numcol=2, numcol_visible=2,  numlin=#dat.ids}
+
+			me.WB_Detail_box[key]:setcell(0,0, L.Ach_ID)
+			me.WB_Detail_box[key]:setcell(0,1, L.Name)
+			me.WB_Detail_box[key]:setcell(0,2, L.Detail)
+			iup.SetAttribute(me.WB_Detail_box[key], "READONLY", "YES")
+			iup.SetAttribute(me.WB_Detail_box[key], "ALIGNMENT0", "ACENTER")
+			iup.SetAttribute(me.WB_Detail_box[key], "ALIGNMENTLIN0", "ALEFT")
+			iup.SetAttribute(me.WB_Detail_box[key], "ALIGNMENT1", "ALEFT")
+			iup.SetAttribute(me.WB_Detail_box[key], "ALIGNMENT2", "ALEFT")
+			iup.SetAttribute(me.WB_Detail_box[key],"WIDTH0", "30")
+			iup.SetAttribute(me.WB_Detail_box[key],"WIDTH1", "150")
+			iup.SetAttribute(me.WB_Detail_box[key],"WIDTH2", "300")
+			for line, id in ipairs (dat.ids) do	-- get the Ach of zone
+				me.WB_Detail_box[key]:setcell(line,0, tostring(id))
+
+				if Ach_Detail[id] == nil then
+					name = "UNKN"
+					Desc = ""
+				else
+					name = Ach_Detail[id].name
+					Desc = Ach_Detail[id].description
+				end
+				me.WB_Detail_box[key]:setcell(line,1, name)
+				me.WB_Detail_box[key]:setcell(line,2, Desc)
+
+				-- Set Detail Colours on achievement
+				if thischar.ach[id] == nil  then
+					iup.SetAttribute(me.WB_Detail_box[key],"FGCOLOR" .. tostring(line) .. ":*", FG_Colour_Not_Complete)	-- Nope
+				else
+					iup.SetAttribute(me.WB_Detail_box[key],"BGCOLOR" .. tostring(line) .. ":*", BG_Colour_Complete)		-- Yes
+				end
+			end
+			iup.Append(me.WB_Detail_Zbox, me.WB_Detail_box[key])
+		end
+
+
+		function me.WB_box:enteritem_cb(L,C)
+
+			me.WB_Detail_Zbox.value = me.WB_Detail_box[tostring(L) .. tostring(C)]
+			if me.WB_Detail_box[tostring(L) .. tostring(C)] == nil then
+		--		print ("me.WB_Detail_box " .. tostring(L) .. tostring(C) ..  "  is nil" )
+			end
+		end
+
+

 -- Create SkillQuest Achievements Box==========================

 		me.SQ_box= iup.matrix {numcol=4, numcol_visible=4,  numlin=5, widthdef=110}
-		me.SQ_Info = {}
 		for i=1, 4 do  -- Load headings
 			me.SQ_box:setcell(0,i, Area_names[i].long)
 		end
@@ -774,10 +852,10 @@ end
 				end

 				count = 0
-				if SQ_Info[key] == nil then
+				if SQ_Info[key] == nil then
 					break	-- Some Locations not necessarily have Skill Quests
 				end
-				for _, id in ipairs (SQ_Info[key].quests) do	-- get the quests of the zone
+				for _, id in ipairs (SQ_Info[key].ids) do	-- get the quests of the zone


 					if  thischar.ach[id] ~= nil then	-- Have we got it?
@@ -788,7 +866,7 @@ end
 				me.SQ_box:setcell(L,C,dname .. " (" .. tostring(count) .. ")")

 				local colour = "FGCOLOR" .. L .. ":" .. C
-				if count == #SQ_Info[key].quests then		-- Got them all??
+				if count == #SQ_Info[key].ids then		-- Got them all??
 					iup.SetAttribute(me.SQ_box, colour , FG_Colour_Complete)  -- Yup
 				end
 			end   -- L
@@ -805,10 +883,9 @@ end
 		me.SQ_Detail_Zbox = iup.zbox{}

 		local  link
-		for key, info in pairs(SQ_Info) do	-- for each zone
-			me.SQ_Detail_box[key]= iup.matrix {numcol=2, numcol_visible=2,  numlin=0}
+		for key, dat in pairs(SQ_Info) do	-- for each zone
+			me.SQ_Detail_box[key]= iup.matrix {numcol=2, numcol_visible=2,  #dat.ids}

-			local Line = 1
 			me.SQ_Detail_box[key]:setcell(0,0, L.Ach_ID)
 			me.SQ_Detail_box[key]:setcell(0,1, L.Name)
 			me.SQ_Detail_box[key]:setcell(0,2, L.Link)
@@ -820,9 +897,9 @@ end
 			iup.SetAttribute(me.SQ_Detail_box[key],"WIDTH0", "30")
 			iup.SetAttribute(me.SQ_Detail_box[key],"WIDTH1", "150")
 			iup.SetAttribute(me.SQ_Detail_box[key],"WIDTH2", "250")
-			for _, id in ipairs (info.quests) do	-- get the quests of the zone
-				me.SQ_Detail_box[key].numlin = Line
-				me.SQ_Detail_box[key]:setcell(Line,0, tostring(id))
+			for line, id in ipairs (dat.ids) do	-- get the quests of the zone
+				me.SQ_Detail_box[key].numlin = line
+				me.SQ_Detail_box[key]:setcell(line,0, tostring(id))

 				if Ach_Detail[id] == nil then
 					name = "UNKN"
@@ -830,14 +907,16 @@ end
 					name = Ach_Detail[id].name
 				end
 				link = SQ_dat[id].link1
-				me.SQ_Detail_box[key]:setcell(Line,1, name)
-				me.SQ_Detail_box[key]:setcell(Line,2, link)
+				me.SQ_Detail_box[key]:setcell(line,1, name)
+				me.SQ_Detail_box[key]:setcell(line,2, link)
 				-- Set Detail Colours on achievement
 				if thischar.ach[id] == nil  then
-					iup.SetAttribute(me.SQ_Detail_box[key],"FGCOLOR" .. tostring(Line) .. ":*", FG_Colour_Not_Complete)	-- Nope
+					iup.SetAttribute(me.SQ_Detail_box[key],"FGCOLOR" .. tostring(line) .. ":*", FG_Colour_Not_Complete)	-- Nope
+				else
+					iup.SetAttribute(me.SQ_Detail_box[key],"BGCOLOR" .. tostring(line) .. ":*", BG_Colour_Complete)		-- Yes
 				end

-				Line= Line+1
+			iup.Append(me.SQ_Detail_Zbox, me.SQ_Detail_box[key])
 			end
 		-- Click on Link,
 		local thisSQDetail = me.SQ_Detail_box[key]	-- The function def below doesn't like the [key]
@@ -849,7 +928,6 @@ end
 				end
 			end

-			iup.Append(me.SQ_Detail_Zbox, me.SQ_Detail_box[key])
 		end

 		function me.SQ_box:enteritem_cb(L,C)
@@ -857,7 +935,7 @@ end
 		end
 --========== DLC

-		me.DLC_box= iup.matrix {numcol=7, numcol_visible=5,  numlin=4, widthdef=105}
+		me.DLC_box= iup.matrix {numcol=5, numcol_visible=5,  numlin=4, widthdef=105}
 		iup.SetAttribute(me.DLC_box, "READONLY", "YES")
 		me.DLC_box.dat = DLC_Dat
 		me.DLC_box.mousemove_cb = box_mousemove_cb
@@ -870,7 +948,7 @@ end
 		me.DLC_box:setcell(0,4, Area_names[10].long)	-- Horns
 		me.DLC_box:setcell(0,5, Area_names[11].long)	-- Bones
 --		me.DLC_box:setcell(0,6, Area_names[12].long)	-- VVardenfell
-		me.DLC_box:setcell(0,6, Area_names[13].long)	-- Summer
+		me.DLC_box:setcell(0,6, Area_names[13].long)	-- Summer

 		for id,_ in pairs (DLC_Dat.id) do
 				local L = DLC_Dat.id[id].L
@@ -965,13 +1043,15 @@ end
 		iup.Append(me.data_tabs, iup.vbox {	["tabtitle"] =L.WBosses,
 												iup.label{title=L.WBLab,expand="HORIZONTAL"},
 												me.WB_box,
+												iup.label{title=L.WB_Detail},
+												me.WB_Detail_Zbox,
 												iup.fill{}
 											})

 		iup.Append(me.data_tabs, iup.vbox {	["tabtitle"] =L.SkillQuests,
 												iup.label{title=L.SkillLab,expand="HORIZONTAL"},
 												me.SQ_box,
-												iup.label{title=L.Detail},
+												iup.label{title=L.SQ_Detail},
 												me.SQ_Detail_Zbox,
 												iup.fill{}
 											})
@@ -993,7 +1073,7 @@ end
 		--	panel = 1600
 		end

-		accounts[acc].panelsize =  tostring(wide) ..  "x310"
+		accounts[acc].panelsize =  tostring(wide) ..  "x350"
 	end  -- Chars

 -- Add to end of Characters
diff --git a/data/de/de.lua b/data/de/de.lua
index 4923609..fd979a3 100644
--- a/data/de/de.lua
+++ b/data/de/de.lua
@@ -12,8 +12,8 @@ Area_names = {
 			medium = "Dominion",
 			long = "Aldmeri-Dominion"},
 	[4] = { short= "KH",
-			medium = "Kalthafen",
-			long = "Kalthafen"},
+			medium = "Other",
+			long = "Other"},
 	[5] = { short= "KRAG",
 			medium = "Kargstein/VVardenfell",
 			long = "Kargstein"},
@@ -66,7 +66,8 @@ L = {
 		GrpLab = "Die Level sind die Minimalvoraussetzung und orientieren sich am Gruppenleiter.",
 		PubLab = "Eroberer Errungenschaften (alle Bosse des Verlieses).",
 		VetLab = "Alle sind VR1 bis VR12 bis auf Stadt der Asche VR13-14",
-		WBLab = "Es gibt 6 Bosse pro Gebiet.",
+		-- WBLab = "Es gibt 6 Bosse pro Gebiet.",
+		WBLab = "",
 		LogTab = "System Log",
 		TStamp = "Zeitstempel" ,
 		title = "Geschichte von  ",
@@ -82,7 +83,8 @@ L = {
 		Ach_ID = "Err. ID",
 		Name = "Name",
 		Link = "Link (zum öffnen anklicken)",
-		Detail = "Aufgaben des oben gewählten Gebiets mit Link zur Beschreibung der Quest auf Englisch.",
+		SQ_Detail = "Aufgaben des oben gewählten Gebiets mit Link zur Beschreibung der Quest auf Englisch.",
+		WB_Detail ="WB_Detail",
 		Characters = "Charaktere",
 		Dungeons = "Verliese",
 		Mode = "Anzeige für",
@@ -142,6 +144,8 @@ pub_names = {
 --Morrowind
 	["24"]= "Vergessenes Ödland",
 	["34"]= "Nchuleftingth",
+	["44"]= "Karnwasten",
+	["54"]= "Sonnenfeste",
 	}

 grp_names = {
@@ -267,6 +271,7 @@ Locations = {
 		["14"] = "Kalthafen",
 --Morrowind
 		["24"] = "Vvardenfell",
+		["34"] = "Sommersend",
 }

 DLC_Location_names = {
diff --git a/data/en/en.lua b/data/en/en.lua
index f9d7424..2568c82 100644
--- a/data/en/en.lua
+++ b/data/en/en.lua
@@ -12,8 +12,8 @@ Area_names = {
 			medium = "Dominion",
 			long = "Aldmeri Dominion"},
 	[4] = { short= "CH",
-			medium = "Coldharbour",
-			long = "Coldharbour/VVardenfell"},
+			medium = "Other",
+			long = "Other"},
 	[5] = { short= "CRAG",
 			medium = "Craglorn",
 			long = "Craglorn"},
@@ -66,7 +66,7 @@ Area_names = {
 		GrpLab = "Levels are Minimum, scales to leader",
 		PubLab = "Conqueror Achievement",
 		VetLab = "All are V1-V12 except City of Ash which is V13-V14",
-		WBLab = "Six Bosses per zone",
+		WBLab = "",
 		LogTab = "System Log",
 		TStamp = "Time Stamp" ,
 		title = "History For  ",
@@ -82,7 +82,8 @@ Area_names = {
 		Ach_ID = "Ach ID",
 		Name = "Name",
 		Link = "Link (Click to launch)",
-		Detail = "Detail",
+		SQ_Detail = "SQ_Detail",
+		WB_Detail ="World Bosses",
 		Characters = "Characters",
 		Dungeons = "Dungeons",
 		Mode = "Showing",
@@ -138,7 +139,7 @@ pub_names = {
 	["53"]= "The Vile Manse" ,
 --Coldharbour
 	["14"]= "Village of the Lost" ,
---Vaardenfell
+--Vvardenfell
 	["24"]= "Forgotten Wastes",
 	["34"]= "Nchuleftingth",
 	["44"]= "Karnwasten",
diff --git a/data/fr/fr.lua b/data/fr/fr.lua
index 4224a71..2591f96 100644
--- a/data/fr/fr.lua
+++ b/data/fr/fr.lua
@@ -12,8 +12,8 @@ Area_names = {
 			medium = "Dominion",
 			long = "Aldmeri Dominion"},
 	[4] = { short= "CH",
-			medium = "Coldharbour",
-			long = "Coldharbour/VVardenfell"},
+			medium = "Other",
+			long = "Other"},
 	[5] = { short= "CRAG",
 			medium = "Craglorn",
 			long = "Craglorn"},
@@ -67,7 +67,7 @@ Area_names = {
 		GrpLab = "Levels are Minimum, scales to leader",
 		PubLab = "Conqueror Achievement",
 		VetLab = "All are V1-V12 except City of Ash which is V13-V14",
-		WBLab = "Six Bosses per zone",
+		WBLab = "",
 		LogTab = "System Log",
 		TStamp = "Time Stamp" ,
 		title = "History For  ",
@@ -80,6 +80,8 @@ Area_names = {
 		Zone = "Zone",
 		SkillQuests = "SkillQuests",
 		SkillLab = "Quests Awarding a Skill Point. Click for Detail",
+		SQ_Detail = "SQ_Detail",
+		WB_Detail ="WB_Detail",
 		Ach_ID = "Ach ID",
 		Name = "Name",
 		Link = "Link (Click to launch)",
@@ -140,9 +142,12 @@ pub_names = {
 --Coldharbour
 	["14"]= "Village des perdus" ,

---Morrowind
+--Vvardenfell
+
 	["24"]= "Landes oubliées",
-	["34"]= "Nchuleftingth Conqueror",
+	["34"]= "Nchuleftingth",
+	["44"]= "Gastecairn",
+	["54"]= "Solandie",
 	}

 grp_names = {
@@ -270,6 +275,8 @@ Locations = {
 		["14"] = "Coldharbour",
 --Morrowind
 		["24"] = "Vvardenfell",
+--Summerset
+		["34"] = "Summerset",
 }
 DLC_Location_names = {
 ["11"]	= "Rkindaleft",
diff --git a/data/ids.lua b/data/ids.lua
index 9a80f41..3142483 100644
--- a/data/ids.lua
+++ b/data/ids.lua
@@ -227,6 +227,8 @@ hist.IDs = {
 [1857] = true,
 [390] = true,
 [300] = true,
+[2093] = true,
+[2094] = true,
 [368] = true,
 [370] = true,
 [1854] = true,
@@ -271,6 +273,7 @@ hist.IDs = {
 [161] = true,
 [162] = true,
 [163] = true,
+[2212] = true,
 [425] = true,
 [426] = true,
 [427] = true,
@@ -299,11 +302,17 @@ hist.IDs = {
 [198] = true,
 [199] = true,
 [200] = true,
+[150] = true,
+[152] = true,
+[149] = true,
+[148] = true,
+[700] = true,
 [210] = true,
 [211] = true,
 [212] = true,
 [213] = true,
 [214] = true,
+[2036] = true,
 [1807] = true,
 [345] = true,
 [346] = true,
@@ -333,11 +342,11 @@ hist.IDs = {
 [498] = true,
 [499] = true,
 [500] = true,
-[700] = true,
-[148] = true,
-[149] = true,
-[152] = true,
-[150] = true,
+[2037] = true,
+[2038] = true,
+[2039] = true,
+[2040] = true,
+[2041] = true,
 [151] = true,
 [404] = true,
 [403] = true,