From 7c7b3de68d11b8692de152d224476eae8670d554 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Sun, 9 Jul 2023 02:20:38 +0900 Subject: [PATCH] swapping save delete/cancel button so that accidental double click would not delete the save --- .../terrarum/modulebasegame/ui/UILoadManage.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UILoadManage.kt b/src/net/torvald/terrarum/modulebasegame/ui/UILoadManage.kt index e55e29f26..a34b5dc8b 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UILoadManage.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UILoadManage.kt @@ -80,14 +80,8 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() { } } - private val confirmCancelButton = UIItemTextButton(this, - { Lang["MENU_LABEL_CANCEL"] }, buttonXleft, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also { - it.clickOnceListener = { _,_ -> - mode = MODE_INIT - } - } private val confirmDeleteButton = UIItemTextButton(this, - { Lang["MENU_LABEL_DELETE"] }, buttonXright, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true, inactiveCol = Toolkit.Theme.COL_RED, activeCol = Toolkit.Theme.COL_REDD).also { + { Lang["MENU_LABEL_DELETE"] }, buttonXleft, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true, inactiveCol = Toolkit.Theme.COL_RED, activeCol = Toolkit.Theme.COL_REDD).also { it.clickOnceListener = { _,_ -> val pu = full.playerButtonSelected!!.playerUUID val wu = full.playerButtonSelected!!.worldUUID @@ -100,6 +94,12 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() { full.remoCon.openUI(UILoadSavegame(full.remoCon)) } } + private val confirmCancelButton = UIItemTextButton(this, + { Lang["MENU_LABEL_CANCEL"] }, buttonXright, buttonRowY, buttonWidth, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also { + it.clickOnceListener = { _,_ -> + mode = MODE_INIT + } + } private var mode = 0