补完反选按钮(顺便性能up) (#390)

This commit is contained in:
notify 2024-10-21 14:47:12 +08:00 committed by GitHub
parent f0ffd68ff2
commit 0233746ead
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 17 deletions

View File

@ -326,6 +326,7 @@ Item {
dashboard.disableAllCards();
dashboard.disableSkills();
dashboard.pending_skill = "";
// dashboard.retractAllPiles();
for (let i = 0; i < photoModel.count; i++) {
@ -451,11 +452,11 @@ Item {
if (dashboard.handcardArea.length <= 15) {
return false;
}
if (roomScene.state === "notactive"
|| roomScene.state === "replying") {
return false;
const cards = dashboard.handcardArea.cards;
for (const card in cards) {
if (card.selectable) return true;
}
return true;
return false;
}
onClicked: roomScene.startCheat("../RoomElement/ChooseHandcard");
}
@ -464,7 +465,10 @@ Item {
text: luatr("Revert Selection")
textFont.pixelSize: 28
enabled: dashboard.pending_skill !== ""
onClicked: dashboard.revertSelection();
onClicked: //dashboard.revertSelection();
{
lcall("RevertSelection");
}
}
// MetroButton {
// text: luatr("Trust")

View File

@ -91,17 +91,6 @@ RowLayout {
}
}
function getSelectedCard() {
if (pending_skill !== "") {
return JSON.stringify({
skill: pending_skill,
subcards: pendings
});
} else {
return selected_card;
}
}
function deactivateSkillButton() {
for (let i = 0; i < skillButtons.count; i++) {
let item = skillButtons.itemAt(i);
@ -209,6 +198,8 @@ RowLayout {
break;
}
}
})
});
pending_skill = lcall("GetPendingSkill");
}
}