Can now create as many tech rows as you wish in mods :)

This commit is contained in:
Yair Morgenstern 2021-02-16 20:02:54 +02:00
parent 105d9690ff
commit 5fa08d9f2d

View File

@ -93,8 +93,9 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
private fun createTechTable() {
val allTechs = civInfo.gameInfo.ruleSet.technologies.values
val columns = allTechs.map { it.column!!.columnNumber }.max()!! + 1
val techMatrix = Array<Array<Technology?>>(columns) { arrayOfNulls(10) } // Divided into columns, then rows
val columns = allTechs.map { it.column!!.columnNumber }.maxOrNull()!! + 1
val rows = allTechs.map { it.row }.maxOrNull()!! + 1
val techMatrix = Array<Array<Technology?>>(columns) { arrayOfNulls(rows) } // Divided into columns, then rows
for (technology in allTechs) {
techMatrix[technology.column!!.columnNumber][technology.row - 1] = technology