Module:PoliticalParty/data: Difference between revisions

From EarthMC
Jump to navigation Jump to search
mNo edit summary
m (Undo revision 234069 by 515797455988850689 (talk))
Tag: Undo
Line 1: Line 1:
p = {}
local p = {}
local data = require("Module:PoliticalParty/data")


function nameConvert(arg)
p.partyNames = {
if data.partyNames[arg] ~= nil then
["UAP"] = "Unity and Progress Party",
return data.partyNames[arg]
["Unity and Progress"] = "Unity and Progress Party",
else
["ADP"] = "Antarctic Democratic Party",
return arg
["CLAU"] = "Classical Liberalists of the Antarctic Union",
end
["PRP"] = "Polar Republic Party"
end
}


p.color = function(frame)
--color shortname altname tablecolor
    local arg = frame.args[1]
p.parties = {
return data.parties[nameConvert(arg)][1]
["Unity and Progress Party"] = {"#F600C2", "UAP", "Unity and Progress", "#F67CDD"},
end
["Antarctic Democratic Party"] = {"#6f56d6", "ADP", "Antarctic Democratic Party", "#A798E5"},
 
["Classical Liberalists of the Antarctic Union"] = {"#fdd116", "CLAU", "Classical Liberalists", "#FAE487"},
p.shortname = function(frame)
["Polar Republic Party"] = {"red", "PRP", "Polar Republic", "#FB7A7A"}
    local arg = frame.args[1]
}
return data.parties[nameConvert(arg)][2]
end
 
p.altname = function(frame)
    local arg = frame.args[1]
return data.parties[nameConvert(arg)][3]
end
 
p.tablecolor = function(frame)
    local arg = frame.args[1]
return data.parties[nameConvert(arg)][4]
end


return p
return p

Revision as of 07:28, 14 November 2023

Documentation for this module may be created at Module:PoliticalParty/data/doc

local p = {}

p.partyNames = {
	["UAP"] = "Unity and Progress Party",
	["Unity and Progress"] = "Unity and Progress Party",
	["ADP"] = "Antarctic Democratic Party",
	["CLAU"] = "Classical Liberalists of the Antarctic Union",
	["PRP"] = "Polar Republic Party"
}

--color shortname altname tablecolor
p.parties = {
	["Unity and Progress Party"] = {"#F600C2", "UAP", "Unity and Progress", "#F67CDD"},
	["Antarctic Democratic Party"] = {"#6f56d6", "ADP", "Antarctic Democratic Party", "#A798E5"},
	["Classical Liberalists of the Antarctic Union"] = {"#fdd116", "CLAU", "Classical Liberalists", "#FAE487"},
	["Polar Republic Party"] = {"red", "PRP", "Polar Republic", "#FB7A7A"}
}

return p