From 2cd9662443ba16a0b2567c3f21a239a3fe54c3b8 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 22 Feb 2024 22:37:04 -0500 Subject: [PATCH 1/7] Remove freeze time options from preflight and pause menu --- QSB/Menus/PreflightChecklistAdjustment.cs | 62 +++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 QSB/Menus/PreflightChecklistAdjustment.cs diff --git a/QSB/Menus/PreflightChecklistAdjustment.cs b/QSB/Menus/PreflightChecklistAdjustment.cs new file mode 100644 index 00000000..95b411f4 --- /dev/null +++ b/QSB/Menus/PreflightChecklistAdjustment.cs @@ -0,0 +1,62 @@ +using QSB.Utility; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace QSB.Menus; + +internal class PreflightChecklistAdjustment : MonoBehaviour, IAddComponentOnStart +{ + private string[] _preflightOptionsToRemove = new string[] + { + "UIElement-FreezeTimeTranslating", + "UIElement-FreezeTimeShipLog", + "UIElement-FreezeTimeConversations", + "UIElement-FreezeTimeTranslator", + "UIElement-FreezeTimeDialogue" + }; + + private MenuOption[] DestroyFreezeTimeOptions(MenuOption[] options) + { + var remainingMenuOptions = new List(); + foreach (var preflightChecklistOption in options) + { + if (_preflightOptionsToRemove.Contains(preflightChecklistOption.name)) + { + GameObject.Destroy(preflightChecklistOption.gameObject); + } + else + { + remainingMenuOptions.Add(preflightChecklistOption); + } + } + return remainingMenuOptions.ToArray(); + } + + public void Awake() + { + QSBSceneManager.OnPostSceneLoad += (_, loadScene) => + { + if (QSBCore.IsInMultiplayer && loadScene.IsUniverseScene()) + { + // PREFLIGHT MENU IN THE SHIP + var suitMenuManager = GameObject.FindObjectOfType()._mainMenu; + suitMenuManager._menuOptions = DestroyFreezeTimeOptions(suitMenuManager._menuOptions); + + // Remove cosmetic elements from ship preflight checklist + var suitOptionsMenu = GameObject.Find("PauseMenu/PreFlightCanvas/OptionsMenu-Panel/SuitOptionsDisplayPanel/SuitOptionsMainMenu/"); + GameObject.Destroy(suitOptionsMenu.transform.Find("FreezeTimeImage").gameObject); + GameObject.Destroy(suitOptionsMenu.transform.Find("Box-FreezeTimeBorder").gameObject); + + + // PREFLIGHT MENU IN THE OPTIONS MENU + var settingsMenuView = GameObject.FindObjectOfType(); + settingsMenuView._listSettingsOptions = DestroyFreezeTimeOptions(settingsMenuView._listSettingsOptions); + + // This one also points to the same options, so just update the list to not have the old broken ones + var menuGameplayPreFlight = GameObject.Find("PauseMenu/OptionsCanvas/OptionsMenu-Panel/OptionsDisplayPanel/GameplayMenu/MenuGameplayPreFl/").GetComponent(); + menuGameplayPreFlight._menuOptions = settingsMenuView._listSettingsOptions; + } + }; + } +} From 94faca2bd7e5b099d5ab85bae68a6db49ab6b9c0 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 22 Feb 2024 23:34:13 -0500 Subject: [PATCH 2/7] Fixed preflight breaking on controller / using wasd --- QSB/Menus/PreflightChecklistAdjustment.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/QSB/Menus/PreflightChecklistAdjustment.cs b/QSB/Menus/PreflightChecklistAdjustment.cs index 95b411f4..2ec1f562 100644 --- a/QSB/Menus/PreflightChecklistAdjustment.cs +++ b/QSB/Menus/PreflightChecklistAdjustment.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; +using UnityEngine.UI; namespace QSB.Menus; @@ -53,9 +54,9 @@ internal class PreflightChecklistAdjustment : MonoBehaviour, IAddComponentOnStar var settingsMenuView = GameObject.FindObjectOfType(); settingsMenuView._listSettingsOptions = DestroyFreezeTimeOptions(settingsMenuView._listSettingsOptions); - // This one also points to the same options, so just update the list to not have the old broken ones + // This one also points to the same options, have to remove the destroyed objects from it var menuGameplayPreFlight = GameObject.Find("PauseMenu/OptionsCanvas/OptionsMenu-Panel/OptionsDisplayPanel/GameplayMenu/MenuGameplayPreFl/").GetComponent(); - menuGameplayPreFlight._menuOptions = settingsMenuView._listSettingsOptions; + Delay.RunNextFrame(() => menuGameplayPreFlight._menuOptions = menuGameplayPreFlight._menuOptions.Where(x => x != null).ToArray()); } }; } From 147fb01e2b22b085b51557ae3355bfb3cc042285 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Feb 2024 00:04:18 -0500 Subject: [PATCH 3/7] Add timeout to debug settings --- QSB/QSBNetworkManager.cs | 4 ++++ QSB/Utility/DebugSettings.cs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index 60255e0e..d295de1f 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -78,10 +78,14 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart { _kcpTransport = gameObject.AddComponent(); + // KCP uses milliseconds + _kcpTransport.Timeout = QSBCore.DebugSettings.Timeout * 1000; } { _steamTransport = gameObject.AddComponent(); + // Steam uses seconds + _steamTransport.Timeout = QSBCore.DebugSettings.Timeout; } { diff --git a/QSB/Utility/DebugSettings.cs b/QSB/Utility/DebugSettings.cs index ee4b4569..725921fa 100644 --- a/QSB/Utility/DebugSettings.cs +++ b/QSB/Utility/DebugSettings.cs @@ -54,4 +54,10 @@ public class DebugSettings [JsonProperty("greySkybox")] private bool _greySkybox; public bool GreySkybox => DebugMode && _greySkybox; + + /// + /// Timeout in seconds + /// + [JsonProperty("timeout")] + public int Timeout = 25; } From 3d30756aa67033a03fd808f6cb3b4cd187e8a5fc Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Feb 2024 00:14:13 -0500 Subject: [PATCH 4/7] Document it in development.md, move it up since "everything below debug mode is only active when it is blah blah" --- DEVELOPMENT.md | 2 ++ QSB/Utility/DebugSettings.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 7b26bed0..b78eb876 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -76,6 +76,7 @@ The template for this file is this : "autoStart": false, "kickEveryone": false, "disableLoopDeath": false, + "timeout": 25, "debugMode": false, "drawGui": false, "drawLines": false, @@ -91,6 +92,7 @@ The template for this file is this : - autoStart - Host/connect automatically for faster testing. - kickEveryone - Kick anyone who joins a game. - disableLoopDeath - Make it so the loop doesn't end when everyone is dead. +- timeout - How many seconds for your connection to timeout, in seconds. - debugMode - Enables debug mode. If this is set to `false`, none of the following settings do anything. - drawGui - Draws a GUI at the top of the screen that gives information on many things. - drawLines - Draws gizmo-esque lines around things. Indicates reference sectors/transforms, triggers, etc. LAGGY. diff --git a/QSB/Utility/DebugSettings.cs b/QSB/Utility/DebugSettings.cs index 725921fa..e1c17404 100644 --- a/QSB/Utility/DebugSettings.cs +++ b/QSB/Utility/DebugSettings.cs @@ -32,6 +32,12 @@ public class DebugSettings [JsonProperty("randomizeSkins")] public bool RandomizeSkins; + /// + /// Timeout in seconds + /// + [JsonProperty("timeout")] + public int Timeout = 25; + [JsonProperty("debugMode")] public bool DebugMode; @@ -54,10 +60,4 @@ public class DebugSettings [JsonProperty("greySkybox")] private bool _greySkybox; public bool GreySkybox => DebugMode && _greySkybox; - - /// - /// Timeout in seconds - /// - [JsonProperty("timeout")] - public int Timeout = 25; } From b2acffdbe8552444f28d80f6a71c24c0d5ddcb4b Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Feb 2024 00:55:07 -0500 Subject: [PATCH 5/7] Fix initial state having headless hearthians --- QSB/Animation/Player/HelmetAnimator.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/QSB/Animation/Player/HelmetAnimator.cs b/QSB/Animation/Player/HelmetAnimator.cs index 97664802..418e641e 100644 --- a/QSB/Animation/Player/HelmetAnimator.cs +++ b/QSB/Animation/Player/HelmetAnimator.cs @@ -67,10 +67,8 @@ public class HelmetAnimator : MonoBehaviour { _fakeHelmetDitheringAnimator.SetVisible(false); FakeHelmet.gameObject.SetActive(false); - if (!SuitGroup.activeSelf) - { - FakeHead.gameObject.SetActive(false); - } + // If the player is currently wearing their suit but has no helmet on, make sure to make the head visible (#655) + FakeHead.gameObject.SetActive(SuitGroup.activeSelf); } } From 8a76b0072ddd1e81c49405d8234650889ee59c43 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Sat, 9 Mar 2024 16:31:16 +0000 Subject: [PATCH 6/7] update version --- QSB/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QSB/manifest.json b/QSB/manifest.json index bd260f96..96965074 100644 --- a/QSB/manifest.json +++ b/QSB/manifest.json @@ -8,7 +8,7 @@ "body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications." }, "uniqueName": "Raicuparta.QuantumSpaceBuddies", - "version": "1.0.0", + "version": "1.1.0", "owmlVersion": "2.9.8", "dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ], "pathsToPreserve": [ "debugsettings.json" ], From 975c4bdca53e0c6f8b8177dcac9d1d5d625e33e9 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Sat, 9 Mar 2024 16:34:23 +0000 Subject: [PATCH 7/7] change to 1.0.1 --- QSB/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QSB/manifest.json b/QSB/manifest.json index 96965074..4f0b51e0 100644 --- a/QSB/manifest.json +++ b/QSB/manifest.json @@ -8,7 +8,7 @@ "body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications." }, "uniqueName": "Raicuparta.QuantumSpaceBuddies", - "version": "1.1.0", + "version": "1.0.1", "owmlVersion": "2.9.8", "dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ], "pathsToPreserve": [ "debugsettings.json" ],