mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
be03b04ef0
- 修复了虚拟牌点数相加的bug - 修复cleaner出错直接爆炸 - QML的代码将宽度控制到80以内
84 lines
1.5 KiB
QML
84 lines
1.5 KiB
QML
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick
|
|
import Fk
|
|
import Fk.RoomElement
|
|
|
|
Item {
|
|
property bool sealed: parent.sealedSlots.includes("JudgeSlot")
|
|
|
|
Image {
|
|
visible: sealed
|
|
x: -6; y: 8; z: 9
|
|
source: SkinBank.DELAYED_TRICK_DIR + "sealed"
|
|
height: 28
|
|
fillMode: Image.PreserveAspectFit
|
|
}
|
|
|
|
InvisibleCardArea {
|
|
id: area
|
|
checkExisting: true
|
|
}
|
|
|
|
ListModel {
|
|
id: cards
|
|
}
|
|
|
|
Row {
|
|
id: grid
|
|
anchors.fill: parent
|
|
spacing: -4
|
|
|
|
Repeater {
|
|
model: cards
|
|
|
|
Image {
|
|
height: 55 * 0.8
|
|
width: 47 * 0.8
|
|
source: SkinBank.getDelayedTrickPicture(name)
|
|
}
|
|
}
|
|
}
|
|
|
|
function add(inputs)
|
|
{
|
|
area.add(inputs);
|
|
if (!(inputs instanceof Array)) {
|
|
inputs = [inputs];
|
|
}
|
|
inputs.forEach(card => {
|
|
const v = lcall("GetVirtualEquip", parent.playerid, card.cid);
|
|
if (v !== null) {
|
|
cards.append(v);
|
|
} else {
|
|
cards.append({
|
|
name: card.name,
|
|
cid: card.cid
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function remove(outputs)
|
|
{
|
|
const result = area.remove(outputs);
|
|
for (let i = 0; i < result.length; i++) {
|
|
const item = result[i];
|
|
for (let j = 0; j < cards.count; j++) {
|
|
const icon = cards.get(j);
|
|
if (icon.cid === item.cid) {
|
|
cards.remove(j, 1);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
function updateCardPosition(animated)
|
|
{
|
|
area.updateCardPosition(animated);
|
|
}
|
|
}
|