Editing Module:Infobox Skill
From Eco - English Wiki
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
Line 47: | Line 45: | ||
-- checks if skill and assigns correct modules based on check | -- checks if skill and assigns correct modules based on check | ||
if check == 'skill' then | if check == 'skill' then | ||
skillData = require( "Module: | skillData = require( "Module:TestSkills" ) | ||
skillTable = skillData.skills[skills] | skillTable = skillData.skills[skills] | ||
else | else | ||
Line 57: | Line 55: | ||
if skillTable == {} then | if skillTable == {} then | ||
if check == 'skill' then | if check == 'skill' then | ||
return skills .. ' could not be found in Module: | return skills .. ' could not be found in Module:TestSkills.' | ||
else | else | ||
return skills .. ' could not be found in Module:TalentData.' | return skills .. ' could not be found in Module:TalentData.' | ||
Line 86: | Line 84: | ||
local checkImage = {'_Icon.png','_Icon.jpg'} | local checkImage = {'_Icon.png','_Icon.jpg'} | ||
local image = '' | local image = '' | ||
local skillsimagename = string.gsub(skills, ' ', '') | |||
for i,v in ipairs(checkImage) do | for i,v in ipairs(checkImage) do | ||
Line 103: | Line 93: | ||
if table.getn(checkImage) == i then | if table.getn(checkImage) == i then | ||
image = 'NoImage.png' | image = 'NoImage.png' | ||
if check == ' | if check == 'Skill' then | ||
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category: | image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_skill]]' | ||
end | end | ||
if check == ' | if check == 'Talent' then | ||
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category: | image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_talent]]' | ||
end | end | ||
end | end | ||
end | end | ||
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|250x250px]]\n' | |||
-- 'Description' section header | -- 'Description' section header | ||
Line 134: | Line 117: | ||
--SKILL | --SKILL | ||
if check == 'skill' then | if check == 'skill' then | ||
-- ' | -- 'Related Skills' section header | ||
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\' | infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Related Skills\'\'\'\n' | ||
-- Professsion .rootSkill | -- Professsion .rootSkill | ||
Line 153: | Line 136: | ||
-- Leads to childSkills | -- Leads to childSkills | ||
if skillTable.childSkills ~= nil then | |||
infobox = infobox .. '|-\n| Leads to:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.childSkills .. '\n' | |||
end | |||
-- Leads to childSkills | |||
if skillTable.childSkills ~= nil then | |||
infobox = infobox .. '|-\n| Leads to:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.childSkills .. '\n' | |||
end | |||
-- 'Skill Information' section header | |||
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Skill Information\'\'\'\n' | |||
-- maxlevel .maxLevel | -- maxlevel .maxLevel | ||
if skillTable.maxLevel ~= nil then | if skillTable.maxLevel ~= nil then | ||
Line 168: | Line 158: | ||
end | end | ||
-- 'IDs' section header | -- 'IDs' section header | ||
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'IDs\'\'\'\n' | infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'IDs\'\'\'\n' | ||
Line 216: | Line 163: | ||
-- skill id (type) | -- skill id (type) | ||
infobox = infobox .. '|- valign=\"center\"\n| Item ID:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.skillID .. '\n' | infobox = infobox .. '|- valign=\"center\"\n| Item ID:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.skillID .. '\n' | ||
-- id number (type id) | |||
infobox = infobox .. '|- valign=\"center\"\n| ID Number:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.skillIDNum .. '\n' | |||
end | end | ||
--TALENT | --TALENT | ||
Line 224: | Line 175: | ||
-- Talent Type | -- Talent Type | ||
if | if talentTable.talentType ~= nil then | ||
infobox = infobox .. '|-\n| Talent Type:\n| style=\"text-align: right; padding: 3px;\" | | infobox = infobox .. '|-\n| Talent Type:\n| style=\"text-align: right; padding: 3px;\" | ' .. talentTable.talentType .. '\n' | ||
end | end | ||
-- Skill Needed | -- Skill Needed | ||
if | if talentTable.owningSkill ~= nil then | ||
infobox = infobox .. '|-\n| Skill Needed:\n| style=\"text-align: right; padding: 3px;\" | | infobox = infobox .. '|-\n| Skill Needed:\n| style=\"text-align: right; padding: 3px;\" | ' .. talentTable.owningSkill .. '\n' | ||
end | end | ||
-- Talents Active at Level | -- Talents Active at Level | ||
if | if talentTable.activeLevel ~= nil then | ||
infobox = infobox .. '|-\n| Active at Level:\n| style=\"text-align: right; padding: 3px;\" | ' .. | infobox = infobox .. '|-\n| Active at Level:\n| style=\"text-align: right; padding: 3px;\" | ' .. talentTable.activeLevel .. '\n' | ||
end | end | ||
end | end | ||
infobox = infobox .. '|}' | infobox = infobox .. '|}' | ||
return infobox | return infobox | ||
end | end | ||
return p | return p |