mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
5628e67a78
* better general card item * translation for UI * optimize size of general card PNGs * make overviews 'singleton' (only create once) * background, small bug fix * init & lobby's roomlist * gitignore for win deploy, fonts
50 lines
1.0 KiB
QML
50 lines
1.0 KiB
QML
import QtQuick 2.15
|
|
import QtQuick.Layouts 1.15
|
|
import QtQuick.Controls 2.0
|
|
import "RoomElement"
|
|
|
|
Item {
|
|
id: root
|
|
|
|
property bool loaded: false
|
|
|
|
ListView {
|
|
width: Math.floor(root.width / 98) * 98
|
|
height: parent.height
|
|
anchors.centerIn: parent
|
|
ScrollBar.vertical: ScrollBar {}
|
|
model: ListModel {
|
|
id: packages
|
|
}
|
|
|
|
delegate: ColumnLayout {
|
|
Text { text: Backend.translate(name) }
|
|
GridLayout {
|
|
columns: root.width / 98
|
|
Repeater {
|
|
model: JSON.parse(Backend.callLuaFunction("GetGenerals", [name]))
|
|
GeneralCardItem {
|
|
autoBack: false
|
|
name: modelData
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Button {
|
|
text: Backend.translate("Quit")
|
|
anchors.right: parent.right
|
|
onClicked: {
|
|
mainStack.pop();
|
|
}
|
|
}
|
|
|
|
function loadPackages() {
|
|
if (loaded) return;
|
|
let packs = JSON.parse(Backend.callLuaFunction("GetAllGeneralPack", []));
|
|
packs.forEach((name) => packages.append({ name: name }));
|
|
loaded = true;
|
|
}
|
|
}
|