diff --git a/android/Images/OtherIcons/Options.png b/android/Images/OtherIcons/Options.png new file mode 100644 index 0000000000..3afbd270c0 Binary files /dev/null and b/android/Images/OtherIcons/Options.png differ diff --git a/android/assets/game.atlas b/android/assets/game.atlas index 4e15f95394..2c77e67f71 100644 --- a/android/assets/game.atlas +++ b/android/assets/game.atlas @@ -433,49 +433,49 @@ BuildingIcons/Opera House index: -1 BuildingIcons/Oxford University rotate: false - xy: 1430, 186 + xy: 716, 173 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Palace rotate: false - xy: 716, 173 + xy: 818, 172 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Paper Maker rotate: false - xy: 206, 116 + xy: 308, 116 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Pentagon rotate: false - xy: 614, 116 + xy: 1532, 106 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Porcelain Tower rotate: false - xy: 1226, 84 + xy: 1430, 84 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Public School rotate: false - xy: 818, 70 + xy: 206, 14 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Research Lab rotate: false - xy: 1940, 4 + xy: 2, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -748,35 +748,35 @@ ImprovementIcons/Oil well index: -1 ImprovementIcons/Pasture rotate: false - xy: 410, 116 + xy: 512, 116 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Plantation rotate: false - xy: 920, 84 + xy: 1022, 84 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Quarry rotate: false - xy: 308, 14 + xy: 410, 14 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Railroad rotate: false - xy: 1532, 4 + xy: 1634, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TileSets/Default/Railroad rotate: false - xy: 1532, 4 + xy: 1634, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -902,14 +902,14 @@ NationIcons/Mongolia index: -1 NationIcons/Persia rotate: false - xy: 1634, 106 + xy: 1736, 106 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NationIcons/Polynesia rotate: false - xy: 1124, 84 + xy: 1226, 84 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -1005,30 +1005,37 @@ OtherIcons/New orig: 100, 100 offset: 0, 0 index: -1 +OtherIcons/Options + rotate: false + xy: 1430, 186 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 OtherIcons/Pentagon rotate: false - xy: 1532, 106 + xy: 1634, 106 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Pillage rotate: false - xy: 104, 88 + xy: 920, 84 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Puppet rotate: false - xy: 206, 14 + xy: 308, 14 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Quickstart rotate: false - xy: 410, 14 + xy: 512, 14 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -1168,7 +1175,7 @@ ResourceIcons/Oil index: -1 ResourceIcons/Pearls rotate: false - xy: 512, 116 + xy: 614, 116 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -1236,13 +1243,6 @@ StatIcons/Production orig: 200, 200 offset: 0, 0 index: -1 -StatIcons/Resistance - rotate: false - xy: 2, 2 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 StatIcons/Science rotate: false xy: 1541, 1642 @@ -1609,84 +1609,84 @@ TechIcons/Optics index: -1 TechIcons/Particle Physics rotate: false - xy: 308, 116 + xy: 410, 116 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Pharmaceuticals rotate: false - xy: 1838, 106 + xy: 1940, 106 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Philosophy rotate: false - xy: 1940, 106 + xy: 2, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Physics rotate: false - xy: 2, 104 + xy: 1328, 90 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Plastics rotate: false - xy: 1022, 84 + xy: 1124, 84 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Pottery rotate: false - xy: 1430, 84 + xy: 716, 71 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Printing Press rotate: false - xy: 716, 71 + xy: 818, 70 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Radar rotate: false - xy: 512, 14 + xy: 614, 14 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Radio rotate: false - xy: 614, 14 + xy: 1532, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Railroad rotate: false - xy: 1634, 4 + xy: 1736, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Refrigeration rotate: false - xy: 1736, 4 + xy: 1838, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Replaceable Parts rotate: false - xy: 1838, 4 + xy: 1940, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -2274,21 +2274,21 @@ UnitIcons/Nuclear Missile index: -1 UnitIcons/Panzer rotate: false - xy: 818, 172 + xy: 206, 116 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 UnitIcons/Persian Immortal rotate: false - xy: 1736, 106 + xy: 1838, 106 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 UnitIcons/Pikeman rotate: false - xy: 1328, 90 + xy: 104, 88 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -2301,35 +2301,35 @@ filter: MipMapLinearLinear,MipMapLinearLinear repeat: none BuildingIcons/SS Booster rotate: false - xy: 308, 922 + xy: 2, 514 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/SS Cockpit rotate: false - xy: 2, 514 + xy: 104, 616 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/SS Engine rotate: false - xy: 104, 616 + xy: 206, 718 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/SS Stasis Chamber rotate: false - xy: 206, 718 + xy: 308, 820 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 BuildingIcons/Satrap's Court rotate: false - xy: 104, 514 + xy: 206, 616 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -2525,7 +2525,7 @@ BuildingIcons/Workshop index: -1 ImprovementIcons/Road rotate: false - xy: 2, 718 + xy: 104, 820 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -2546,14 +2546,14 @@ ImprovementIcons/Trading post index: -1 NationIcons/Rome rotate: false - xy: 104, 718 + xy: 206, 820 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NationIcons/Russia rotate: false - xy: 206, 820 + xy: 308, 922 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -2609,19 +2609,12 @@ OtherIcons/Down index: -1 OtherIcons/Resume rotate: false - xy: 2, 922 + xy: 2, 820 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Scenario - rotate: false - xy: 206, 616 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Scenario_old rotate: false xy: 308, 718 size: 100, 100 @@ -3041,6 +3034,13 @@ StatIcons/RangedStrength orig: 50, 50 offset: 0, 0 index: -1 +StatIcons/Resistance + rotate: false + xy: 2, 922 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 StatIcons/Specialist rotate: false xy: 206, 310 @@ -3050,35 +3050,35 @@ StatIcons/Specialist index: -1 TechIcons/Rifling rotate: false - xy: 104, 922 + xy: 2, 718 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Robotics rotate: false - xy: 104, 820 + xy: 206, 922 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Rocketry rotate: false - xy: 2, 616 + xy: 104, 718 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Sailing rotate: false - xy: 308, 820 + xy: 410, 922 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TechIcons/Satellites rotate: false - xy: 2, 412 + xy: 104, 514 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -4821,21 +4821,21 @@ TileSets/FantasyHex/Units/Work Boats index: -1 UnitIcons/Rifleman rotate: false - xy: 2, 820 + xy: 104, 922 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 UnitIcons/Rocket Artillery rotate: false - xy: 206, 922 + xy: 2, 616 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 UnitIcons/Samurai rotate: false - xy: 410, 922 + xy: 2, 412 size: 100, 100 orig: 100, 100 offset: 0, 0 diff --git a/android/assets/game.png b/android/assets/game.png index 4e623a19ec..d1ee415431 100644 Binary files a/android/assets/game.png and b/android/assets/game.png differ diff --git a/android/assets/game2.png b/android/assets/game2.png index 5fae3d1df0..f22726742f 100644 Binary files a/android/assets/game2.png and b/android/assets/game2.png differ diff --git a/core/src/com/unciv/MainMenuScreen.kt b/core/src/com/unciv/MainMenuScreen.kt index 3af21a9a63..6a4bbc4629 100644 --- a/core/src/com/unciv/MainMenuScreen.kt +++ b/core/src/com/unciv/MainMenuScreen.kt @@ -145,7 +145,7 @@ class MainMenuScreen: CameraStageBaseScreen() { loadMapButton.background = tableBackground mapEditorPopup.add(loadMapButton).row() - if (UncivGame.Current.scenarioDebugSwitch) { + if (UncivGame.Current.settings.extendedMapEditor) { val loadScenarioButton = getTableBlock("Load scenario", "OtherIcons/Scenario") { val loadScenarioScreen = LoadScenarioScreen(null) loadScenarioScreen.closeButton.isVisible = true diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index bdb2f61628..e29210d4ae 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -58,9 +58,6 @@ class UncivGame(parameters: UncivGameParameters) : Game() { /** Console log battles */ val alertBattle = false - /** Debug new Scenario functionality - */ - val scenarioDebugSwitch = false lateinit var worldScreen: WorldScreen diff --git a/core/src/com/unciv/models/metadata/GameSettings.kt b/core/src/com/unciv/models/metadata/GameSettings.kt index 298e9d9708..cf035782df 100644 --- a/core/src/com/unciv/models/metadata/GameSettings.kt +++ b/core/src/com/unciv/models/metadata/GameSettings.kt @@ -36,6 +36,8 @@ class GameSettings { var isFreshlyCreated = false var minimapSize = 20 var minimapSquare = false + var extendedMapEditor = false + var spectatorMode = false init { // 26 = Android Oreo. Versions below may display permanent icon in notification bar. diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt index 863b9136ad..f573c6836f 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt @@ -36,7 +36,7 @@ class MapEditorMenuPopup(var mapEditorScreen: MapEditorScreen): Popup(mapEditorS addCopyMapAsTextButton() addLoadMapButton() addUploadMapButton() - if (UncivGame.Current.scenarioDebugSwitch) { + if (UncivGame.Current.settings.extendedMapEditor) { addScenarioButton() addSaveScenarioButton() addLoadScenarioButton() diff --git a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt index cd93e4efc2..49a4dea5b6 100644 --- a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt @@ -60,7 +60,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera tabPickerTable.add(improvementsButton) // debug Scenario mode - if (UncivGame.Current.scenarioDebugSwitch && mapEditorScreen.hasScenario()) { + if (UncivGame.Current.settings.extendedMapEditor && mapEditorScreen.hasScenario()) { val unitsButton = "Units".toTextButton().onClick { setUnits() } tabPickerTable.add(unitsButton) } @@ -163,7 +163,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera val nationTable = Table() - if (UncivGame.Current.scenarioDebugSwitch) { + if (UncivGame.Current.settings.extendedMapEditor) { /** new scenario/improvements functionality * We shouldn't be able to edit random players or spectators * */ diff --git a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt index 0079a5f503..5974d4c997 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt @@ -29,7 +29,7 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() { add("{Map Type}:".toLabel()) val mapTypes = arrayListOf("Generated") 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 mapFileSelectBox = getMapFileSelectBox() diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt index bad8f3d6d1..35524ed988 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt @@ -21,8 +21,6 @@ import kotlin.concurrent.thread class GameSetupInfo(var gameId:String, var gameParameters: GameParameters, var mapParameters: MapParameters) { -// var ruleset = RulesetCache.getComplexRuleset(gameParameters.mods) - constructor() : this("", GameParameters(), MapParameters()) constructor(gameInfo: GameInfo) : this("", gameInfo.gameParameters.clone(), gameInfo.tileMap.mapParameters) constructor(gameParameters: GameParameters, mapParameters: MapParameters) : this("", gameParameters, mapParameters) @@ -63,14 +61,6 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe 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) { for (player in gameSetupInfo.gameParameters.players.filter { it.playerType == PlayerType.Human }) { try { diff --git a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt index 3d4c03c917..2f1f7ee324 100644 --- a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt @@ -25,7 +25,7 @@ import kotlin.reflect.typeOf /** * 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] - * 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. * 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 @@ -273,8 +273,10 @@ class PlayerPickerTable(val previousScreen: IPreviousScreen, var gameParameters: private fun getAvailablePlayerCivs(): ArrayList { var nations = ArrayList() for (nation in previousScreen.ruleset.nations.values - .filter { it.isMajorCiv() }) { - if (gameParameters.players.any { it.chosenCiv == nation.name && it.chosenCiv != Constants.spectator}) + .filter { it.isMajorCiv() || it.isSpectator() }) { + if (gameParameters.players.any { it.chosenCiv == nation.name }) + continue + if (!UncivGame.Current.settings.spectatorMode && nation.isSpectator()) continue nations.add(nation) } diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenOptionsPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenOptionsPopup.kt index e8d1c14eb2..077e567cca 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenOptionsPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenOptionsPopup.kt @@ -118,6 +118,9 @@ class WorldScreenOptionsPopup(val worldScreen:WorldScreen) : Popup(worldScreen) addHeader("Other options") + addYesNoRow("Extended map editor", settings.extendedMapEditor) { settings.extendedMapEditor = it } + addYesNoRow("Experimental spectator mode", settings.spectatorMode) { settings.spectatorMode = it } + addSoundEffectsVolumeSlider() addMusicVolumeSlider() addTranslationGeneration() diff --git a/docs/Credits.md b/docs/Credits.md index 946d73516c..9082c0355d 100644 --- a/docs/Credits.md +++ b/docs/Credits.md @@ -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 * [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 +* [Options](https://thenounproject.com/search/?q=options&i=866090) By Thengakola # Sound credits diff --git a/tests/src/com/unciv/testing/BasicTests.kt b/tests/src/com/unciv/testing/BasicTests.kt index b08f2f239d..dc795b57ff 100644 --- a/tests/src/com/unciv/testing/BasicTests.kt +++ b/tests/src/com/unciv/testing/BasicTests.kt @@ -43,7 +43,6 @@ class BasicTests { && !game.viewEntireMapForDebug && game.simulateUntilTurnForDebug <= 0 && !game.simulateUntilWin - && !game.scenarioDebugSwitch && !game.consoleMode ) }