Toggle menu
517
2.5K
889
23.2K
Deadlock Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Abilities/utils: Difference between revisions

From Deadlock Wiki
No edit summary
m added option to omit the + symbol from format_value_with_prepost
Line 22: Line 22:


-- Add prefix and postfix labels to a value. Eg. "32" -> "32s"
-- Add prefix and postfix labels to a value. Eg. "32" -> "32s"
function p.format_value_with_prepost(key, value, frame)
function p.format_value_with_prepost(key, value, frame, exclude_plus)
if (value == nil) then return nil end
if (value == nil) then return nil end
Line 41: Line 41:
if value < 0 then  
if value < 0 then  
prefix = '-'
prefix = '-'
else  
else
prefix = '+'
prefix = '+'
end
end
Line 49: Line 49:
prefix = '+'
prefix = '+'
end
end
end
-- some use cases don't require the '+' symbol prefix
if exclude_plus == true and prefix == '+' then
prefix = ''
end
end