NewGameScreen threading normalized.

The NewGameScreen was written by a past version of myself that had no idea how to handle threading, and thus was extremely strange. Checking an object _on render_ and if it's set then activate? Totally clueless.
This commit is contained in:
yairm210 2022-01-16 19:10:30 +02:00
parent 9b121a478a
commit dd90b2bacc
34 changed files with 51 additions and 56 deletions

View File

@ -519,7 +519,7 @@ Invalid game ID! = ID de partida inválida!
Copy user ID = Copiar ID de usuário
Copy game ID = Copiar ID da partida
UserID copied to clipboard = ID de usuário copiada
GameID copied to clipboard = ID da partida copiada
Game ID copied to clipboard! = ID da partida copiada
Set current user = Definir usuário atual
Player ID from clipboard = ID de jogador da área de transferência
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. = Para criar uma partida multijogador, verifique a opção "multijogador" na tela de Nova Partida, e para cada jogador humano coloque o ID de usuário.

View File

@ -576,7 +576,7 @@ Invalid game ID! = Невалидно ID!
Copy user ID = Копиране на user ID
Copy game ID = Копиране на game ID
UserID copied to clipboard = UserID е копирано
GameID copied to clipboard = GameID е копирано
Game ID copied to clipboard! = GameID е копирано
Set current user = Избор на текущ потребител
Player ID from clipboard = Копирано Player ID
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. = За да започнете Multiplayer игра, проверете 'multiplayer' ключа в екрана Нова Игра, и за всеки играч добавете неговото ID.

View File

@ -436,7 +436,7 @@ Invalid game ID! = Chybné ID hry
Copy user ID = Kopírovat uživatelské ID
Copy game ID = Kopírovat ID hry
UserID copied to clipboard = Uživatelské ID zkopírováno do schránky
GameID copied to clipboard = ID hry zkopírováno do schránky
Game ID copied to clipboard! = ID hry zkopírováno do schránky
Set current user = Nastavit aktuálního uživatele
Player ID from clipboard = Kopírovat ID hráče ze schránky
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. = Pro vytvoření hry pro více hráčů zaškrtněte 'Více hráčů' na obrazovce s novou hrou a pro každého lidského hráče vložte jeho hráčské ID.

View File

@ -440,7 +440,7 @@ Invalid game ID! = Onjuist spel-ID!
Copy user ID = Kopieer Gebruikers-ID
Copy game ID = Kopieer Spel-ID
UserID copied to clipboard = Gebruikers-ID gekopieerd naar het plakbord
GameID copied to clipboard = Spel-ID gekopieerd naar het plakbord
Game ID copied to clipboard! = Spel-ID gekopieerd naar het plakbord
Set current user = Selecteer de huidige gebruiker
Player ID from clipboard = Gebruikers-ID van plakbord
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. = Om een multiplayer spel te maken, klik de 'multiplayer' schakelaar in het Nieuwe Spel scherm en voer voor elke menselijke speler een speler's gebruikers-ID in.

View File

@ -802,7 +802,7 @@ Copy game ID =
# Requires translation!
UserID copied to clipboard =
# Requires translation!
GameID copied to clipboard =
Game ID copied to clipboard! =
# Requires translation!
Set current user =
# Requires translation!

View File

@ -675,7 +675,7 @@ Copy game ID =
# Requires translation!
UserID copied to clipboard =
# Requires translation!
GameID copied to clipboard =
Game ID copied to clipboard! =
# Requires translation!
Set current user =
# Requires translation!

View File

@ -554,7 +554,7 @@ Invalid game ID! = Viallinen pelin ID!
Copy user ID = Kopioi Käyttäjän ID
Copy game ID = Kopioi Pelin ID
UserID copied to clipboard = Käyttäjän ID kopioitu leikepöydälle
GameID copied to clipboard = Pelin ID kopioitu leikepöydälle
Game ID copied to clipboard! = Pelin ID kopioitu leikepöydälle
Set current user = Aseta tämä käyttäjä
Player ID from clipboard = Pelaajan ID leikepöydältä
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. = Luodaksesi moninpelin aseata 'moninpeli' asetus Uuden Pelin asetuksissa, ja aseta jokaiselle ihmispelaajalle heidän Käyttäjä ID

