mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
9a9fc9c105
杀光侧栏 只留战报一个 Qml标记,以及一个割圆demo 自由选将增加搜索功能 room:setBanner,相当于公共标记了,客户端可以Fk:currentRoom():getBanner拿(当然服务端也可) 改掉两个很蠢的命名
61 lines
1.4 KiB
QML
61 lines
1.4 KiB
QML
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Controls
|
|
import Qt5Compat.GraphicalEffects
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
anchors.fill: parent
|
|
property var extra_data: ({}) // unused
|
|
signal finish()
|
|
property var cards: []
|
|
|
|
Text {
|
|
text: Backend.translate("Handcard selector")
|
|
Layout.fillWidth: true
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pixelSize: 18
|
|
color: "#E4D5A0"
|
|
}
|
|
|
|
GridView {
|
|
id: cardsList
|
|
cellWidth: 93 * 0.9 + 4
|
|
cellHeight: 130 * 0.9 + 4
|
|
Layout.preferredWidth: root.width - root.width % 88
|
|
Layout.fillHeight: true
|
|
Layout.alignment: Qt.AlignHCenter
|
|
clip: true
|
|
|
|
model: cards
|
|
|
|
delegate: CardItem {
|
|
width: 93 * 0.9
|
|
height: 130 * 0.9
|
|
chosenInBox: modelData.chosen
|
|
onClicked: {
|
|
const clist = roomScene.dashboard.handcardArea.cards;
|
|
for (let cd of clist) {
|
|
if (cd.cid == cid) {
|
|
cd.selected = !cd.selected;
|
|
cd.clicked();
|
|
finish();
|
|
}
|
|
}
|
|
}
|
|
Component.onCompleted: {
|
|
setData(JSON.parse(Backend.callLuaFunction("GetCardData", [modelData.cid])));
|
|
}
|
|
}
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
cards = roomScene.dashboard.handcardArea.cards
|
|
.filter(c => c.selectable)
|
|
.map(c => { return { cid: c.cid, chosen: c.selected }; });
|
|
}
|
|
}
|
|
|