Module:Dialogue/data: Difference between revisions

From Sekaipedia
Content added Content deleted
(Created page with "local CHARACTERS = { -- VIRTUAL SINGER ['hatsune miku'] = 'Hatsune Miku', ['miku'] = 'Hatsune Miku', ['kagamine rin'] = 'Kagamine Rin', ['rin'] = 'Kagamine Ri...")
 
No edit summary
Line 35: Line 35:
}
}


local function get_character(character)
local function get_image_mapping()
local mapping = {}
return CHARACTERS[character]
for k,v in pairs(CHARACTERS) do
mapping[k] = IMAGES[v]
end
return mapping
end
end


local function get_image(character)
local function get_color_mapping()
local mapping = {}
return IMAGES[get_character(character)]
end
for k,v in pairs(CHARACTERS) do

mapping[k] = COLORS[v]
local function get_color(character)
end
return COLORS[get_character(character)] or '#868686'
return mapping
end
end


return {
return {
characters = CHARACTERS,
characters = CHARACTERS,
images = IMAGES,
images = get_image_mapping(),
colors = get_color_mapping()
color = COLORS,
get_character = get_character(),
get_image = get_image(),
get_color = get_color()
}
}

Revision as of 03:08, 16 August 2021

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

local CHARACTERS = {
	-- VIRTUAL SINGER
	['hatsune miku'] = 'Hatsune Miku', 
		['miku']     = 'Hatsune Miku',
	['kagamine rin'] = 'Kagamine Rin',
		['rin']      = 'Kagamine Rin',
	['kagamine len'] = 'Kagamine Len',
		['len']      = 'Kagamine Len',
	['megurine luka'] = 'Megurine Luka',
		['luka']      = 'Megurine Luka',
	['meiko'] = 'MEIKO',
	['kaito'] = 'KAITO',

	-- Leo/need
}

local IMAGES = {
	-- VIRTUAL SINGER
	['Hatsune Miku'] = 'Miku-circle.png',
	['Kagamine Rin'] = 'Rin-circle.png',
	['Kagamine Len'] = 'Len-circle.png',
	['Megurine Luka'] = 'Luka-circle.png',
	['MEIKO'] = 'Meiko-circle.png',
	['KAITO'] = 'Kaito-circle.png'
}

local COLORS = {
	-- VIRTUAL SINGER
	['Hatsune Miku'] = '#33ccbb',
	['Kagamine Rin'] = '#ffcc11',
	['Kagamine Len'] = '#ffee11',
	['Megurine Luka'] = '#ffbbcc',
	['MEIKO'] = '#dd4444',
	['KAITO'] = '#3366cc'
}

local function get_image_mapping()
	local mapping = {}
	
	for k,v in pairs(CHARACTERS) do
		mapping[k] = IMAGES[v]
	end
	
	return mapping
end

local function get_color_mapping()
	local mapping = {}
	
	for k,v in pairs(CHARACTERS) do
		mapping[k] = COLORS[v]
	end
	
	return mapping
end

return {
	characters = CHARACTERS,
	images = get_image_mapping(),
	colors = get_color_mapping()
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.