View File

@ -458,7 +458,7 @@ Invalid game ID! = ID de partie invalide !
Copy user ID = Copier l'ID utilisateur
Copy game ID = Copier l'ID de partie
UserID copied to clipboard = ID utilisateur copié dans le presse-papier
GameID copied to clipboard = ID de partie copié dans le presse-papier
Game ID copied to clipboard! = ID de partie copié dans le presse-papier
Set current user = Définir l'utilisateur actuel
Player ID from clipboard = Coller l'ID utilisateur depuis le presse-papier
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. = Pour créer une partie multijoueurs, cochez la case 'multijoueurs' dans l'écran 'Nouvelle Partie' et, pour chaque joueur humain, renseignez l'ID utilisateur du joueur

View File

@ -435,7 +435,7 @@ Invalid game ID! = Ungültige Spiel-ID!
Copy user ID = Spieler-ID kopieren
Copy game ID = Spiel-ID kopieren
UserID copied to clipboard = Spieler-ID in die Zwischenablage kopiert
GameID copied to clipboard = Spiel-ID in die Zwischenablage kopiert
Game ID copied to clipboard! = Spiel-ID in die Zwischenablage kopiert
Set current user = Aktuellen Spieler eintragen
Player ID from clipboard = Spieler-ID aus Zwischenablage
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. = Um ein Mehrspielerspiel zu erstellen, aktiviere die Option "Online Mehrspieler" in der Ansicht "Neues Spiel" und gib für jeden menschlichen Spieler die Spieler-ID ein.

View File

@ -622,7 +622,7 @@ Copy game ID =
# Requires translation!
UserID copied to clipboard =
# Requires translation!
GameID copied to clipboard =
Game ID copied to clipboard! =
# Requires translation!
Set current user =
# Requires translation!

View File

@ -561,7 +561,7 @@ Invalid game ID! = Hibás azonosító!
Copy user ID = Felhasználó azonosító másolása
Copy game ID = Játék azonosító másolása
UserID copied to clipboard = Felhasználó azonosító a vágólapra másolva
GameID copied to clipboard = Játék azonosító a vágólapra másolva
Game ID copied to clipboard! = Játék azonosító a vágólapra másolva
Set current user = Jelenlegi játékos beállítása
Player ID from clipboard = Játékos azonosító vágólapról
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. = Multiplayer játék létrehozásához jelöld be a 'multiplayer' opciót az Új játék felületen és minden emberi játékoshoz add meg az azonosítójukat.

View File

@ -435,7 +435,7 @@ Invalid game ID! = Game ID tidak valid!
Copy user ID = Salin ID Pengguna
Copy game ID = Salin ID Permainan
UserID copied to clipboard = ID Pengguna disalin ke papan klip
GameID copied to clipboard = ID Permainan disalin ke papan klip
Game ID copied to clipboard! = ID Permainan disalin ke papan klip
Set current user = Atur pengguna saat ini
Player ID from clipboard = ID Pemain dari papan klip
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. = Untuk membuat permainan multiplayer, cek tombol 'Multiplayer' di tampilan Permainan Baru, dan untuk setiap pemain asli, masukkan ID pengguna pemain tersebut.

View File

@ -436,7 +436,7 @@ Invalid game ID! = ID Partita non corretto
Copy user ID = Copia ID Utente
Copy game ID = Copia ID Partita
UserID copied to clipboard = ID Utente copiato negli appunti
GameID copied to clipboard = ID Partita copiato negli appunti
Game ID copied to clipboard! = ID Partita copiato negli appunti
Set current user = Imposta utente attuale
Player ID from clipboard = Copia ID giocatore dagli appunti
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. = Per creare una partita multigiocatore, attiva la spunta su 'Multigiocatore' nella schermata Nuova Partita, e inserisci l'ID utente per del giocatore per ogni rispettivo giocatore umano.

View File

