diff --git a/core/src/com/unciv/logic/civilization/PolicyManager.kt b/core/src/com/unciv/logic/civilization/PolicyManager.kt index 63e4302114..aecb654f29 100644 --- a/core/src/com/unciv/logic/civilization/PolicyManager.kt +++ b/core/src/com/unciv/logic/civilization/PolicyManager.kt @@ -109,7 +109,7 @@ class PolicyManager { fun adopt(policy: Policy, branchCompletion: Boolean = false) { - if (!branchCompletion) { + if (!branchCompletion && !civInfo.gameInfo.gameParameters.godMode) { if (freePolicies > 0) freePolicies-- else { val cultureNeededForNextPolicy = getCultureNeededForNextPolicy() diff --git a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt index 3a29c4fbe9..c841066e33 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt @@ -71,9 +71,10 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() { if (savedGame.toLowerCase().endsWith("scenario")) scenarioSelectBox.items.add(savedGame) } - scenarioSelectBox.onChange { selectSavedGameAsScenario(scenarioSelectBox.selected) } scenarioSelectBox.items = scenarioSelectBox.items // it doesn't register them until you do this. scenarioSelectBox.selected = scenarioMapSelectBox.items.first() + // needs to be after the item change, so it doesn't activate before we choose the Scenario maptype + scenarioSelectBox.onChange { selectSavedGameAsScenario(scenarioSelectBox.selected) } scenarioOptionsTable.add("{Scenario file}:".toLabel()).left() scenarioOptionsTable.add(scenarioSelectBox) @@ -83,6 +84,7 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() { mapParameters.type = MapType.custom mapParameters.name = mapFileSelectBox.selected mapTypeSpecificTable.add(savedMapOptionsTable) + newGameScreen.gameSetupInfo.gameParameters.godMode = false newGameScreen.unlockTables() newGameScreen.updateTables() } else if (mapTypeSelectBox.selected.value == MapType.scenarioMap) { @@ -103,6 +105,7 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() { } else { // generated map mapParameters.name = "" mapParameters.type = generatedMapOptionsTable.mapTypeSelectBox.selected.value + newGameScreen.gameSetupInfo.gameParameters.godMode = false mapTypeSpecificTable.add(generatedMapOptionsTable) newGameScreen.unlockTables() newGameScreen.updateTables() diff --git a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt index 4dc4b20e2b..f310cd5b9e 100644 --- a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt @@ -42,10 +42,9 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo } else game.setScreen(PolicyPickerScreen(worldScreen)) // update policies } + if(!UncivGame.Current.worldScreen.canChangeState) rightSideButton.disable() - - topTable.row().pad(30f) @@ -92,6 +91,11 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo } else { rightSideButton.enable() } + if (viewingCiv.gameInfo.gameParameters.godMode && pickedPolicy == policy + && viewingCiv.policies.isAdoptable(policy)) { + viewingCiv.policies.adopt(policy) + game.setScreen(PolicyPickerScreen(worldScreen)) + } pickedPolicy = policy val policyText = mutableListOf() policyText += policy.name