2023-04-09 13:35:35 +08:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-12-20 12:51:54 +08:00
|
|
|
import QtQuick
|
2023-05-19 10:08:36 +08:00
|
|
|
import Fk.Pages
|
2022-12-20 12:51:54 +08:00
|
|
|
|
|
|
|
GraphicsBox {
|
|
|
|
property string winner: ""
|
|
|
|
|
|
|
|
id: root
|
2024-01-25 03:23:29 +08:00
|
|
|
title.text: luatr("$GameOver")
|
2022-12-20 12:51:54 +08:00
|
|
|
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 {
|
2024-01-25 03:23:29 +08:00
|
|
|
text: winner !== "" ? luatr("$Winner").arg(luatr(winner))
|
|
|
|
: luatr("$NoWinner")
|
2022-12-20 12:51:54 +08:00
|
|
|
color: "#E4D5A0"
|
|
|
|
}
|
|
|
|
|
2023-06-04 19:31:44 +08:00
|
|
|
MetroButton {
|
2024-01-25 03:23:29 +08:00
|
|
|
text: luatr("Back To Room")
|
2023-06-04 19:31:44 +08:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-06-04 20:00:35 +08:00
|
|
|
visible: !config.observing
|
2023-06-04 19:31:44 +08:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
roomScene.resetToInit();
|
|
|
|
finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-20 12:51:54 +08:00
|
|
|
MetroButton {
|
2024-01-25 03:23:29 +08:00
|
|
|
text: luatr("Back To Lobby")
|
2022-12-20 12:51:54 +08:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
onClicked: {
|
2023-08-01 21:01:01 +08:00
|
|
|
if (config.replaying) {
|
|
|
|
mainStack.pop();
|
|
|
|
Backend.controlReplayer("shutdown");
|
|
|
|
} else {
|
|
|
|
ClientInstance.notifyServer("QuitRoom", "[]");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MetroButton {
|
|
|
|
id: repBtn
|
2024-01-25 03:23:29 +08:00
|
|
|
text: luatr("Save Replay")
|
2023-08-01 21:01:01 +08:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
visible: !config.replaying
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
repBtn.visible = false;
|
2024-01-25 03:23:29 +08:00
|
|
|
lcall("SaveRecord");
|
2023-08-01 21:01:01 +08:00
|
|
|
toast.show("OK.");
|
2022-12-20 12:51:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|