补完反选按钮(顺便性能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.disableAllCards();
dashboard.disableSkills(); dashboard.disableSkills();
dashboard.pending_skill = "";
// dashboard.retractAllPiles(); // dashboard.retractAllPiles();
for (let i = 0; i < photoModel.count; i++) { for (let i = 0; i < photoModel.count; i++) {
@ -451,11 +452,11 @@ Item {
if (dashboard.handcardArea.length <= 15) { if (dashboard.handcardArea.length <= 15) {
return false; return false;
} }
if (roomScene.state === "notactive" const cards = dashboard.handcardArea.cards;
|| roomScene.state === "replying") { for (const card in cards) {
return false; if (card.selectable) return true;
} }
return true; return false;
} }
onClicked: roomScene.startCheat("../RoomElement/ChooseHandcard"); onClicked: roomScene.startCheat("../RoomElement/ChooseHandcard");
} }
@ -464,7 +465,10 @@ Item {
text: luatr("Revert Selection") text: luatr("Revert Selection")
textFont.pixelSize: 28 textFont.pixelSize: 28
enabled: dashboard.pending_skill !== "" enabled: dashboard.pending_skill !== ""
onClicked: dashboard.revertSelection(); onClicked: //dashboard.revertSelection();
{
lcall("RevertSelection");
}
} }
// MetroButton { // MetroButton {
// text: luatr("Trust") // 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() { function deactivateSkillButton() {
for (let i = 0; i < skillButtons.count; i++) { for (let i = 0; i < skillButtons.count; i++) {
let item = skillButtons.itemAt(i); let item = skillButtons.itemAt(i);
@ -209,6 +198,8 @@ RowLayout {
break; break;
} }
} }
}) });
pending_skill = lcall("GetPendingSkill");
} }
} }