Added an option to unlock all techs to the debug menu (#5820)

This commit is contained in:
Xander Lenstra
2021-12-18 19:05:34 +01:00
committed by GitHub
parent 75ef6f6c8d
commit b30576d115

View File

@ -336,6 +336,14 @@ class OptionsPopup(val previousScreen: BaseScreen) : Popup(previousScreen) {
add("Gdx Scene2D debug".toCheckBox(BaseScreen.enableSceneDebug) { add("Gdx Scene2D debug".toCheckBox(BaseScreen.enableSceneDebug) {
BaseScreen.enableSceneDebug = it BaseScreen.enableSceneDebug = it
}).row() }).row()
val unlockTechsButton = "Unlock all techs".toTextButton()
unlockTechsButton.onChange {
for (tech in game.gameInfo.ruleSet.technologies.keys) {
if (tech !in game.gameInfo.getCurrentPlayerCivilization().tech.techsResearched)
game.gameInfo.getCurrentPlayerCivilization().tech.addTechnology(tech)
}
}
add(unlockTechsButton)
} }
//endregion //endregion