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
|
2023-03-20 06:53:56 +00:00
|
|
|
import QtQuick.Layouts
|
2022-09-14 05:01:10 +00:00
|
|
|
import QtQuick.Controls
|
2022-01-24 02:23:08 +00:00
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
2023-06-30 20:12:19 +00:00
|
|
|
property alias serverDialog: serverDialogLoader
|
2022-01-24 02:23:08 +00:00
|
|
|
|
2023-03-20 06:53:56 +00:00
|
|
|
Item {
|
|
|
|
width: 960 * 0.8
|
|
|
|
height: 540 * 0.8
|
2022-04-30 07:27:56 +00:00
|
|
|
anchors.centerIn: parent
|
2023-03-20 06:53:56 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: left
|
|
|
|
width: 300
|
|
|
|
height: parent.height
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: lady
|
|
|
|
width: parent.width + 20
|
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 12
|
|
|
|
width: parent.width
|
|
|
|
source: AppPath + "/image/widelogo"
|
|
|
|
}
|
2022-05-01 10:37:13 +00:00
|
|
|
}
|
2023-02-26 08:51:29 +00:00
|
|
|
|
2023-03-20 06:53:56 +00:00
|
|
|
Rectangle {
|
|
|
|
id: right
|
|
|
|
anchors.left: left.right
|
|
|
|
width: parent.width - left.width
|
|
|
|
height: parent.height
|
|
|
|
color: "#88EEEEEE"
|
|
|
|
radius: 16
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
width: parent.width * 0.8
|
|
|
|
height: parent.height * 0.8
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 40
|
|
|
|
//spacing
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("Welcome back!")
|
|
|
|
font.pixelSize: 28
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
}
|
|
|
|
|
2023-06-30 20:12:19 +00:00
|
|
|
Button {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: qsTr("Console start")
|
|
|
|
onClicked: {
|
|
|
|
config.serverAddr = "127.0.0.1";
|
|
|
|
const serverCfg = config.savedPassword["127.0.0.1"] ?? {};
|
|
|
|
config.screenName = serverCfg.username ?? "player";
|
|
|
|
config.password = serverCfg.shorten_password ?? "1234";
|
|
|
|
mainWindow.busy = true;
|
|
|
|
Backend.startServer(9527);
|
|
|
|
Backend.joinServer("127.0.0.1");
|
2023-03-20 06:53:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: qsTr("Join Server")
|
|
|
|
Layout.fillWidth: true
|
2023-03-20 07:25:23 +00:00
|
|
|
display: AbstractButton.TextBesideIcon
|
2023-03-20 06:53:56 +00:00
|
|
|
onClicked: {
|
2023-06-30 20:12:19 +00:00
|
|
|
serverDialog.show();
|
2022-12-18 04:52:52 +00:00
|
|
|
}
|
|
|
|
}
|
2023-03-20 06:53:56 +00:00
|
|
|
|
2023-06-30 20:12:19 +00:00
|
|
|
Button {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: qsTr("PackageManage")
|
|
|
|
onClicked: {
|
|
|
|
mainStack.push(packageManage);
|
2023-03-20 06:53:56 +00:00
|
|
|
}
|
2023-06-30 20:12:19 +00:00
|
|
|
}
|
2023-03-20 06:53:56 +00:00
|
|
|
|
2023-06-30 20:12:19 +00:00
|
|
|
Button {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: qsTr("Quit Game")
|
|
|
|
onClicked: {
|
|
|
|
config.saveConf();
|
|
|
|
Qt.quit();
|
2022-12-18 04:52:52 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2023-03-20 06:53:56 +00:00
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.leftMargin: 12
|
|
|
|
anchors.bottomMargin: 12
|
2023-05-27 13:59:31 +00:00
|
|
|
text: qsTr("FreeKill") + " v" + FkVersion
|
2023-03-20 06:53:56 +00:00
|
|
|
font.pixelSize: 16
|
|
|
|
font.bold: true
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2023-03-20 06:53:56 +00:00
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
anchors.bottomMargin: 8
|
|
|
|
text: qsTr("FAQ")
|
|
|
|
color: "blue"
|
|
|
|
font.pixelSize: 24
|
|
|
|
font.underline: true
|
|
|
|
|
|
|
|
TapHandler {
|
|
|
|
onTapped: {
|
2023-09-29 13:16:53 +00:00
|
|
|
mainStack.push(Qt.createComponent("../Tutorial.qml").createObject());
|
2023-03-20 06:53:56 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-24 02:23:08 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-12-18 04:52:52 +00:00
|
|
|
|
2023-06-30 20:12:19 +00:00
|
|
|
Item {
|
|
|
|
id: serverDialog
|
|
|
|
width: parent.width * 0.8
|
|
|
|
height: parent.height * 0.9
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
opacity: 0.9
|
|
|
|
radius: 8
|
|
|
|
color: "snow"
|
|
|
|
border.color: "black"
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: serverDialogLoader
|
|
|
|
anchors.fill: parent
|
|
|
|
source: "JoinServer.qml"
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyAnimation on opacity {
|
|
|
|
id: showAnim
|
|
|
|
from: 0
|
|
|
|
to: 1
|
|
|
|
duration: 400
|
|
|
|
running: false
|
|
|
|
onStarted: {
|
|
|
|
serverDialogLoader.item.loadConfig();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyAnimation on opacity {
|
|
|
|
id: hideAnim
|
|
|
|
from: 1
|
|
|
|
to: 0
|
|
|
|
duration: 400
|
|
|
|
running: false
|
|
|
|
onFinished: {
|
|
|
|
serverDialog.visible = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function show() {
|
|
|
|
visible = true;
|
|
|
|
showAnim.start();
|
|
|
|
}
|
|
|
|
|
|
|
|
function hide() {
|
|
|
|
hideAnim.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-26 12:53:26 +00:00
|
|
|
// Temp
|
|
|
|
Button {
|
2023-06-14 05:40:50 +00:00
|
|
|
text: qsTr("Making Mod")
|
2023-05-26 12:53:26 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
2023-05-27 13:59:31 +00:00
|
|
|
visible: Debugging
|
2023-05-26 12:53:26 +00:00
|
|
|
onClicked: {
|
|
|
|
mainStack.push(modMaker);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
function downloadComplete() {
|
|
|
|
toast.show(qsTr("updated packages for md5"));
|
|
|
|
}
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
config.loadConf();
|
2023-03-20 06:53:56 +00:00
|
|
|
|
|
|
|
lady.source = config.ladyImg;
|
2022-12-18 04:52:52 +00:00
|
|
|
}
|
2022-01-24 02:23:08 +00:00
|
|
|
}
|