Module:BiomeList: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
Created page with "local p = {} local Utils = require('Module:Utils') local IconUtils = require('Module:IconUtils') local L = require('Module:Localization') -- Main entry point for the Module function p.main() -- load lists local skillData = require( "Module:SkillData" ) local skillList = skillData.skills local text = '<div class="col-lg-12"><Center><h2 class="title">Skills</h2></Center></div>'; for Pname,Pdata in pairs(skillList) do if Pdata.Root == 'True' then..."
 
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 3: Line 3:
local Utils = require('Module:Utils')
local Utils = require('Module:Utils')
local IconUtils = require('Module:IconUtils')
local IconUtils = require('Module:IconUtils')
local L = require('Module:Localization')
local Lang = Utils.WikiLang


-- Main entry point for the Module
-- Main entry point for the Module
Line 9: Line 9:
  
  
     -- load lists
     -- load lists
     local skillData = require( "Module:SkillData" )
     local biomeData = mw.loadData( "Module:BiomeData" )
     local skillList = skillData.skills
     local biomesList = biomeData.biomes
local text = '<div class="col-lg-12"><Center><h2 class="title">Skills</h2></Center></div>';
   
local text = '<div class="col-lg-12"><Center><h2 class="title">' .. Utils.Translate("Biomes") ..'</h2></Center><p>Biomes are the unique natural environments found within Eco. Each one has different characteristics that affect the growth of various crops in-game.</p></div>';
for Pname,Pdata in pairs(skillList) do
for Bname,Bdata in pairs(biomesList) do
 
if Pdata.Root == 'True' then  
local BiomeBannerName = Bdata.ID .. "Banner.png"
if (Utils.checkImage(BiomeBannerName) == "N") then BiomeBannerName = "Banner4k.jpg" end
text = text .. '<div class="col-lg-3"><div class="card">';
text = text .. '<div class="col-lg-3"><div class="card">';
text = text .. '[[File:Banner4k.jpg|class=card-img-top|link=]]';
text = text .. '[[File:' .. BiomeBannerName ..'|class=card-img-top|link=]]';
text = text .. '<div class="card-body"><h5 class="card-title">';
text = text .. '<div class="card-body"><p class="card-title">';
text = text .. IconUtils.main{ name = Pname, id = Pdata.SkillID , size = 48, style = 2, link = Pname} .. ' '
text = text .. '[[' .. Bdata.Name[Lang] .. ']]';
text = text .. 'Profession</h5><h6 class="card-subtitle mb-2 text-muted">' .. Pdata.Description .. '</h6><p class="card-text">';
text = text .. '</p><p class="card-subtitle mb-2 text-muted" style="min-height: 95px;">' .. Bdata.Description[Lang] .. '</p>';
text = text .. '<div class="card"> <div class="card-body">';
text = text .. '</div></div></div>';
 
for Sname,Sdata in pairs(skillList) do
if Sdata.Root == 'False' and Sdata.RootSkill == Pname then
text = text .. IconUtils.main{ name = Sname, id = Sdata.SkillID , size = 32, style = 1, link = Sname} .. '  ';
end
end
text = text .. '</div></div></p></div></div></div>'; end
end
end



Latest revision as of 11:07, 13 April 2026

Documentation for this module may be created at Module:BiomeList/doc

local p = {}

local Utils = require('Module:Utils')
local IconUtils = require('Module:IconUtils')
local Lang = Utils.WikiLang

-- Main entry point for the Module
function p.main()
   	
    -- load lists
    local biomeData = mw.loadData( "Module:BiomeData" )
    local biomesList = biomeData.biomes
    
	local text = '<div class="col-lg-12"><Center><h2 class="title">' .. Utils.Translate("Biomes") ..'</h2></Center><p>Biomes are the unique natural environments found within Eco. Each one has different characteristics that affect the growth of various crops in-game.</p></div>';
	
	for Bname,Bdata in pairs(biomesList) do
		
		local BiomeBannerName = Bdata.ID .. "Banner.png"
		if (Utils.checkImage(BiomeBannerName) == "N") then BiomeBannerName = "Banner4k.jpg" end
			
		text = text .. '<div class="col-lg-3"><div class="card">';
		text = text .. '[[File:' .. BiomeBannerName ..'|class=card-img-top|link=]]';
		text = text .. '<div class="card-body"><p class="card-title">';
		text = text .. '[[' .. Bdata.Name[Lang] .. ']]';
		text = text .. '</p><p class="card-subtitle mb-2 text-muted" style="min-height: 95px;">' .. Bdata.Description[Lang] .. '</p>';
		text = text .. '</div></div></div>';
	end

	return text
end

return p