diff --git a/HistOffline.lua b/HistOffline.lua index 964f627..448b3a8 100644 --- a/HistOffline.lua +++ b/HistOffline.lua @@ -140,7 +140,7 @@ for acc,_ in pairs(History_SV["Default"]) do if accounts[acc].lang == nil then accounts[acc].lang = "en" end --- accounts[acc].lang = "de" -- Force for testing +-- accounts[acc].lang = "fr" -- Force for testing load_lang(accounts[acc].lang) -- Reset Globals Area_names = lingua[accounts[acc].lang].Area_names @@ -1004,6 +1004,22 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab) --================= END OF CHARACTER MODE DISPLAY --================= START OF DUNGEON MODE DISPLAY + -- Generic function for populating these tables + populate = function(ADung,Grp_key) + for line, key in ipairs(Grp_key) do -- for lines going down, get the key + -- does that char exist in the table. Check by PlayerID + for col,playerID in ipairs(accounts[acc].playerIDs) do -- over each char in order + if ADung.key[key][playerID] then + ADung.box:setcell(line,col, L.YesLabel) + iup.SetAttribute(ADung.box,"BGCOLOR" .. tostring(line) .. ":" .. tostring(col), BG_Colour_Complete) + else + ADung.box:setcell(line,col, L.NoLabel) + iup.SetAttribute(ADung.box,"BGCOLOR" .. tostring(line) .. ":" .. tostring(col), BG_Colour_Not_Complete) + end + end + end + end + -- Create Pub Dungeon Character Box========================= dung.pub.box = iup.matrix {numcol=#accounts[acc].playerIDs, numlin=#Pub_Dat.key, widthdef=100} @@ -1022,18 +1038,8 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab) iup.SetAttribute(dung.pub.box, "READONLY", "YES") -- Populate with character data ============================ - for line,key in ipairs(Pub_Dat.key) do -- over each dungeon - -- does that char exist in the table. - for col,playerID in ipairs(accounts[acc].playerIDs) do -- over each char in order - if dung.pub.key[key][playerID] ~= true then - dung.pub.box:setcell(line,col, "N") - iup.SetAttribute(dung.pub.box,"BGCOLOR" .. tostring(line) .. ":" .. tostring(col), BG_Colour_Not_Complete) - else - dung.pub.box:setcell(line,col, "Y") - iup.SetAttribute(dung.pub.box,"BGCOLOR" .. tostring(line) .. ":" .. tostring(col), BG_Colour_Complete) - end - end - end + populate(dung.pub,Pub_Dat.key) + -- Create Pub Dungeon Tab ================================== dung.pub.tab = iup.vbox { @@ -1044,23 +1050,12 @@ iup.Append(accounts[acc].char_tabs, accounts[acc].log_tab) iup.Append(accounts[acc].dung_tabs, dung.pub.tab) - -- Grp Dungeons =========================================== + for _,i in ipairs (Grp_Order) do iup.Append(accounts[acc].dung_tabs, dung.Grp[i].tab) -- Populate with character data ============================ - for line, key in ipairs(Grp_Dat[i].key) do -- for lines going down, get the key - -- does that char exist in the table. Check by PlayerID - for col,playerID in ipairs(accounts[acc].playerIDs) do -- over each char in order - if dung.Grp[i].key[key][playerID] then - dung.Grp[i].box:setcell(line,col, "Y") - iup.SetAttribute(dung.Grp[i].box,"BGCOLOR" .. tostring(line) .. ":" .. tostring(col), BG_Colour_Complete) - else - dung.Grp[i].box:setcell(line,col, "N") - iup.SetAttribute(dung.Grp[i].box,"BGCOLOR" .. tostring(line) .. ":" .. tostring(col), BG_Colour_Not_Complete) - end - end - end + populate(dung.Grp[i], Grp_Dat[i].key) end -- Create DLC Dungeon Character Box========================= diff --git a/data/de/de.lua b/data/de/de.lua index f2bff93..9010fef 100644 --- a/data/de/de.lua +++ b/data/de/de.lua @@ -88,6 +88,8 @@ DLC_names = { NoAccount ="Only 1 account, can't delete that.", ChooseAccounttoDelete = "Choose Account to Delete", ChooseChartoDelete = "Choose Character to Delete", + YesLabel = "Y", + NoLabel = "N", } L.Grp_TabName["1N"] = "Mode 1N" L.Grp_TabName["1V"] = "Mode 1V" diff --git a/data/en/en.lua b/data/en/en.lua index 59d51b3..d53a962 100644 --- a/data/en/en.lua +++ b/data/en/en.lua @@ -85,6 +85,8 @@ DLC_names = { NoAccount ="Only 1 account, can't delete that.", ChooseAccounttoDelete = "Choose Account to Delete", ChooseChartoDelete = "Choose Character to Delete", + YesLabel = "Y", + NoLabel = "N", } L.Grp_TabName["1N"] = "Mode 1N" L.Grp_TabName["1V"] = "Mode 1V" diff --git a/data/fr/fr.lua b/data/fr/fr.lua index c50c5ce..a041484 100644 --- a/data/fr/fr.lua +++ b/data/fr/fr.lua @@ -84,6 +84,8 @@ DLC_names = { NoAccount ="Only 1 account, can't delete that.", ChooseAccounttoDelete = "Choose Account to Delete", ChooseChartoDelete = "Choose Character to Delete", + YesLabel = "O", + NoLabel = "N", } L.Grp_TabName["1N"] = "Mode 1N" L.Grp_TabName["1V"] = "Mode 1V"