mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-20 19:56:51 +01:00
New game screen adjusts to base rulesets with small amounts of civs, including barbarians
Unknown eras no longer cause the screen to go black
This commit is contained in:
parent
33ee29bbb2
commit
9ec721f93b
|
|
@ -2,7 +2,6 @@ package com.unciv.logic.civilization
|
|||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.math.Vector2
|
||||
import com.sun.xml.internal.bind.v2.runtime.reflect.opt.Const
|
||||
import com.unciv.Constants
|
||||
import com.unciv.JsonParser
|
||||
import com.unciv.UncivGame
|
||||
|
|
@ -20,7 +19,6 @@ import com.unciv.models.ruleset.Building
|
|||
import com.unciv.models.ruleset.Difficulty
|
||||
import com.unciv.models.ruleset.Nation
|
||||
import com.unciv.models.ruleset.VictoryType
|
||||
import com.unciv.models.ruleset.tech.TechEra
|
||||
import com.unciv.models.ruleset.tile.ResourceSupplyList
|
||||
import com.unciv.models.ruleset.unit.BaseUnit
|
||||
import com.unciv.models.stats.Stats
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.unciv.logic.civilization.CivilizationInfo
|
|||
import com.unciv.logic.map.action.MapUnitAction
|
||||
import com.unciv.logic.map.action.StringAction
|
||||
import com.unciv.models.ruleset.Ruleset
|
||||
import com.unciv.models.ruleset.tech.TechEra
|
||||
import com.unciv.models.ruleset.tile.TerrainType
|
||||
import com.unciv.models.ruleset.unit.BaseUnit
|
||||
import com.unciv.models.ruleset.unit.UnitType
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.unciv.models.metadata
|
|||
import com.unciv.Constants
|
||||
import com.unciv.logic.civilization.PlayerType
|
||||
import com.unciv.models.ruleset.VictoryType
|
||||
import com.unciv.models.ruleset.tech.TechEra
|
||||
|
||||
class GameParameters { // Default values are the default new game
|
||||
var difficulty = "Prince"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.unciv.models.ruleset
|
||||
|
||||
import com.unciv.models.ruleset.tech.TechEra
|
||||
|
||||
class PolicyBranch : Policy() {
|
||||
var policies: ArrayList<Policy> = arrayListOf()
|
||||
lateinit var era: String
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package com.unciv.models.ruleset.tech
|
||||
|
||||
enum class TechEra {
|
||||
Ancient,
|
||||
Classical,
|
||||
Medieval,
|
||||
Renaissance,
|
||||
Industrial,
|
||||
Modern,
|
||||
Information,
|
||||
Future
|
||||
}
|
||||
|
|
@ -9,7 +9,6 @@ import com.unciv.logic.map.MapType
|
|||
import com.unciv.models.metadata.GameSpeed
|
||||
import com.unciv.models.ruleset.RulesetCache
|
||||
import com.unciv.models.ruleset.VictoryType
|
||||
import com.unciv.models.ruleset.tech.TechEra
|
||||
import com.unciv.models.translations.tr
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.ImageGetter
|
||||
|
|
|
|||
|
|
@ -34,8 +34,9 @@ class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters:
|
|||
val gameBasics = newGameScreen.ruleset // the mod picking changes this ruleset
|
||||
|
||||
reassignRemovedModReferences()
|
||||
if(newGameParameters.players.size>newGameScreen.ruleset.nations.size)
|
||||
newGameParameters.players=newGameParameters.players.subList(0,newGameScreen.ruleset.nations.size)
|
||||
val newRulesetPlayableCivs = newGameScreen.ruleset.nations.count { it.key!=Constants.barbarians }
|
||||
if(newGameParameters.players.size > newRulesetPlayableCivs)
|
||||
newGameParameters.players=newGameParameters.players.subList(0,newRulesetPlayableCivs)
|
||||
if (desiredCiv.isNotEmpty()) assignDesiredCiv(desiredCiv)
|
||||
|
||||
for (player in newGameParameters.players) {
|
||||
|
|
|
|||
|
|
@ -221,19 +221,18 @@ object ImageGetter {
|
|||
}
|
||||
|
||||
fun getTechIconGroup(techName: String, circleSize: Float): Group {
|
||||
var techIconColor = Color.WHITE
|
||||
when (ruleset.technologies[techName]!!.era()) {
|
||||
Constants.ancientEra -> techIconColor = colorFromRGB(255, 87, 35)
|
||||
Constants.classicalEra -> techIconColor = colorFromRGB(233, 31, 99)
|
||||
Constants.medievalEra -> techIconColor = colorFromRGB(157, 39, 176)
|
||||
Constants.renaissanceEra -> techIconColor = colorFromRGB(104, 58, 183)
|
||||
Constants.industrialEra -> techIconColor = colorFromRGB(63, 81, 182)
|
||||
Constants.modernEra -> techIconColor = colorFromRGB(33, 150, 243)
|
||||
Constants.informationEra -> techIconColor = colorFromRGB(0, 150, 136)
|
||||
Constants.futureEra -> techIconColor = colorFromRGB(76,176,81)
|
||||
val techIconColor = when (ruleset.technologies[techName]!!.era()) {
|
||||
Constants.ancientEra -> colorFromRGB(255, 87, 35)
|
||||
Constants.classicalEra -> colorFromRGB(233, 31, 99)
|
||||
Constants.medievalEra -> colorFromRGB(157, 39, 176)
|
||||
Constants.renaissanceEra -> colorFromRGB(104, 58, 183)
|
||||
Constants.industrialEra -> colorFromRGB(63, 81, 182)
|
||||
Constants.modernEra -> colorFromRGB(33, 150, 243)
|
||||
Constants.informationEra -> colorFromRGB(0, 150, 136)
|
||||
Constants.futureEra -> colorFromRGB(76, 176, 81)
|
||||
else -> Color.WHITE.cpy()
|
||||
}
|
||||
return getImage("TechIcons/$techName").apply { color = techIconColor.lerp(Color.BLACK,0.6f) }
|
||||
return getImage("TechIcons/$techName").apply { color = techIconColor.lerp(Color.BLACK, 0.6f) }
|
||||
.surroundWithCircle(circleSize)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user