2022-09-14 05:01:10 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
2022-12-18 04:52:52 +00:00
|
|
|
import "Common"
|
2022-03-23 11:40:28 +00:00
|
|
|
import "RoomElement"
|
|
|
|
import "RoomLogic.js" as Logic
|
2022-12-20 04:51:54 +00:00
|
|
|
import "skin-bank.js" as SkinBank
|
|
|
|
|
2022-03-01 05:18:00 +00:00
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: roomScene
|
|
|
|
|
|
|
|
property int playerNum: 0
|
|
|
|
property var dashboardModel
|
|
|
|
|
|
|
|
property bool isOwner: false
|
|
|
|
property bool isStarted: false
|
|
|
|
|
|
|
|
property alias popupBox: popupBox
|
|
|
|
property alias promptText: prompt.text
|
2022-12-18 04:52:52 +00:00
|
|
|
property alias okCancel: okCancel
|
|
|
|
property alias okButton: okButton
|
|
|
|
property alias cancelButton: cancelButton
|
|
|
|
property alias dynamicCardArea: dynamicCardArea
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
property var selected_targets: []
|
2022-12-18 13:19:35 +00:00
|
|
|
property string responding_card
|
|
|
|
property bool respond_play: false
|
2023-01-16 11:13:07 +00:00
|
|
|
property var extra_data: ({})
|
2022-04-30 07:27:56 +00:00
|
|
|
|
2022-05-01 10:37:13 +00:00
|
|
|
Image {
|
|
|
|
source: AppPath + "/image/gamebg"
|
|
|
|
anchors.fill: parent
|
|
|
|
fillMode: Image.PreserveAspectCrop
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-05-01 10:37:13 +00:00
|
|
|
|
|
|
|
// tmp
|
2022-04-30 07:27:56 +00:00
|
|
|
Button {
|
|
|
|
text: "quit"
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
onClicked: {
|
2022-12-18 04:52:52 +00:00
|
|
|
// ClientInstance.clearPlayers();
|
2022-04-30 07:27:56 +00:00
|
|
|
ClientInstance.notifyServer("QuitRoom", "[]");
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
Button {
|
|
|
|
text: "add robot"
|
|
|
|
visible: dashboardModel.isOwner && !isStarted
|
|
|
|
anchors.centerIn: parent
|
|
|
|
onClicked: {
|
|
|
|
ClientInstance.notifyServer("AddRobot", "[]");
|
2022-03-01 05:18:00 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-09-14 05:01:10 +00:00
|
|
|
Button {
|
|
|
|
text: "test"
|
|
|
|
onClicked: dashboard.expandPile("_equip");
|
|
|
|
}
|
|
|
|
Button {
|
|
|
|
text: "test2"
|
|
|
|
x: 60
|
|
|
|
onClicked: dashboard.retractPile("_equip");
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
states: [
|
|
|
|
State { name: "notactive" }, // Normal status
|
|
|
|
State { name: "playing" }, // Playing cards in playing phase
|
|
|
|
State { name: "responding" }, // all requests need to operate dashboard
|
|
|
|
State { name: "replying" } // requests only operate a popup window
|
|
|
|
]
|
|
|
|
state: "notactive"
|
|
|
|
transitions: [
|
|
|
|
Transition {
|
|
|
|
from: "*"; to: "notactive"
|
|
|
|
ScriptAction {
|
|
|
|
script: {
|
|
|
|
promptText = "";
|
|
|
|
progress.visible = false;
|
|
|
|
okCancel.visible = false;
|
|
|
|
endPhaseButton.visible = false;
|
2022-12-20 13:15:49 +00:00
|
|
|
respond_play = false;
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
if (dashboard.pending_skill !== "")
|
|
|
|
dashboard.stopPending();
|
2022-09-15 03:17:13 +00:00
|
|
|
dashboard.disableAllCards();
|
|
|
|
dashboard.disableSkills();
|
2022-04-30 07:27:56 +00:00
|
|
|
selected_targets = [];
|
|
|
|
|
|
|
|
if (popupBox.item != null) {
|
|
|
|
popupBox.item.finished();
|
|
|
|
}
|
2022-04-02 22:41:55 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Transition {
|
|
|
|
from: "*"; to: "playing"
|
|
|
|
ScriptAction {
|
|
|
|
script: {
|
|
|
|
dashboard.enableCards();
|
2022-09-14 05:01:10 +00:00
|
|
|
dashboard.enableSkills();
|
2022-04-30 07:27:56 +00:00
|
|
|
progress.visible = true;
|
|
|
|
okCancel.visible = true;
|
|
|
|
endPhaseButton.visible = true;
|
2022-12-20 13:15:49 +00:00
|
|
|
respond_play = false;
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Transition {
|
|
|
|
from: "*"; to: "responding"
|
|
|
|
ScriptAction {
|
|
|
|
script: {
|
2022-12-18 13:19:35 +00:00
|
|
|
dashboard.enableCards(responding_card);
|
|
|
|
dashboard.enableSkills(responding_card);
|
2022-04-30 07:27:56 +00:00
|
|
|
progress.visible = true;
|
|
|
|
okCancel.visible = true;
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Transition {
|
|
|
|
from: "*"; to: "replying"
|
|
|
|
ScriptAction {
|
|
|
|
script: {
|
2022-09-14 05:01:10 +00:00
|
|
|
dashboard.disableAllCards();
|
|
|
|
dashboard.disableSkills();
|
2022-04-30 07:27:56 +00:00
|
|
|
progress.visible = true;
|
2022-12-20 13:15:49 +00:00
|
|
|
respond_play = false;
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
/* Layout:
|
|
|
|
* +---------------------+
|
|
|
|
* | Photos, get more |
|
|
|
|
* | in arrangePhotos() |
|
|
|
|
* | tablePile |
|
|
|
|
* | progress,prompt,btn |
|
|
|
|
* +---------------------+
|
|
|
|
* | dashboard |
|
|
|
|
* +---------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: photoModel
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: roomArea
|
|
|
|
width: roomScene.width
|
2022-09-14 05:01:10 +00:00
|
|
|
height: roomScene.height - dashboard.height + 20
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: photos
|
|
|
|
model: photoModel
|
|
|
|
Photo {
|
|
|
|
playerid: model.id
|
|
|
|
general: model.general
|
|
|
|
screenName: model.screenName
|
|
|
|
role: model.role
|
|
|
|
kingdom: model.kingdom
|
|
|
|
netstate: model.netstate
|
|
|
|
maxHp: model.maxHp
|
|
|
|
hp: model.hp
|
|
|
|
seatNumber: model.seatNumber
|
2022-12-20 04:51:54 +00:00
|
|
|
dead: model.dead
|
2022-04-30 07:27:56 +00:00
|
|
|
dying: model.dying
|
|
|
|
faceup: model.faceup
|
|
|
|
chained: model.chained
|
|
|
|
drank: model.drank
|
|
|
|
isOwner: model.isOwner
|
|
|
|
|
|
|
|
onSelectedChanged: {
|
|
|
|
Logic.updateSelectedTargets(playerid, selected);
|
|
|
|
}
|
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
onWidthChanged: Logic.arrangePhotos();
|
|
|
|
onHeightChanged: Logic.arrangePhotos();
|
2022-04-02 07:11:13 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
InvisibleCardArea {
|
|
|
|
id: drawPile
|
|
|
|
x: parent.width / 2
|
|
|
|
y: roomScene.height / 2
|
|
|
|
}
|
2022-04-02 07:11:13 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
TablePile {
|
|
|
|
id: tablePile
|
|
|
|
width: parent.width * 0.6
|
|
|
|
height: 150
|
|
|
|
x: parent.width * 0.2
|
2022-09-14 05:01:10 +00:00
|
|
|
y: parent.height * 0.6 + 20
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
Item {
|
|
|
|
id: dashboardBtn
|
|
|
|
width: childrenRect.width
|
|
|
|
height: childrenRect.height
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
ColumnLayout {
|
|
|
|
MetroButton {
|
|
|
|
text: Backend.translate("Trust")
|
|
|
|
}
|
|
|
|
MetroButton {
|
|
|
|
text: Backend.translate("Sort Cards")
|
|
|
|
}
|
|
|
|
MetroButton {
|
|
|
|
text: Backend.translate("Chat")
|
|
|
|
onClicked: roomDrawer.open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Dashboard {
|
|
|
|
id: dashboard
|
2022-12-18 04:52:52 +00:00
|
|
|
width: roomScene.width - dashboardBtn.width
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.top: roomArea.bottom
|
2022-12-18 04:52:52 +00:00
|
|
|
anchors.left: dashboardBtn.right
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
self.playerid: dashboardModel.id
|
|
|
|
self.general: dashboardModel.general
|
|
|
|
self.screenName: dashboardModel.screenName
|
|
|
|
self.role: dashboardModel.role
|
|
|
|
self.kingdom: dashboardModel.kingdom
|
|
|
|
self.netstate: dashboardModel.netstate
|
|
|
|
self.maxHp: dashboardModel.maxHp
|
|
|
|
self.hp: dashboardModel.hp
|
|
|
|
self.seatNumber: dashboardModel.seatNumber
|
2022-12-20 04:51:54 +00:00
|
|
|
self.dead: dashboardModel.dead
|
2022-04-30 07:27:56 +00:00
|
|
|
self.dying: dashboardModel.dying
|
|
|
|
self.faceup: dashboardModel.faceup
|
|
|
|
self.chained: dashboardModel.chained
|
|
|
|
self.drank: dashboardModel.drank
|
|
|
|
self.isOwner: dashboardModel.isOwner
|
|
|
|
|
|
|
|
onSelectedChanged: {
|
|
|
|
Logic.updateSelectedTargets(self.playerid, selected);
|
|
|
|
}
|
2022-04-02 07:11:13 +00:00
|
|
|
|
2022-09-14 05:01:10 +00:00
|
|
|
onCardSelected: function(card) {
|
2022-04-30 07:27:56 +00:00
|
|
|
Logic.enableTargets(card);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: controls
|
|
|
|
anchors.bottom: dashboard.top
|
2022-09-14 05:01:10 +00:00
|
|
|
anchors.bottomMargin: -60
|
2022-04-30 07:27:56 +00:00
|
|
|
width: roomScene.width
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: prompt
|
|
|
|
visible: progress.visible
|
2022-12-18 04:52:52 +00:00
|
|
|
anchors.top: progress.top
|
|
|
|
anchors.topMargin: -2
|
|
|
|
color: "white"
|
|
|
|
z: 1
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.horizontalCenter: progress.horizontalCenter
|
2022-04-02 07:11:13 +00:00
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
ProgressBar {
|
|
|
|
id: progress
|
|
|
|
width: parent.width * 0.6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: okCancel.top
|
2022-12-18 04:52:52 +00:00
|
|
|
anchors.bottomMargin: 4
|
2022-04-30 07:27:56 +00:00
|
|
|
from: 0.0
|
|
|
|
to: 100.0
|
|
|
|
|
|
|
|
visible: false
|
2022-12-18 04:52:52 +00:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
implicitWidth: 200
|
|
|
|
implicitHeight: 14
|
|
|
|
color: "black"
|
|
|
|
radius: 3
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: Item {
|
|
|
|
implicitWidth: 200
|
|
|
|
implicitHeight: 12
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: progress.visualPosition * parent.width
|
|
|
|
height: parent.height
|
|
|
|
radius: 2
|
|
|
|
color: "red"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
NumberAnimation on value {
|
|
|
|
running: progress.visible
|
|
|
|
from: 100.0
|
|
|
|
to: 0.0
|
|
|
|
duration: config.roomTimeout * 1000
|
|
|
|
|
|
|
|
onFinished: {
|
|
|
|
roomScene.state = "notactive"
|
2022-03-30 06:14:40 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-30 06:14:40 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Row {
|
|
|
|
id: okCancel
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.horizontalCenter: progress.horizontalCenter
|
|
|
|
spacing: 20
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: okButton
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("OK")
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: Logic.doOkButton();
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: cancelButton
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Cancel")
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: Logic.doCancelButton();
|
|
|
|
}
|
2022-03-30 06:14:40 +00:00
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Button {
|
|
|
|
id: endPhaseButton
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("End")
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 40
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 30
|
|
|
|
visible: false;
|
2022-09-15 03:17:13 +00:00
|
|
|
onClicked: Logic.replyToServer("");
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: popupBox
|
2022-09-14 05:01:10 +00:00
|
|
|
z: 999
|
2022-04-30 07:27:56 +00:00
|
|
|
onSourceChanged: {
|
|
|
|
if (item === null)
|
|
|
|
return;
|
|
|
|
item.finished.connect(function(){
|
|
|
|
source = "";
|
|
|
|
});
|
|
|
|
item.widthChanged.connect(function(){
|
|
|
|
popupBox.moveToCenter();
|
|
|
|
});
|
|
|
|
item.heightChanged.connect(function(){
|
|
|
|
popupBox.moveToCenter();
|
|
|
|
});
|
|
|
|
moveToCenter();
|
|
|
|
}
|
2022-03-24 13:23:42 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
function moveToCenter()
|
|
|
|
{
|
|
|
|
item.x = Math.round((roomArea.width - item.width) / 2);
|
|
|
|
item.y = Math.round(roomArea.height * 0.67 - item.height / 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-14 05:01:10 +00:00
|
|
|
function activateSkill(skill_name, pressed) {
|
|
|
|
if (pressed) {
|
|
|
|
dashboard.startPending(skill_name);
|
|
|
|
cancelButton.enabled = true;
|
|
|
|
} else {
|
|
|
|
Logic.doCancelButton();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
Drawer {
|
|
|
|
id: roomDrawer
|
|
|
|
width: parent.width * 0.3
|
|
|
|
height: parent.height
|
|
|
|
dim: false
|
|
|
|
clip: true
|
|
|
|
dragMargin: 0
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
SwipeView {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
interactive: false
|
|
|
|
currentIndex: drawerBar.currentIndex
|
|
|
|
Item {
|
|
|
|
LogEdit {
|
|
|
|
id: log
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
ChatBox {
|
|
|
|
id: chat
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TabBar {
|
|
|
|
id: drawerBar
|
|
|
|
width: roomDrawer.width
|
|
|
|
TabButton {
|
|
|
|
width: roomDrawer.width / 2
|
|
|
|
text: Backend.translate("Log")
|
|
|
|
}
|
|
|
|
TabButton {
|
|
|
|
width: roomDrawer.width / 2
|
|
|
|
text: Backend.translate("Chat")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: dynamicCardArea
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: easyChat
|
|
|
|
width: parent.width
|
|
|
|
height: 28
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
visible: false
|
|
|
|
color: "#040403"
|
|
|
|
radius: 3
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#A6967A"
|
|
|
|
|
|
|
|
TextInput {
|
|
|
|
id: easyChatEdit
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 6
|
|
|
|
color: "white"
|
|
|
|
clip: true
|
|
|
|
font.pixelSize: 14
|
|
|
|
|
|
|
|
onAccepted: {
|
|
|
|
if (text != "") {
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"Chat",
|
|
|
|
JSON.stringify({
|
|
|
|
type: 0,
|
|
|
|
msg: text
|
|
|
|
})
|
|
|
|
);
|
|
|
|
text = "";
|
|
|
|
easyChat.visible = false;
|
|
|
|
easyChatEdit.enabled = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequence: "T"
|
|
|
|
onActivated: {
|
|
|
|
easyChat.visible = true;
|
|
|
|
easyChatEdit.enabled = true;
|
|
|
|
easyChatEdit.forceActiveFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
Shortcut {
|
|
|
|
sequence: "D"
|
|
|
|
property bool show_distance: false
|
|
|
|
onActivated: {
|
|
|
|
show_distance = !show_distance;
|
|
|
|
showDistance(show_distance);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
Shortcut {
|
|
|
|
sequence: "Esc"
|
|
|
|
onActivated: {
|
|
|
|
easyChat.visible = false;
|
|
|
|
easyChatEdit.enabled = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequence: "Return"
|
|
|
|
enabled: okButton.enabled
|
|
|
|
onActivated: Logic.doOkButton();
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequence: "Space"
|
|
|
|
enabled: cancelButton.enabled
|
|
|
|
onActivated: Logic.doCancelButton();
|
|
|
|
}
|
|
|
|
|
|
|
|
function addToChat(pid, raw, msg) {
|
|
|
|
chat.append(msg);
|
|
|
|
let photo = Logic.getPhoto(pid);
|
|
|
|
if (photo === undefined)
|
|
|
|
photo = dashboard.self;
|
|
|
|
photo.chat(raw.msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
function addToLog(msg) {
|
|
|
|
log.append(msg);
|
|
|
|
}
|
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
function showDistance(show) {
|
|
|
|
for (let i = 0; i < photoModel.count; i++) {
|
|
|
|
let item = photos.itemAt(i);
|
|
|
|
if (show) {
|
|
|
|
let dis = Backend.callLuaFunction("DistanceTo",[Self.id, item.playerid]);
|
|
|
|
item.distance = parseInt(dis);
|
|
|
|
} else {
|
|
|
|
item.distance = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Component.onCompleted: {
|
2022-05-01 10:37:13 +00:00
|
|
|
toast.show(Backend.translate("$EnterRoom"));
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
dashboardModel = {
|
|
|
|
id: Self.id,
|
|
|
|
general: Self.avatar,
|
|
|
|
screenName: Self.screenName,
|
|
|
|
role: "unknown",
|
|
|
|
kingdom: "qun",
|
|
|
|
netstate: "online",
|
|
|
|
maxHp: 0,
|
|
|
|
hp: 0,
|
|
|
|
seatNumber: 1,
|
2022-12-20 04:51:54 +00:00
|
|
|
dead: false,
|
2022-04-30 07:27:56 +00:00
|
|
|
dying: false,
|
|
|
|
faceup: true,
|
|
|
|
chained: false,
|
|
|
|
drank: false,
|
|
|
|
isOwner: false
|
|
|
|
}
|
2022-03-24 13:23:42 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
playerNum = config.roomCapacity;
|
|
|
|
|
|
|
|
let i;
|
|
|
|
for (i = 1; i < playerNum; i++) {
|
|
|
|
photoModel.append({
|
|
|
|
id: -1,
|
|
|
|
index: i - 1, // For animating seat swap
|
|
|
|
general: "",
|
|
|
|
screenName: "",
|
|
|
|
role: "unknown",
|
|
|
|
kingdom: "qun",
|
|
|
|
netstate: "online",
|
|
|
|
maxHp: 0,
|
|
|
|
hp: 0,
|
|
|
|
seatNumber: i + 1,
|
2022-12-20 04:51:54 +00:00
|
|
|
dead: false,
|
2022-04-30 07:27:56 +00:00
|
|
|
dying: false,
|
|
|
|
faceup: true,
|
|
|
|
chained: false,
|
|
|
|
drank: false,
|
|
|
|
isOwner: false
|
|
|
|
});
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
|
|
|
|
Logic.arrangePhotos();
|
|
|
|
}
|
2022-03-01 05:18:00 +00:00
|
|
|
}
|
|
|
|
|