Toggle search
Search
Toggle menu
Notifications
Toggle personal menu
Editing
Module:Iconbar
From WoopMC
Views
Read
Edit
View history
associated-pages
Module
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} function p.bar( f ) local args = require( 'Module:ProcessArgs' ).merge() local alt = args.alt or '' local link = args.link or '' local full = args.full local half = args.half or 'Half ' .. full local empty = args.empty or 'Empty ' .. full local value = math.abs( tonumber( args.value ) or 0 ) / 2 local min = math.ceil( math.abs( tonumber( args.min ) or 0 ) / 2 ) local size = args.size or '' local title = args.title or '' local reverse = args.reverse or '' if title:lower() == 'none' then title = '' elseif title ~= '' then title = ' title="' .. title .. '"' else title = ' title="' .. value .. '"' end local fullIcon = '' local halfIcon = '' local emptyIcon = '' if tonumber( size ) then size = '|' .. size .. 'px' elseif size ~= '' then size = '|' .. size end if value == 0 then emptyIcon = '[[File:' .. empty .. size .. '|link=' .. link .. '|alt=' .. alt .. ']]' else fullIcon = string.rep( '[[File:' .. full .. size .. '|link=' .. link .. '|alt=' .. alt .. ']]', math.floor( value ) ) if math.floor( value ) ~= value then halfIcon = '[[File:' .. half .. size .. '|link=' .. link .. '|alt=' .. alt .. ']]' end end if min - value >= 1 then emptyIcon = string.rep( '[[File:' .. empty .. size .. '|link=' .. link .. '|alt=' .. alt .. ']]', min - math.ceil( value ) ) end if reverse ~= '' then return '<span class="pixel-image nowrap"' .. title .. '>' .. emptyIcon .. halfIcon .. fullIcon .. '</span>' else return '<span class="pixel-image nowrap"' .. title .. '>' .. fullIcon .. halfIcon .. emptyIcon .. '</span>' end end return p
Summary:
Please note that all contributions to WoopMC may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
WoopMC:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Template link general
(
edit
)
Template:Template link general
(
edit
)
Module:Arguments
(
edit
)
Module:Iconbar/doc
(
edit
)
Module:Template link general
(
edit
)