FreeKill/Fk/Cheat/GeneralDetail.qml
Nyutanislavsky d0913e42ce
Heg (#254)
1. 修复木马、真名无懈可击
2. 增加亮将、暗将时机
3. 增加武将珠联璧合关系
4. 增加武将选择框禁止替换
5. 增加变换武将不改变体力上限
6. 增加亮将禁止、不计入距离和座次的MarkEnum,相应的player函数
7. 状态技默认锁定技
8. 修复拼点
9. 增加出牌阶段亮将技能
10. 增加暗置武将函数

---------

Signed-off-by: Mechanel <nyutanislavsky@qq.com>
2023-08-24 21:37:06 +08:00

61 lines
1.5 KiB
QML

// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Flickable {
id: root
anchors.fill: parent
property var extra_data: ({})
signal finish()
contentHeight: details.height
ScrollBar.vertical: ScrollBar {}
ColumnLayout {
id: details
width: parent.width - 40
x: 20
TextEdit {
id: skillDesc
Layout.fillWidth: true
font.pixelSize: 18
readOnly: true
selectByKeyboard: true
selectByMouse: false
wrapMode: TextEdit.WordWrap
textFormat: TextEdit.RichText
}
}
onExtra_dataChanged: {
if (!extra_data.generals) return;
skillDesc.text = "";
extra_data.generals.forEach((g) => {
const data = JSON.parse(Backend.callLuaFunction("GetGeneralDetail", [g]));
skillDesc.append(Backend.translate(data.kingdom) + " " + Backend.translate(g) + " " + data.hp + "/" + data.maxHp);
if (data.companions.length > 0){
let ret = '';
ret += "<font color=\"slategrey\"><b>" + Backend.translate("Companions") + "</b>: ";
data.companions.forEach(t => {
ret += Backend.translate(t) + ' '
});
skillDesc.append(ret)
}
data.skill.forEach(t => {
skillDesc.append("<b>" + Backend.translate(t.name) + "</b>: " + t.description)
});
data.related_skill.forEach(t => {
skillDesc.append("<font color=\"purple\"><b>" + Backend.translate(t.name) + "</b>: " + t.description + "</font>")
});
skillDesc.append("\n");
});
}
}