Anonymous

Module:Equipment/Recommended: Difference between revisions

From Melvor Idle
Use printError function
m (icontype)
(Use printError function)
(3 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 = 'prayer', icon = 'Slot_prayer', txt = 'Prayers', link = 'Prayer', icontype = 'prayer' },
{ 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 69: Line 71:
else
else
-- Otherwise treat as an item icon
-- Otherwise treat as an item icon
local icontype = v.icontype or 'item'
local icontype = slot.icontype or 'item'
itemIcon = Icons.Icon({v, img=v, type=icontype})
itemIcon = Icons.Icon({v, img=v, type=icontype})
end
end
Line 119: 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