Différences entre les versions de « Module:OInfobox-Building »

Aller à la navigation Aller à la recherche
m
aucun résumé de modification
m
m
Ligne 194 : Ligne 194 :
         local first = true
         local first = true
           for resource, amount in pairs(buildingData.influence) do
           for resource, amount in pairs(buildingData.influence) do
           if resource ~= 'tier' then -- Exclude the 'tier' key
           if resource ~= 'tier' and resource ~= 'perEach splendour' then -- Exclude 'tier' and 'perEach splendour'
             local displayAmount = amount
             local displayAmount = amount
             if first and buildingData.influence.tier then
             if first and buildingData.influence.tier then
Ligne 234 : Ligne 234 :
         local costData = {}
         local costData = {}


        if buildingData.costs then
if buildingData.costs or buildingData.influence['perEach splendour'] then
             local costData = {}
             local costData = {}
             for resource, amount in pairs(buildingData.costs) do
             for resource, amount in pairs(buildingData.costs) do
Ligne 240 : Ligne 240 :
                 table.insert(costData, {label = resourceIcon, value = amount})
                 table.insert(costData, {label = resourceIcon, value = amount})
             end
             end
 
-- Add 'perEach splendour' to running costs if it exists
if buildingData.influence['perEach splendour'] then
            local resourceIcon = i.icon('splendor', nil, nil, 'Splendor', 'en') -- Assuming a generic splendor icon
        table.insert(costData, {label = resourceIcon .. ' (per each)', value = buildingData.influence['perEach splendour']})
            end
             if #costData > 0 then
             if #costData > 0 then
                 addSection(infobox, costData, 'Economic Impact', 2)
                 addSection(infobox, costData, 'Economic Impact', 2)
606

modifications

Menu de navigation