Module:Cite/Data
Jump to navigation
Jump to search
This data is used to determine which color that should be applied to a Template:Cite quote, if any. Edit Module:Color/Data to add colors and associate them to certain game characters or interfaces.
For information on editing module data in general, see Guidelines:Modules/Data.
Data
local ColorData = mw.loadData("Module:Color/Data")
local Franchise = require("Module:Franchise")
local utilsString = require("Module:UtilsString")
local utilsTable = require("Module:UtilsTable")
local dialogueColors = {}
local colorKeys = utilsTable.keys(ColorData.colors)
for i, game in ipairs(Franchise.enum()) do
local gameColorKeys = utilsTable.filter(colorKeys, utilsString._startsWith(game.." "))
for i, colorKey in ipairs(gameColorKeys) do
local color = ColorData.colors[colorKey]
if color.isDefault then
dialogueColors[game] = dialogueColors[game] or {}
dialogueColors[game].default = colorKey
else
for i, source in ipairs(color.defaultFor or {}) do
dialogueColors[game] = dialogueColors[game] or {}
dialogueColors[game][source] = colorKey
end
end
end
end
return {
dialogueColors = dialogueColors
}