FreeKill/Fk/SkillInteraction/SkillCombo.qml
notify fa8335a330
Some checks failed
Check Whitespace and New Line / check (push) Has been cancelled
Deploy Sphinx documentation to Pages / pages (push) Has been cancelled
UI rewrite (#367)
TODOS
========

手气卡、重铸、本轮跳过无懈
----------

禁用理由、Target脸上提示(可烈弓)
----------

**修bug**

---------

Co-authored-by: YoumuKon <38815081+YoumuKon@users.noreply.github.com>
2024-09-19 00:31:49 +08:00

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];
});
}
}