From bd0af8b2cf20cef8cbc183ae2e0854be60643f78 Mon Sep 17 00:00:00 2001 From: notify Date: Sat, 10 Jun 2023 23:55:39 +0800 Subject: [PATCH] Conf (#188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修安卓退出框(感谢板神) 进大厅/出大厅时也保存配置信息 --- Fk/Logic.js | 1 + Fk/Pages/Lobby.qml | 1 + Fk/RoomElement/Dashboard.qml | 2 +- Fk/main.qml | 22 +++++++++++++++------- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Fk/Logic.js b/Fk/Logic.js index 0b5577c4..f6652bb3 100644 --- a/Fk/Logic.js +++ b/Fk/Logic.js @@ -90,6 +90,7 @@ callbacks["EnterLobby"] = (jsonData) => { mainStack.pop(); } mainWindow.busy = false; + config.saveConf(); } callbacks["EnterRoom"] = (jsonData) => { diff --git a/Fk/Pages/Lobby.qml b/Fk/Pages/Lobby.qml index 47900f7a..810576a0 100644 --- a/Fk/Pages/Lobby.qml +++ b/Fk/Pages/Lobby.qml @@ -198,6 +198,7 @@ Item { onClicked: { toast.show("Goodbye."); mainStack.pop(); + config.saveConf(); Backend.quitLobby(); } } diff --git a/Fk/RoomElement/Dashboard.qml b/Fk/RoomElement/Dashboard.qml index 02be4b6d..33d392b5 100644 --- a/Fk/RoomElement/Dashboard.qml +++ b/Fk/RoomElement/Dashboard.qml @@ -388,7 +388,7 @@ RowLayout { unSelectAll(); disableSkills(); - const cards = handcardAreaItem.cards; + let cards = handcardAreaItem.cards; const toRemove = []; for (let c of cards) { toRemove.push(c.cid); diff --git a/Fk/main.qml b/Fk/main.qml index fbc2b78d..55a976c2 100644 --- a/Fk/main.qml +++ b/Fk/main.qml @@ -224,13 +224,21 @@ Window { title: realMainWin.title informativeText: qsTr("Are you sure to exit?") buttons: MessageDialog.Ok | MessageDialog.Cancel - onAccepted: { - mainWindow.closing = true; - config.winWidth = width; - config.winHeight = height; - config.saveConf(); - Backend.quitLobby(false); - realMainWin.close(); + onButtonClicked: function (button, role) { + switch (button) { + case MessageDialog.Ok: { + mainWindow.closing = true; + config.winWidth = width; + config.winHeight = height; + config.saveConf(); + Backend.quitLobby(false); + realMainWin.close(); + break; + } + case MessageDialog.Cancel: { + exitMessageDialog.close(); + } + } } }