|
|
| Line 1: |
Line 1: |
| iconList = {
| | --<nowiki> |
| ['barrel'] = {
| | local p = {} |
| ['file'] = 'Barrel.png',
| | local com = require('Module:Common') |
| ['link'] = 'Barrel'
| | require('Module:Icon/data') |
| },
| | |
| ['beer'] = {
| | local function _requirements(resource, value, link, text) |
| ['file'] = 'Beer.png',
| | resource = string.lower(com.trim(resource)) |
| ['link'] = 'Beer'
| | resource = iconList[resource] |
| },
| | result = '' |
| ['berries'] = {
| | if resource ~= nil then |
| ['file'] = 'Berries.png',
| | -- Init link here, will be nil if resource is nil |
| ['link'] = 'Berries'
| | if com.exists(link) == false then |
| },
| | link = resource['link'] |
| ['blueprint'] = { | | end |
| ['file'] = 'Blueprint.png', | | |
| ['link'] = 'Blueprints' | | --No point trimming the value if it won't be used |
| },
| | value = com.trim(value) |
| ['boar'] = {
| | |
| ['file'] = 'Boar.png',
| | --Check after trim as may be whitespace only |
| ['link'] = 'Boar'
| | if com.exists(value) == true then |
| },
| | value = ' (' .. value .. ')' |
| ['bread'] = {
| | end |
| ['file'] = 'Bread.png',
| | |
| ['link'] = 'Bread'
| | -- result = result .. |
| },
| | -- '[[file:' |
| ['candle'] = {
| | -- .. resource['file'] |
| ['file'] = 'Candle.png',
| | -- .. '|16px|link=' |
| ['link'] = 'Candle'
| | -- .. link ]]-- |
| },
| | -- .. ']]' |
| ['cheese'] = {
| | |
| ['file'] = 'Cheese.png',
| | |
| ['link'] = 'Cheese'
| | if com.exists(text) == true then |
| },
| | if string.lower(text) ~= 'no' then |
| ['clergy'] = {
| | result = result .. '[[' |
| ['file'] = 'Clergy Influence.png',
| | .. link |
| ['link'] = 'Influence'
| | .. ']]' |
| },
| | end |
| ['clergy influence'] = {
| | end |
| ['file'] = 'Clergy Influence.png',
| | |
| ['link'] = 'Influence'
| | else |
| },
| | result = 'Icon does not exist[[Category:Missing Icon]]' |
| ['clergy splendor'] = {
| | end |
| ['file'] = 'Clergy Splendor.png',
| | |
| ['link'] = 'Splendor'
| | return result |
| },
| | end |
| ['cloth'] = {
| | |
| ['file'] = 'Cloth.png',
| | function p.requirements(frame) |
| ['link'] = 'Cloth'
| | r = frame.args['resource'] |
| },
| | v = frame.args['value'] |
| ['clothes'] = {
| | l = frame.args['link'] |
| ['file'] = 'Common Clothes.png',
| | t = frame.args[1] |
| ['link'] = 'Common Clothes'
| | return _requirements(r, v, l, t) |
| },
| | end |
| ['coal'] = {
| | |
| ['file'] = 'Coal.png',
| | function p.icon(resource, value, link, text) |
| ['link'] = 'Coal'
| | return _requirements(resource, value, link, text) |
| },
| | end |
| ['coin'] = {
| | |
| ['file'] = 'Gold Coins.png',
| | function p.iconList(frame) |
| ['link'] = 'Gold Coins'
| | list = mw.text.split(frame.args[1], ';') |
| },
| | result = '' |
| ['common wares'] = {
| | for k, v in ipairs(list) do |
| ['file'] = 'Common Wares.png',
| | vs = mw.text.split(v, '-') |
| ['link'] = 'Common Wares'
| | result = result .. _requirements(vs[1], vs[2], nil, frame.args['text']) |
| },
| | if k ~= table.getn(list) then |
| ['fish'] = {
| | result = result .. '<br />' |
| ['file'] = 'Fish.png',
| | end |
| ['link'] = 'Fish'
| | end |
| },
| | |
| ['flour'] = {
| | return result |
| ['file'] = 'Flour.png',
| | end |
| ['link'] = 'Flour'
| | |
| },
| | function p.documentation() |
| ['gem'] = {
| | keys = {} |
| ['file'] = 'Gems.png',
| | for z in pairs(iconList) do |
| ['link'] = 'Gems'
| | table.insert(keys, z) |
| },
| | end |
| ['gems'] = {
| | |
| ['file'] = 'Gems.png',
| | table.sort(keys) |
| ['link'] = 'Gems'
| | dataTable = {[1] = '', [2] = '', [3] = ''} |
| },
| | header = '\n{| class="wikitable"\n' |
| ['glass'] = {
| | .. '! Code !! Icon !! Link\n' |
| ['file'] = 'Glass.png',
| | .. '\n|-\n' |
| ['link'] = 'Glass'
| | footer = '|}' |
| },
| | i = 1 |
| ['gold'] = {
| | while i < 4 do |
| ['file'] = 'Gold Bar.png',
| | dataTable[i] = header |
| ['link'] = 'Gold'
| | i = i + 1 |
| },
| | end |
| ['gold bar'] = {
| | i = 1 |
| ['file'] = 'Gold Bar.png',
| | for k, v in ipairs(keys) do |
| ['link'] = 'Gold'
| | dataTable[i] = dataTable[i] |
| },
| | .. '| ' .. v |
| ['gold coin'] = {
| | .. ' || ' .. _requirements(v, '', '', '') |
| ['file'] = 'Gold Coins.png',
| | .. ' || ' .. iconList[v]['link'] |
| ['link'] = 'Gold Coins'
| | .. '\n|-\n' |
| },
| | if i == 3 then |
| ['gold coins'] = {
| | i = 1 |
| ['file'] = 'Gold Coins.png',
| | else |
| ['link'] = 'Gold Coins'
| | i = i + 1 |
| },
| | end |
| ['gold ore'] = {
| | end |
| ['file'] = 'Gold Ore.png',
| | |
| ['link'] = 'Gold Ore'
| | i = 1 |
| },
| | while i < 4 do |
| ['grape'] = {
| | dataTable[i] = dataTable[i] .. footer |
| ['file'] = 'Grape.png',
| | i = i + 1 |
| ['link'] = 'Grapes'
| | end |
| },
| | |
| ['grapes'] = {
| | result = mw.html.create('div') |
| ['file'] = 'Grape.png',
| | result:css('display', 'grid') |
| ['link'] = 'Grapes'
| | :css('grid-template-columns', '1fr 1fr 1fr') |
| },
| | :wikitext(dataTable[1] .. dataTable[2] .. dataTable[3] .. '\n') |
| ['herb'] = {
| | return result |
| ['file'] = 'Herbs.png',
| | end |
| ['link'] = 'Herbs'
| | |
| },
| | return p |
| ['herbs'] = {
| |
| ['file'] = 'herbs.png',
| |
| ['link'] = 'Herbs'
| |
| },
| |
| ['honey'] = {
| |
| ['file'] = 'Honey.png',
| |
| ['link'] = 'Honey'
| |
| },
| |
| ['hop'] = {
| |
| ['file'] = 'Hop.png',
| |
| ['link'] = 'Hops'
| |
| },
| |
| ['hops'] = {
| |
| ['file'] = 'Hop.png',
| |
| ['link'] = 'Hops'
| |
| },
| |
| ['iron'] = {
| |
| ['file'] = 'Iron Bar.png',
| |
| ['link'] = 'Iron'
| |
| },
| |
| ['iron bar'] = {
| |
| ['file'] = 'Iron Bar.png',
| |
| ['link'] = 'Iron'
| |
| },
| |
| ['iron ore'] = {
| |
| ['file'] = 'Iron Ore.png',
| |
| ['link'] = 'Iron Ore'
| |
| },
| |
| ['jewelry'] = { | |
| ['file'] = 'Jewelry.png', | |
| ['link'] = 'Jewelry'
| |
| },
| |
| ['kingdom'] = { | |
| ['file'] = 'Kingdom Influence.png',
| |
| ['link'] = 'Influence'
| |
| },
| |
| ['kingdom influence'] = {
| |
| ['file'] = 'Kingdom Influence.png',
| |
| ['link'] = 'Influence'
| |
| },
| |
| ['kingdom splendor'] = {
| |
| ['file'] = 'Kingdom Splendor.png',
| |
| ['link'] = 'Splendor'
| |
| },
| |
| ['labor'] = {
| |
| ['file'] = 'Labor Influence.png',
| |
| ['link'] = 'Influence'
| |
| },
| |
| ['labor influence'] = {
| |
| ['file'] = 'Labor Influence.png',
| |
| ['link'] = 'Influence'
| |
| },
| |
| ['labor splendor'] = {
| |
| ['file'] = 'Labor Splendor.png',
| |
| ['link'] = 'Splendor'
| |
| },
| |
| ['logs'] = { | |
| ['file'] = 'Logs.png', | |
| ['link'] = 'Logs' | |
| }, | |
| ['maintenance'] = {
| |
| ['file'] = 'Maintenance Cost.png',
| |
| ['link'] = 'Maintenance Cost'
| |
| },
| |
| ['maintenance cost'] = {
| |
| ['file'] = 'Maintenance Cost.png',
| |
| ['link'] = 'Maintenance Cost'
| |
| },
| |
| ['marble'] = {
| |
| ['file'] = 'Marble.png',
| |
| ['link'] = 'Marble'
| |
| },
| |
| ['meal'] = {
| |
| ['file'] = 'Meal.png',
| |
| ['link'] = 'Meal'
| |
| },
| |
| ['milk'] = {
| |
| ['file'] = 'Milk.png',
| |
| ['link'] = 'Milk'
| |
| },
| |
| ['pike'] = {
| |
| ['file'] = 'Pike.png',
| |
| ['link'] = 'Pike'
| |
| },
| |
| ['planks'] = {
| |
| ['file'] = 'Planks.png',
| |
| ['link'] = 'Planks'
| |
| },
| |
| ['polished stone'] = {
| |
| ['file'] = 'Polished Stone.png',
| |
| ['link'] = 'Polished Stone'
| |
| },
| |
| ['quartz'] = {
| |
| ['file'] = 'Quartz.png',
| |
| ['link'] = 'Quartz'
| |
| },
| |
| ['sculpture'] = {
| |
| ['file'] = 'Sculpture.png',
| |
| ['link'] = 'Sculpture'
| |
| },
| |
| ['spear'] = {
| |
| ['file'] = 'Spear.png',
| |
| ['link'] = 'Spear'
| |
| },
| |
| ['stained glass'] = {
| |
| ['file'] = 'Stained Glass.png',
| |
| ['link'] = 'Stained Glass'
| |
| },
| |
| ['stone'] = {
| |
| ['file'] = 'Stone.png',
| |
| ['link'] = 'Stone'
| |
| },
| |
| ['sword'] = {
| |
| ['file'] = 'Sword.png',
| |
| ['link'] = 'Sword'
| |
| },
| |
| ['tool'] = {
| |
| ['file'] = 'Tools.png',
| |
| ['link'] = 'Tools'
| |
| },
| |
| ['tools'] = {
| |
| ['file'] = 'Tools.png',
| |
| ['link'] = 'Tools'
| |
| },
| |
| ['water'] = {
| |
| ['file'] = 'Water.png',
| |
| ['link'] = 'Water'
| |
| },
| |
| ['wax'] = {
| |
| ['file'] = 'Wax.png',
| |
| ['link'] ='Wax'
| |
| },
| |
| ['wheat'] = {
| |
| ['file'] = 'Wheat.png',
| |
| ['link'] = 'Wheat'
| |
| },
| |
| ['wine'] = {
| |
| ['file'] = 'Wine.png',
| |
| ['link'] = 'Wine'
| |
| },
| |
| ['wood'] = {
| |
| ['file'] = 'Logs.png',
| |
| ['link'] = 'Wood'
| |
| },
| |
| ['wool'] = {
| |
| ['file'] = 'Wool.png',
| |
| ['link'] = 'Wool'
| |
| }
| |
| }
| |