@ -525,7 +525,7 @@ Invalid game ID! = 無効なゲームID
Copy user ID = ユーザーIDをコピー
Copy game ID = ゲームIDをコピー
UserID copied to clipboard = ユーザーIDをクリップボードにコピーしました
GameID copied to clipboard = ゲームIDをクリップボードにコピーしました
Game ID copied to clipboard! = ゲームIDをクリップボードにコピーしました
Set current user = 現在のユーザーを設定
Player ID from clipboard = クリップボードのプレーヤーID
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. = マルチプレイゲームを作成するには、「新しいゲーム」で「オンラインマルチプレイ」をオンにし、人間のプレイヤーごとにそのプレイヤーのユーザーIDを入れ込みます。

View File

@ -502,7 +502,7 @@ Invalid game ID! = 잘못된 게임ID 입니다!
Copy user ID = 유저ID 복사
Copy game ID = 게임ID 복사
UserID copied to clipboard = 클립보드에 유저ID가 복사되었습니다
GameID copied to clipboard = 클립보드에 게임ID가 복사되었습니다
Game ID copied to clipboard! = 클립보드에 게임ID가 복사되었습니다
Set current user = 현재 사용자 설정
Player ID from clipboard = 클립보드의 플레이어 ID
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. = 멀티플레이 게임을 하려면 [새 게임]에서 '멀티플레이'에 체크하고 각 플레이어의 유저ID를 입력하십시오.

View File

@ -556,7 +556,7 @@ Invalid game ID! = Netinkamas žaidimoID!
Copy user ID = Nukopijuokite vartotojoID
Copy game ID = Nukopijuokite žaidimoID
UserID copied to clipboard = VartotojoID nukopijuotas į mainų sritį
GameID copied to clipboard = žaidimoID nukopijuotas į mainų sritį
Game ID copied to clipboard! = žaidimoID nukopijuotas į mainų sritį
Set current user = Nustatyti dabartinį vartotoją
Player ID from clipboard = ŽaidėjoID iš mainų srities
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. = Norėdami sukurti kelių žaidėjų žaidimą, naujo žaidimo ekrane pažymėkite „daugelio žaidėjų“ jungiklį ir kiekvienam žaidėjui įveskite to žaidėjo vartotojoID.

View File

@ -526,7 +526,7 @@ Invalid game ID! = ID permainan tidak sah!
Copy user ID = Salin ID penguna
Copy game ID = Salin ID permainan
UserID copied to clipboard = ID Pengguna disalin
GameID copied to clipboard = ID Permainan disalin
Game ID copied to clipboard! = ID Permainan disalin
Set current user = Set pengguna semasa
Player ID from clipboard = ID Pemain dari 'clipboard'
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. = Untuk memulakan permainan multipemain, semak togol 'multipemain' di skrin Permainan Baru, dan masukkan ID pemain untuk setiap pemain manusia.

View File

@ -586,7 +586,7 @@ Invalid game ID! = ID e bāzi nā-motabar ast!
Copy user ID = Kopi Kardan e ID e Kārbari
Copy game ID = Kopi Kardan e ID e Bāzi
UserID copied to clipboard = ID e Kārbari kopi šod
GameID copied to clipboard = ID e Bāzi kopi šod
Game ID copied to clipboard! = ID e Bāzi kopi šod
Set current user = Ğarār dādan e hamin kārbar
Player ID from clipboard = ID e Kārbari e kopi šode
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. = Barāye sāḵt e yek bāzi čand-nafare, tik e čand-nafare rā dar safhe ye Bāzi e Jadid bezanid, va be ezāye har fard ID oo rā vāred konid.

View File

@ -584,7 +584,7 @@ Invalid game ID! = ID e baazi naa-motabar ast!
Copy user ID = Kopi Kardan e ID e Kaarbari
Copy game ID = Kopi Kardan e ID e Baazi
UserID copied to clipboard = ID e Kaarbari kopi shod
GameID copied to clipboard = ID e Baazi kopi shod
Game ID copied to clipboard! = ID e Baazi kopi shod
Set current user = Gharaar daadan e hamin kaarbar
Player ID from clipboard = ID e Kaarbari e kopi shode
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. = Baraaye saakht e yek baazi chand-nafare, tik e chand-nafare raa dar safhe ye Baazi e Jadid bezanid, va be ezaaye har fard ID oo raa vaared konid.

