Module:ProjectLister: Difference between revisions
From Terra Invicta Official Wiki
No edit summary |
No edit summary |
||
| Line 14: | Line 14: | ||
local TechNames = mw.loadData('Module:ENReader/Tech') | local TechNames = mw.loadData('Module:ENReader/Tech') | ||
local ObjectiveNames = mw.loadData('Module:ENReader/Objective') | local ObjectiveNames = mw.loadData('Module:ENReader/Objective') | ||
local OrgNames = mw.loadData('Module:ENReader/Org') | |||
local ProjectPrereqs = mw.loadData('Module:ProjectLister/Prereqs') | local ProjectPrereqs = mw.loadData('Module:ProjectLister/Prereqs') | ||
local ProjectCosts = mw.loadData('Module:ProjectLister/Costs') | local ProjectCosts = mw.loadData('Module:ProjectLister/Costs') | ||
local ProjectProjects = mw.loadData('Module:ProjectLister/Projects') | local ProjectProjects = mw.loadData('Module:ProjectLister/Projects') | ||
local ProjectUnlocks = mw.loadData('Module:ProjectLister/UnlocksFormatted') | |||
local | |||
--endregion | --endregion | ||
| Line 524: | Line 488: | ||
end | end | ||
local | local punlocks = projectUnlocks[ProjectID] | ||
if punlocks and punlocks ~= {} then | |||
returnString = returnString .. '\n! Unlocks:' | |||
returnString = returnString .. '\n| colspan=3 | ' .. concat(punlocks, ' • ') | |||
if | |||
returnString = returnString .. '\n! Unlocks | |||
returnString = returnString .. '\n| colspan=3 | ' .. concat( | |||
returnString = returnString .. '\n|-' | returnString = returnString .. '\n|-' | ||
end | end | ||
returnString = returnString .. '\n! colspan=4 | Notes' | returnString = returnString .. '\n! colspan=4 | Notes' | ||
Revision as of 02:27, 27 September 2025
Documentation for this module may be created at Module:ProjectLister/doc
---
---Reads the Project data files and presents them in readable formats, with additional calculated statistics.
---
---@module ProjectLister
local ProjectLister = {}
--region Dependencies
local IconModule = require('Module:Icon')
local ProjectData = mw.loadData('Module:CSVReader/Project')
local TechData = mw.loadData('Module:CSVReader/Tech')
local BilateralData = mw.loadData('Module:CSVReader/Bilateral')
local ProjectNames = mw.loadData('Module:ENReader/Project')
local TechNames = mw.loadData('Module:ENReader/Tech')
local ObjectiveNames = mw.loadData('Module:ENReader/Objective')
local OrgNames = mw.loadData('Module:ENReader/Org')
local ProjectPrereqs = mw.loadData('Module:ProjectLister/Prereqs')
local ProjectCosts = mw.loadData('Module:ProjectLister/Costs')
local ProjectProjects = mw.loadData('Module:ProjectLister/Projects')
local ProjectUnlocks = mw.loadData('Module:ProjectLister/UnlocksFormatted')
--endregion
--region Private constants
local insert = table.insert
local concat = table.concat
local floor = math.floor
local sfind = string.find
local ssub = string.sub
local ScienceCategories = {
Energy = 'energy',
InformationScience='information',
LifeScience='life',
Materials='material',
MilitaryScience='military',
SocialScience='social',
SpaceScience='space',
Xenology='xenology'
}
local CouncilIcons = {
DestroyCouncil='destroy',
ResistCouncil='resist',
EscapeCouncil='escape',
ExploitCouncil='exploit',
CooperateCouncil='cooperate',
AppeaseCouncil='appease',
SubmitCouncil='submit',
AlienCouncil='alien'
}
--endregion
--region Private member variables
--none
--endregion
--region Private methods
local round = function(num, decimals)
local mult = 10^(decimals or 0)
return floor(num * mult + 0.5) / mult
end
-- Replaces ONE instance of the stringToReplace with replacementString in the fullString
local sreplace = function(fullString, stringToReplace, replacementString)
local si, ei = sfind(fullString, stringToReplace, 1, true)
if not si then
return fullString
end
local prefix = ssub(fullString,1,si - 1)
local suffix = ssub(fullString,ei+1)
return prefix .. replacementString .. suffix
end
--endregion
--region Public methods
-- Might remove this detailed view. It's too cluttered.
function ProjectLister.ListDetailedProjects()
return ProjectLister.ListProjects(true)
end
function ProjectLister.ListBasicProjects()
return ProjectLister.ListProjects(false)
end
---@param detailed boolean whether to show the detailed or basic version.
---@return wiki table of Projects
function ProjectLister.ListProjects(detailed)
local returnString = '{| class="wikitable sortable mw-collapsible" style="text-align: center;"'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Project'
returnString = returnString .. '\n! Type'
returnString = returnString .. '\n! Research<br>Cost'
returnString = returnString .. '\n! Full<br>Cost'
if detailed then
returnString = returnString .. '\n! Unlockable<br>Projects'
returnString = returnString .. '\n! Full<br>Prereqs'
else
returnString = returnString .. '\n! Direct<br>Prereqs'
end
returnString = returnString .. '\n! Alt<br>Prereq'
returnString = returnString .. '\n|-'
for rowID, row in pairs(ProjectData) do
if (not row['disable'] or row['disable'] ~= 'true') and row['factionPrereq/0'] ~= 'AlienCouncil' then
returnString = returnString .. '\n| [[' .. rowID .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. rowID] or rowID) .. ']]'
returnString = returnString .. '\n| ' .. IconModule.Icon({args={ScienceCategories[row['techCategory']]}})
returnString = returnString .. '\n| ' .. row['researchCost']
returnString = returnString .. '\n| ' .. tostring(ProjectCosts[rowID]['total'])
if detailed then
if ProjectProjects[rowID] then
local projects = {}
for projectID, _ in pairs(ProjectProjects[rowID]) do
local projectChance = ProjectData[projectID]['factionAvailableChance']
insert(projects, '(' .. projectChance .. '%)[[' .. projectID .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. projectID] or projectID) .. ']]')
end
returnString = returnString .. '\n| ' .. concat(projects, '<br>')
else
returnString = returnString .. '\n| '
end
end
local prereqs = {}
if detailed then
for prereqID, _ in pairs(ProjectPrereqs[rowID]) do
if string.sub(prereqID,1,7) == 'Project' then
insert(prereqs, '[[' .. prereqID .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. prereqID] or prereqID) .. ']]')
else
insert(prereqs, '[[' .. prereqID .. '|' .. TechNames['TITechTemplate.displayName.' .. prereqID] .. ']]')
end
end
else
for i = 0, 4 do
local prereq = row['prereqs/' .. i]
if prereq and prereq ~= '' and prereq ~= 0 then
if string.sub(prereq,1,7) == 'Project' then
insert(prereqs, '[[' .. prereq .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. prereq] or prereq) .. ']]')
else
insert(prereqs, '[[' .. prereq .. '|' .. TechNames['TITechTemplate.displayName.' .. prereq] .. ']]')
end
end
end
end
returnString = returnString .. '\n| ' .. concat(prereqs, '<br>')
local prereq0 = row['prereqs/0']
local altprereq = row['altPrereq0']
if not altprereq or altprereq == '' then
returnString = returnString .. '\n| '
else
if string.sub(prereq0,1,7) == 'Project' then
prereq0 = '[[' .. prereq0 .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. prereq0] or prereq0) .. ']]'
else
prereq0 = '[[' .. prereq0 .. '|' .. TechNames['TITechTemplate.displayName.' .. prereq0] .. ']]'
end
if string.sub(altprereq,1,7) == 'Project' then
altprereq = '[[' .. altprereq .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. altprereq] or altprereq) .. ']]'
else
altprereq = '[[' .. altprereq .. '|' .. TechNames['TITechTemplate.displayName.' .. altprereq] .. ']]'
end
returnString = returnString .. '\n| Replace ' .. prereq0 .. '<br>With ' .. altprereq
end
returnString = returnString .. '\n|-'
end
end
returnString = returnString .. '\n|}'
return returnString
end
function ProjectLister.ListProjectChances()
local returnString = '{| class="wikitable sortable mw-collapsible" style="text-align: center;"'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! rowspan=2|Project'
returnString = returnString .. '\n! rowspan=2|Base Unlock Chance'
returnString = returnString .. '\n! colspan=3|Available Chance'
returnString = returnString .. '\n! rowspan=2|Available To:'
returnString = returnString .. '\n! rowspan=2|Guaranteed Unlock for:'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Initial'
returnString = returnString .. '\n! Monthly Increase'
returnString = returnString .. '\n! Maximum'
returnString = returnString .. '\n|-'
for rowID, row in pairs(ProjectData) do
if (not row['disable'] or row['disable'] ~= 'true') and row['factionPrereq/0'] ~= 'AlienCouncil' then
returnString = returnString .. '\n| [[' .. rowID .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. rowID] or rowID) .. ']]'
returnString = returnString .. '\n| ' .. row['factionAvailableChance'] .. '%'
returnString = returnString .. '\n| ' .. row['initialUnlockChance'] .. '%'
returnString = returnString .. '\n| ' .. row['deltaUnlockChance'] .. '%'
returnString = returnString .. '\n| ' .. row['maxUnlockChance'] .. '%'
if not row['factionPrereq/0'] or row['factionPrereq/0'] == '' then
returnString = returnString .. '\n| All'
else
local councils = {}
for i = 0, 5 do
local freq = row['factionPrereq/' .. i]
if freq and freq ~= '' and freq ~= 0 then
insert(councils, IconModule.Icon({args={CouncilIcons[freq]}}))
end
end
returnString = returnString .. '\n| ' .. concat(councils, '')
end
local falways = row['factionAlways']
if not falways or falways == '' then
returnString = returnString .. '\n| '
elseif falways == 'Random' then
returnString = returnString .. '\n| Random'
else
returnString = returnString .. '\n| ' .. IconModule.Icon({args={CouncilIcons[falways]}})
end
returnString = returnString .. '\n|-'
end
end
returnString = returnString .. '\n|}'
return returnString
end
---@param frame a set of arguments that includes:
----frame.args[1] the dataName of the project
----frame.args['notes'] any additional notes the output table should contain
---@return wiki table of details for that project
function ProjectLister.SingleProjectTable(frame)
local ProjectID = frame.args[1]
local ProjectNotes = frame.args['notes'] or ''
local returnString = '{| class="wikitable" style="width: 100%;text-align:center;"'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! colspan=4 | <big>' .. (ProjectNames['TIProjectTemplate.displayName.' .. ProjectID] or ProjectID) .. '</big><br>' .. IconModule.Icon({args={ScienceCategories[ProjectData[ProjectID]['techCategory']], size='120px'}})
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! colspan=4 | ' .. IconModule.Icon({args={'research'}}) .. 'Research Cost: ' .. ProjectData[ProjectID]['researchCost']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! colspan=4 | Summary'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| colspan=4 | ' .. (ProjectNames['TIProjectTemplate.summary.' .. ProjectID] or 'Error: Missing Summary')
returnString = returnString .. '\n|-'
if ProjectNames['TIProjectTemplate.description.' .. ProjectID] then
returnString = returnString .. '\n! colspan=4 | Description'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| colspan=4 | ' .. ProjectNames['TIProjectTemplate.description.' .. ProjectID]
returnString = returnString .. '\n|-'
end
if ProjectData[ProjectID]['repeatable'] and ProjectData[ProjectID]['repeatable'] == 'true' then
returnString = returnString .. '\n! <big>Repeatable Project</big>'
returnString = returnString .. '\n| colspan=3 | Can be researched an unlimited number of times, but research cost is multiplied by (1 + number of times researched).'
returnString = returnString .. '\n|-'
end
if ProjectData[ProjectID]['oneTimeGlobally'] and ProjectData[ProjectID]['oneTimeGlobally'] == 'true' then
returnString = returnString .. '\n! <big>Global Project</big>'
returnString = returnString .. '\n| colspan=3 | Can be researched by only one faction. As soon as a faction researches this project, it is removed from all factions. Global projects usually give a global bonus (such as nation claims) that all factions can potentially benefit from, but may also have smaller bonuses that are only given to the faction that researches the project.'
returnString = returnString .. '\n|-'
end
returnString = returnString .. '\n! rowspan=2| Base Unlock Chance'
returnString = returnString .. '\n! colspan=3| Monthly Available Chance'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Initial'
returnString = returnString .. '\n! Monthly Increase'
returnString = returnString .. '\n! Maximum'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| style="width:25%;" | ' .. ProjectData[ProjectID]['factionAvailableChance'] .. '%'
returnString = returnString .. '\n| style="width:25%;" | ' .. ProjectData[ProjectID]['initialUnlockChance'] .. '%'
returnString = returnString .. '\n| style="width:25%;" | ' .. ProjectData[ProjectID]['deltaUnlockChance'] .. '%'
returnString = returnString .. '\n| style="width:25%;" | ' .. ProjectData[ProjectID]['maxUnlockChance'] .. '%'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Available to Faction(s): '
if not ProjectData[ProjectID]['factionPrereq/0'] or ProjectData[ProjectID]['factionPrereq/0'] == '' then
returnString = returnString .. '\n| colspan=3 | All'
else
local councils = {}
for i = 0, 5 do
local freq = ProjectData[ProjectID]['factionPrereq/' .. i]
if freq and freq ~= '' and freq ~= 0 then
insert(councils, IconModule.Icon({args={CouncilIcons[freq]}}))
end
end
returnString = returnString .. '\n| colspan=3 | ' .. concat(councils, '')
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Guaranteed for Faction: '
local falways = ProjectData[ProjectID]['factionAlways']
if not falways or falways == '' then
returnString = returnString .. '\n| colspan=3 | '
elseif falways == 'Random' then
returnString = returnString .. '\n| colspan=3 | Random'
else
returnString = returnString .. '\n| colspan=3 | ' .. IconModule.Icon({args={CouncilIcons[falways]}})
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| colspan=4 | \n{| class="wikitable sortable mw-collapsible" style="width: 100%;text-align:center;"'
returnString = returnString .. '\n|+ Full List of Prerequisites.'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Name'
returnString = returnString .. '\n! Type'
returnString = returnString .. '\n! Cost'
returnString = returnString .. '\n|-'
for prereqID, _ in pairs(ProjectPrereqs[ProjectID]) do
if string.sub(prereqID,1,7) == 'Project' then
local prereqIDChance = ProjectData[prereqID]['factionAvailableChance']
returnString = returnString .. '\n| (' .. prereqIDChance .. '%) [[' .. prereqID .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. prereqID] or prereqID) .. ']]'
returnString = returnString .. '\n| ' .. IconModule.Icon({args={ScienceCategories[ProjectData[prereqID]['techCategory']]}}) .. IconModule.Icon({args={'projects'}})
returnString = returnString .. '\n| ' .. ProjectData[prereqID]['researchCost']
returnString = returnString .. '\n|-'
else
returnString = returnString .. '\n| [[' .. prereqID .. '|' .. (TechNames['TITechTemplate.displayName.' .. prereqID] or prereqID) .. ']]'
returnString = returnString .. '\n| ' .. IconModule.Icon({args={ScienceCategories[TechData[prereqID]['techCategory']]}})
returnString = returnString .. '\n| ' .. TechData[prereqID]['researchCost']
returnString = returnString .. '\n|-'
end
end
returnString = returnString .. '\n|}'
returnString = returnString .. '\n|-'
local prereq0 = ProjectData[ProjectID]['prereqs/0']
local altprereq = ProjectData[ProjectID]['altPrereq0']
if altprereq and altprereq ~= '' then
if string.sub(prereq0,1,7) == 'Project' then
prereq0 = '[[' .. prereq0 .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. prereq0] or prereq0) .. ']]'
else
prereq0 = '[[' .. prereq0 .. '|' .. TechNames['TITechTemplate.displayName.' .. prereq0] .. ']]'
end
if string.sub(altprereq,1,7) == 'Project' then
altprereq = '[[' .. altprereq .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. altprereq] or altprereq) .. ']]'
else
altprereq = '[[' .. altprereq .. '|' .. TechNames['TITechTemplate.displayName.' .. altprereq] .. ']]'
end
returnString = returnString .. '\n! Alt Prereq: || colspan=3 | Replace ' .. prereq0 .. '<br>With ' .. altprereq
returnString = returnString .. '\n|-'
end
local requiredObjectiveName = ProjectData[ProjectID]['requiredObjectiveName']
local altRequiredObjectiveName = ProjectData[ProjectID]['altRequiredObjectiveName']
if requiredObjectiveName and requiredObjectiveName ~= '' then
returnString = returnString .. '\n! colspan=4 | Required Objective (only one needed)'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'destroy'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.DestroyCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.DestroyCouncil']
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'resist'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.ResistCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.ResistCouncil']
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'escape'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.EscapeCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.EscapeCouncil']
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'exploit'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.ExploitCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.ExploitCouncil']
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'cooperate'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.CooperateCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.CooperateCouncil']
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'appease'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.AppeaseCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.AppeaseCouncil']
end
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! ' .. IconModule.Icon({args={'submit'}})
returnString = returnString .. '\n| colspan=3 | ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. requiredObjectiveName .. '.SubmitCouncil']
if altRequiredObjectiveName and altRequiredObjectiveName ~= '' then
returnString = returnString .. ' • ' .. ObjectiveNames['TIObjectiveTemplate.displayName.' .. altRequiredObjectiveName .. '.SubmitCouncil']
end
returnString = returnString .. '\n|-'
end
returnString = returnString .. '\n! colspan=4 | Total ' .. IconModule.Icon({args={'research'}}) .. 'Research Cost (including itself)<br>(Does not consider Alt Prereqs)'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. 'Category'
returnString = returnString .. '\n!' .. 'From Projects'
returnString = returnString .. '\n!' .. 'From Techs'
returnString = returnString .. '\n!' .. 'Category Subtotal'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'energy'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['energyProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['energyTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['energyTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'information'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['informationProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['informationTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['informationTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'life'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['lifeProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['lifeTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['lifeTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'material'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['materialProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['materialTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['materialTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'military'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['militaryProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['militaryTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['militaryTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'social'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['socialProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['socialTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['socialTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'space'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['spaceProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['spaceTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['spaceTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n!' .. IconModule.Icon({args={'xenology'}})
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['xenologyProject']
returnString = returnString .. '\n|'
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['xenologyTotal']
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! Total'
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['totalProject']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['totalTech']
returnString = returnString .. '\n|' .. ProjectCosts[ProjectID]['total']
returnString = returnString .. '\n|-'
if ProjectProjects[ProjectID] then
returnString = returnString .. '\n! colspan=4 | Direct Prerequisite For Projects:'
returnString = returnString .. '\n|-'
local projectprojects = {}
for projectprojectID, _ in pairs(ProjectProjects[ProjectID]) do
insert(projectprojects, '[[' .. projectprojectID .. '|' .. (ProjectNames['TIProjectTemplate.displayName.' .. projectprojectID] or projectprojectID) .. ']]')
end
returnString = returnString .. '\n| colspan=4 | ' .. concat(projectprojects, ' • ')
returnString = returnString .. '\n|-'
end
returnString = returnString .. '\n! colspan=4| Effects'
returnString = returnString .. '\n|-'
if ProjectData[ProjectID]['effects/0'] and ProjectData[ProjectID]['effects/0'] ~= '' and ProjectData[ProjectID]['effects/0'] ~= 0 then
for i = 0, 2 do
local peffect = ProjectData[ProjectID]['effects/' .. i]
if peffect and peffect ~= '' and peffect ~= 0 then
returnString = returnString .. '\n| colspan=4| ' .. peffect
returnString = returnString .. '\n|-'
end
end
end
local projectOrg = ProjectData[ProjectID]['orgGranted']
if projectOrg and projectOrg ~= '' and projectOrg ~= 0 then
returnString = returnString .. '\n! Creates [[Orgs|Org]]:'
returnString = returnString .. '\n| colspan=3 | ' .. (OrgNames['TIOrgTemplate.displayName.' .. projectOrg] or projectOrg)
returnString = returnString .. '\n|-'
end
local projectResourceType = ProjectData[ProjectID]['resourcesGranted/0/resource']
if projectResourceType and projectResourceType ~= '' and projectResourceType ~= 0 then
returnString = returnString .. '\n! Gives [[Resources|Resource]]:'
returnString = returnString .. '\n| colspan=3 | ' .. ProjectData[ProjectID]['resourcesGranted/0/value'] .. ' ' .. projectResourceType
returnString = returnString .. '\n|-'
end
local punlocks = projectUnlocks[ProjectID]
if punlocks and punlocks ~= {} then
returnString = returnString .. '\n! Unlocks:'
returnString = returnString .. '\n| colspan=3 | ' .. concat(punlocks, ' • ')
returnString = returnString .. '\n|-'
end
returnString = returnString .. '\n! colspan=4 | Notes'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| colspan=4 | ' .. ProjectNotes
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! colspan=4 | Data Sources'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| colspan=4 | [[TIProjectTemplate_CSV]] • [[TIProjectTemplate_EN]] • [[TITechTemplate_CSV]] • [[TITechTemplate_EN]] • [[TIBatteryTemplate_CSV]] • [[TIBatteryTemplate_EN]] • [[TIBilateralTemplate_CSV]] • [[TIDriveTemplate_CSV]] • [[TIDriveTemplate_EN]] • [[TIGunTemplate_CSV]] • [[TIGunTemplate_EN]] • [[TIHabModuleTemplate_CSV]] • [[TIHabModuleTemplate_EN]] • [[TIHeatSinkTemplate_CSV]] • [[TIHeatSinkTemplate_EN]] • [[TILaserWeaponTemplate_CSV]] • [[TILaserWeaponTemplate_EN]] • [[TIMagneticGunTemplate_CSV]] • [[TIMagneticGunTemplate_EN]] • [[TIMissileTemplate_CSV]] • [[TIMissileTemplate_EN]] • [[TINationTemplate_EN]] • [[TIOrgTemplate_CSV]] • [[TIOrgTemplate_EN]] • [[TIParticleWeaponTemplate_CSV]] • [[TIParticleWeaponTemplate_EN]] • [[TIPlasmaWeaponTemplate_CSV]] • [[TIPlasmaWeaponTemplate_EN]] • [[TIPowerPlantTemplate_CSV]] • [[TIPowerPlantTemplate_EN]] • [[TIRadiatorTemplate_CSV]] • [[TIRadiatorTemplate_EN]] • [[TIRegionTemplate_EN]] • [[TIShipArmorTemplate_CSV]] • [[TIShipArmorTemplate_EN]] • [[TIShipHullTemplate_CSV]] • [[TIShipHullTemplate_EN]] • [[TIUtilityModuleTemplate_CSV]] • [[TIUtilityModuleTemplate_EN]]'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n! colspan=4 | Related Pages'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n| colspan=4 | [[Tech List]] • [[Project List]] • [[Technology]]'
returnString = returnString .. '\n|-'
returnString = returnString .. '\n|}'
return returnString
end
--endregion
return ProjectLister


