Beta WB SQ

His Dad [09-11-18 - 06:57]
Beta  WB SQ
Filename
HistOfflineBeta.lua
data/WB.lua
data/en/en.lua
data/keys.lua
data/utility.lua
diff --git a/HistOfflineBeta.lua b/HistOfflineBeta.lua
index 6a91888..3ee1ad0 100644
--- a/HistOfflineBeta.lua
+++ b/HistOfflineBeta.lua
@@ -856,25 +856,7 @@ end

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

-		me.SQ_box= iup.matrix {numcol=5, numcol_visible=5,  numlin=5, widthdef=110}
-		for i=1, 4 do  -- Load headings
-			me.SQ_box:setcell(0,i, Area_names[i].long)
-		end
-		me.SQ_box:setcell(0,5, Area_names[4].long)	--	Common
-		me.SQ_box:setcell(0,0, L.Zone)
-		me.SQ_box:setcell(1,0, "1")
-		me.SQ_box:setcell(2,0, "2")
-		me.SQ_box:setcell(3,0, "3")
-		me.SQ_box:setcell(4,0, "4")
-		me.SQ_box:setcell(5,0, "5")
-		iup.SetAttribute(me.SQ_box, "READONLY", "YES")
-		iup.SetAttribute(me.SQ_box, "ALIGNMENT0", "ACENTER")
-
-		iup.SetAttribute(me.SQ_box,  "FGCOLOR*:1", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.SQ_box,  "FGCOLOR*:2", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.SQ_box,  "FGCOLOR*:3", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.SQ_box,  "FGCOLOR*:4", FG_Colour_Not_Complete)
-		iup.SetAttribute(me.SQ_box,  "FGCOLOR*:5", FG_Colour_Not_Complete)
+		me.SQ_box= Location_Box("name")

 		-- Need to keep track of multiple achievements for SQ in Zones. Index them by zone LineColumn.

diff --git a/data/WB.lua b/data/WB.lua
index 9d4f98d..b5ca238 100644
--- a/data/WB.lua
+++ b/data/WB.lua
@@ -125,26 +125,37 @@ WB_dat = {		--World Boss Achievements


 --Vvardenfell
-[1847] = {L=4, C=4},	--Loop Eradicator  ,"Save Dubdil Alar from the consequences of his temporal experiments.",
-[1802] = {L=4, C=4},	--Songbird Silencer
-[1803] = {L=4, C=4},	--Salothan's Cursebreaker
-[1805] = {L=4, C=4},	--Breaker of the Unbroken, Defeat the nix-ox Nilthog the Unbroken at Nilthog's Hollow.
-[1807] = {L=4, C=4},	--Cheater Defeater, Defeat the Skaafin, Mehz the Cozener, at Dubdil Alar Tower and seal the rift to Oblivion.
-[1804] = {L=4, C=4},	-- "Consort Killer""Defeat the Queen's Consort at Missir-Dadalit Egg Mine.",
+[1847] = {L=5, C=4},	--Loop Eradicator  ,"Save Dubdil Alar from the consequences of his temporal experiments.",
+[1802] = {L=5, C=4},	--Songbird Silencer
+[1803] = {L=5, C=4},	--Salothan's Cursebreaker
+[1805] = {L=5, C=4},	--Breaker of the Unbroken, Defeat the nix-ox Nilthog the Unbroken at Nilthog's Hollow.
+[1807] = {L=5, C=4},	--Cheater Defeater, Defeat the Skaafin, Mehz the Cozener, at Dubdil Alar Tower and seal the rift to Oblivion.
+[1804] = {L=5, C=4},	-- "Consort Killer""Defeat the Queen's Consort at Missir-Dadalit Egg Mine.",
+
+
+
+--Orsinium
+[1286] = {L=1, C=5},	-- Kill Zandadunoz the Reborn,  Defeat Zandadunoz the Reborn at the Unfinished Dolmen.
+[1285] = {L=1, C=5},	-- Kill Old Snagara,  Kill Old Snagara the echatere in the Poacher's Encampment.
+[1290] = {L=1, C=5},	-- Kill Nyzchaleft,  Kill Nyzchaleft the Dwarven Centurion at Nyzchaleft Falls.
+[1289] = {L=1, C=5},	-- Kill Mad Urkazbur the Ogre,  Kill Mad Urkazbur at the Mad-Ogre's Altar.
+[1287] = {L=1, C=5},	-- Kill King-Chief Edu,  Kill the Riekr regent King-Chief Edu at the King-Chief's Throne.
+[1288] = {L=1, C=5},		-- Kill Corintthac the Abomination,  Kill the Winterborn Briarheart Warrior, Corintthac the Abomination, at the Accursed Nursery.
+

 --Clock
-[2046] = {L=5, C=4},	-- "Murderer of Crows" "Defeat Ithoxis, Abathoth, and Ssatinot in Exarchs' Egress.",
-[2028] = {L=5, C=4},	-- "Imperfection" "Defeat The Imperfect in the Sanctuary of Verification.",
+[2046] = {L=2, C=5},	-- "Murderer of Crows" "Defeat Ithoxis, Abathoth, and Ssatinot in Exarchs' Egress.",
+[2028] = {L=2, C=5},	-- "Imperfection" "Defeat The Imperfect in the Sanctuary of Verification.",


 --Summerset
-[2036] = {L=6, C=4},	-- "Reef Raider" "Defeat Queen of the Reef at The Queen's Hatchery.",
-[2037] = {L=6, C=4},	-- "Bucking the Matriarchy" "Defeat Caanerin at Indrik Frolic.",
-[2038] = {L=6, C=4},	-- "Sea Sload Slugger""Defeat the Sea Sload B'Korgen at Welenkin Cove.",
-[2039] = {L=6, C=4},	-- "Talon Taker" "Defeat Haeliata and Nagravia at Gryphon Run.",
-[2040] = {L=6, C=4},	-- "Amphibian Agitator""Defeat Graveld at Graveld's Hideaway.",
-[2041] = {L=6, C=4},	-- "Keel Hauler" "Defeat Keelsplitter at Keelsplitter's Nest.",
-[2212] = {L=6, C=4},	-- "Asp Awareness" "Defeat Keelsplitter without stepping on any of the snakes.",
+[2036] = {L=3, C=5},	-- "Reef Raider" "Defeat Queen of the Reef at The Queen's Hatchery.",
+[2037] = {L=3, C=5},	-- "Bucking the Matriarchy" "Defeat Caanerin at Indrik Frolic.",
+[2038] = {L=3, C=5},	-- "Sea Sload Slugger""Defeat the Sea Sload B'Korgen at Welenkin Cove.",
+[2039] = {L=3, C=5},	-- "Talon Taker" "Defeat Haeliata and Nagravia at Gryphon Run.",
+[2040] = {L=3, C=5},	-- "Amphibian Agitator""Defeat Graveld at Graveld's Hideaway.",
+[2041] = {L=3, C=5},	-- "Keel Hauler" "Defeat Keelsplitter at Keelsplitter's Nest.",
+[2212] = {L=3, C=5},	-- "Asp Awareness" "Defeat Keelsplitter without stepping on any of the snakes.",


 }
