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

Aller à la navigation Aller à la recherche
m
aucun résumé de modification
m
m
Ligne 238 : Ligne 238 :
         local costData = {}
         local costData = {}


if buildingData.costs or buildingData.influence['bsplendour'] then
if buildingData.costs or buildingData.influence['bsplendour'] or buildingData.costs['gold coins'] then
             local costData = {}
             local costData = {}
             for resource, amount in pairs(buildingData.costs) do
             for resource, amount in pairs(buildingData.costs) do
                local labelText = com.firstUpper({resource})
                 local resourceIcon = i.icon(resource, nil, nil, com.firstUpper({resource}), 'en')
                local finalLabel = labelText
                 table.insert(costData, {label = resourceIcon, value = amount})
                if resource == 'gold coins' then
                    finalLabel = 'Build Cost' -- Rename only in this section
                end
                 local resourceIcon = i.icon(resource, nil, nil, labelText, 'en') -- Keep original for icon
                 table.insert(costData, {label = finalLabel, value = amount}) -- Use finalLabel here
             end
             end
        end
           
 
            if buildingData.costs['gold coins'] then
            local resourceIcon = i.icon('gold coins', nil, nil, 'gold coins', 'en')
        table.insert(costData, {label = 'Build Cost', value = buildingData.costs['gold coins']})
            end
-- Add 'bsplendour' to running costs if it exists
-- Add 'bsplendour' to running costs if it exists
if buildingData.influence['bsplendour'] then
if buildingData.influence['bsplendour'] then
Ligne 256 : Ligne 255 :
         table.insert(costData, {label = resourceIcon, value = buildingData.influence['bsplendour']})
         table.insert(costData, {label = resourceIcon, value = buildingData.influence['bsplendour']})
             end
             end
 
             if #costData > 0 then
             if #costData > 0 then
                 addSection(infobox, costData, 'Economic Impact', 2)
                 addSection(infobox, costData, 'Economic Costs', 2)
             end
             end
         end
         end
        --/
    end
    --/
     return infobox
     return infobox
end
end


return p
return p
606

modifications

Menu de navigation