Module:Constants: Difference between revisions

From Sekaipedia
Content added Content deleted
mNo edit summary
(added a color for append, this can be changed later)
 
(12 intermediate revisions by one other user not shown)
Line 1: Line 1:
local constants = {}
local constants = {}


local CHARACTERS = {
constants.UNIT_ABBR_TO_UNIT = {
-- 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
['hoshino ichika'] = 'Hoshino Ichika',
['ichika'] = 'Hoshino Ichika',
['tenma saki'] = 'Tenma Saki',
['saki'] = 'Tenma Saki',
['mochizuki honami'] = 'Mochizuki Honami',
['honami'] = 'Mochizuki Honami',
['hinomori shiho'] = 'Hinomori Shiho',
['shiho'] = 'Hinomori Shiho',
-- MORE MORE JUMP!
['hanasato minori'] = 'Hanasato Minori',
['minori'] = 'Hanasato Minori',
['kiritani haruka'] = 'Kiritani Haruka',
['haruka'] = 'Kiritani Haruka',
['momoi airi'] = 'Momoi Airi',
['airi'] = 'Momoi Airi',
['hinomori shizuku'] = 'Hinomori Shizuku',
['shizuku'] = 'Hinomori Shizuku',
-- Vivid BAD SQUAD
['azusawa kohane'] = 'Azusawa Kohane',
['kohane'] = 'Azusawa Kohane',
['shiraishi an'] = 'Shiraishi An',
['an'] = 'Shiraishi An',
['shinonome akito'] = 'Shinonome Akito',
['akito'] = 'Shinonome Akito',
['aoyagi toya'] = 'Aoyagi Toya',
['toya'] = 'Aoyagi Toya',
-- Wonderlands×Showtime
['tenma tsukasa'] = 'Tenma Tsukasa',
['tsukasa'] = 'Tenma Tsukasa',
['otori emu'] = 'Otori Emu',
['emu'] = 'Otori Emu',
['kusanagi nene'] = 'Kusanagi Nene',
['nene'] = 'Kusanagi Nene',
['kamishiro rui'] = 'Kamishiro Rui',
['rui'] = 'Kamishiro Rui',
-- 25-ji, Nightcord de.
['yoisaki kanade'] = 'Yoisaki Kanade',
['kanade'] = 'Yoisaki Kanade',
['asahina mafuyu'] = 'Asahina Mafuyu',
['mafuyu'] = 'Asahina Mafuyu',
['shinonome ena'] = 'Shinonome Ena',
['ena'] = 'Shinonome Ena',
['akiyama mizuki'] = 'Akiyama Mizuki',
['mizuki'] = 'Akiyama Mizuki'
}

local UNIT_ABBR_TO_UNIT = {
-- VIRTUAL SINGER
-- VIRTUAL SINGER
['virtual singer'] = 'VIRTUAL SINGER',
['virtual singer'] = 'VIRTUAL SINGER',
Line 9: Line 73:
['leo/need'] = 'Leo/need',
['leo/need'] = 'Leo/need',
['ln'] = 'Leo/need',
['ln'] = 'Leo/need',
['l/n'] = 'Leo/need',
['l/n'] = 'Leo/need',
-- MORE MORE JUMP!
-- MORE MORE JUMP!
Line 21: Line 85:
-- Wonderlands×Showtime
-- Wonderlands×Showtime
['wonderlands×showtime'] = 'Wonderlands×Showtime',
['wonderlands×showtime'] = 'Wonderlands×Showtime',
['wxs'] = 'Wonderlands×Showtime',
['wxs'] = 'Wonderlands×Showtime',
-- 25-ji, Night Code de.
-- 25-ji, Nightcord de.
['25-ji, night code de.'] = '25-ji, Night Code de.',
['25-ji, nightcord de.'] = '25-ji, Nightcord de.',
['25ji'] = '25-ji, Night Code de.',
['25-ji, night code de.'] = '25-ji, Nightcord de.',
['25-ji'] = '25-ji, Night Code de.',
['25ji'] = '25-ji, Nightcord de.',
['niigo'] = '25-ji, Night Code de.',
['25-ji'] = '25-ji, Nightcord de.',
['niigo'] = '25-ji, Nightcord de.',
-- Other
-- Other
Line 35: Line 100:


local UNIT_IMAGES = {
local UNIT_IMAGES = {
['VIRTUAL SINGER'] = 'Virtualsingerlogo.png',
['VIRTUAL SINGER'] = 'VIRTUAL SINGER logo (bordered).png',
['Leo/need'] = 'Leoneedlogo.png',
['Leo/need'] = 'Leoneed logo (bordered).png',
['MORE MORE JUMP!'] = 'MMJ logo.png',
['MORE MORE JUMP!'] = 'MORE MORE JUMP! logo (bordered).png',
['Vivid BAD SQUAD'] = 'Vivid logo.png',
['Vivid BAD SQUAD'] = 'Vivid BAD SQUAD logo (bordered).png',
['Wonderlands×Showtime'] = 'Wonderlandsxswowtimelogo.png',
['Wonderlands×Showtime'] = 'Wonderlands×Showtime logo (bordered).png',
['25-ji, Night Code de.'] = '25ji-logo.png'
['25-ji, Nightcord de.'] = '25-ji, Nightcord de. logo (bordered).png'
}
}


local UNIT_COLORS = {
local UNIT_COLORS = {
['VIRTUAL SINGER'] = { ['background-color'] = '#00CDBA', color = '#FFFFFF' },
['VIRTUAL SINGER'] = { ['background-color'] = '#00CDBA', color = '#000' },
['Leo/need'] = { ['background-color'] = '#4455DD', color = '#FFFFFF' },
['Leo/need'] = { ['background-color'] = '#4455DD', color = '#FFF' },
['MORE MORE JUMP!'] = { ['background-color'] = '#6CCB20', color = '#FFFFFF' },
['MORE MORE JUMP!'] = { ['background-color'] = '#6CCB20', color = '#000' },
['Vivid BAD SQUAD'] = { ['background-color'] = '#EE1166', color = '#FFFFFF' },
['Vivid BAD SQUAD'] = { ['background-color'] = '#EE1166', color = '#FFF' },
['Wonderlands×Showtime'] = { ['background-color'] = '#FF9900', color = '#FFFFFF' },
['Wonderlands×Showtime'] = { ['background-color'] = '#FF9900', color = '#000' },
['25-ji, Night Code de.'] = { ['background-color'] = '#884499', color = '#FFFFFF' },
['25-ji, Nightcord de.'] = { ['background-color'] = '#884499', color = '#FFF' },
['Other'] = { ['background-color'] = '#3F939D', color = '#FFFFFF' }
['Other'] = { ['background-color'] = '#3F939D', color = '#000' }
}
}

local ATTRIBUTE_COLORS = {
cute = { ['background-color'] = '#ff70a8', color = '#000' },
cool = { ['background-color'] = '#435cff', color = '#fff' },
pure = { ['background-color'] = '#00bf51', color = '#000' },
happy = { ['background-color'] = '#ff9821', color = '#000' },
mysterious = { ['background-color'] = '#8651bc', color = '#fff' }
}

local DIFFICULTY_COLORS = {
easy = '#6BD81B',
normal = '#5FB8E9',
hard = '#FFA900',
expert = '#E23F6A',
master = '#BE3EE9',
append = '#E93ED2'
}

function constants.get_character(character)
return CHARACTERS[string.lower(character)]
end

function constants.get_unit(unit_name)
if unit_name then
return UNIT_ABBR_TO_UNIT[string.lower(unit_name)]
end
return nil
end


function constants.get_unit_image(unit_name)
function constants.get_unit_image(unit_name)
if unit_name and unit_name ~= '' then
local unit = constants.get_unit(unit_name)
if unit then
local unit = constants.UNIT_ABBR_TO_UNIT[string.lower(unit_name)]
if unit then
return UNIT_IMAGES[unit]
return UNIT_IMAGES[unit]
end
end
end
Line 65: Line 157:


function constants.get_unit_colors(unit_name)
function constants.get_unit_colors(unit_name)
if unit_name and unit_name ~= '' then
local unit = constants.get_unit(unit_name)
if unit then
local unit = constants.UNIT_ABBR_TO_UNIT[string.lower(unit_name)]
if unit then
return UNIT_COLORS[unit]
return UNIT_COLORS[unit]
end
end
end
Line 75: Line 165:
end
end


function constants.get_attribute_colors(attribute)
constants.ATTRIBUTE_COLORS = {
if attribute then
cute = { ['background-color'] = '#ff70a8', color = '#ffffff' },
return ATTRIBUTE_COLORS[string.lower(attribute)]
cool = { ['background-color'] = '#435cff', color = '#ffffff'},
end
pure = { ['background-color'] = '#00bf51', color = '#ffffff'},
happy = { ['background-color'] = '#ff9821', color = '#ffffff'},
return nil
mysterious = { ['background-color'] = '#8651bc', color = '#ffffff' }
end
}

function constants.get_difficulty_color(difficulty)
if difficulty then
return DIFFICULTY_COLORS[string.lower(difficulty)]
end
return nil
end


return constants
return constants

Latest revision as of 10:13, 4 October 2023

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

local constants = {}

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
	['hoshino ichika'] = 'Hoshino Ichika',
		['ichika']     = 'Hoshino Ichika',
	['tenma saki'] = 'Tenma Saki',
		['saki']   = 'Tenma Saki',
	['mochizuki honami'] = 'Mochizuki Honami',
		['honami']       = 'Mochizuki Honami',
	['hinomori shiho'] = 'Hinomori Shiho',
		['shiho']      = 'Hinomori Shiho',
	
	-- MORE MORE JUMP!
	['hanasato minori'] = 'Hanasato Minori',
		['minori']      = 'Hanasato Minori',
	['kiritani haruka'] = 'Kiritani Haruka',
		['haruka']      = 'Kiritani Haruka',
	['momoi airi'] = 'Momoi Airi',
		['airi']   = 'Momoi Airi',
	['hinomori shizuku'] = 'Hinomori Shizuku',
		['shizuku']      = 'Hinomori Shizuku',
	
	-- Vivid BAD SQUAD
	['azusawa kohane'] = 'Azusawa Kohane',
		['kohane']     = 'Azusawa Kohane',
	['shiraishi an'] = 'Shiraishi An',
		['an']       = 'Shiraishi An',
	['shinonome akito'] = 'Shinonome Akito',
		['akito']       = 'Shinonome Akito',
	['aoyagi toya'] = 'Aoyagi Toya',
		['toya']    = 'Aoyagi Toya',
	
	-- Wonderlands×Showtime
	['tenma tsukasa'] = 'Tenma Tsukasa',
		['tsukasa']   = 'Tenma Tsukasa',
	['otori emu'] = 'Otori Emu',
		['emu']   = 'Otori Emu',
	['kusanagi nene'] = 'Kusanagi Nene',
		['nene']      = 'Kusanagi Nene',
	['kamishiro rui'] = 'Kamishiro Rui',
		['rui']       = 'Kamishiro Rui',
	
	-- 25-ji, Nightcord de.
	['yoisaki kanade'] = 'Yoisaki Kanade',
		['kanade']     = 'Yoisaki Kanade',
	['asahina mafuyu'] = 'Asahina Mafuyu',
		['mafuyu']     = 'Asahina Mafuyu',
	['shinonome ena'] = 'Shinonome Ena',
		['ena']       = 'Shinonome Ena',
	['akiyama mizuki'] = 'Akiyama Mizuki',
		['mizuki']     = 'Akiyama Mizuki'
}

local UNIT_ABBR_TO_UNIT = {
	-- VIRTUAL SINGER
	['virtual singer'] = 'VIRTUAL SINGER',
		['vs']         = 'VIRTUAL SINGER',
	
	-- Leo/need
	['leo/need'] = 'Leo/need',
		['ln']   = 'Leo/need',
		['l/n']  = 'Leo/need',
	
	-- MORE MORE JUMP!
	['more more jump!'] = 'MORE MORE JUMP!',
		['mmj']         = 'MORE MORE JUMP!',
		['mmj!']        = 'MORE MORE JUMP!',
	
	-- Vivid BAD SQUAD
	['vivid bad squad'] = 'Vivid BAD SQUAD',
		['vbs']         = 'Vivid BAD SQUAD',
	
	-- Wonderlands×Showtime
	['wonderlands×showtime'] = 'Wonderlands×Showtime',
		['wxs']              = 'Wonderlands×Showtime',
		
	-- 25-ji, Nightcord de.
	['25-ji, nightcord de.']      = '25-ji, Nightcord de.',
		['25-ji, night code de.'] = '25-ji, Nightcord de.',
		['25ji']                  = '25-ji, Nightcord de.',
		['25-ji']                 = '25-ji, Nightcord de.',
		['niigo']                 = '25-ji, Nightcord de.',
		
	-- Other
	['other'] = 'Other'
}

local UNIT_IMAGES = {
	['VIRTUAL SINGER']       = 'VIRTUAL SINGER logo (bordered).png',
	['Leo/need']             = 'Leoneed logo (bordered).png',
	['MORE MORE JUMP!']      = 'MORE MORE JUMP! logo (bordered).png',
	['Vivid BAD SQUAD']      = 'Vivid BAD SQUAD logo (bordered).png',
	['Wonderlands×Showtime'] = 'Wonderlands×Showtime logo (bordered).png',
	['25-ji, Nightcord de.'] = '25-ji, Nightcord de. logo (bordered).png'
}

local UNIT_COLORS = {
	['VIRTUAL SINGER']       = { ['background-color'] = '#00CDBA', color = '#000' },
	['Leo/need']             = { ['background-color'] = '#4455DD', color = '#FFF' },
	['MORE MORE JUMP!']      = { ['background-color'] = '#6CCB20', color = '#000' },
	['Vivid BAD SQUAD']      = { ['background-color'] = '#EE1166', color = '#FFF' },
	['Wonderlands×Showtime'] = { ['background-color'] = '#FF9900', color = '#000' },
	['25-ji, Nightcord de.'] = { ['background-color'] = '#884499', color = '#FFF' },
	['Other']                = { ['background-color'] = '#3F939D', color = '#000' }
}

local ATTRIBUTE_COLORS = {
	cute       = { ['background-color'] = '#ff70a8', color = '#000' },
	cool       = { ['background-color'] = '#435cff', color = '#fff' },
	pure       = { ['background-color'] = '#00bf51', color = '#000' },
	happy      = { ['background-color'] = '#ff9821', color = '#000' },
	mysterious = { ['background-color'] = '#8651bc', color = '#fff' }
}

local DIFFICULTY_COLORS = {
	easy   = '#6BD81B',
	normal = '#5FB8E9',
	hard   = '#FFA900',
	expert = '#E23F6A',
	master = '#BE3EE9',
	append = '#E93ED2'
}

function constants.get_character(character)
	return CHARACTERS[string.lower(character)]
end

function constants.get_unit(unit_name)
	if unit_name then
		return UNIT_ABBR_TO_UNIT[string.lower(unit_name)]
	end
	
	return nil
end

function constants.get_unit_image(unit_name)
	local unit = constants.get_unit(unit_name)
	if unit then
		return UNIT_IMAGES[unit]
	end
	
	return nil
end

function constants.get_unit_colors(unit_name)
	local unit = constants.get_unit(unit_name)
	if unit then
		return UNIT_COLORS[unit]
	end
	
	return nil
end

function constants.get_attribute_colors(attribute)
	if attribute then
		return ATTRIBUTE_COLORS[string.lower(attribute)]
	end
	
	return nil
end

function constants.get_difficulty_color(difficulty)
	if difficulty then
		return DIFFICULTY_COLORS[string.lower(difficulty)]
	end
	
	return nil
end

return constants
Cookies help us deliver our services. By using our services, you agree to our use of cookies.