mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Resolved #5823
This commit is contained in:
parent
90df253783
commit
eb4a76dcd0
@ -39,9 +39,13 @@ class SaveGameScreen(val gameInfo: GameInfo) : PickerScreen(disableScroll = true
|
|||||||
|
|
||||||
val copyJsonButton = "Copy to clipboard".toTextButton()
|
val copyJsonButton = "Copy to clipboard".toTextButton()
|
||||||
copyJsonButton.onClick {
|
copyJsonButton.onClick {
|
||||||
|
try {
|
||||||
val json = Json().toJson(gameInfo)
|
val json = Json().toJson(gameInfo)
|
||||||
val base64Gzip = Gzip.zip(json)
|
val base64Gzip = Gzip.zip(json)
|
||||||
Gdx.app.clipboard.contents = base64Gzip
|
Gdx.app.clipboard.contents = base64Gzip
|
||||||
|
} catch (OOM: OutOfMemoryError) {
|
||||||
|
// you don't get a special toast, this isn't nearly common enough, this is a total edge-case
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newSave.add(copyJsonButton).row()
|
newSave.add(copyJsonButton).row()
|
||||||
if (GameSaver.canLoadFromCustomSaveLocation()) {
|
if (GameSaver.canLoadFromCustomSaveLocation()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user