From b30576d1150e3d09ba19f67bae876e6baef3ca68 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Sat, 18 Dec 2021 19:05:34 +0100 Subject: [PATCH] Added an option to unlock all techs to the debug menu (#5820) --- .../src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt index 465bfa66b1..e19d9e2c1a 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt @@ -336,6 +336,14 @@ class OptionsPopup(val previousScreen: BaseScreen) : Popup(previousScreen) { add("Gdx Scene2D debug".toCheckBox(BaseScreen.enableSceneDebug) { BaseScreen.enableSceneDebug = it }).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