View File

@ -527,7 +527,7 @@ Invalid game ID! = Nieprawidłowy ID gry!
Copy user ID = Skopiuj ID użytkownika
Copy game ID = Skopiuj ID gry
UserID copied to clipboard = ID użytkownika zostało skopiowane do schowka
GameID copied to clipboard = ID gry zostało skopiowane do schowka
Game ID copied to clipboard! = ID gry zostało skopiowane do schowka
Set current user = Ustaw bieżącego użytkownika
Player ID from clipboard = ID gracza ze schowka
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. = Aby utworzyć grę wieloosobową, zaznacz pole "Gra Wieloosobowa" w ekranie Nowej Gry i dla każdego ludzkiego gracza wprowadź ID tego gracza.

View File

@ -527,7 +527,7 @@ Invalid game ID! = ID de partida inválida
Copy user ID = Copiar ID de usuário
Copy game ID = Copiar ID de jogo
UserID copied to clipboard = Identificação do usuário copiada para área de transferência
GameID copied to clipboard = Identificação da partida copiada para área de transferência
Game ID copied to clipboard! = Identificação da partida copiada para área de transferência
Set current user = Definir usuário atual
Player ID from clipboard = ID de jogador da prancheta
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. = Para criar um jogo multijogador, verifica a opção 'multijogador' na tela de Nova Partida, e para cada jogador, coloca o ID de usuário.

View File

@ -446,7 +446,7 @@ Invalid game ID! = ID-ul jocului invalid!
Copy user ID = Copiază ID-ul utilizatorului
Copy game ID = Copiază ID-ul jocului
UserID copied to clipboard = ID-ul utilizatorului copiat în clipboard
GameID copied to clipboard = ID-ul jocului copiat în clipboard
Game ID copied to clipboard! = ID-ul jocului copiat în clipboard
Set current user = Pune utilizaorul curent
Player ID from clipboard = ID-ul utilizatorului din clipboard
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. = Pentru a crea un joc multiplayer, activează butonul 'multiplayer' în ecranul 'Joc nou', și pentru fiecare jucător uman inserează ID jucătorului respectiv.

View File

@ -437,7 +437,7 @@ Invalid game ID! = Некорректный ID игры!
Copy user ID = Скопировать ID игрока
Copy game ID = Скопировать ID игры
UserID copied to clipboard = ID игрока скопирован в буфер обмена
GameID copied to clipboard = ID игры скопирован в буфер обмена
Game ID copied to clipboard! = ID игры скопирован в буфер обмена
Set current user = Выбрать текущего игрока
Player ID from clipboard = ID игрока из буфера обмена
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. = Чтобы создать многопользовательскую игру, поставьте флажок 'Сетевая игра' на экране создания новой игры и для каждого игрока (человека) введите ID игрока.

View File

@ -435,7 +435,7 @@ Invalid game ID! = 无效的游戏 ID
Copy user ID = 复制玩家 ID
Copy game ID = 复制游戏 ID
UserID copied to clipboard = 玩家 ID 已复制
GameID copied to clipboard = 游戏 ID 已复制
Game ID copied to clipboard! = 游戏 ID 已复制
Set current user = 设定为当前玩家
Player ID from clipboard = 从剪贴板获取玩家 ID
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. = 创建多人游戏时,首先请选中 “开始新游戏” 界面的 “在线多人游戏” 复选框,同时将每个参与游戏的玩家 ID 填入其想扮演文明的 “玩家 ID” 文本框内。

View File

