Added a hidden option for enabling espionage (#7615)

This commit is contained in:
Xander Lenstra
2022-08-06 21:05:44 +02:00
committed by GitHub
parent baeae5c8ae
commit 44fdf53b05
5 changed files with 30 additions and 10 deletions

View File

@ -28,6 +28,7 @@ class GameParameters : IsPartOfGameInfoSerialization { // Default values are the
var nuclearWeaponsEnabled = true var nuclearWeaponsEnabled = true
@Deprecated("As of 4.2.3") @Deprecated("As of 4.2.3")
var religionEnabled = true var religionEnabled = true
var espionageEnabled = false
var noStartBias = false var noStartBias = false
var victoryTypes: ArrayList<String> = arrayListOf() var victoryTypes: ArrayList<String> = arrayListOf()

View File

@ -64,6 +64,7 @@ class GameSettings {
var multiplayer = GameSettingsMultiplayer() var multiplayer = GameSettingsMultiplayer()
var showExperimentalWorldWrap = false // We're keeping this as a config due to ANR problems on Android phones for people who don't know what they're doing :/ var showExperimentalWorldWrap = false // We're keeping this as a config due to ANR problems on Android phones for people who don't know what they're doing :/
var enableEspionageOption = false
var lastOverviewPage: String = "Cities" var lastOverviewPage: String = "Cities"

View File

@ -70,6 +70,8 @@ class GameOptionsTable(
checkboxTable.addOneCityChallengeCheckbox() checkboxTable.addOneCityChallengeCheckbox()
checkboxTable.addNuclearWeaponsCheckbox() checkboxTable.addNuclearWeaponsCheckbox()
checkboxTable.addIsOnlineMultiplayerCheckbox() checkboxTable.addIsOnlineMultiplayerCheckbox()
if (UncivGame.Current.settings.enableEspionageOption)
checkboxTable.addEnableEspionageCheckbox()
checkboxTable.addNoStartBiasCheckbox() checkboxTable.addNoStartBiasCheckbox()
add(checkboxTable).center().row() add(checkboxTable).center().row()
@ -111,6 +113,11 @@ class GameOptionsTable(
} }
} }
private fun Table.addEnableEspionageCheckbox() =
addCheckbox("Enable Espionage", gameParameters.espionageEnabled)
{ gameParameters.espionageEnabled = it }
private fun numberOfCityStates() = ruleset.nations.values.count { private fun numberOfCityStates() = ruleset.nations.values.count {
it.isCityState() it.isCityState()
&& !it.hasUnique(UniqueType.CityStateDeprecated) && !it.hasUnique(UniqueType.CityStateDeprecated)

View File

@ -51,6 +51,9 @@ fun debugTab() = Table(BaseScreen.skin).apply {
curGameInfo.gameParameters.godMode = it curGameInfo.gameParameters.godMode = it
}).colspan(2).row() }).colspan(2).row()
} }
add("Enable espionage option".toCheckBox(game.settings.enableEspionageOption) {
game.settings.enableEspionageOption = it
}).colspan(2).row()
add("Save games compressed".toCheckBox(UncivFiles.saveZipped) { add("Save games compressed".toCheckBox(UncivFiles.saveZipped) {
UncivFiles.saveZipped = it UncivFiles.saveZipped = it
}).colspan(2).row() }).colspan(2).row()

View File

@ -744,11 +744,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Global, Unit Applicable to: Global, Unit
??? example "[greatPerson] is earned [relativeAmount]% faster"
Example: "[Great General] is earned [+20]% faster"
Applicable to: Global, Unit
??? example "Earn [amount]% of the damage done to [combatantFilter] units as [civWideStat]" ??? example "Earn [amount]% of the damage done to [combatantFilter] units as [civWideStat]"
Example: "Earn [3]% of the damage done to [City] units as [Gold]" Example: "Earn [3]% of the damage done to [City] units as [Gold]"
@ -774,6 +769,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Global, Unit Applicable to: Global, Unit
??? example "[greatPerson] is earned [relativeAmount]% faster"
Example: "[Great General] is earned [+20]% faster"
Applicable to: Global, Unit
??? example "[amount] Movement point cost to disembark" ??? example "[amount] Movement point cost to disembark"
Example: "[3] Movement point cost to disembark" Example: "[3] Movement point cost to disembark"
@ -1173,6 +1173,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Unit Applicable to: Unit
??? example "Destroys tile improvements when attacking"
Applicable to: Unit
??? example "Double movement in [terrainFilter]" ??? example "Double movement in [terrainFilter]"
Example: "Double movement in [Fresh Water]" Example: "Double movement in [Fresh Water]"
@ -1663,11 +1666,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
??? example "&lt;during a Golden Age&gt;" ??? example "&lt;during a Golden Age&gt;"
Applicable to: Conditional Applicable to: Conditional
??? example "&lt;with [resource]&gt;"
Example: "&lt;with [Iron]&gt;"
Applicable to: Conditional
??? example "&lt;while the empire is happy&gt;" ??? example "&lt;while the empire is happy&gt;"
Applicable to: Conditional Applicable to: Conditional
@ -1729,6 +1727,16 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Conditional Applicable to: Conditional
??? example "&lt;with [resource]&gt;"
Example: "&lt;with [Iron]&gt;"
Applicable to: Conditional
??? example "&lt;without [resource]&gt;"
Example: "&lt;without [Iron]&gt;"
Applicable to: Conditional
??? example "&lt;in cities with a [buildingFilter]&gt;" ??? example "&lt;in cities with a [buildingFilter]&gt;"
Example: "&lt;in cities with a [Culture]&gt;" Example: "&lt;in cities with a [Culture]&gt;"