diff --git a/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json b/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json index a7b8cf90ba..27f11f8654 100644 --- a/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json +++ b/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json @@ -458,7 +458,21 @@ Portuguese:"Salvo em" } - // Options + ////////////// Load map + + "Load map":{ + } + + "Are you sure you want to delete this map?":{ + } + + "Upload":{ + } + + "Could not upload map!":{ + } + + ////////////// Options "Options":{ Italian:"Opzioni" diff --git a/android/assets/jsons/Translations/Units,Promotions.json b/android/assets/jsons/Translations/Units,Promotions.json index dd45b4f0d5..55a14ffc28 100644 --- a/android/assets/jsons/Translations/Units,Promotions.json +++ b/android/assets/jsons/Translations/Units,Promotions.json @@ -560,7 +560,8 @@ German:"Tribock" } - "Hwach'a":{ + "Hwach'a":{ + Italian:"Hwach'a" Simplified_Chinese:"火厢车" } @@ -668,6 +669,10 @@ Russian:"+1 Диапазон видимости" } + "Turtle Ship":{ + Spanish:"Nave tartaruga" + } + "Cannon":{ Italian:"Cannone" Russian:"Пушка" diff --git a/android/build.gradle b/android/build.gradle index 9796b8b98f..873d6946ca 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 29 - versionCode 294 - versionName "3.0.1" + versionCode 295 + versionName "3.0.2" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/models/gamebasics/unit/BaseUnit.kt b/core/src/com/unciv/models/gamebasics/unit/BaseUnit.kt index 39e1b8556f..928ce3bff5 100644 --- a/core/src/com/unciv/models/gamebasics/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/gamebasics/unit/BaseUnit.kt @@ -75,7 +75,7 @@ class BaseUnit : INamed, IConstruction, ICivilopedia { } for(unique in uniques) - sb.appendln(unique.tr()) + sb.appendln(Translations.translateBonusOrPenalty(unique)) for(promotion in promotions) sb.appendln(promotion.tr()) diff --git a/core/src/com/unciv/models/metadata/GameSettings.kt b/core/src/com/unciv/models/metadata/GameSettings.kt index f85393ac7f..16cefafd5c 100644 --- a/core/src/com/unciv/models/metadata/GameSettings.kt +++ b/core/src/com/unciv/models/metadata/GameSettings.kt @@ -17,6 +17,7 @@ class GameSettings { var tileSet:String = "FantasyHex" var showTutorials: Boolean = true var autoAssignCityProduction: Boolean = true + var showMinimap: Boolean = true var userName:String="" var userId = "" diff --git a/core/src/com/unciv/ui/EmpireOverviewScreen.kt b/core/src/com/unciv/ui/EmpireOverviewScreen.kt index c7672ea31b..759e05c262 100644 --- a/core/src/com/unciv/ui/EmpireOverviewScreen.kt +++ b/core/src/com/unciv/ui/EmpireOverviewScreen.kt @@ -414,7 +414,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ civGroup.add(ImageGetter.getImage("OtherIcons/DisbandUnit")).size(30f) civGroup.background = civGroupBackground.tint(Color.LIGHT_GRAY) label.setFontColor(Color.BLACK) - } else if (currentPlayer==civ || currentPlayer.knows(civ)) { + } else if (currentPlayer==civ || UnCivGame.Current.viewEntireMapForDebug || currentPlayer.knows(civ)) { civGroup.add(ImageGetter.getNationIndicator(civ.nation, 30f)) civGroup.background = civGroupBackground.tint(civ.nation.getColor()) label.setFontColor(civ.nation.getSecondaryColor()) diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt b/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt index 9a1e1e0ccd..6069a1f8af 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt @@ -1,11 +1,12 @@ package com.unciv.ui.mapeditor +import com.badlogic.gdx.scenes.scene2d.actions.Actions import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane import com.badlogic.gdx.scenes.scene2d.ui.TextButton -import com.unciv.models.metadata.GameParameters import com.unciv.logic.MapSaver import com.unciv.logic.map.TileMap import com.unciv.models.gamebasics.tr +import com.unciv.models.metadata.GameParameters import com.unciv.ui.tilegroups.TileGroup import com.unciv.ui.tilegroups.TileSetStrings import com.unciv.ui.utils.CameraStageBaseScreen @@ -18,7 +19,7 @@ class MapEditorScreen(): CameraStageBaseScreen(){ var mapName = "My first map" lateinit var mapHolder: TileGroupMap val tileEditorOptions = TileEditorOptionsTable(this) - + val showHideEditorOptionsButton = TextButton(">",skin) constructor(mapNameToLoad:String?):this(){ var mapToLoad = mapNameToLoad @@ -44,8 +45,23 @@ class MapEditorScreen(): CameraStageBaseScreen(){ val mapHolder = getMapHolder(tileMap) stage.addActor(mapHolder) - stage.addActor(tileEditorOptions) + tileEditorOptions.setPosition(stage.width - tileEditorOptions.width, 0f) + + showHideEditorOptionsButton.labelCell.pad(10f) + showHideEditorOptionsButton.pack() + showHideEditorOptionsButton.onClick { + if (showHideEditorOptionsButton.text.toString() == ">") { + tileEditorOptions.addAction(Actions.moveTo(stage.width, 0f, 0.5f)) + showHideEditorOptionsButton.setText("<") + } else { + tileEditorOptions.addAction(Actions.moveTo(stage.width - tileEditorOptions.width, 0f, 0.5f)) + showHideEditorOptionsButton.setText(">") + } + } + showHideEditorOptionsButton.setPosition(stage.width - showHideEditorOptionsButton.width - 10f, + stage.height - showHideEditorOptionsButton.height - 10f) + stage.addActor(showHideEditorOptionsButton) val optionsMenuButton = TextButton("Options".tr(), skin) diff --git a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt index 29e709859a..a47029bcc5 100644 --- a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt @@ -56,8 +56,6 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera add(ScrollPane(tabPickerTable).apply { this.width= mapEditorScreen.stage.width/3}).row() add(editorPickTable).row() - - setPosition(mapEditorScreen.stage.width - width, 0f) } private fun setImprovements() { diff --git a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt index 2acba0a31a..57a119a52b 100644 --- a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt @@ -10,14 +10,15 @@ import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.Policy import com.unciv.models.gamebasics.tr import com.unciv.ui.utils.* +import com.unciv.ui.worldscreen.WorldScreen -class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen() { - +class PolicyPickerScreen(val worldScreen: WorldScreen) : PickerScreen() { + internal val viewingCiv: CivilizationInfo = worldScreen.viewingCiv private var pickedPolicy: Policy? = null init { - val policies = civInfo.policies + val policies = viewingCiv.policies displayTutorials("PolicyPickerScreen") rightSideButton.setText("{Adopt policy}\r\n(".tr() + policies.storedCulture + "/" + policies.getCultureNeededForNextPolicy() + ")") @@ -30,14 +31,14 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen( else onBackButtonClicked { UnCivGame.Current.setWorldScreen() } rightSideButton.onClick("policy") { - civInfo.policies.adopt(pickedPolicy!!) + viewingCiv.policies.adopt(pickedPolicy!!) // If we've moved to another screen in the meantime (great person pick, victory screen) ignore this if(game.screen !is PolicyPickerScreen || !policies.canAdoptPolicy()){ game.setWorldScreen() dispose() } - else game.screen = PolicyPickerScreen(civInfo) // update policies + else game.screen = PolicyPickerScreen(worldScreen) // update policies } if(!UnCivGame.Current.worldScreen.isPlayersTurn) rightSideButton.disable() @@ -78,10 +79,11 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen( } private fun pickPolicy(policy: Policy) { - if (civInfo.policies.isAdopted(policy.name) + if (!worldScreen.isPlayersTurn + || viewingCiv.policies.isAdopted(policy.name) || policy.name.endsWith("Complete") - || !civInfo.policies.isAdoptable(policy) - || !civInfo.policies.canAdoptPolicy()) { + || !viewingCiv.policies.isAdoptable(policy) + || !viewingCiv.policies.canAdoptPolicy()) { rightSideButton.disable() } else { rightSideButton.enable() @@ -106,9 +108,9 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen( policyButton = TextButton(policy.name.tr(), skin) } - if (civInfo.policies.isAdopted(policy.name)) { // existing + if (viewingCiv.policies.isAdopted(policy.name)) { // existing policyButton.color = Color.GREEN - } else if (!civInfo.policies.isAdoptable(policy)) + } else if (!viewingCiv.policies.isAdoptable(policy)) // non-available { policyButton.color = Color.GRAY diff --git a/core/src/com/unciv/ui/saves/LoadMapScreen.kt b/core/src/com/unciv/ui/saves/LoadMapScreen.kt index b95c91bf28..43cc48c77b 100644 --- a/core/src/com/unciv/ui/saves/LoadMapScreen.kt +++ b/core/src/com/unciv/ui/saves/LoadMapScreen.kt @@ -14,13 +14,14 @@ import com.unciv.ui.pickerscreens.PickerScreen import com.unciv.ui.utils.disable import com.unciv.ui.utils.enable import com.unciv.ui.utils.onClick +import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable class LoadMapScreen(previousMap: TileMap) : PickerScreen(){ var chosenMap = "" val deleteMapButton = TextButton("Delete map",skin) init { - rightSideButton.setText("Load map") + rightSideButton.setText("Load map".tr()) rightSideButton.onClick { UnCivGame.Current.screen = MapEditorScreen(chosenMap) dispose() @@ -50,8 +51,10 @@ class LoadMapScreen(previousMap: TileMap) : PickerScreen(){ rightSideTable.add(loadFromClipboardButton).row() deleteMapButton.onClick { - MapSaver().deleteMap(chosenMap) - UnCivGame.Current.screen = LoadMapScreen(previousMap) + YesNoPopupTable("Are you sure you want to delete this map?", { + MapSaver().deleteMap(chosenMap) + UnCivGame.Current.screen = LoadMapScreen(previousMap) + }, this) } deleteMapButton.disable() deleteMapButton.color = Color.RED diff --git a/core/src/com/unciv/ui/worldscreen/Minimap.kt b/core/src/com/unciv/ui/worldscreen/Minimap.kt index 8166e37099..d3e0825a14 100644 --- a/core/src/com/unciv/ui/worldscreen/Minimap.kt +++ b/core/src/com/unciv/ui/worldscreen/Minimap.kt @@ -137,5 +137,8 @@ class MinimapHolder(tileMapHolder: TileMapHolder): Table(){ return toggleIconTable } - fun update(civInfo:CivilizationInfo){minimap.update(civInfo)} + fun update(civInfo:CivilizationInfo){ + isVisible = UnCivGame.Current.settings.showMinimap + minimap.update(civInfo) + } } \ No newline at end of file diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index e0978de4e3..f1c976b633 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -75,7 +75,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { if(viewingCiv.policies.adoptedPolicies.isNotEmpty() || viewingCiv.policies.canAdoptPolicy()) { val policyScreenButton = Button(skin) policyScreenButton.add(ImageGetter.getImage("PolicyIcons/Constitution")).size(30f).pad(15f) - policyScreenButton.onClick { game.screen = PolicyPickerScreen(viewingCiv) } + policyScreenButton.onClick { game.screen = PolicyPickerScreen(this) } techPolicyandVictoryHolder.add(policyScreenButton).pad(10f) } @@ -186,7 +186,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { if(!isSomethingOpen) { when { !gameInfo.oneMoreTurnMode && gameInfo.civilizations.any { it.victoryManager.hasWon() } -> game.screen = VictoryScreen() - viewingCiv.policies.freePolicies > 0 -> game.screen = PolicyPickerScreen(viewingCiv) + viewingCiv.policies.freePolicies > 0 -> game.screen = PolicyPickerScreen(this) viewingCiv.greatPeople.freeGreatPeople > 0 -> game.screen = GreatPersonPickerScreen() viewingCiv.tradeRequests.isNotEmpty() -> TradePopup(this) viewingCiv.popupAlerts.any() -> AlertPopup(this, viewingCiv.popupAlerts.first()) @@ -298,7 +298,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { game.screen = TechPickerScreen(viewingCiv.tech.freeTechs != 0, viewingCiv) return@onClick } else if (viewingCiv.policies.shouldOpenPolicyPicker) { - game.screen = PolicyPickerScreen(viewingCiv) + game.screen = PolicyPickerScreen(this) viewingCiv.policies.shouldOpenPolicyPicker = false return@onClick } diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt index c840f95f66..10a60bbf2c 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt @@ -105,7 +105,7 @@ class WorldScreenMenuTable(val worldScreen: WorldScreen) : PopupTable(worldScree return@addButton } try { - val game = OnlineMultiplayer().tryDownloadGame(gameId) + val game = OnlineMultiplayer().tryDownloadGame(gameId.trim()) UnCivGame.Current.loadGame(game) } catch (ex: Exception) { badGameIdLabel.setText("Could not download game!".tr()) diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt index 8c9f51fc16..c5bc155c8b 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt @@ -80,6 +80,12 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr update() } + innerTable.add("Show minimap".toLabel()) + innerTable.addButton(if(settings.showMinimap) "Yes".tr() else "No".tr()) { + settings.showMinimap= !settings.showMinimap + update() + } + addLanguageSelectBox(innerTable) addFontSelectBox(innerTable) diff --git a/docs/NewCivs.md b/docs/NewCivs.md index b210c265b4..788b95fe19 100644 --- a/docs/NewCivs.md +++ b/docs/NewCivs.md @@ -2,7 +2,7 @@ So you want to add your favorite civilization? -There are a few steps requires, so we'll walk you through them! +There are a few steps required, so we'll walk you through them! ## Fill in your Nation info @@ -19,7 +19,7 @@ will notify translators that they should translate them =) Each civ has an icon, like the wreath for Rome, for instant identification. -All of these icons are white on a transparent background, and are 100x100 pixels. +All of these icons are white on a transparent background, and are 100x100 pixels - see [icon considerations](#icon-considerations) for details You'll need to put your icon in the [NationIcons folder](/android/Images/NationIcons). @@ -35,7 +35,7 @@ But apart from the flavor, they are boring gameplay-wise, so now we need to add Units in general are added in the [Units.json](/android/assets/jsons/Units.json) file, with an icon in the [UnitIcons](/android/Images/UnitIcons) folder. -The icon must be 200x200 pixels, white on transparent background. +The icon must be 200x200 pixels, white on transparent background - see [icon considerations](#icon-considerations) for details Remember that these are unique units, so search for an existing unique unit to see how they replace their regular counterparts! @@ -45,7 +45,7 @@ Again, [translation file](/android/assets/jsons/Translations/Units%2CPromotions. Same as the units - info is in the [Buildings.json](/android/assets/jsons/Buildings.json) file and icons in the [BuildingIcons](/android/Images/BuildingIcons) folder, -same rules for the icons apply. +same rules for the icons apply (200x200 pixels, icon considerations) Again, [translation file](/android/assets/jsons/Translations/Buildings.json) for bonus points! @@ -53,3 +53,13 @@ Again, [translation file](/android/assets/jsons/Translations/Buildings.json) for All Civ uniques require touching actual code - you can try it if ou feel you're up to it, but if not, send me an email to yairm210@hotmail.com (if you've finished all of the above) and I'll be happy to lend you a hand! + +## Icon considerations + +ALL icons must be legally acceptable, meaning they either come from from open sources or you act according to their licence (for Creative Commons, for instance, you have to specify the source and the creator). + +Icons directly from the base game belong to Firaxis, so I'm not sure we're legally allowed to use them - please use other sources! + +One source I use constantly is [The Noun Project](https://thenounproject.com) - everything there is Creative Commons or open, so they can all be used! + +Credits for icons should go in the [Credits](Credits.md) page