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
|
2024-01-24 19:23:29 +00:00
|
|
|
title.text: luatr("$GameOver")
|
2022-12-20 04:51:54 +00: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-24 19:23:29 +00:00
|
|
|
text: winner !== "" ? luatr("$Winner").arg(luatr(winner))
|
|
|
|
: luatr("$NoWinner")
|
2022-12-20 04:51:54 +00:00
|
|
|
color: "#E4D5A0"
|
|
|
|
}
|
|
|
|
|
2023-06-04 11:31:44 +00:00
|
|
|
MetroButton {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Back To Room")
|
2023-06-04 11:31:44 +00:00
|
|
|
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 {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Back To Lobby")
|
2022-12-20 04:51:54 +00:00
|
|
|
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
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Save Replay")
|
2023-08-01 13:01:01 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
visible: !config.replaying
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
repBtn.visible = false;
|
2024-01-24 19:23:29 +00:00
|
|
|
lcall("SaveRecord");
|
2023-08-01 13:01:01 +00:00
|
|
|
toast.show("OK.");
|
2022-12-20 04:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|