2023-05-18 23:45:21 +00:00
|
|
|
// 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
|
2023-12-12 11:22:18 +00:00
|
|
|
color: "#E4D5A0"
|
2023-05-18 23:45:21 +00:00
|
|
|
|
|
|
|
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) => {
|
2024-01-24 19:23:29 +00:00
|
|
|
const data = lcall("GetGeneralDetail", g);
|
|
|
|
skillDesc.append(luatr(data.kingdom) + " " + luatr(g) + " " + data.hp +
|
|
|
|
"/" + data.maxHp);
|
2023-08-24 13:37:06 +00:00
|
|
|
if (data.companions.length > 0){
|
|
|
|
let ret = '';
|
2024-01-24 19:23:29 +00:00
|
|
|
ret +="<font color=\"slategrey\"><b>" + luatr("Companions") + "</b>: ";
|
2023-08-24 13:37:06 +00:00
|
|
|
data.companions.forEach(t => {
|
2024-01-24 19:23:29 +00:00
|
|
|
ret += luatr(t) + ' '
|
2023-08-24 13:37:06 +00:00
|
|
|
});
|
|
|
|
skillDesc.append(ret)
|
|
|
|
}
|
2023-05-18 23:45:21 +00:00
|
|
|
data.skill.forEach(t => {
|
2024-01-24 19:23:29 +00:00
|
|
|
skillDesc.append("<b>" + luatr(t.name) + "</b>: " + t.description)
|
2023-05-18 23:45:21 +00:00
|
|
|
});
|
|
|
|
data.related_skill.forEach(t => {
|
2024-01-24 19:23:29 +00:00
|
|
|
skillDesc.append("<font color=\"purple\"><b>" + luatr(t.name) +
|
|
|
|
"</b>: " + t.description + "</font>")
|
2023-05-18 23:45:21 +00:00
|
|
|
});
|
|
|
|
skillDesc.append("\n");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|