Anonymous

Module:Equipment/Recommended: Difference between revisions

From Melvor Idle
Use printError function
(User:Mazunki: moving notes into correct column)
(Use printError function)
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
-- Adapted from: https://oldschool.runescape.wiki/w/Module:Recommended Equipment
-- Adapted from: https://oldschool.runescape.wiki/w/Module:Recommended_equipment
-- Released under: https://creativecommons.org/licenses/by-nc-sa/3.0/  
-- Released under: https://creativecommons.org/licenses/by-nc-sa/3.0/  


Line 5: Line 5:


local Params = require('Module:Shared/Paramtest')
local Params = require('Module:Shared/Paramtest')
local Shared = require('Module:Shared')
local Icons = require("Module:Icons")
local Icons = require("Module:Icons")


Line 25: Line 26:
{ placement = 13, name = 'familiar1', icon = 'Slot_summon', txt = 'Familiar Left', link = 'Summoning' },
{ placement = 13, name = 'familiar1', icon = 'Slot_summon', txt = 'Familiar Left', link = 'Summoning' },
{ placement = 14, name = 'familiar2', icon = 'Slot_summon', txt = 'Familiar Right', link = 'Summoning' },
{ placement = 14, name = 'familiar2', icon = 'Slot_summon', txt = 'Familiar Right', link = 'Summoning' },
{ placement = 15, name = 'prayer1', icon = 'Slot_prayer', txt = 'Prayer1', link = 'Prayer', icontype = 'prayer' },
{ placement = 16, name = 'prayer2', icon = 'Slot_prayer', txt = 'Prayer2', link = 'Prayer', icontype = 'prayer' },
{ placement = 99, name = 'notes', icon = '', txt = 'Notes', link = '', hasStats = false }
{ placement = 99, name = 'notes', icon = '', txt = 'Notes', link = '', hasStats = false }
Line 68: Line 71:
else
else
-- Otherwise treat as an item icon
-- Otherwise treat as an item icon
itemIcon = Icons.Icon({v, img=v, type='item'})
local icontype = slot.icontype or 'item'
itemIcon = Icons.Icon({v, img=v, type=icontype})
end
end
local gearname = tr:tag('td'):wikitext(itemIcon)
local gearname = tr:tag('td'):wikitext(itemIcon)
Line 117: Line 121:
if showDR and greatest_row_size > 1 then
if showDR and greatest_row_size > 1 then
-- showDR option is only compatible if a single column of equipment is to be displayed
-- showDR option is only compatible if a single column of equipment is to be displayed
return 'ERROR: showDR option is incompatible with more than one item per slot'
return Shared.printError('showDR option is incompatible with more than one item per slot')
end
end
Line 236: Line 240:
familiar22 = 'Octopus',
familiar22 = 'Octopus',
familiar13 = 'Crow',
familiar13 = 'Crow',
familiar23 = 'Bear'
familiar23 = 'Bear',
}} )
}} )
end
end


return p
return p