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 47: | Line 47: | ||
-- 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 57: | ||
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 74: | Line 74: | ||
infobox = infobox .. '|- style=\"text-align: center;color: white; background-color: goldenrod;\"\n| colspan=\"2\"' | infobox = infobox .. '|- style=\"text-align: center;color: white; background-color: goldenrod;\"\n| colspan=\"2\"' | ||
if skillTable.root == true then | if skillTable.root == true then | ||
infobox = infobox .. '| \'\'\'Profession\'\'\'[[Category: | infobox = infobox .. '| \'\'\'Profession\'\'\'[[Category:Professions]]\n' | ||
elseif skillTable.specialty == true then | elseif skillTable.specialty == true then | ||
infobox = infobox .. '| \'\'\'Specialty\'\'\'[[Category: | infobox = infobox .. '| \'\'\'Specialty\'\'\'[[Category:Specialties]]\n' | ||
elseif skillTable.group == 'Talents' then | elseif skillTable.group == 'Talents' then | ||
infobox = infobox .. '| \'\'\'Talent\'\'\'[[Category: | infobox = infobox .. '| \'\'\'Talent\'\'\'[[Category:Talents]]\n' | ||
else | else | ||
infobox = infobox .. '|\n' | infobox = infobox .. '|\n' | ||
Line 86: | Line 86: | ||
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 95: | ||
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:Pages_with_missing_skill_Icon]]' | image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_skill_Icon]]' | ||
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:Pages_with_missing_talent_Icon]]' | image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_talent_Icon]]' | ||
end | end | ||
Line 112: | Line 104: | ||
end | end | ||
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | <div class="iconContainer"><div class="iconStack">[[File:' .. image .. '|frameless|class=iconGreen]]</div><div class=iconBorder style=\"position:absolute;\"></div></div> \n' | |||
-- 'Description' section header | -- 'Description' section header | ||
Line 153: | Line 138: | ||
-- 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 | |||
-- maxlevel .maxLevel | -- maxlevel .maxLevel | ||
if skillTable.maxLevel ~= nil then | if skillTable.maxLevel ~= nil then | ||
Line 175: | Line 159: | ||
local talent6 = skillTable.talents.level6 | local talent6 = skillTable.talents.level6 | ||
-- for each item in the listTalents3 (b is position, c is value) | -- for each item in the listTalents3 (b is position, c is value) | ||
for b,c in ipairs(talent3) do | for b,c in ipairs(talent3) do | ||
--if not these tags listed here | --if not these tags listed here | ||
Line 189: | Line 172: | ||
end | end | ||
end | end | ||
-- for each item in the listTalents6 (e is position, d is value) | -- for each item in the listTalents6 (e is position, d is value) | ||
for e,d in ipairs(talent6) do | for e,d in ipairs(talent6) do | ||
--if not these tags listed here | --if not these tags listed here | ||
Line 204: | Line 185: | ||
end | end | ||
end | end | ||
-- 'Talent Information' section header | -- 'Talent Information' section header | ||
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Talent Information\'\'\'\n' | infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Talent Information\'\'\'\n' | ||
Line 216: | Line 196: | ||
-- 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 | ||