OptionsPopup with two experimental switches: Spectator mode, Extended Map editor. (#2834)

This commit is contained in:
Alexander Korolyov 2020-07-12 11:59:32 +02:00 committed by GitHub
parent 438a4dbaff
commit c51879cc5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 81 additions and 87 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -433,49 +433,49 @@ BuildingIcons/Opera House
index: -1 index: -1
BuildingIcons/Oxford University BuildingIcons/Oxford University
rotate: false rotate: false
xy: 1430, 186 xy: 716, 173
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Palace BuildingIcons/Palace
rotate: false rotate: false
xy: 716, 173 xy: 818, 172
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Paper Maker BuildingIcons/Paper Maker
rotate: false rotate: false
xy: 206, 116 xy: 308, 116
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Pentagon BuildingIcons/Pentagon
rotate: false rotate: false
xy: 614, 116 xy: 1532, 106
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Porcelain Tower BuildingIcons/Porcelain Tower
rotate: false rotate: false
xy: 1226, 84 xy: 1430, 84
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Public School BuildingIcons/Public School
rotate: false rotate: false
xy: 818, 70 xy: 206, 14
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Research Lab BuildingIcons/Research Lab
rotate: false rotate: false
xy: 1940, 4 xy: 2, 2
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -748,35 +748,35 @@ ImprovementIcons/Oil well
index: -1 index: -1
ImprovementIcons/Pasture ImprovementIcons/Pasture
rotate: false rotate: false
xy: 410, 116 xy: 512, 116
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Plantation ImprovementIcons/Plantation
rotate: false rotate: false
xy: 920, 84 xy: 1022, 84
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Quarry ImprovementIcons/Quarry
rotate: false rotate: false
xy: 308, 14 xy: 410, 14
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
ImprovementIcons/Railroad ImprovementIcons/Railroad
rotate: false rotate: false
xy: 1532, 4 xy: 1634, 4
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TileSets/Default/Railroad TileSets/Default/Railroad
rotate: false rotate: false
xy: 1532, 4 xy: 1634, 4
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -902,14 +902,14 @@ NationIcons/Mongolia
index: -1 index: -1
NationIcons/Persia NationIcons/Persia
rotate: false rotate: false
xy: 1634, 106 xy: 1736, 106
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
NationIcons/Polynesia NationIcons/Polynesia
rotate: false rotate: false
xy: 1124, 84 xy: 1226, 84
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1005,30 +1005,37 @@ OtherIcons/New
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Options
rotate: false
xy: 1430, 186
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
OtherIcons/Pentagon OtherIcons/Pentagon
rotate: false rotate: false
xy: 1532, 106 xy: 1634, 106
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Pillage OtherIcons/Pillage
rotate: false rotate: false
xy: 104, 88 xy: 920, 84
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Puppet OtherIcons/Puppet
rotate: false rotate: false
xy: 206, 14 xy: 308, 14
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Quickstart OtherIcons/Quickstart
rotate: false rotate: false
xy: 410, 14 xy: 512, 14
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1168,7 +1175,7 @@ ResourceIcons/Oil
index: -1 index: -1
ResourceIcons/Pearls ResourceIcons/Pearls
rotate: false rotate: false
xy: 512, 116 xy: 614, 116
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -1236,13 +1243,6 @@ StatIcons/Production
orig: 200, 200 orig: 200, 200
offset: 0, 0 offset: 0, 0
index: -1 index: -1
StatIcons/Resistance
rotate: false
xy: 2, 2
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
StatIcons/Science StatIcons/Science
rotate: false rotate: false
xy: 1541, 1642 xy: 1541, 1642
@ -1609,84 +1609,84 @@ TechIcons/Optics
index: -1 index: -1
TechIcons/Particle Physics TechIcons/Particle Physics
rotate: false rotate: false
xy: 308, 116 xy: 410, 116
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Pharmaceuticals TechIcons/Pharmaceuticals
rotate: false rotate: false
xy: 1838, 106 xy: 1940, 106
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Philosophy TechIcons/Philosophy
rotate: false rotate: false
xy: 1940, 106 xy: 2, 104
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Physics TechIcons/Physics
rotate: false rotate: false
xy: 2, 104 xy: 1328, 90
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Plastics TechIcons/Plastics
rotate: false rotate: false
xy: 1022, 84 xy: 1124, 84
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Pottery TechIcons/Pottery
rotate: false rotate: false
xy: 1430, 84 xy: 716, 71
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Printing Press TechIcons/Printing Press
rotate: false rotate: false
xy: 716, 71 xy: 818, 70
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Radar TechIcons/Radar
rotate: false rotate: false
xy: 512, 14 xy: 614, 14
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Radio TechIcons/Radio
rotate: false rotate: false
xy: 614, 14 xy: 1532, 4
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Railroad TechIcons/Railroad
rotate: false rotate: false
xy: 1634, 4 xy: 1736, 4
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Refrigeration TechIcons/Refrigeration
rotate: false rotate: false
xy: 1736, 4 xy: 1838, 4
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Replaceable Parts TechIcons/Replaceable Parts
rotate: false rotate: false
xy: 1838, 4 xy: 1940, 4
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -2274,21 +2274,21 @@ UnitIcons/Nuclear Missile
index: -1 index: -1
UnitIcons/Panzer UnitIcons/Panzer
rotate: false rotate: false
xy: 818, 172 xy: 206, 116
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitIcons/Persian Immortal UnitIcons/Persian Immortal
rotate: false rotate: false
xy: 1736, 106 xy: 1838, 106
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitIcons/Pikeman UnitIcons/Pikeman
rotate: false rotate: false
xy: 1328, 90 xy: 104, 88
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -2301,35 +2301,35 @@ filter: MipMapLinearLinear,MipMapLinearLinear
repeat: none repeat: none
BuildingIcons/SS Booster BuildingIcons/SS Booster
rotate: false rotate: false
xy: 308, 922 xy: 2, 514
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/SS Cockpit BuildingIcons/SS Cockpit
rotate: false rotate: false
xy: 2, 514 xy: 104, 616
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/SS Engine BuildingIcons/SS Engine
rotate: false rotate: false
xy: 104, 616 xy: 206, 718
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/SS Stasis Chamber BuildingIcons/SS Stasis Chamber
rotate: false rotate: false
xy: 206, 718 xy: 308, 820
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
BuildingIcons/Satrap's Court BuildingIcons/Satrap's Court
rotate: false rotate: false
xy: 104, 514 xy: 206, 616
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -2525,7 +2525,7 @@ BuildingIcons/Workshop
index: -1 index: -1
ImprovementIcons/Road ImprovementIcons/Road
rotate: false rotate: false
xy: 2, 718 xy: 104, 820
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -2546,14 +2546,14 @@ ImprovementIcons/Trading post
index: -1 index: -1
NationIcons/Rome NationIcons/Rome
rotate: false rotate: false
xy: 104, 718 xy: 206, 820
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
NationIcons/Russia NationIcons/Russia
rotate: false rotate: false
xy: 206, 820 xy: 308, 922
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -2609,19 +2609,12 @@ OtherIcons/Down
index: -1 index: -1
OtherIcons/Resume OtherIcons/Resume
rotate: false rotate: false
xy: 2, 922 xy: 2, 820
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
OtherIcons/Scenario OtherIcons/Scenario
rotate: false
xy: 206, 616
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
OtherIcons/Scenario_old
rotate: false rotate: false
xy: 308, 718 xy: 308, 718
size: 100, 100 size: 100, 100
@ -3041,6 +3034,13 @@ StatIcons/RangedStrength
orig: 50, 50 orig: 50, 50
offset: 0, 0 offset: 0, 0
index: -1 index: -1
StatIcons/Resistance
rotate: false
xy: 2, 922
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
StatIcons/Specialist StatIcons/Specialist
rotate: false rotate: false
xy: 206, 310 xy: 206, 310
@ -3050,35 +3050,35 @@ StatIcons/Specialist
index: -1 index: -1
TechIcons/Rifling TechIcons/Rifling
rotate: false rotate: false
xy: 104, 922 xy: 2, 718
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Robotics TechIcons/Robotics
rotate: false rotate: false
xy: 104, 820 xy: 206, 922
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Rocketry TechIcons/Rocketry
rotate: false rotate: false
xy: 2, 616 xy: 104, 718
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Sailing TechIcons/Sailing
rotate: false rotate: false
xy: 308, 820 xy: 410, 922
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TechIcons/Satellites TechIcons/Satellites
rotate: false rotate: false
xy: 2, 412 xy: 104, 514
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
@ -4821,21 +4821,21 @@ TileSets/FantasyHex/Units/Work Boats
index: -1 index: -1
UnitIcons/Rifleman UnitIcons/Rifleman
rotate: false rotate: false
xy: 2, 820 xy: 104, 922
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitIcons/Rocket Artillery UnitIcons/Rocket Artillery
rotate: false rotate: false
xy: 206, 922 xy: 2, 616
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitIcons/Samurai UnitIcons/Samurai
rotate: false rotate: false
xy: 410, 922 xy: 2, 412
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 878 KiB

After

Width:  |  Height:  |  Size: 872 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 KiB

After

Width:  |  Height:  |  Size: 460 KiB

View File

@ -145,7 +145,7 @@ class MainMenuScreen: CameraStageBaseScreen() {
loadMapButton.background = tableBackground loadMapButton.background = tableBackground
mapEditorPopup.add(loadMapButton).row() mapEditorPopup.add(loadMapButton).row()
if (UncivGame.Current.scenarioDebugSwitch) { if (UncivGame.Current.settings.extendedMapEditor) {
val loadScenarioButton = getTableBlock("Load scenario", "OtherIcons/Scenario") { val loadScenarioButton = getTableBlock("Load scenario", "OtherIcons/Scenario") {
val loadScenarioScreen = LoadScenarioScreen(null) val loadScenarioScreen = LoadScenarioScreen(null)
loadScenarioScreen.closeButton.isVisible = true loadScenarioScreen.closeButton.isVisible = true

View File

@ -58,9 +58,6 @@ class UncivGame(parameters: UncivGameParameters) : Game() {
/** Console log battles /** Console log battles
*/ */
val alertBattle = false val alertBattle = false
/** Debug new Scenario functionality
*/
val scenarioDebugSwitch = false
lateinit var worldScreen: WorldScreen lateinit var worldScreen: WorldScreen

View File

@ -36,6 +36,8 @@ class GameSettings {
var isFreshlyCreated = false var isFreshlyCreated = false
var minimapSize = 20 var minimapSize = 20
var minimapSquare = false var minimapSquare = false
var extendedMapEditor = false
var spectatorMode = false
init { init {
// 26 = Android Oreo. Versions below may display permanent icon in notification bar. // 26 = Android Oreo. Versions below may display permanent icon in notification bar.

View File

@ -36,7 +36,7 @@ class MapEditorMenuPopup(var mapEditorScreen: MapEditorScreen): Popup(mapEditorS
addCopyMapAsTextButton() addCopyMapAsTextButton()
addLoadMapButton() addLoadMapButton()
addUploadMapButton() addUploadMapButton()
if (UncivGame.Current.scenarioDebugSwitch) { if (UncivGame.Current.settings.extendedMapEditor) {
addScenarioButton() addScenarioButton()
addSaveScenarioButton() addSaveScenarioButton()
addLoadScenarioButton() addLoadScenarioButton()

View File

@ -60,7 +60,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
tabPickerTable.add(improvementsButton) tabPickerTable.add(improvementsButton)
// debug Scenario mode // debug Scenario mode
if (UncivGame.Current.scenarioDebugSwitch && mapEditorScreen.hasScenario()) { if (UncivGame.Current.settings.extendedMapEditor && mapEditorScreen.hasScenario()) {
val unitsButton = "Units".toTextButton().onClick { setUnits() } val unitsButton = "Units".toTextButton().onClick { setUnits() }
tabPickerTable.add(unitsButton) tabPickerTable.add(unitsButton)
} }
@ -163,7 +163,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
val nationTable = Table() val nationTable = Table()
if (UncivGame.Current.scenarioDebugSwitch) { if (UncivGame.Current.settings.extendedMapEditor) {
/** new scenario/improvements functionality /** new scenario/improvements functionality
* We shouldn't be able to edit random players or spectators * We shouldn't be able to edit random players or spectators
* */ * */

View File

@ -29,7 +29,7 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() {
add("{Map Type}:".toLabel()) add("{Map Type}:".toLabel())
val mapTypes = arrayListOf("Generated") val mapTypes = arrayListOf("Generated")
if (MapSaver.getMaps().isNotEmpty()) mapTypes.add(MapType.custom) if (MapSaver.getMaps().isNotEmpty()) mapTypes.add(MapType.custom)
if (MapSaver.getScenarios().isNotEmpty() && UncivGame.Current.scenarioDebugSwitch) mapTypes.add(MapType.scenario) if (MapSaver.getScenarios().isNotEmpty() && UncivGame.Current.settings.extendedMapEditor) mapTypes.add(MapType.scenario)
val mapTypeSelectBox = TranslatedSelectBox(mapTypes, "Generated", CameraStageBaseScreen.skin) val mapTypeSelectBox = TranslatedSelectBox(mapTypes, "Generated", CameraStageBaseScreen.skin)
val mapFileSelectBox = getMapFileSelectBox() val mapFileSelectBox = getMapFileSelectBox()

View File

@ -21,8 +21,6 @@ import kotlin.concurrent.thread
class GameSetupInfo(var gameId:String, var gameParameters: GameParameters, var mapParameters: MapParameters) { class GameSetupInfo(var gameId:String, var gameParameters: GameParameters, var mapParameters: MapParameters) {
// var ruleset = RulesetCache.getComplexRuleset(gameParameters.mods)
constructor() : this("", GameParameters(), MapParameters()) constructor() : this("", GameParameters(), MapParameters())
constructor(gameInfo: GameInfo) : this("", gameInfo.gameParameters.clone(), gameInfo.tileMap.mapParameters) constructor(gameInfo: GameInfo) : this("", gameInfo.gameParameters.clone(), gameInfo.tileMap.mapParameters)
constructor(gameParameters: GameParameters, mapParameters: MapParameters) : this("", gameParameters, mapParameters) constructor(gameParameters: GameParameters, mapParameters: MapParameters) : this("", gameParameters, mapParameters)
@ -63,14 +61,6 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe
return@onClick return@onClick
} }
if (gameSetupInfo.gameParameters.players.count { it.chosenCiv == Constants.spectator } > 1) {
val noMoreSpectatorsPopup = Popup(this)
noMoreSpectatorsPopup.addGoodSizedLabel("Sorry! No more than one spectator for the moment".tr()).row()
noMoreSpectatorsPopup.addCloseButton()
noMoreSpectatorsPopup.open()
return@onClick
}
if (gameSetupInfo.gameParameters.isOnlineMultiplayer) { if (gameSetupInfo.gameParameters.isOnlineMultiplayer) {
for (player in gameSetupInfo.gameParameters.players.filter { it.playerType == PlayerType.Human }) { for (player in gameSetupInfo.gameParameters.players.filter { it.playerType == PlayerType.Human }) {
try { try {

View File

@ -25,7 +25,7 @@ import kotlin.reflect.typeOf
/** /**
* This [Table] is used to pick or edit players information for new game/scenario creation. * This [Table] is used to pick or edit players information for new game/scenario creation.
* Could be inserted to [NewGameScreen], [GameParametersScreen] or any other [Screen] * Could be inserted to [NewGameScreen], [GameParametersScreen] or any other [Screen]
* which provides [GameSetupInfo] for ruleset and updates. * which provides [GameSetupInfo] and [Ruleset].
* Upon player changes updates property [gameParameters]. Also updates available nations when mod changes. * Upon player changes updates property [gameParameters]. Also updates available nations when mod changes.
* In case it is used in map editor, as a part of [GameParametersScreen], additionally tries to * In case it is used in map editor, as a part of [GameParametersScreen], additionally tries to
* update units/starting location on the [previousScreen] when player deleted or * update units/starting location on the [previousScreen] when player deleted or
@ -273,8 +273,10 @@ class PlayerPickerTable(val previousScreen: IPreviousScreen, var gameParameters:
private fun getAvailablePlayerCivs(): ArrayList<Nation> { private fun getAvailablePlayerCivs(): ArrayList<Nation> {
var nations = ArrayList<Nation>() var nations = ArrayList<Nation>()
for (nation in previousScreen.ruleset.nations.values for (nation in previousScreen.ruleset.nations.values
.filter { it.isMajorCiv() }) { .filter { it.isMajorCiv() || it.isSpectator() }) {
if (gameParameters.players.any { it.chosenCiv == nation.name && it.chosenCiv != Constants.spectator}) if (gameParameters.players.any { it.chosenCiv == nation.name })
continue
if (!UncivGame.Current.settings.spectatorMode && nation.isSpectator())
continue continue
nations.add(nation) nations.add(nation)
} }

View File

@ -118,6 +118,9 @@ class WorldScreenOptionsPopup(val worldScreen:WorldScreen) : Popup(worldScreen)
addHeader("Other options") addHeader("Other options")
addYesNoRow("Extended map editor", settings.extendedMapEditor) { settings.extendedMapEditor = it }
addYesNoRow("Experimental spectator mode", settings.spectatorMode) { settings.spectatorMode = it }
addSoundEffectsVolumeSlider() addSoundEffectsVolumeSlider()
addMusicVolumeSlider() addMusicVolumeSlider()
addTranslationGeneration() addTranslationGeneration()

View File

@ -526,6 +526,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [New](https://thenounproject.com/search/?q=new&i=1886943) by Alice Design for New Game * [New](https://thenounproject.com/search/?q=new&i=1886943) by Alice Design for New Game
* [Go back](https://thenounproject.com/search/?q=go%20back&i=1901947) by Salvia Santos for Resume * [Go back](https://thenounproject.com/search/?q=go%20back&i=1901947) by Salvia Santos for Resume
* [Multiplayer](https://thenounproject.com/search/?q=multiplayer&i=1215652) by Roy Charles * [Multiplayer](https://thenounproject.com/search/?q=multiplayer&i=1215652) by Roy Charles
* [Options](https://thenounproject.com/search/?q=options&i=866090) By Thengakola
# Sound credits # Sound credits

View File

@ -43,7 +43,6 @@ class BasicTests {
&& !game.viewEntireMapForDebug && !game.viewEntireMapForDebug
&& game.simulateUntilTurnForDebug <= 0 && game.simulateUntilTurnForDebug <= 0
&& !game.simulateUntilWin && !game.simulateUntilWin
&& !game.scenarioDebugSwitch
&& !game.consoleMode && !game.consoleMode
) )
} }