Modül:RoleDutyIcons

FM Wiki sitesinden

Bu modül için bir Modül:RoleDutyIcons/belge belgelendirmesi oluşturabilirsiniz

local p = {}

local dutyMap = {
	["Savunma"] = "🛡 Savunma",
	["Destek"]  = "⚙ Destek",
	["Hücum"]   = "⚔ Hücum",
}

function p.render(frame)
	local raw = frame.args[1] or ""
	if raw == "" then
		return ""
	end

	local output = {}
	for duty in string.gmatch(raw, "([^%-]+)") do
		duty = mw.text.trim(duty)
		if dutyMap[duty] then
			table.insert(output, dutyMap[duty])
		else
			-- Harici / bilinmeyen görev ismi yazılır
			table.insert(output, duty)
		end
	end

	return table.concat(output, " / ")
end

return p