修安卓退出框(感谢板神)
进大厅/出大厅时也保存配置信息
This commit is contained in:
notify 2023-06-10 23:55:39 +08:00 committed by GitHub
parent 89c4f04db4
commit bd0af8b2cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 8 deletions

View File

@ -90,6 +90,7 @@ callbacks["EnterLobby"] = (jsonData) => {
mainStack.pop(); mainStack.pop();
} }
mainWindow.busy = false; mainWindow.busy = false;
config.saveConf();
} }
callbacks["EnterRoom"] = (jsonData) => { callbacks["EnterRoom"] = (jsonData) => {

View File

@ -198,6 +198,7 @@ Item {
onClicked: { onClicked: {
toast.show("Goodbye."); toast.show("Goodbye.");
mainStack.pop(); mainStack.pop();
config.saveConf();
Backend.quitLobby(); Backend.quitLobby();
} }
} }

View File

@ -388,7 +388,7 @@ RowLayout {
unSelectAll(); unSelectAll();
disableSkills(); disableSkills();
const cards = handcardAreaItem.cards; let cards = handcardAreaItem.cards;
const toRemove = []; const toRemove = [];
for (let c of cards) { for (let c of cards) {
toRemove.push(c.cid); toRemove.push(c.cid);

View File

@ -224,13 +224,21 @@ Window {
title: realMainWin.title title: realMainWin.title
informativeText: qsTr("Are you sure to exit?") informativeText: qsTr("Are you sure to exit?")
buttons: MessageDialog.Ok | MessageDialog.Cancel buttons: MessageDialog.Ok | MessageDialog.Cancel
onAccepted: { onButtonClicked: function (button, role) {
mainWindow.closing = true; switch (button) {
config.winWidth = width; case MessageDialog.Ok: {
config.winHeight = height; mainWindow.closing = true;
config.saveConf(); config.winWidth = width;
Backend.quitLobby(false); config.winHeight = height;
realMainWin.close(); config.saveConf();
Backend.quitLobby(false);
realMainWin.close();
break;
}
case MessageDialog.Cancel: {
exitMessageDialog.close();
}
}
} }
} }