mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 03:32:34 +08:00
fa8335a330
TODOS ======== 手气卡、重铸、本轮跳过无懈 ---------- 禁用理由、Target脸上提示(可烈弓) ---------- **修bug** --------- Co-authored-by: YoumuKon <38815081+YoumuKon@users.noreply.github.com>
41 lines
944 B
QML
41 lines
944 B
QML
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick
|
|
import Fk
|
|
import Fk.Pages
|
|
|
|
MetroButton {
|
|
id: root
|
|
property string skill
|
|
property var choices: []
|
|
property var all_choices: []
|
|
property string default_choice
|
|
property string answer: default_choice
|
|
property bool detailed: false
|
|
|
|
text: Util.processPrompt(answer)
|
|
|
|
onAnswerChanged: {
|
|
if (!answer) return;
|
|
lcall("UpdateRequestUI", "Interaction", "1", "update", answer);
|
|
}
|
|
|
|
onClicked: {
|
|
if (detailed) {
|
|
roomScene.popupBox.sourceComponent =
|
|
Qt.createComponent("../RoomElement/DetailedChoiceBox.qml");
|
|
} else {
|
|
roomScene.popupBox.sourceComponent =
|
|
Qt.createComponent("../RoomElement/ChoiceBox.qml");
|
|
}
|
|
const box = roomScene.popupBox.item;
|
|
box.options = choices;
|
|
box.all_options = all_choices;
|
|
box.skill_name = skill;
|
|
box.accepted.connect(() => {
|
|
answer = all_choices[box.result];
|
|
});
|
|
}
|
|
|
|
}
|