diff --git a/data/en/en.lua b/data/en/en.lua
index eb4ff61..8084aa4 100644
--- a/data/en/en.lua
+++ b/data/en/en.lua
@@ -291,9 +291,45 @@ Locations = {   -- Used for WB and SQ
 	["35"] = "Summerset",
 --Other

-
 }

+
+
+Locations2 = {   -- Used for WB and SQ,
+
+--EP
+{ name="Stonefalls",Grp="Fungal Grotto", Pub="Crow's Wood"},
+{ name="Deshaan", Grp="Darkshade Caverns", Pub="Forgotten Crypts"},
+{ name="Shadowfen", Grp="Arx Corinum", Pub="Sanguine's Demesne"},
+{ name="Eastmarch", Grp="Direfrost Keep", Pub="Hall of the Dead"},
+{ name="The Rift", Grp="Blessed Crucible", Pub="Lion's Den"},
+--DC
+{ kname="Glenumbra", Grp="Spindleclutch", Pub="Bad Man's Hallows"},
+{ name="Stormhaven", Grp="Wayrest Sewers", Pub="Bonesnap Ruins"},
+{ name="Rivenspire", Grp="Crypt of Hearts", Pub="Obsidian Scar"},
+{ name="Alik'r Desert", Grp="Volenfell", Pub="Lost City"},
+{ name="Bangkorai", Grp="Blackheart Haven", Pub="Razaks Wheel"},
+--AD
+{ name="Auridon", Grp="Banished Cells", Pub="Toothmall Gully"},
+{ name="Grahtwood", Grp="Elden Hollow", Pub="Root Sunder Ruins"},
+{ name="Greenshade", Grp="City of Ash", Pub="Rulanyil's Fall"},
+{ name="Malabal-Tor", Grp="Tempest Island", Pub="Crimson Cove"},
+{ name="Reaper's March", Grp="Selene's Web", Pub="The Vile Manse"},
+--Coldharbour
+{ name="Coldharbour", Grp="Vaults of Madness", Pub="Village of the Lost"},
+{ name="Dark Brotherhood"},
+{ name="Thieves Guild"},
+{ name="Imperial City"},
+{ name="VVardenfell"},
+
+{ name="Orsinium"},
+{ name="Clockwork City"},
+{ name="Summerset"},
+
+}
+
+
+
 DLC_Location_names = {
 ["11"]	= "Rkindaleft",
 ["21"]	= "Old Orsinum",
diff --git a/data/keys.lua b/data/keys.lua
index 6cb43c7..527f8ac 100644
--- a/data/keys.lua
+++ b/data/keys.lua
@@ -177,3 +177,39 @@ Trials2key["VH"] = {
 "51",	-- "Thieves Guild: "Maw of Lorkhaj Difficult Mode"
 "61",	-- "Craglorn Trials Conqueror",,"Complete Hel Ra Citadel, Aetherian Archive, and Sanctum Ophidia at their highest difficulties.",
 }
+
+--Generalised Location keys for square Grids
+
+Locations2Key = {   -- Used for WB and SQ,
+--Area is the heading  L.Area_Names[Area]
+
+--EP
+{ key="11",L=1,C=1,Area=1},		--	name="Stonefalls"},
+{ key="21",L=2,C=1,Area=1},		--	name="Deshaan"},
+{ key="31",L=3,C=1,Area=1},		--	name="Shadowfen"},
+{ key="41",L=4,C=1,Area=1},		--	name="Eastmarch"},
+{ key="51",L=5,C=1,Area=1},		--	name="The Rift"},
+--DC
+{ key="12",L=1,C=2,Area=2},		--	name="Glenumbra"},
+{ key="22",L=2,C=2,Area=2},		--	name="Stormhaven"},
+{ key="32",L=3,C=2,Area=2},		--	name="Rivenspire"},
+{ key="42",L=4,C=2,Area=2},		--	name="Alik'r Desert"},
+{ key="52",L=5,C=2,Area=2},		--	name="Bangkorai"},
+--AD
+{ key="13",L=1,C=3,Area=3},		--	name="Auridon"},
+{ key="23",L=2,C=3,Area=3},		--	name="Grahtwood"},
+{ key="33",L=3,C=3,Area=3},--	--	name="Greenshade"},
+{ key="43",L=4,C=3,Area=3},--	--	name="Malabal-Tor"},
+{ key="53",L=5,C=3,Area=3},--	--	name="Reaper's March"},
+--Coldharbour
+{ key="14",L=1,C=4,Area=4},		--	name="Reaper's March"},
+{ key="24",L=2,C=4,Area=4},		--	name="Dark Brotherhood"},
+{ key="34",L=3,C=4,Area=4},		--	name="Thieves Guild"},
+{ key="44",L=4,C=4,Area=4},		--	name="Imperial City"},
+{ key="54",L=5,C=4,Area=4},		--	name="VVardenfell"},
+
+{ key="15",L=1,C=5,Area=4},		--	name="Orsinium"},
+{ key="25",L=2,C=5,Area=4},		--	name="Clockwork City"},
+{ key="35",L=3,C=5,Area=4},		--	name="Summerset"},
+
+}
diff --git a/data/utility.lua b/data/utility.lua
index 485119a..0d170a6 100644
--- a/data/utility.lua
+++ b/data/utility.lua
@@ -220,3 +220,54 @@ generate_id=function()
 	outfile:write("}" .. "\n")
 	outfile:close()
 end
