修安卓退出框(感谢板神)
进大厅/出大厅时也保存配置信息
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();
}
mainWindow.busy = false;
config.saveConf();
}
callbacks["EnterRoom"] = (jsonData) => {

View File

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

View File

@ -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);

View File

@ -224,13 +224,21 @@ Window {
title: realMainWin.title
informativeText: qsTr("Are you sure to exit?")
buttons: MessageDialog.Ok | MessageDialog.Cancel
onAccepted: {
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();
}
}
}
}