Module:Sandbox/Samlovesmath

Revision as of 21:37, 29 March 2026 by Samlovesmath (talk | contribs) (added themes for Holliday, Abrams, and Bebop ... misc fixes)

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

local p = {}
local heroData = mw.loadJsonData("Data:HeroData.json")
local langEn = mw.loadJsonData("Data:Lang_en.json")

--   THEME VARS:
--		color1			  <<  custom color1
--		color1_grad		  <<  custom color1 (gradient end)
--		color2			  <<  custom color2
--		text_title		  <<  title color for text
--		stats_text		  <<  text color for stat/info dropdowns
--		stats_back		  <<  background color for stat/info dropdowns
--
--		background_image  <<  background image file (seen in hero roster select)
--		background_height <<  background image height
--		background_margin <<  background image margin (for non-whole background) (ex. silver, graves, rem)
--
--		logo_height		  <<  height of name (name logos can be very different in sizing because of text "bleeding")
--		logo_bleed		  <<  how much the name logo "bleeds" over the supposed padding
--
--	INFO VARS:
--		voice_actor
--		release_date
--		codenames

local infoboxVars = {
	-- Default
	["default"] = {
		["background_image"] = "Default_select_background.png",
		["background_height"] = "x700px",
		["background_margin"] = "0px",
		["logo_height"] = "x35px",
		["logo_bleed"] = "0px",
		["logo_bottom"] = "0px",
		
		["color1"] = "098959",
		["color1_grad"] = "0F6D4C",
		["color2"] = "6DD48C",
		["text_title"] = "DCFFE7",
		["stats_text"] = "bbffbf",
		["stats_back"] = "12301aA3"
	},

	-- Lady Geist
	["hero_ghost"] = {
		["background_image"] = "Geist_select_background.png",
		["background-margin"] = "-118px",
		["logo_height"] = "x32px",
		
		["color1"] = "098959",
		["color1_grad"] = "0F6D4C",
		["color2"] = "6DD48C",
		["text_title"] = "DCFFE7",
		["stats_text"] = "bbffbf",
		["stats_back"] = "12301aA3",
		["voice_actor"] = "Abigail Marlowe",
		["release_date"] = "April 24, 2024",
		["codenames"] = "Geist; Ghost; Spectre"
	},	

	-- Holliday
	["hero_astro"] = {
		["background_image"] = "Holliday_select_background.png",
		["background_margin"] = "-123px";
		["logo_height"] = "x42px",
		["logo_bottom"] = "2px",
		
		["color1"] = "934D14",
		["color1_grad"] = "753D22",
		["color2"] = "92CEB5",
		["text_title"] = "FFDBBF",
		["stats_text"] = "CAF7EF",
		["stats_back"] = "382415A3",
		["voice_actor"] = "Melanie Minichino",
		["release_date"] = "January 17, 2025",
		["codenames"] = "Astro"
	},

	-- Abrams
	["hero_atlas"] = {
		["background_image"] = "Abrams_select_background.png",
		["background_margin"] = "-300px",
		["logo_height"] = "x42px",
		["logo_bottom"] = "2px",
		
		["color1"] = "264B66",
		["color1_grad"] = "264B66",
		["color2"] = "AB933C",
		["text_title"] = "FFEEB0",
		["stats_text"] = "BAE2FF",
		["stats_back"] = "11222DA3",
		["voice_actor"] = "Samoa Joe",
		["release_date"] = "April 24, 2024",
		["codenames"] = "Atlas; Bull"
	},

	-- Bebop
	["hero_bebop"] = {
		["background_image"] = "Bebop_select_background.png",
		["background_margin"] = "-283px",
		["logo_height"] = "x42px",
		["logo_bottom"] = "2px",
		
		["color1"] = "683931",
		["color1_grad"] = "5E3C35",
		["color2"] = "D88C70",
		["text_title"] = "FFD1D1",
		["stats_text"] = "FFC9DB",
		["stats_back"] = "2D1611A3",
		["voice_actor"] = "JB Blanc",
		["release_date"] = "April 24, 2024"
	},

	-- Paige
	["hero_bookworm"] = {
		["background_image"] = "Paige_select_background.png"
	},

	-- Paradox
	["hero_chrono"] = {
		["background_image"] = "Paradox_select_background.png"
	},

	-- The Doorman
	["hero_doorman"] = {
		["background_image"] = "Doorman_select_background.png"
	},

	-- Drifter
	["hero_drifter"] = {
		["background_image"] = "Drifter_select_background.png"
	},

	-- Dynamo
	["hero_dynamo"] = {
		["background_image"] = "Dynamo_select_background.png"
	},

	-- Rem
	["hero_familiar"] = {
		["background_image"] = "Rem_select_background.png"
	},

	-- Apollo
	["hero_fencer"] = {
		["background_image"] = "Apollo_select_background.png"
	},

	-- McGinnis
	["hero_forge"] = {
		["background_image"] = "Mcginnis_select_background.png"
	},

	-- Victor
	["hero_frank"] = {
		["background_image"] = "Victor_select_background.png"
	},

	-- Seven
	["hero_gigawatt"] = {
		["background_image"] = "Seven_select_background.png"
	},

	-- Haze
	["hero_haze"] = {
		["background_image"] = "Haze_select_background.png"
	},

	-- Vindicta
	["hero_hornet"] = {
		["background_image"] = "Vindicta_select_background.png"
	},

	-- Infernus
	["hero_inferno"] = {
		["background_image"] = "Infernus_select_background.png"
	},

	-- Kelvin
	["hero_kelvin"] = {
		["background_image"] = "Kelvin_select_background.png"
	},

	-- Mo & Krill
	["hero_krill"] = {
		["background_image"] = "Krill_select_background.png"
	},

	-- Lash
	["hero_lash"] = {
		["background_image"] = "Lash_select_background.png"
	},

	-- Sinclair
	["hero_magician"] = {
		["background_image"] = "Sinclair_select_background.png"
	},

	-- Mirage
	["hero_mirage"] = {
		["background_image"] = "Mirage_select_background.png"
	},

	-- Calico
	["hero_nano"] = {
		["background_image"] = "Calico_select_background.png"
	},

	-- Graves
	["hero_necro"] = {
		["background_image"] = "Graves_select_background.png"
	},

	-- Grey Talon
	["hero_orion"] = {
		["background_image"] = "Talon_select_background.png"
	},

	-- Venator
	["hero_priest"] = {
		["background_image"] = "Venator_select_background.png"
	},

	-- Billy
	["hero_punkgoat"] = {
		["background_image"] = "Billy_select_background.png"
	},

	-- Shiv
	["hero_shiv"] = {
		["background_image"] = "Shiv_select_background.png"
	},

	-- Pocket
	["hero_synth"] = {
		["background_image"] = "Pocket_select_background.png"
	},

	-- Ivy
	["hero_tengu"] = {
		["background_image"] = "Ivy_select_background.png"
	},

	-- Celeste
	["hero_unicorn"] = {
		["background_image"] = "Celeste_select_background.png"
	},

	-- Mina
	["hero_vampirebat"] = {
		["background_image"] = "Mina_select_background.png"
	},

	-- Vyper
	["hero_viper"] = {
		["background_image"] = "Vyper_select_background.png"
	},

	-- Viscous
	["hero_viscous"] = {
		["background_image"] = "Viscous_select_background.png"
	},

	-- Warden
	["hero_warden"] = {
		["background_image"] = "Warden_select_background.png"
	},

	-- Silver
	["hero_werewolf"] = {
		["background_image"] = "Silver_select_background.png",
		["logo_height"] = "x60px",
		["logo_bleed"] = "-10px 0px -20px 0px"
	},

	-- Silver (Transformed)
	["hero_werewolf_transformed"] = {
		["background_image"] = "Silver_select_background.png"
	},

	-- Wraith
	["hero_wraith"] = {
		["background_image"] = "Wraith_select_background.png"
	},

	-- Yamato
	["hero_yamato"] = {
		["background_image"] = "Yamato_select_background.png"
	}
}

-- get list of heroes (debug)
function create_hero_list()
	local heroList = {}
	for i,v in pairs(heroData) do
		table.insert(heroList, i)
	end
	table.sort(heroList)

	return heroList
end
	
function p.get_value(frame)
	local heroName = frame.args[1]
	local themeVar = frame.args[2]
	if infoboxVars[heroName] ~= nil and infoboxVars[heroName][themeVar] ~= nil then
		return infoboxVars[heroName][themeVar]
	elseif infoboxVars["default"][themeVar] ~= nil then
		return infoboxVars["default"][themeVar]
	end
	return nil
end

return p