@ -435,7 +435,7 @@ Invalid game ID! = ¡ID de partida no válido!
Copy user ID = Copiar ID de usuario
Copy game ID = Copiar ID de la partida
UserID copied to clipboard = ID de usuario copiado al portapapeles
GameID copied to clipboard = ID del juego copiada al portapapeles
Game ID copied to clipboard! = ID del juego copiada al portapapeles
Set current user = Asignar usuario actual
Player ID from clipboard = ID de jugador desde el portapapeles
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. = Para crear un juego multijugador, marque el botón 'multijugador' en la pantalla Nueva Partida, y para cada jugador humano inserte la ID de usuario de ese jugador.

View File

@ -437,7 +437,7 @@ Invalid game ID! = Ogiltigt spel-ID!
Copy user ID = Kopiera användar-ID
Copy game ID = Kopiera spel-ID
UserID copied to clipboard = Användar-ID kopierat till urklipp
GameID copied to clipboard = Spel-ID kopierat till urklipp
Game ID copied to clipboard! = Spel-ID kopierat till urklipp
Set current user = Ställ in nuvarande användare
Player ID from clipboard = Spelar-ID från urklipp
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. = För att skapa ett flerspelarspel, välj 'flerspelar'-alternativet i Nytt Spel-skärme, och infoga användar-ID för varje mänsklig spelare.

View File

@ -664,7 +664,7 @@ Copy game ID =
# Requires translation!
UserID copied to clipboard =
# Requires translation!
GameID copied to clipboard =
Game ID copied to clipboard! =
# Requires translation!
Set current user =
# Requires translation!

View File

@ -571,7 +571,7 @@ Invalid game ID! = 無效的遊戲ID
Copy user ID = 複製玩家ID
Copy game ID = 複製遊戲ID
UserID copied to clipboard = 玩家ID已複製
GameID copied to clipboard = 遊戲ID已複製
Game ID copied to clipboard! = 遊戲ID已複製
Set current user = 設定為目前玩家
Player ID from clipboard = 從剪貼簿取得玩家ID
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. = 建立多人遊戲時請先選擇“開始新遊戲”選單的“線上多人遊戲”並將參與遊戲的玩家ID填入對應扮演的文明的“Player ID”文字框。

View File

@ -495,7 +495,7 @@ Invalid game ID! = Geçersiz oyun kimliği!
Copy user ID = Kullanıcı Kimliğini Kopyala
Copy game ID = Oyun Kimliğini Kopyala
UserID copied to clipboard = Kullanıcı Kimliği panoya kopyalandı
GameID copied to clipboard = Oyun Kimliği panoya kopyalandı
Game ID copied to clipboard! = Oyun Kimliği panoya kopyalandı
Set current user = Geçerli kullanıcıyı ayarla
Player ID from clipboard = Panodan oyuncu kimliği
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. = Çok oyunculu bir oyun oluşturmak için Yeni Oyun ekranındaki 'çok oyunculu' kısmını kontrol edin ve her insan oyuncu için o oyuncunun kullanıcı kimliğini girin.

View File

@ -471,7 +471,7 @@ Invalid game ID! = Ідентифікатор гри недійсний!
Copy user ID = Копіювати ідентифікатор гравця
Copy game ID = Копіювати ідентифікатор гри
UserID copied to clipboard = Ідентифікатор користувача скопійовано до буферу
GameID copied to clipboard = Ідентифікатор гри скопійовано до буферу
Game ID copied to clipboard! = Ідентифікатор гри скопійовано до буферу
Set current user = Вибрати поточного гравця
Player ID from clipboard = Ідентифікатор гравця з буфера обміну
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. = Для створення багатокористувацької гри перевірте перемикач «Багатокористувацька» у віконці «Нова гра» і для кожної людини-гравця введіть відповідний ідентифікатор.

View File

@ -337,7 +337,7 @@ Invalid game ID! = ID trò chơi không hợp lệ!
Copy User ID = Sao chép ID người dùng
Copy Game ID = Sao chép ID trò chơi
UserID copied to clipboard = ID người dùng đã được sao chép vào khay nhớ tạm
GameID copied to clipboard = ID trò chơi đã được sao chép vào khay nhớ tạm
Game ID copied to clipboard! = ID trò chơi đã được sao chép vào khay nhớ tạm
Set current user = Đặt người dùng hiện tại
Player ID from clipboard = ID người chơi từ khay nhớ tạm
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. = Để tạo một phòng nhiều người chơi, kiểm tra 'Chơi Trực Tuyến' tại cửa sổ chính. Và với mỗi người chơi, nhập ID của những người chơi đó.

