Editing Module:AbilityTable/ComplexRenderersGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 81: | Line 81: | ||
end | end | ||
-- Formats one barrier step. Spirit scaling goes through {{Ss}}, expanded via | |||
-- the frame the surrounding #invoke is already running under: module return | |||
-- values are not re-expanded, so a literal "{{Ss|0.8}}" would reach the page | |||
-- as text. The plain fallback covers a nil frame (module console). | |||
-- Formats one barrier step. Spirit scaling goes through | |||
-- | |||
local function format_barrier(value, scale) | local function format_barrier(value, scale) | ||
local out = tostring(value) | local out = tostring(value) | ||
if scale and scale ~= 0 then | if scale and scale ~= 0 then | ||
local frame = mw.getCurrentFrame() | local frame = mw.getCurrentFrame() | ||
if frame then | if frame then | ||
out = out .. " " .. frame:expandTemplate{ | out = out .. " " .. frame:expandTemplate{ title = "Ss", args = { scale } } | ||
else | else | ||
out = out .. " ×" .. | out = out .. " ×" .. scale | ||
end | end | ||
end | end | ||