Difference between revisions of "Module:OInfobox-Building"

Jump to navigation Jump to search
m
no edit summary
m
m
Line 241: Line 241:
             local costData = {}
             local costData = {}
             for resource, amount in pairs(buildingData.costs) do
             for resource, amount in pairs(buildingData.costs) do
                 local resourceIcon = i.icon(resource, nil, nil, com.firstUpper({resource}), 'en')
                 local labelText = com.firstUpper({resource})
                 table.insert(costData, {label = resourceIcon, value = amount})
                 local finalLabel = labelText
                 if resourceIcon == 'gold coins' then
                 if resource == 'gold coins' then
                table.insert(costData, {label = 'Build Cost', value = amount})
                    finalLabel = 'Build Cost' -- Rename only in this section
                 end
                 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


-- Add 'bsplendour' to running costs if it exists
-- Add 'bsplendour' to running costs if it exists
Line 259: Line 262:
         end
         end
         --/
         --/
    end
    --/
     return infobox
     return infobox
end
end


return p
return p
606

edits

Navigation menu