Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
MediaWiki help
Creopedia
Search
Search
Appearance
Log in
Personal tools
Log in
View source for Module:Ability/Components/Infobox
Module
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
←
Module:Ability/Components/Infobox
require( 'strict' ) local infoboxLua = require( 'Module:InfoboxLua' ) local effect = require( 'Module:Effect' ) local getThumbnail = require( 'Module:Ability' ).getThumbnail local p = {} --- Ability icons are 30px of pixel art in EvoCreo 2, which is too small to read --- as artwork at the top of an infobox. Shown at 2.5x, with pixelated rendering --- (see Module:InfoboxLua/styles.css) so the upscale stays crisp rather than --- being smoothed into a blur. local ICON_SIZE = 75 --- @param evocreo2Data table --- @return SectionComponentData|nil local function getEvoCreo2Section( evocreo2Data ) if not evocreo2Data then return nil end local section = { label = 'EvoCreo 2', columns = 2, items = {}, } -- Every ability effect triggers on use and applies to the player, so the -- Notes block never appears here. The Effects list carries the whole story. for _, card in ipairs( effect.getInfoboxCards( evocreo2Data.abilityEffectMaps, 'ability' ) ) do table.insert( section.items, card ) end return section end --- Build the infobox data needed from the raw data --- --- @param context table --- @return table local function getInfoboxData( context ) local data = context.data local args = context.args or {} return { title = data.name, image = { src = args.image or getThumbnail( data.name ), size = ICON_SIZE, class = 'cp-image-pixelated' }, sections = { { sections = { getEvoCreo2Section( data.evocreo2 ) } } } } end --- @param context ComponentContext --- @return string function p.render( context ) return infoboxLua.render( getInfoboxData( context ) ) end return p
Templates used on this page:
Template:Documentation
(
view source
)
Module:Ability/Components/Infobox/doc
(
view source
)
Return to
Module:Ability/Components/Infobox
.