diff --git a/Fk/Base/command.mjs b/Fk/Base/command.mjs index 2b42b03023dca0276109fe63ffe9f9e71267383f..b0738e534a1dcf6267a79945c7fd7e72cd21888b 100644 --- a/Fk/Base/command.mjs +++ b/Fk/Base/command.mjs @@ -39,12 +39,15 @@ export const PackageTransferProgress = "PackageTransferProgress"; // RoomPage 房间基底页 export const ChangeRoomPage = "ChangeRoomPage"; export const ResetRoomPage = "ResetRoomPage"; +export const ContinueGame = "ContinueGame"; export const BackToRoom = "BackToRoom"; +export const RestartGame = "RestartGame"; export const IWantToQuitRoom = "IWantToQuitRoom"; export const IWantToSaveRecord = "IWantToSaveRecord"; export const IWantToBookmarkRecord = "IWantToBookmarkRecord"; export const IWantToChat = "IWantToChat"; + // Misc export const Chat = "Chat"; diff --git a/Fk/Pages/Common/RoomPage.qml b/Fk/Pages/Common/RoomPage.qml index 903655ed5c462205379b14e97a49d576f4571672..40161dfbe070e8f5d4146b792207cfe74e15667c 100644 --- a/Fk/Pages/Common/RoomPage.qml +++ b/Fk/Pages/Common/RoomPage.qml @@ -717,6 +717,14 @@ Item { Mediator.notify(this, Command.BackToRoom); } + function continueGame() { + Lua.call("ResetClientLua"); + gameLoader.sourceComponent = Qt.createComponent("Fk.Pages.Common", "WaitingRoom"); + log.clear(); + chat.clear(); + Mediator.notify(this, Command.RestartGame); + } + function tryQuitRoom() { if (Config.replaying) { App.quitPage(); @@ -748,6 +756,7 @@ Item { overlay.addCallback(Command.ReplyToServer, replyToServer); overlay.addCallback(Command.ChangeRoomPage, changeRoomPage); overlay.addCallback(Command.ResetRoomPage, resetRoomPage); + overlay.addCallback(Command.ContinueGame, continueGame); overlay.addCallback(Command.IWantToQuitRoom, tryQuitRoom); overlay.addCallback(Command.IWantToSaveRecord, trySaveRecord); diff --git a/Fk/Pages/Common/WaitingRoom.qml b/Fk/Pages/Common/WaitingRoom.qml index 26e4ade3aa1ab0aeac0e52058064508813b58f8b..de9f7dd4c5ffd03157e778acb2e96b99623f4ad3 100644 --- a/Fk/Pages/Common/WaitingRoom.qml +++ b/Fk/Pages/Common/WaitingRoom.qml @@ -540,6 +540,17 @@ W.PageBase { } } + function restartGame(sender) { + loadPlayerData(sender); + //有人走了自动用机器人填充 + for (let i = 0; i < playerNum; i++) { + if (!isFull) { + Cpp.notifyServer("AddRobot", ""); + } + } + Cpp.notifyServer("StartGame", ""); + } + function startGame() { canKickOwner = false; kickOwnerTimer.stop(); @@ -566,6 +577,7 @@ W.PageBase { addCallback(Command.StartGame, startGame); addCallback(Command.BackToRoom, loadPlayerData); + addCallback(Command.RestartGame, restartGame); App.showToast(Lua.tr("$EnterRoom")); playerNum = Config.roomCapacity; diff --git a/Fk/Pages/LunarLTK/GameOverBox.qml b/Fk/Pages/LunarLTK/GameOverBox.qml index 96d17f7630f1d6f45f60bce6fd6b2ddc42de6297..9d4076ff9e878f0374547168bea7af4ffa34094a 100644 --- a/Fk/Pages/LunarLTK/GameOverBox.qml +++ b/Fk/Pages/LunarLTK/GameOverBox.qml @@ -95,6 +95,16 @@ GraphicsBox { spacing: 15 Item { Layout.fillWidth: true } + MetroButton { + text: Lua.tr("Continue Game") + visible: !Config.observing && !Config.replaying && Config.serverEnableBot + + onClicked: { + Mediator.notify(root, Command.ContinueGame); + finished(); + } + } + MetroButton { text: Lua.tr("Back To Room") visible: !Config.observing diff --git a/lua/client/i18n/zh_CN.lua b/lua/client/i18n/zh_CN.lua index c1c3fd036daf4b0f11f28f151d882a663a3b4713..15293f58d30693e3acf3ac00a035c2c287ca4fd9 100644 --- a/lua/client/i18n/zh_CN.lua +++ b/lua/client/i18n/zh_CN.lua @@ -489,6 +489,7 @@ FreeKill使用的是libgit2的C API,与此同时使用Git完成拓展包的下 ["Impasse Strike"] = "绝境逆袭", ["Back To Room"] = "回到房间", + ["Continue Game"] = "继续游戏", ["Back To Lobby"] = "返回大厅", ["Save Replay"] = "保存录像",