From b744acdc55a2d08739e4b343a90a058c0c16884d Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sat, 25 Dec 2021 22:28:43 +0200 Subject: [PATCH] Exit CrashScreen normally, without exceptions --- core/src/com/unciv/CrashScreen.kt | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/core/src/com/unciv/CrashScreen.kt b/core/src/com/unciv/CrashScreen.kt index 2ab3a6c6a3..2ff18d22e3 100644 --- a/core/src/com/unciv/CrashScreen.kt +++ b/core/src/com/unciv/CrashScreen.kt @@ -68,12 +68,12 @@ class CrashScreen(val exception: Throwable): BaseScreen() { } /** @return Label for title at top of screen. */ - private fun makeTitleLabel() - = "An unrecoverable error has occurred in Unciv:".toLabel(fontSize = 24) - .apply { - wrap = true - setAlignment(Align.center) - } + private fun makeTitleLabel() = + "An unrecoverable error has occurred in Unciv:".toLabel(fontSize = 24) + .apply { + wrap = true + setAlignment(Align.center) + } /** @return Actor that displays a scrollable view of the error report text. */ private fun makeErrorScroll(): Actor { @@ -88,12 +88,12 @@ class CrashScreen(val exception: Throwable): BaseScreen() { } /** @return Label to give the user more information and context below the error report. */ - private fun makeInstructionLabel() - = "{If this keeps happening, you can try disabling mods.}\n{You can also report this on the issue tracker.}".toLabel() - .apply { - wrap = true - setAlignment(Align.center) - } + private fun makeInstructionLabel() = + "{If this keeps happening, you can try disabling mods.}\n{You can also report this on the issue tracker.}".toLabel() + .apply { + wrap = true + setAlignment(Align.center) + } /** @return Table that displays decision buttons for the bottom of the screen. */ private fun makeActionButtonsTable(): Table { @@ -118,9 +118,7 @@ class CrashScreen(val exception: Throwable): BaseScreen() { } } val closeButton = "Close Unciv".toButton() - .onClick { - throw exception // throw the original exception to allow crash recording on GP - } + .onClick { Gdx.app.exit() } val buttonsTable = Table() buttonsTable.add(copyButton)