mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-04 06:33:32 +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 {
|
private fun getLoadFromClipboardButton(): TextButton {
|
||||||
val pasteButton = loadFromClipboard.toTextButton()
|
val pasteButton = loadFromClipboard.toTextButton()
|
||||||
pasteButton.onActivation {
|
pasteButton.onActivation {
|
||||||
|
pasteButton.setText("Working...".tr())
|
||||||
|
pasteButton.disable()
|
||||||
Concurrency.run(loadFromClipboard) {
|
Concurrency.run(loadFromClipboard) {
|
||||||
try {
|
try {
|
||||||
val clipboardContentsString = Gdx.app.clipboard.contents.trim()
|
val clipboardContentsString = Gdx.app.clipboard.contents.trim()
|
||||||
@ -149,6 +151,11 @@ class LoadGameScreen : LoadOrSaveScreen() {
|
|||||||
game.loadGame(loadedGame, true)
|
game.loadGame(loadedGame, true)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
launchOnGLThread { handleLoadGameException(ex, "Could not load game from clipboard!") }
|
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