2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
import QtQuick
|
2023-05-19 02:08:36 +00:00
|
|
|
import Fk.Pages
|
2022-12-20 04:51:54 +00:00
|
|
|
|
|
|
|
GraphicsBox {
|
|
|
|
property string winner: ""
|
|
|
|
|
|
|
|
id: root
|
|
|
|
title.text: Backend.translate("$GameOver")
|
|
|
|
width: Math.max(140, body.width + 20)
|
|
|
|
height: body.height + title.height + 20
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: body
|
|
|
|
x: 10
|
|
|
|
y: title.height + 5
|
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
Text {
|
2023-03-20 06:53:56 +00:00
|
|
|
text: winner !== "" ? Backend.translate("$Winner").arg(Backend.translate(winner)) : Backend.translate("$NoWinner")
|
2022-12-20 04:51:54 +00:00
|
|
|
color: "#E4D5A0"
|
|
|
|
}
|
|
|
|
|
2023-06-04 11:31:44 +00:00
|
|
|
MetroButton {
|
|
|
|
text: Backend.translate("Back To Room")
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-06-04 12:00:35 +00:00
|
|
|
visible: !config.observing
|
2023-06-04 11:31:44 +00:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
roomScene.resetToInit();
|
|
|
|
finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
MetroButton {
|
|
|
|
text: Backend.translate("Back To Lobby")
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
onClicked: {
|
2023-08-01 13:01:01 +00:00
|
|
|
if (config.replaying) {
|
|
|
|
mainStack.pop();
|
|
|
|
Backend.controlReplayer("shutdown");
|
|
|
|
} else {
|
|
|
|
ClientInstance.notifyServer("QuitRoom", "[]");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MetroButton {
|
|
|
|
id: repBtn
|
|
|
|
text: Backend.translate("Save Replay")
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
visible: !config.replaying
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
repBtn.visible = false;
|
|
|
|
Backend.callLuaFunction("SaveRecord", []);
|
|
|
|
toast.show("OK.");
|
2022-12-20 04:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|