+
+
+--Run through Location data to get the info needed to dimension the WB and SQ boxes
+Location_Box = function (name)
+	if type(name) ~= "string" then
+		print ("Location_Box name is not string.")
+		return
+	end
+
+
+	local cols = {}
+	local lines = {}
+	local Areas = {}
+	--Summarise
+	for i,entry in ipairs(Locations2Key) do
+		if lines[entry.L] == nil then  lines[entry.L] = true end
+		if cols[entry.C] == nil then  cols[entry.C] = entry.Area end	-- Note the Area for the Col
+		if Areas[entry.Area] == nil then  Areas[entry.Area] = true end
+	end
+	--[[
+	print("Cols:  " .. tostring(#cols))
+	print("Lines: " .. #lines)
+	print("Areas: " .. #Areas)
+	--]]
+
+	local return_t = iup.matrix{}
+	return_t.numlin=#lines
+	return_t.numcol=#cols
+	return_t.widthdef=100
+
+	iup.SetAttribute(return_t, "READONLY", "YES")
+	iup.SetAttribute(return_t, "ALIGNMENT0", "ACENTER")
+	-- Set Headings
+	for col, Area in ipairs (cols) do
+	--	print("Col:  " .. col .. ",  Area:  "  .. Area )
+		return_t:setcell(0,col, Area_names[Area].long)
+	--	print("Set Heading: " .. Area_names[Area].long)
+	end
+
+	--Set Lines
+	return_t:setcell(0,0, L.Zone)
+	for line,_ in ipairs(lines) do
+		return_t:setcell(line,0, tostring(line))
+		iup.SetAttribute(return_t,  "FGCOLOR*:".. tostring(line), FG_Colour_Not_Complete)
+		iup.SetAttribute(return_t,  "BGCOLOR*:".. tostring(line), BG_Colour_Not_Complete)
+	end
+
+
+	return return_t
+end
+