2022-09-14 05:01:10 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Controls
|
2022-04-15 10:37:20 +00:00
|
|
|
import "RoomElement"
|
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
property bool loaded: false
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
ListView {
|
|
|
|
width: Math.floor(root.width / 98) * 98
|
|
|
|
height: parent.height
|
|
|
|
anchors.centerIn: parent
|
|
|
|
ScrollBar.vertical: ScrollBar {}
|
|
|
|
model: ListModel {
|
|
|
|
id: packages
|
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
delegate: ColumnLayout {
|
|
|
|
Text { text: Backend.translate(name) }
|
|
|
|
GridLayout {
|
|
|
|
columns: root.width / 98
|
|
|
|
Repeater {
|
|
|
|
model: JSON.parse(Backend.callLuaFunction("GetGenerals", [name]))
|
|
|
|
GeneralCardItem {
|
|
|
|
autoBack: false
|
2022-05-01 10:37:13 +00:00
|
|
|
name: modelData
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Button {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Quit")
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
onClicked: {
|
|
|
|
mainStack.pop();
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
function loadPackages() {
|
|
|
|
if (loaded) return;
|
|
|
|
let packs = JSON.parse(Backend.callLuaFunction("GetAllGeneralPack", []));
|
|
|
|
packs.forEach((name) => packages.append({ name: name }));
|
|
|
|
loaded = true;
|
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|