2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-09-14 05:01:10 +00:00
|
|
|
import QtQuick
|
|
|
|
import Qt5Compat.GraphicalEffects
|
|
|
|
import QtQuick.Controls
|
2023-05-19 02:08:36 +00:00
|
|
|
import Fk
|
|
|
|
import Fk.PhotoElement
|
2022-03-23 11:40:28 +00:00
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
|
|
|
width: 175
|
|
|
|
height: 233
|
2022-09-14 05:01:10 +00:00
|
|
|
scale: 0.75
|
2023-04-09 03:44:19 +00:00
|
|
|
property int playerid: 0
|
2022-04-30 07:27:56 +00:00
|
|
|
property string general: ""
|
2023-04-19 06:07:16 +00:00
|
|
|
property string deputyGeneral: ""
|
2022-04-30 07:27:56 +00:00
|
|
|
property string screenName: ""
|
|
|
|
property string role: "unknown"
|
|
|
|
property string kingdom: "qun"
|
|
|
|
property string netstate: "online"
|
|
|
|
property alias handcards: handcardAreaItem.length
|
|
|
|
property int maxHp: 0
|
|
|
|
property int hp: 0
|
2023-04-13 12:17:39 +00:00
|
|
|
property int shield: 0
|
2022-04-30 07:27:56 +00:00
|
|
|
property int seatNumber: 1
|
2022-12-20 04:51:54 +00:00
|
|
|
property bool dead: false
|
2022-04-30 07:27:56 +00:00
|
|
|
property bool dying: false
|
|
|
|
property bool faceup: true
|
|
|
|
property bool chained: false
|
2023-03-14 12:48:08 +00:00
|
|
|
property int drank: 0
|
2022-04-30 07:27:56 +00:00
|
|
|
property bool isOwner: false
|
2022-12-20 04:51:54 +00:00
|
|
|
property int distance: 0
|
2022-04-30 07:27:56 +00:00
|
|
|
property string status: "normal"
|
2023-05-28 10:45:37 +00:00
|
|
|
property int maxCard: 0
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
property alias handcardArea: handcardAreaItem
|
|
|
|
property alias equipArea: equipAreaItem
|
2023-02-15 11:54:35 +00:00
|
|
|
property alias markArea: markAreaItem
|
2022-04-30 07:27:56 +00:00
|
|
|
property alias delayedTrickArea: delayedTrickAreaItem
|
2023-02-21 05:44:24 +00:00
|
|
|
property alias specialArea: specialAreaItem
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
property alias progressBar: progressBar
|
|
|
|
property alias progressTip: progressTip.text
|
|
|
|
|
|
|
|
property bool selectable: false
|
|
|
|
property bool selected: false
|
|
|
|
|
2022-05-01 10:37:13 +00:00
|
|
|
property bool playing: false
|
|
|
|
onPlayingChanged: {
|
|
|
|
if (playing) {
|
|
|
|
animPlaying.start();
|
|
|
|
} else {
|
|
|
|
animPlaying.stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Behavior on x {
|
|
|
|
NumberAnimation { duration: 600; easing.type: Easing.InOutQuad }
|
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on y {
|
|
|
|
NumberAnimation { duration: 600; easing.type: Easing.InOutQuad }
|
|
|
|
}
|
|
|
|
|
|
|
|
states: [
|
|
|
|
State { name: "normal" },
|
2022-05-01 10:37:13 +00:00
|
|
|
State { name: "candidate" }
|
|
|
|
//State { name: "playing" }
|
2022-04-30 07:27:56 +00:00
|
|
|
//State { name: "responding" },
|
|
|
|
//State { name: "sos" }
|
|
|
|
]
|
|
|
|
|
|
|
|
state: "normal"
|
|
|
|
transitions: [
|
|
|
|
Transition {
|
|
|
|
from: "*"; to: "normal"
|
|
|
|
ScriptAction {
|
|
|
|
script: {
|
|
|
|
animSelectable.stop();
|
|
|
|
animSelected.stop();
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Transition {
|
|
|
|
from: "*"; to: "candidate"
|
|
|
|
ScriptAction {
|
|
|
|
script: {
|
|
|
|
animSelectable.start();
|
|
|
|
animSelected.start();
|
2022-03-28 14:24:30 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-28 14:24:30 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
PixmapAnimation {
|
|
|
|
id: animPlaying
|
2023-02-21 05:44:24 +00:00
|
|
|
source: SkinBank.PIXANIM_DIR + "playing"
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
loop: true
|
|
|
|
scale: 1.1
|
2022-05-01 10:37:13 +00:00
|
|
|
visible: root.playing
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PixmapAnimation {
|
|
|
|
id: animSelected
|
2023-02-21 05:44:24 +00:00
|
|
|
source: SkinBank.PIXANIM_DIR + "selected"
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
loop: true
|
|
|
|
scale: 1.1
|
|
|
|
visible: root.state === "candidate" && selected
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: back
|
2023-04-04 18:21:59 +00:00
|
|
|
source: SkinBank.getPhotoBack(root.kingdom)
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: generalName
|
|
|
|
x: 5
|
|
|
|
y: 28
|
2022-05-01 10:37:13 +00:00
|
|
|
font.family: fontLibian.name
|
2022-04-30 07:27:56 +00:00
|
|
|
font.pixelSize: 22
|
2023-04-19 06:07:16 +00:00
|
|
|
opacity: 0.9
|
2022-04-30 07:27:56 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
lineHeight: 18
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
color: "white"
|
|
|
|
width: 24
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: ""
|
|
|
|
}
|
|
|
|
|
2023-02-27 02:23:48 +00:00
|
|
|
Text {
|
|
|
|
id: longGeneralName
|
|
|
|
x: 5
|
|
|
|
y: 6
|
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 22
|
|
|
|
rotation: 90
|
|
|
|
transformOrigin: Item.BottomLeft
|
2023-04-19 06:07:16 +00:00
|
|
|
opacity: 0.9
|
2023-02-27 02:23:48 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
lineHeight: 18
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
color: "white"
|
|
|
|
text: ""
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
HpBar {
|
|
|
|
id: hp
|
|
|
|
x: 8
|
|
|
|
value: root.hp
|
|
|
|
maxValue: root.maxHp
|
2023-04-13 12:17:39 +00:00
|
|
|
shieldNum: root.shield
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 36
|
|
|
|
}
|
|
|
|
|
2023-04-19 06:07:16 +00:00
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
width: 138
|
|
|
|
height: 222
|
|
|
|
visible: false
|
2023-04-19 06:07:16 +00:00
|
|
|
id: generalImgItem
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: generalImage
|
|
|
|
width: deputyGeneral ? parent.width / 2 : parent.width
|
|
|
|
height: parent.height
|
|
|
|
smooth: true
|
|
|
|
fillMode: Image.PreserveAspectCrop
|
|
|
|
source: (general != "") ? SkinBank.getGeneralPicture(general) : ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: deputyGeneralImage
|
|
|
|
anchors.left: generalImage.right
|
|
|
|
width: parent.width / 2
|
|
|
|
height: parent.height
|
|
|
|
smooth: true
|
|
|
|
fillMode: Image.PreserveAspectCrop
|
|
|
|
source: (deputyGeneral != "") ?
|
|
|
|
SkinBank.getGeneralPicture(deputyGeneral) : ""
|
|
|
|
}
|
2023-03-14 12:48:08 +00:00
|
|
|
|
2023-04-19 06:07:16 +00:00
|
|
|
Image {
|
|
|
|
id: deputySplit
|
|
|
|
source: SkinBank.PHOTO_DIR + "deputy-split"
|
|
|
|
opacity: deputyGeneral ? 1 : 0
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: deputyGeneralName
|
|
|
|
anchors.left: generalImage.right
|
|
|
|
anchors.leftMargin: -14
|
|
|
|
y: 23
|
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 22
|
|
|
|
opacity: 0.9
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
lineHeight: 18
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
color: "white"
|
|
|
|
width: 24
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: Backend.translate(deputyGeneral)
|
|
|
|
style: Text.Outline
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: photoMask
|
|
|
|
x: 31
|
|
|
|
y: 5
|
|
|
|
width: 138
|
|
|
|
height: 222
|
|
|
|
radius: 8
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
|
|
|
OpacityMask {
|
|
|
|
anchors.fill: photoMask
|
2023-04-19 06:07:16 +00:00
|
|
|
source: generalImgItem
|
2022-04-30 07:27:56 +00:00
|
|
|
maskSource: photoMask
|
|
|
|
}
|
|
|
|
|
|
|
|
Colorize {
|
|
|
|
anchors.fill: photoMask
|
2023-04-19 06:07:16 +00:00
|
|
|
source: generalImgItem
|
2022-04-30 07:27:56 +00:00
|
|
|
saturation: 0
|
2022-12-20 04:51:54 +00:00
|
|
|
visible: root.dead
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
2023-03-14 12:48:08 +00:00
|
|
|
Rectangle {
|
|
|
|
x: 31
|
|
|
|
y: 5
|
|
|
|
width: 138
|
|
|
|
height: 222
|
|
|
|
radius: 8
|
|
|
|
|
|
|
|
visible: root.drank > 0
|
|
|
|
color: "red"
|
|
|
|
opacity: 0.4 + Math.log(root.drank) * 0.12
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Image {
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottomMargin: 8
|
|
|
|
anchors.rightMargin: 4
|
|
|
|
source: SkinBank.PHOTO_DIR + (isOwner ? "owner" : "ready")
|
|
|
|
visible: screenName != "" && !roomScene.isStarted
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
visible: equipAreaItem.length > 0
|
|
|
|
source: SkinBank.PHOTO_DIR + "equipbg"
|
|
|
|
x: 31
|
|
|
|
y: 121
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
source: root.status != "normal" ? SkinBank.STATUS_DIR + root.status : ""
|
|
|
|
x: -6
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: turnedOver
|
|
|
|
visible: !root.faceup
|
|
|
|
source: SkinBank.PHOTO_DIR + "faceturned"
|
|
|
|
x: 29; y: 5
|
|
|
|
}
|
|
|
|
|
|
|
|
EquipArea {
|
|
|
|
id: equipAreaItem
|
|
|
|
|
|
|
|
x: 31
|
|
|
|
y: 139
|
|
|
|
}
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
Item {
|
|
|
|
id: specialAreaItem
|
|
|
|
|
|
|
|
x: 31
|
|
|
|
y: 139
|
|
|
|
|
|
|
|
InvisibleCardArea {
|
|
|
|
id: specialContainer
|
|
|
|
// checkExisting: true
|
|
|
|
}
|
|
|
|
|
|
|
|
function updatePileInfo(areaName) {
|
|
|
|
let data = JSON.parse(Backend.callLuaFunction("GetPile", [root.playerid, areaName]));
|
|
|
|
if (data.length === 0) {
|
|
|
|
root.markArea.removeMark(areaName);
|
|
|
|
} else {
|
2023-03-18 07:34:42 +00:00
|
|
|
root.markArea.setMark(areaName, data.length.toString());
|
2023-02-21 05:44:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function add(inputs, areaName) {
|
|
|
|
updatePileInfo(areaName);
|
|
|
|
specialContainer.add(inputs);
|
|
|
|
}
|
|
|
|
|
|
|
|
function remove(inputs, areaName) {
|
|
|
|
updatePileInfo(areaName);
|
|
|
|
return specialContainer.remove(inputs);
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateCardPosition(a) {
|
|
|
|
specialContainer.updateCardPosition(a);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-15 11:54:35 +00:00
|
|
|
MarkArea {
|
|
|
|
id: markAreaItem
|
|
|
|
|
|
|
|
anchors.bottom: equipAreaItem.top
|
|
|
|
anchors.bottomMargin: -18
|
|
|
|
x: 31
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Image {
|
|
|
|
id: chain
|
|
|
|
visible: root.chained
|
|
|
|
source: SkinBank.PHOTO_DIR + "chain"
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
y: 72
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
// id: saveme
|
2022-12-20 04:51:54 +00:00
|
|
|
visible: root.dead || root.dying
|
|
|
|
source: SkinBank.DEATH_DIR + (root.dead ? root.role : "saveme")
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.centerIn: photoMask
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: netstat
|
|
|
|
source: SkinBank.STATE_DIR + root.netstate
|
|
|
|
x: photoMask.x
|
|
|
|
y: photoMask.y
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: handcardNum
|
|
|
|
source: SkinBank.PHOTO_DIR + "handcard"
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: -6
|
|
|
|
x: -6
|
2022-03-30 06:14:40 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Text {
|
2023-05-28 10:45:37 +00:00
|
|
|
text: (root.maxCard === root.hp) ? (root.handcards) : (root.handcards + "/" + root.maxCard)
|
2022-05-01 10:37:13 +00:00
|
|
|
font.family: fontLibian.name
|
2023-05-28 10:45:37 +00:00
|
|
|
font.pixelSize: root.maxCard === root.hp ? 32 : 27
|
2022-04-30 07:27:56 +00:00
|
|
|
//font.weight: 30
|
|
|
|
color: "white"
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 4
|
|
|
|
style: Text.Outline
|
2022-03-30 06:14:40 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
2023-03-18 07:34:42 +00:00
|
|
|
TapHandler {
|
2023-04-09 03:44:19 +00:00
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.NoButton
|
|
|
|
gesturePolicy: TapHandler.WithinBounds
|
|
|
|
|
|
|
|
onTapped: (p, btn) => {
|
|
|
|
if (btn === Qt.LeftButton || btn === Qt.NoButton) {
|
|
|
|
if (parent.state != "candidate" || !parent.selectable) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
parent.selected = !parent.selected;
|
|
|
|
} else if (btn === Qt.RightButton) {
|
|
|
|
parent.showDetail();
|
2023-02-21 05:44:24 +00:00
|
|
|
}
|
2023-04-09 03:44:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onLongPressed: {
|
|
|
|
parent.showDetail();
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RoleComboBox {
|
|
|
|
id: role
|
|
|
|
value: root.role
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -4
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -4
|
|
|
|
}
|
|
|
|
|
2023-04-04 17:05:06 +00:00
|
|
|
LimitSkillArea {
|
|
|
|
id: limitSkills
|
2023-04-23 13:10:07 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.topMargin: role.height + 2
|
|
|
|
anchors.rightMargin: 30
|
2023-04-04 17:05:06 +00:00
|
|
|
}
|
|
|
|
|
2023-03-18 07:34:42 +00:00
|
|
|
GlowText {
|
|
|
|
id: playerName
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 2
|
|
|
|
|
|
|
|
font.pixelSize: 16
|
|
|
|
text: screenName
|
|
|
|
|
|
|
|
glow.radius: 8
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Image {
|
|
|
|
visible: root.state === "candidate" && !selectable && !selected
|
|
|
|
source: SkinBank.PHOTO_DIR + "disable"
|
|
|
|
x: 31; y: -21
|
|
|
|
}
|
|
|
|
|
|
|
|
GlowText {
|
|
|
|
id: seatNum
|
|
|
|
visible: !progressBar.visible
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: -32
|
|
|
|
property var seatChr: ["一", "二", "三", "四", "五", "六", "七", "八"]
|
2022-05-01 10:37:13 +00:00
|
|
|
font.family: fontLi2.name
|
2022-04-30 07:27:56 +00:00
|
|
|
font.pixelSize: 32
|
|
|
|
text: seatChr[seatNumber - 1]
|
|
|
|
|
|
|
|
glow.color: "brown"
|
|
|
|
glow.spread: 0.2
|
|
|
|
glow.radius: 8
|
2022-09-14 05:01:10 +00:00
|
|
|
//glow.samples: 12
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SequentialAnimation {
|
|
|
|
id: trembleAnimation
|
|
|
|
running: false
|
|
|
|
PropertyAnimation {
|
|
|
|
target: root
|
|
|
|
property: "x"
|
|
|
|
to: root.x - 20
|
|
|
|
easing.type: Easing.InQuad
|
|
|
|
duration: 100
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
PropertyAnimation {
|
|
|
|
target: root
|
|
|
|
property: "x"
|
|
|
|
to: root.x
|
|
|
|
easing.type: Easing.OutQuad
|
|
|
|
duration: 100
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2023-02-26 08:51:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
function tremble() {
|
|
|
|
trembleAnimation.start()
|
|
|
|
}
|
|
|
|
|
|
|
|
ProgressBar {
|
|
|
|
id: progressBar
|
|
|
|
width: parent.width
|
|
|
|
height: 4
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: -4
|
|
|
|
from: 0.0
|
|
|
|
to: 100.0
|
|
|
|
|
|
|
|
visible: false
|
|
|
|
NumberAnimation on value {
|
|
|
|
running: progressBar.visible
|
|
|
|
from: 100.0
|
|
|
|
to: 0.0
|
|
|
|
duration: config.roomTimeout * 1000
|
|
|
|
|
|
|
|
onFinished: {
|
|
|
|
progressBar.visible = false;
|
|
|
|
root.progressTip = "";
|
|
|
|
}
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-14 10:22:00 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Image {
|
|
|
|
anchors.top: progressBar.bottom
|
|
|
|
anchors.topMargin: 1
|
|
|
|
source: SkinBank.PHOTO_DIR + "control/tip"
|
|
|
|
visible: progressTip.text != ""
|
|
|
|
Text {
|
|
|
|
id: progressTip
|
2022-05-01 10:37:13 +00:00
|
|
|
font.family: fontLibian.name
|
2022-04-30 07:27:56 +00:00
|
|
|
font.pixelSize: 18
|
|
|
|
x: 18
|
|
|
|
color: "white"
|
|
|
|
text: ""
|
2022-04-02 07:55:01 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PixmapAnimation {
|
|
|
|
id: animSelectable
|
2023-02-21 05:44:24 +00:00
|
|
|
source: SkinBank.PIXANIM_DIR + "selectable"
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
loop: true
|
|
|
|
visible: root.state === "candidate" && selectable
|
|
|
|
}
|
|
|
|
|
|
|
|
InvisibleCardArea {
|
|
|
|
id: handcardAreaItem
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
DelayedTrickArea {
|
|
|
|
id: delayedTrickAreaItem
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 8
|
|
|
|
}
|
|
|
|
|
|
|
|
InvisibleCardArea {
|
|
|
|
id: defaultArea
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
Rectangle {
|
|
|
|
id: chat
|
|
|
|
color: "#F2ECD7"
|
|
|
|
radius: 4
|
|
|
|
opacity: 0
|
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height + 8
|
|
|
|
property string text: ""
|
|
|
|
visible: false
|
|
|
|
Text {
|
|
|
|
width: parent.width - 8
|
|
|
|
x: 4
|
|
|
|
y: 4
|
|
|
|
text: parent.text
|
|
|
|
wrapMode: Text.WrapAnywhere
|
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
|
|
|
SequentialAnimation {
|
|
|
|
id: chatAnim
|
|
|
|
PropertyAnimation {
|
|
|
|
target: chat
|
|
|
|
property: "opacity"
|
|
|
|
to: 0.9
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
NumberAnimation {
|
|
|
|
duration: 2500
|
|
|
|
}
|
|
|
|
PropertyAnimation {
|
|
|
|
target: chat
|
|
|
|
property: "opacity"
|
|
|
|
to: 0
|
|
|
|
duration: 150
|
|
|
|
}
|
|
|
|
onFinished: chat.visible = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
Rectangle {
|
|
|
|
color: "white"
|
|
|
|
height: 20
|
|
|
|
width: 20
|
|
|
|
visible: distance != 0
|
|
|
|
Text {
|
|
|
|
text: distance
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
onGeneralChanged: {
|
|
|
|
if (!roomScene.isStarted) return;
|
2023-02-27 02:23:48 +00:00
|
|
|
let text = Backend.translate(general);
|
|
|
|
if (text.length > 6) {
|
|
|
|
generalName.text = "";
|
|
|
|
longGeneralName.text = text;
|
|
|
|
} else {
|
|
|
|
generalName.text = text;
|
|
|
|
longGeneralName.text = "";
|
|
|
|
}
|
2023-04-04 18:21:59 +00:00
|
|
|
// let data = JSON.parse(Backend.callLuaFunction("GetGeneralData", [general]));
|
|
|
|
// kingdom = data.kingdom;
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-12-18 04:52:52 +00:00
|
|
|
|
|
|
|
function chat(msg) {
|
|
|
|
chat.text = msg;
|
|
|
|
chat.visible = true;
|
|
|
|
chatAnim.restart();
|
|
|
|
}
|
2023-04-04 17:05:06 +00:00
|
|
|
|
|
|
|
function updateLimitSkill(skill, time) {
|
|
|
|
limitSkills.update(skill, time);
|
|
|
|
}
|
2023-04-09 03:44:19 +00:00
|
|
|
|
|
|
|
function showDetail() {
|
2023-05-19 02:08:36 +00:00
|
|
|
roomScene.startCheat("PlayerDetail", { photo: this });
|
2023-04-09 03:44:19 +00:00
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|