View File

@ -438,7 +438,7 @@ Invalid game ID! =
Copy user ID =
Copy game ID =
UserID copied to clipboard =
GameID copied to clipboard =
Game ID copied to clipboard! =
Set current user =
Player ID from clipboard =
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. =

View File

@ -90,7 +90,7 @@ class MultiplayerScreen(previousScreen: BaseScreen) : PickerScreen() {
val gameInfo = multiplayerGames[selectedGameFile]
if (gameInfo != null) {
Gdx.app.clipboard.contents = gameInfo.gameId
ToastPopup("GameID copied to clipboard", this)
ToastPopup("Game ID copied to clipboard!", this)
}
}
rightSideTable.add(copyGameIdButton).row()

View File

@ -17,7 +17,6 @@ import com.unciv.ui.pickerscreens.PickerScreen
import com.unciv.ui.utils.*
import com.unciv.ui.worldscreen.mainmenu.OnlineMultiplayer
import java.util.*
import kotlin.concurrent.thread
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
@ -177,6 +176,7 @@ class NewGameScreen(
}
private fun newGameThread() {
val newGame:GameInfo
try {
newGame = GameStarter.startNewGame(gameSetupInfo)
} catch (exception: Exception) {
@ -192,22 +192,18 @@ class NewGameScreen(
rightSideButton.enable()
rightSideButton.setText("Start game!".tr())
}
return
}
if (newGame != null && gameSetupInfo.gameParameters.isOnlineMultiplayer) {
newGame!!.isUpToDate = true // So we don't try to download it from dropbox the second after we upload it - the file is not yet ready for loading!
if (gameSetupInfo.gameParameters.isOnlineMultiplayer) {
newGame.isUpToDate = true // So we don't try to download it from dropbox the second after we upload it - the file is not yet ready for loading!
try {
OnlineMultiplayer().tryUploadGame(newGame!!, withPreview = true)
OnlineMultiplayer().tryUploadGame(newGame, withPreview = true)
// Save gameId to clipboard because you have to do it anyway.
Gdx.app.clipboard.contents = newGame!!.gameId
// Popup to notify the User that the gameID got copied to the clipboard
postCrashHandlingRunnable { ToastPopup("gameID copied to clipboard".tr(), game.worldScreen, 2500) }
GameSaver.autoSave(newGame!!) {}
GameSaver.autoSave(newGame)
// Saved as Multiplayer game to show up in the session browser
val newGamePreview = newGame!!.asPreview()
val newGamePreview = newGame.asPreview()
GameSaver.saveGame(newGamePreview, newGamePreview.gameId)
} catch (ex: Exception) {
postCrashHandlingRunnable {
@ -217,11 +213,20 @@ class NewGameScreen(
open()
}
}
newGame = null
return
}
}
Gdx.graphics.requestRendering()
postCrashHandlingRunnable {
game.loadGame(newGame)
previousScreen.dispose()
if (newGame.gameParameters.isOnlineMultiplayer) {
// Save gameId to clipboard because you have to do it anyway.
Gdx.app.clipboard.contents = newGame.gameId
// Popup to notify the User that the gameID got copied to the clipboard
ToastPopup("Game ID copied to clipboard!".tr(), game.worldScreen, 2500)
}
}
}
fun updateRuleset() {
@ -248,16 +253,6 @@ class NewGameScreen(
newGameOptionsTable.update()
}
var newGame: GameInfo? = null
override fun render(delta: Float) {
if (newGame != null) {
game.loadGame(newGame!!)
previousScreen.dispose()
}
super.render(delta)
}
override fun resize(width: Int, height: Int) {
if (stage.viewport.screenWidth != width || stage.viewport.screenHeight != height) {
game.setScreen(NewGameScreen(previousScreen, gameSetupInfo))