Difference between revisions of "Module:IconBar"
Jump to navigation
Jump to search
ShadowNinja (talk | contribs) (Add Lua implementation of the Heart template) |
m |
||
Line 3: | Line 3: | ||
function p.hearts(num) | function p.hearts(num) | ||
num = num or 1 | num = num or 1 | ||
+ | if num == 0 then | ||
+ | return "[[File:Empty heart.png|16px]]" | ||
+ | end | ||
local numFloor = math.floor(num) | local numFloor = math.floor(num) | ||
local s = "" | local s = "" | ||
for i = 1, numFloor do | for i = 1, numFloor do | ||
− | s = s .. "[[File:Heart.png | 16px]]" | + | s = s .. "[[File:Heart.png|16px]]" |
end | end | ||
if numFloor ~= num then | if numFloor ~= num then | ||
− | s = s .. "[[File: | + | s = s .. "[[File:Half heart.png|16px]]" |
end | end | ||
return s | return s |