mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-03 22:22:51 +07:00
Visual clue a load game from clipboard is underway (#9278)
This commit is contained in:
parent
a507da9a4a
commit
2b57bd44ab
@ -142,6 +142,8 @@ class LoadGameScreen : LoadOrSaveScreen() {
|
||||
private fun getLoadFromClipboardButton(): TextButton {
|
||||
val pasteButton = loadFromClipboard.toTextButton()
|
||||
pasteButton.onActivation {
|
||||
pasteButton.setText("Working...".tr())
|
||||
pasteButton.disable()
|
||||
Concurrency.run(loadFromClipboard) {
|
||||
try {
|
||||
val clipboardContentsString = Gdx.app.clipboard.contents.trim()
|
||||
@ -149,6 +151,11 @@ class LoadGameScreen : LoadOrSaveScreen() {
|
||||
game.loadGame(loadedGame, true)
|
||||
} catch (ex: Exception) {
|
||||
launchOnGLThread { handleLoadGameException(ex, "Could not load game from clipboard!") }
|
||||
} finally {
|
||||
launchOnGLThread {
|
||||
pasteButton.setText(loadFromClipboard.tr())
|
||||
pasteButton.enable()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user