Difference between revisions of "Module:OInfobox-Building"

Jump to navigation Jump to search
m
no edit summary
m
Tag: Undo
m
Line 172: Line 172:
         end
         end
         --/
         --/
--SECTION-REREQUISITES
--SECTION-PREQUISITES
         local prereqData = {}
         local prereqData = {}
          
          
Line 195: Line 195:
         end
         end
--/
--/
        --SECTION-PROSPERITY
        ---SECTION-UNLOCKING
        if #prereqData > 0 then
         if buildingData.influence then
            addSection(infobox, prereqData, 'Prerequisites')
             local unlockData = {}
        end
             for resource, amount in pairs(buildingData.influence) do
       
                 local resourceIcon = i.icon(resource, nil, nil, com.firstUpper({resource}), 'en')
         if buildingData.prosperity then
                table.insert(unlockData, {label = resourceIcon, value = amount})
             local prosperityData = {}
             for type, value in pairs(buildingData.prosperity) do
                 table.insert(prosperityData, {label = com.firstUpper({type}), value = value})
             end
             end
              
              
             if #prosperityData > 0 then
             if #unlockData > 0 then
                 addSection(infobox, prosperityData, 'Prosperity', 2)
                 addSection(infobox, unlockData, 'Unlocking Conditions', 2)
             end
             end
         end
         end
Line 220: Line 217:
              
              
             if #constructionData > 0 then
             if #constructionData > 0 then
                 addSection(infobox, constructionData, 'Construction Requirements', 2)
                 addSection(infobox, constructionData, 'Construction Resources', 2)
             end
             end
         end
         end
606

edits

Navigation menu