Module:Gems/infobox

--- Gems/infobox builds the infobox on pages for crafts in the Stonecutting.

-- @module     Gems -- @author FINNER --

return { --- Builds the infobox for Gems crafts. --	@function		p.buildInfobox --	@param			{table} frame Frame object --	@return			{string} Wikitext of infobox buildInfobox = function(frame) local args = frame.args;--require('Dev:Arguments').getArgs(frame); local name = args['Name']; local Stonecutting = {}

Gems = mw.loadData(Module:Gems/data)[name];

local infobox = mw.html.create('infobox') :tag('title') :tag('default') :tag('b'):wikitext(name):done :done :done :tag('image'):attr('source', 'Image') :tag('default'):wikitext(Gems.Image):done :done :tag('data'):attr('source', 'Tier') :tag('label'):wikitext('Tier'):done :tag('default'):wikitext(Gems.Tier or 'Unknown'):done :done :tag('data'):attr('source', 'Category') :tag('label'):wikitext('Category'):done :tag('default'):wikitext(Gems.Category or 'Unknown'):done :done :tag('data'):attr('source', 'Resources') :tag('label'):wikitext('Resources'):done :tag('default'):wikitext(Gems.Resources or 'Unknown'):done :done :tag('data'):attr('source', 'Yield') :tag('label'):wikitext('Yield'):done :tag('default'):wikitext(Gems.Yield or 'Unknown'):done :done :tag('data'):attr('source', 'Source') :tag('label'):wikitext('Source'):done :tag('default'):wikitext(Gems.Source or 'Unknown'):done :done :tag('data'):attr('source', 'Skill Level') :tag('label'):wikitext('Skill Level'):done :tag('default'):wikitext(..Gems.CraftSkill..' Lv. '..Gems.SkillLevel.. or 'Unknown'):done :done :tag('data'):attr('source', 'CraftingXP') :tag('label'):wikitext('Crafting Exp'):done :tag('default'):wikitext(..'+'..Gems.CraftingXP..' '..Gems.CraftSkill.. or 'Unknown'):done :done :tag('data'):attr('source', 'WeaponSocket') :tag('label'):wikitext('Weapon Socket'):done :tag('default'):wikitext(Gems.WeaponSocket or 'Unknown'):done :done :tag('data'):attr('source', 'ArmorSocket') :tag('label'):wikitext('Armor Socket'):done :tag('default'):wikitext(Gems.ArmorSocket or 'Unknown'):done :done :tag('data'):attr('source', 'Weight') :tag('label'):wikitext('Weight'):done :tag('default'):wikitext(Gems.Weight or 'Unknown'):done :done :tag('data'):attr('source', 'Buy') :tag('label'):wikitext('Buy'):done :tag('default'):wikitext(Gems.Buy or 'Unknown'):done :done :tag('data'):attr('source', 'Sell') :tag('label'):wikitext('Sell'):done :tag('default'):wikitext(Gems.Sell or 'Unknown'):done :done :tag('data'):attr('source', 'Salvageable') :tag('label'):wikitext('Salvageable'):done :tag('default'):wikitext(Gems.Salvageable or 'Unknown'):done :done :tag('data'):attr('source', 'Tradeable') :tag('label'):wikitext('Tradeable'):done :tag('default'):wikitext(Gems.Tradeable or 'Unknown'):done :done

return frame:preprocess(tostring(infobox)) end }