Minor fixes to multiplayer UI components

This commit is contained in:
Yair Morgenstern 2019-09-01 17:18:08 +03:00
parent efaa0c9a6c
commit 675d05d1e4
7 changed files with 66 additions and 25 deletions

View File

@ -317,21 +317,57 @@
Italian:"Nome utente" Italian:"Nome utente"
} }
"Multiplayer":{
}
"Could not download game!":{
}
"Could not upload game!":{
}
"Join Game":{
}
"Invalid game ID!":{
}
"Copy User Id":{
}
"Copy Game Id":{
}
/// tutorials for multiplayer
"To create a multiplayer game, check the 'multiplayer' toggle in the New Game screen, and for each human player insert that player's user ID.":{
}
"You can assign your own user ID there easily, and othr players can copy their user IDs here and send them to you for you to include them in the game.":{
}
"Once you've created your game, enter this screen again to copy the Game ID and send it to the other players.":{
}
"Players can enter you game by copying the game ID to the clipboard, and clicking on the Join Game button":{
}
// Game speeds // Game speeds
"Game Speed":{ "Game Speed":{
Italian:"Velocità di gioco" Italian:"Velocità di gioco"
Russian:"Скорость игры" Russian:"Скорость игры"
} }
"Quick":{ "Quick":{
Italian:"Rapida" Italian:"Rapida"
Russian:"Быстрая" Russian:"Быстрая"
} }
"Standard":{ "Standard":{
Italian:"Standard" Italian:"Standard"
Russian:"Обычная" Russian:"Обычная"
} }
"Epic":{ "Epic":{
@ -467,14 +503,14 @@
French:"Tours avant sauvegarde automatique" French:"Tours avant sauvegarde automatique"
Simplified_Chinese:"自动存档回合数" Simplified_Chinese:"自动存档回合数"
Portuguese:"Turnos entre autosaves" Portuguese:"Turnos entre autosaves"
Russian:"Кол-во ходов между автосохранениями" Russian:"Кол-во ходов между автосохранениями"
} }
"Sound effects volume":{ "Sound effects volume":{
Italian:"Volume effetti" Italian:"Volume effetti"
French:"Volume sonore" French:"Volume sonore"
Simplified_Chinese:"声效大小" Simplified_Chinese:"声效大小"
Russian:"Громкость звука" Russian:"Громкость звука"
} }
"Show":{ "Show":{
@ -541,12 +577,15 @@
Italian:"Muovi unità con un solo tocco" Italian:"Muovi unità con un solo tocco"
German: "Einheiten mit einem Klick bewegen" German: "Einheiten mit einem Klick bewegen"
French:"Bouger les unités en un seul click" French:"Bouger les unités en un seul click"
Russian:"Перемещать юниты одним касанием" Russian:"Перемещать юниты одним касанием"
} }
"Show tutorials":{ "Show tutorials":{
Italian:"Mostra tutorial" Italian:"Mostra tutorial"
Russian:"Показывать обучение" Russian:"Показывать обучение"
}
"Auto-assign city production":{
} }
} }

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app" applicationId "com.unciv.app"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 28 targetSdkVersion 28
versionCode 292 versionCode 293
versionName "2.19.10" versionName "3.0.0"
} }
// Had to add this crap for Travis to build, it wanted to sign the app // Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -73,7 +73,7 @@ class NewGameScreen: PickerScreen(){
GameSaver().autoSave(newGame!!){} GameSaver().autoSave(newGame!!){}
} catch (ex: Exception) { } catch (ex: Exception) {
val cantUploadNewGamePopup = PopupTable(this) val cantUploadNewGamePopup = PopupTable(this)
cantUploadNewGamePopup.addGoodSizedLabel("Can't upload the new game!") cantUploadNewGamePopup.addGoodSizedLabel("Could not upload game!")
cantUploadNewGamePopup.addCloseButton() cantUploadNewGamePopup.addCloseButton()
cantUploadNewGamePopup.open() cantUploadNewGamePopup.open()
newGame = null newGame = null

View File

@ -52,7 +52,7 @@ class Fonts {
return true return true
return false return false
} }
fun getCharsForFont(withChinese:Boolean): String { fun getCharsForFont(withChinese:Boolean): String {
val defaultText = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽaäàâăbcčćçdđeéfghiîjklmnoöpqrsșštțuüvwxyzž" + val defaultText = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽaäàâăbcčćçdđeéfghiîjklmnoöpqrsșštțuüvwxyzž" +
"АБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋУЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюя" + "АБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋУЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюя" +

View File

@ -141,8 +141,9 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
} catch (ex: Exception) { } catch (ex: Exception) {
loadingGamePopup.close() loadingGamePopup.close()
val couldntDownloadLatestGame = PopupTable(this) val couldntDownloadLatestGame = PopupTable(this)
couldntDownloadLatestGame.addGoodSizedLabel("Couldn't download the latest game state!") couldntDownloadLatestGame.addGoodSizedLabel("Couldn't download the latest game state!").row()
couldntDownloadLatestGame.addCloseButton() couldntDownloadLatestGame.addCloseButton()
couldntDownloadLatestGame.addAction(Actions.delay(5f, Actions.run { couldntDownloadLatestGame.close() }))
couldntDownloadLatestGame.open() couldntDownloadLatestGame.open()
} }
} }
@ -324,10 +325,11 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
OnlineMultiplayer().tryUploadGame(gameInfoClone) OnlineMultiplayer().tryUploadGame(gameInfoClone)
} catch (ex: Exception) { } catch (ex: Exception) {
val cantUploadNewGamePopup = PopupTable(this) val cantUploadNewGamePopup = PopupTable(this)
cantUploadNewGamePopup.addGoodSizedLabel("Can't upload the new game!") cantUploadNewGamePopup.addGoodSizedLabel("Could not upload game!").row()
cantUploadNewGamePopup.addCloseButton() cantUploadNewGamePopup.addCloseButton()
cantUploadNewGamePopup.open() cantUploadNewGamePopup.open()
isPlayersTurn = true // Since we couldn't push the new game clone, then it's like we never clicked the "next turn" button isPlayersTurn = true // Since we couldn't push the new game clone, then it's like we never clicked the "next turn" button
shouldUpdate = true
return@thread return@thread
} }
} }

