diff --git a/BTKUILib.cs b/BTKUILib.cs index dd8f68d..ad2695e 100644 --- a/BTKUILib.cs +++ b/BTKUILib.cs @@ -13,7 +13,7 @@ internal static class BuildInfo public const string Name = "BTKUILib"; public const string Author = "BTK Development Team"; public const string Company = "BTK Development"; - public const string Version = "2.3.0"; + public const string Version = "2.3.1"; } internal class BTKUILib : MelonMod @@ -26,6 +26,7 @@ internal class BTKUILib : MelonMod internal Queue MainThreadQueue = new(); internal Dictionary MLPrefsPages = new(); internal MelonPreferences_Entry PlayerListStyle; + internal MelonPreferences_Entry QMPlayerSelectorRedirect; private MelonPreferences_Entry _displayPrefsTab; private MelonPreferences_Entry _miscTabFirst; @@ -54,6 +55,8 @@ public override void OnInitializeMelon() PlayerListStyle = MelonPreferences.CreateEntry("BTKUILib", "PlayerListStyleNew", PlayerListStyleEnum.TabBar, "PlayerList Button Style", "Sets where the playerlist button will appear"); _miscTabFirst = MelonPreferences.CreateEntry("BTKUILib", "MiscTabFirst", false, "Misc Tab Always First", "Makes sure the misc tab is always first in the tab row"); + + QMPlayerSelectorRedirect = MelonPreferences.CreateEntry("BTKUILib", "PlayerSelectorRedirect", true, "Redirect Player QM Selector", "Chooses if the player selector should open the QM player details or always go to the big menu"); Patches.Initialize(HarmonyInstance); @@ -101,6 +104,13 @@ internal void GenerateSettingsPage() QuickMenuAPI.ShowNotice("Restart Required!", "To change the Misc tab first setting you must restart your game! This setting will be applied on the next startup!"); }; + var playerSelector = mainCat.AddToggle("Player Selector QM Redirect", "Sets if the player selector should open the QM Player Details page or the big menu", QMPlayerSelectorRedirect.Value); + playerSelector.OnValueUpdated += b => + { + QMPlayerSelectorRedirect.Value = b; + MelonPreferences.Save(); + }; + _playerListStyleNames = Enum.GetNames(typeof(PlayerListStyleEnum)); _playerListButtonStyle = new MultiSelection("PlayerList Button Position", _playerListStyleNames, (int)PlayerListStyle.Value); diff --git a/Patches.cs b/Patches.cs index d9d7a03..7d77d3c 100644 --- a/Patches.cs +++ b/Patches.cs @@ -170,7 +170,7 @@ class UsersPatch [HarmonyPrefix] static bool ShowDetailsPrefix(string userId) { - if (!CVR_MenuManager.Instance.IsQuickMenuOpen) return true; + if (!CVR_MenuManager.Instance.IsQuickMenuOpen || !BTKUILib.Instance.QMPlayerSelectorRedirect.Value) return true; //QM is open, redirect selection to playerlist QuickMenuAPI.OpenPlayerListByUserID(userId); @@ -187,8 +187,6 @@ static void SendToWorldUi(string value) { var elapsedTime = DateTime.Now.Subtract(QuickMenuAPI.TimeSinceKeyboardOpen); - BTKUILib.Log.Msg($"SendToWorldUI fired | seconds: {elapsedTime.TotalSeconds} minutes: {elapsedTime.TotalMinutes} fired: {QuickMenuAPI.KeyboardCloseFired}"); - //Ensure that we check if the keyboard action was used within 3 minutes, this will avoid the next keyboard usage triggering the action if (elapsedTime.TotalMinutes <= 3 && (!QuickMenuAPI.KeyboardCloseFired || elapsedTime.TotalSeconds <= 10)) QuickMenuAPI.OnKeyboardSubmitted?.Invoke(value); @@ -200,8 +198,6 @@ static void SendToWorldUi(string value) [HarmonyPostfix] static void KeyboardClosedPatch() { - BTKUILib.Log.Msg("Keyboard Closed Fired"); - //Update cause the keyboard has been closed QuickMenuAPI.TimeSinceKeyboardOpen = DateTime.Now; QuickMenuAPI.KeyboardCloseFired = true;