From e31148c45c268c4649c5d7a6126822d1574250ec Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 6 May 2023 18:49:40 -0700 Subject: [PATCH] fix previous commit --- QSB/Menus/MenuManager.cs | 2 +- QSB/QSBCore.cs | 2 -- QSB/QSBNetworkManager.cs | 11 +++++- QSB/default-config.json | 73 ++++++++++++++++++++++------------------ 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/QSB/Menus/MenuManager.cs b/QSB/Menus/MenuManager.cs index b732066a..6d376ba1 100644 --- a/QSB/Menus/MenuManager.cs +++ b/QSB/Menus/MenuManager.cs @@ -111,7 +111,7 @@ internal class MenuManager : MonoBehaviour, IAddComponentOnStart _nowLoadingSB.Length = 0; } - private void OnLanguageChanged() + public void OnLanguageChanged() { if (QSBSceneManager.CurrentScene != OWScene.TitleScreen) { diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index e087c541..995e1ec8 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -157,8 +157,6 @@ public class QSBCore : ModBehaviour if (DebugSettings.AutoStart) { UseKcpTransport = true; - Helper.Config.SetSettingsValue("UseKcpTransport", UseKcpTransport); - Helper.Storage.Save(Helper.Config, Constants.ModConfigFileName); DebugSettings.DebugMode = true; } diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index 2858c5a2..aba5a6bd 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -12,6 +12,7 @@ using QSB.EchoesOfTheEye.EclipseDoors.VariableSync; using QSB.EchoesOfTheEye.EclipseElevators.VariableSync; using QSB.EchoesOfTheEye.RaftSync.TransformSync; using QSB.JellyfishSync.TransformSync; +using QSB.Menus; using QSB.Messaging; using QSB.ModelShip; using QSB.ModelShip.TransformSync; @@ -165,10 +166,18 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart public static void UpdateTransport() { - if (!QSBCore.IsInMultiplayer) + if (QSBCore.IsInMultiplayer) + { + return; + } + if (singleton != null) { singleton.transport = QSBCore.UseKcpTransport ? _kcpTransport : _eosTransport; } + if (MenuManager.Instance != null) + { + MenuManager.Instance.OnLanguageChanged(); // hack to update text + } } private void InitPlayerName() => diff --git a/QSB/default-config.json b/QSB/default-config.json index 7672cee1..40bf87c5 100644 --- a/QSB/default-config.json +++ b/QSB/default-config.json @@ -1,35 +1,42 @@ { - "enabled": true, - "settings": { - "defaultServerIP": { - "title": "Last Entered IP/ID", - "type": "text", - "value": "localhost", - "tooltip": "Used if you leave the connect prompt blank." - }, - "incompatibleModsAllowed": { - "title": "Incompatible Mods Allowed", - "type": "toggle", - "value": false, - "tooltip": "Kicks players if they have certain mods." - }, - "showPlayerNames": { - "title": "Show Player Names", - "type": "toggle", - "value": true, - "tooltip": "Shows player names in the HUD and the map view." - }, - "shipDamage": { - "title": "Ship Damage", - "type": "toggle", - "value": true, - "tooltip": "Take impact damage when inside the ship." - }, - "showExtraHud": { - "title": "Show Extra HUD Elements", - "type": "toggle", - "value": true, - "tooltip" : "Show extra HUD elements, like player status and minimap icons." - } - } + "$schema": "https://raw.githubusercontent.com/ow-mods/owml/master/schemas/config_schema.json", + "enabled": true, + "settings": { + "useKcpTransport": { + "title": "Use KCP Transport", + "type": "toggle", + "value": false, + "tooltip": "Use alternative transport that requires port forwarding but seems to be more reliable. The port to forward is 7777. Use this if you are having trouble connecting." + }, + "defaultServerIP": { + "title": "Last Entered IP/ID", + "type": "text", + "value": "localhost", + "tooltip": "Used if you leave the connect prompt blank." + }, + "incompatibleModsAllowed": { + "title": "Incompatible Mods Allowed", + "type": "toggle", + "value": false, + "tooltip": "Kicks players if they have certain mods." + }, + "showPlayerNames": { + "title": "Show Player Names", + "type": "toggle", + "value": true, + "tooltip": "Shows player names in the HUD and the map view." + }, + "shipDamage": { + "title": "Ship Damage", + "type": "toggle", + "value": true, + "tooltip": "Take impact damage when inside the ship." + }, + "showExtraHud": { + "title": "Show Extra HUD Elements", + "type": "toggle", + "value": true, + "tooltip": "Show extra HUD elements, like player status and minimap icons." + } + } } \ No newline at end of file