From cc4556364096fda7a9dfb781ab498d1506fbc4aa Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 22 Mar 2026 14:30:58 -0500 Subject: [PATCH] Add touch support to favorite colors --- src/Patches/Gameplay/UI/PlayerTabPatch.cs | 46 +++++++++++++++++------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/src/Patches/Gameplay/UI/PlayerTabPatch.cs b/src/Patches/Gameplay/UI/PlayerTabPatch.cs index c694426..7ef9c8e 100644 --- a/src/Patches/Gameplay/UI/PlayerTabPatch.cs +++ b/src/Patches/Gameplay/UI/PlayerTabPatch.cs @@ -113,24 +113,46 @@ internal static class PlayerTabPatch colorChip.Button.OnClick = new(); colorChip.Button.OnClick.AddListener(() => { - // Shift+Click = toggle favorite - if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) + if (ActiveInputManager.currentControlType == ActiveInputManager.InputType.Keyboard) { - if (BAUConfigs.FavoriteColor.Value == index) + // Shift+Click to toggle favorite + if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) { - BAUConfigs.FavoriteColor.Value = -1; // Remove favorite - } - else - { - BAUConfigs.FavoriteColor.Value = index; // Set favorite + if (BAUConfigs.FavoriteColor.Value == index) + { + BAUConfigs.FavoriteColor.Value = -1; // Remove favorite + } + else + { + BAUConfigs.FavoriteColor.Value = index; // Set favorite + } + + UpdateFavorite(); + return; } - UpdateFavorite(); - return; + playerTab.ClickEquip(); } + else + { + // Click Color to toggle favorite if color is already taken + if (DataManager.Player.Customization.Color == index || !playerTab.AvailableColors.Contains(index)) + { + if (BAUConfigs.FavoriteColor.Value == index) + { + BAUConfigs.FavoriteColor.Value = -1; // Remove favorite + } + else + { + BAUConfigs.FavoriteColor.Value = index; // Set favorite + } - // Normal click = equip color - playerTab.ClickEquip(); + UpdateFavorite(); + return; + } + + playerTab.SelectColor(index); + } }); // Add favorite star indicator