Differenze tra le versioni di "Modulo:Stats"

293 byte aggiunti ,  12:37, 18 ago 2017
m
Added alignment
(Creata pagina con "--[[ This module displays wikicode for anything related to a set of values for al six statistics. So far, it can display stats for a single Pokémon, the average for a single...")
 
m (Added alignment)
totalLink = [=[<div class="flex flex-nowrap flex-row flex-main-start flex-items-center">${tot}<span class="text-small text-center" style="margin-left: 2ex;">[[:Categoria:Pokémon con statistiche base totali di ${tot}|<span style="color: initial;">Altri Pokémon con questo totale</span>]]</span></div>]=],
 
boxStats = [=[{| class="roundy pull-center text-center${align}${width}" style="border-spacing: 0 0.3ex; padding: 0.3ex 0.5ex; font-weight: bolder; ${bg};"
! colspan="2" ${rs}style="padding: 0.3ex 0.8ex;" | Statistiche base${values}
${stats}
 
--]]
local boxStats = function(stats, types, align, computeBounds, totalLink)
local tot = string.printNumber(table.fold(stats, 0, function(a, b)
return a + b end))
--]]
local interpVal = {
align = align == 'left' and '' or ' pull-' .. align,
width = ' width-xl-30 width-md-50 width-sm-60 width-xs-100',
bg = css.horizGradLua(types),
--]]
PokeStatBox.__tostring = function(this)
local box = boxStats(this.stats, this.types, true, true)
'center', true, true)
 
if #this.labels < 1 then
 
if noForms then
return boxStats(stats[poke], pokes[poke], true, true)
'center', true, true)
else
return list.makeFormsLabelledBoxes{
end, list.pokeNames))
 
return boxStats(statsAvg(typedPokes), {type = type}, false, false)
'left', false, false)
end
s.TypeAvg, s.typeavg = s.typeAvg, s.typeavg
with the same base sta total.
Defaults to no.
- align: alignment of the box stat. One of
'left', 'center', ir 'right'.
Defaults to 'center'
 
Examples:
|type = acciaio
|link = yes
|align = left
}}
 
p.bounds = (p.bounds or 'no'):lower() == 'yes'
p.link = (p.link or 'no'):lower() == 'yes'
p.align = (p.align or 'center')
 
--[[
}
 
return boxStats(stats, p, p.align, p.bounds, p.link)
end
s.StatsBox, s.statsbox = s.statsBox, s.statsBox