diff --git a/JvmClient/src/commonMain/kotlin/spaceEngineers/controller/Screens.kt b/JvmClient/src/commonMain/kotlin/spaceEngineers/controller/Screens.kt index 9a95965ac..cb8beae43 100644 --- a/JvmClient/src/commonMain/kotlin/spaceEngineers/controller/Screens.kt +++ b/JvmClient/src/commonMain/kotlin/spaceEngineers/controller/Screens.kt @@ -116,6 +116,7 @@ interface Medicals { fun selectFaction(factionIndex: Int) fun refresh() fun showMessageOfTheDay() + fun showMainMenu() } interface Terminal { diff --git a/JvmClient/src/commonMain/kotlin/spaceEngineers/navigation/ScreenNavigation.kt b/JvmClient/src/commonMain/kotlin/spaceEngineers/navigation/ScreenNavigation.kt index 5ed9cc6b6..918f14f3c 100644 --- a/JvmClient/src/commonMain/kotlin/spaceEngineers/navigation/ScreenNavigation.kt +++ b/JvmClient/src/commonMain/kotlin/spaceEngineers/navigation/ScreenNavigation.kt @@ -16,6 +16,7 @@ import spaceEngineers.model.ScreenName.Companion.GamePlay import spaceEngineers.model.ScreenName.Companion.JoinGame import spaceEngineers.model.ScreenName.Companion.LoadGame import spaceEngineers.model.ScreenName.Companion.MainMenu +import spaceEngineers.model.ScreenName.Companion.Medicals import spaceEngineers.model.ScreenName.Companion.MessageBox import spaceEngineers.model.ScreenName.Companion.NewGame import spaceEngineers.model.ScreenName.Companion.SaveAs @@ -115,6 +116,9 @@ val DEFAULT_TRANSITIONS = listOf( ScreenTransition(GamePlay, ToolbarConfig) { gamePlay.showToolbarConfig() }, + ScreenTransition(Medicals, MainMenu) { + medicals.showMainMenu() + }, ) fun ScreenName.toNode(): spaceEngineers.graph.Node { diff --git a/Source/Ivxr.SePlugin/Control/Screen/MedicalsScreen.cs b/Source/Ivxr.SePlugin/Control/Screen/MedicalsScreen.cs index 81c4e607b..3704e7aa6 100644 --- a/Source/Ivxr.SePlugin/Control/Screen/MedicalsScreen.cs +++ b/Source/Ivxr.SePlugin/Control/Screen/MedicalsScreen.cs @@ -4,6 +4,8 @@ using Iv4xr.SpaceEngineers; using Iv4xr.SpaceEngineers.WorldModel; using Iv4xr.SpaceEngineers.WorldModel.Screen; +using Sandbox; +using Sandbox.Game; using Sandbox.Graphics.GUI; using SpaceEngineers.Game.GUI; @@ -80,5 +82,12 @@ public void Refresh() { return Screen.TableOrNull("m_factionsTable")?.RowsAsList() ?? new List(); } + + public void ShowMainMenu() + { + CheckScreen(); + MyGuiSandbox.AddScreen(MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.MainMenu, + MySandboxGame.IsPaused == false)); + } } } diff --git a/Source/Ivxr.SpaceEngineers/IScreens.cs b/Source/Ivxr.SpaceEngineers/IScreens.cs index 4f7b758c9..ecedf5099 100644 --- a/Source/Ivxr.SpaceEngineers/IScreens.cs +++ b/Source/Ivxr.SpaceEngineers/IScreens.cs @@ -90,6 +90,7 @@ public interface IMedicals void Join(); void Refresh(); void ShowMessageOfTheDay(); + void ShowMainMenu(); } public interface ITerminal