2022-03-27 12:00:29 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.0
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
width: childrenRect.width
|
|
|
|
height: childrenRect.height
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
signal finished()
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
ColumnLayout {
|
|
|
|
spacing: 20
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Room Name")
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: roomName
|
|
|
|
font.pixelSize: 18
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("$RoomName").arg(Self.screenName)
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Player num")
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
SpinBox {
|
|
|
|
id: playerNum
|
|
|
|
from: 2
|
|
|
|
to: 8
|
|
|
|
}
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2023-02-15 11:54:35 +00:00
|
|
|
CheckBox {
|
|
|
|
id: freeAssignCheck
|
|
|
|
checked: Debugging ? true : false
|
|
|
|
text: Backend.translate("Enable free assign")
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Button {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("OK")
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: {
|
|
|
|
root.finished();
|
|
|
|
mainWindow.busy = true;
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"CreateRoom",
|
2023-02-15 11:54:35 +00:00
|
|
|
JSON.stringify([roomName.text, playerNum.value, {
|
|
|
|
enableFreeAssign: freeAssignCheck.checked
|
|
|
|
}])
|
2022-04-30 07:27:56 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Button {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Cancel")
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: {
|
|
|
|
root.finished();
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|