View File

@ -83,7 +83,7 @@ class WorldScreenMenuTable(val worldScreen: WorldScreen) : PopupTable(worldScree
multiplayerPopup.addGoodSizedLabel("To create a multiplayer game, check the 'multiplayer' toggle in the New Game screen, and for each human player insert that player's user ID.").row() multiplayerPopup.addGoodSizedLabel("To create a multiplayer game, check the 'multiplayer' toggle in the New Game screen, and for each human player insert that player's user ID.").row()
multiplayerPopup.addGoodSizedLabel("You can assign your own user ID there easily, and othr players can copy their user IDs here and send them to you for you to include them in the game.").row() multiplayerPopup.addGoodSizedLabel("You can assign your own user ID there easily, and othr players can copy their user IDs here and send them to you for you to include them in the game.").row()
multiplayerPopup.addButton("Click to copy User Id"){ Gdx.app.clipboard.contents = UnCivGame.Current.settings.userId }.row() multiplayerPopup.addButton("Copy User Id"){ Gdx.app.clipboard.contents = UnCivGame.Current.settings.userId }.row()
multiplayerPopup.addGoodSizedLabel("Once you've created your game, enter this screen again to copy the Game ID and send it to the other players.").row() multiplayerPopup.addGoodSizedLabel("Once you've created your game, enter this screen again to copy the Game ID and send it to the other players.").row()
@ -108,7 +108,7 @@ class WorldScreenMenuTable(val worldScreen: WorldScreen) : PopupTable(worldScree
val game = OnlineMultiplayer().tryDownloadGame(gameId) val game = OnlineMultiplayer().tryDownloadGame(gameId)
UnCivGame.Current.loadGame(game) UnCivGame.Current.loadGame(game)
} catch (ex: Exception) { } catch (ex: Exception) {
badGameIdLabel.setText("Could not download game1!") badGameIdLabel.setText("Could not download game!".tr())
badGameIdLabel.isVisible = true badGameIdLabel.isVisible = true
return@addButton return@addButton
} }

View File

@ -79,11 +79,11 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
settings.autoAssignCityProduction= !settings.autoAssignCityProduction settings.autoAssignCityProduction= !settings.autoAssignCityProduction
update() update()
} }
addFontSelectBox(innerTable)
addLanguageSelectBox(innerTable) addLanguageSelectBox(innerTable)
addFontSelectBox(innerTable)
addResolutionSelectBox(innerTable) addResolutionSelectBox(innerTable)
addAutosaveTurnsSelectBox(innerTable) addAutosaveTurnsSelectBox(innerTable)
@ -222,10 +222,10 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
YesNoPopupTable("This Font requires you to download fonts.\n" + YesNoPopupTable("This Font requires you to download fonts.\n" +
"Do you want to download fonts(about 4.2MB)?", "Do you want to download fonts(about 4.2MB)?",
{ {
val downloading = PopupTable(screen) val downloadingFontPopup = PopupTable(screen)
downloading.add("Downloading...\n".toLabel()).row() downloadingFontPopup.add("Downloading...\n".toLabel()).row()
downloading.add("Warning:Don't switch this game to background until download finished.".toLabel().setFontColor(Color.RED)).row() downloadingFontPopup.add("Warning:Don't switch this game to background until download finished.".toLabel().setFontColor(Color.RED)).row()
downloading.open() downloadingFontPopup.open()
Gdx.input.inputProcessor = null Gdx.input.inputProcessor = null
thread { thread {
try { try {
@ -237,10 +237,10 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
catch (e: IOException) { catch (e: IOException) {
Gdx.app.postRunnable { Gdx.app.postRunnable {
FontSetSelectBox.selected = "NativeFont(Recommended)" FontSetSelectBox.selected = "NativeFont(Recommended)"
val downloading = PopupTable(UnCivGame.Current.worldScreen) val downloadFailedPopup = PopupTable(UnCivGame.Current.worldScreen)
downloading.add("Download failed!\nPlease check your internet connection.".toLabel().setFontColor(Color.RED)).row() downloadFailedPopup.add("Download failed!\nPlease check your internet connection.".toLabel().setFontColor(Color.RED)).row()
downloading.addButton("Close".tr()) { downloading.remove() }.row() downloadFailedPopup.addCloseButton()
downloading.open() downloadFailedPopup.open()
} }
} }
} }