432
edits
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 291: | Line 291: | ||
function p.hex(frame) | function p.hex(frame) | ||
-- Default behavior, when no coords supplied | -- Default behavior, when no coords supplied | ||
if (frame == nil or frame.args == nil) then | if (frame == nil or frame.args['x'] == nil or frame.args['y'] == nil) then | ||
return 'Hex' | return 'Hex' | ||
end | end | ||
Line 307: | Line 307: | ||
local noicon = frame.args['noicon'] or false | local noicon = frame.args['noicon'] or false | ||
local nolink = frame.args['nolink'] or false | local nolink = frame.args['nolink'] or false | ||
local coords = '<span>(' .. X .. ', ' .. Y .. ')</span>' | local coords = '<span>(' .. X .. ',' .. Y .. ')</span>' | ||
-- Valid, but not a POI | -- Valid, but not a POI | ||
if hex['id'] == nil or noicon then | if hex['id'] == nil or noicon then | ||
Line 313: | Line 313: | ||
end | end | ||
-- Valid POI | -- Valid POI | ||
local poi_icon = Icons.Icon({hex['name'], type='poi', notext=notext, nolink=nolink, size='25'}) | local poi_icon = Icons.Icon({hex['name'], type='poi', notext=notext or nil, nolink=nolink or nil, size='25'}) | ||
return '<span>' .. poi_icon .. coords .. '</span>' | return '<span>' .. poi_icon .. ' ' .. coords .. '</span>' | ||
end | end | ||
edits