Module:SkillInfoCard: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
No edit summary
No edit summary
Line 18: Line 18:
if (Skill.IsRoot == 'True') then
if (Skill.IsRoot == 'True') then
WikiText =  WikiText .. '==Specialties=='
WikiText =  WikiText .. '==Specialties== '
WikiText =  WikiText .. 'The '.. Skill.Name[Lang] .. ' Profession includes the following Specialties:<br>'
WikiText =  WikiText .. 'The '.. Skill.Name[Lang] .. ' Profession includes the following Specialties:<br>'
else
else

Revision as of 05:40, 10 July 2025

Warning about use

To prevent multiple call of data array, you must use the function: local SkillInfoCard = mw.loadData("Module:SkillInfoCard")


local p = {}

local Utils = require('Module:Utils')
local IconUtils = require('Module:IconUtils')
local L = require('Module:Localization')
local Lang = Utils.getLanguageName()

function p.main(frame)
	local PageName = frame.args[1]
	if (Lang == 'English') then SkillName = PageName else SkillName = Utils.SkillSearch(PageName) end
	local SkillData = require( "Module:SkillData" )
    local Skill = SkillData.skills[SkillName]	
	local WikiText =''
	
	WikiText =  WikiText .. IconUtils.main{name = Skill.Name[Lang], id = Skill.SkillID , size = 32, style = 1} .. ' '
	if (Skill.IsRoot == 'True') then WikiText =  WikiText .. Skill.Name[Lang] .. ' it is [[Skills|Profession]].<br>'   else WikiText =  WikiText .. Skill.Name[Lang] .. ' it is [[Skills|Specialty]].<br>' end
	WikiText =  WikiText .. Skill.Description[Lang] .. '<br>'
	
	if (Skill.IsRoot == 'True') then
		WikiText =  WikiText .. '==Specialties== '
		WikiText =  WikiText .. 'The '.. Skill.Name[Lang] .. ' Profession includes the following Specialties:<br>'
	else
		WikiText =  WikiText .. '==How to learn=='
	end
	
	return WikiText
end

return p