Module:IconBar

From Luanti Wiki
Revision as of 19:49, 18 October 2013 by ShadowNinja (talk | contribs) (Add Lua implementation of the Heart template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

local p = {}

function p.hearts(num)

   num = num or 1
   local numFloor = math.floor(num)
   local s = ""
   for i = 1, numFloor do
       s = s .. "Heart.png"
   end
   if numFloor ~= num then
       s = s .. "Half heart.png"
   end
   return s

end

return p