From c67545007836236e1cf8fb2e113e0430036150cf Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 18 Oct 2025 21:30:03 -0500 Subject: [PATCH] Fix button colors --- Items/OptionItems/OptionTab.cs | 13 +++++++++---- Patches/Client/MainMenuPatch.cs | 2 +- .../Gameplay/UI/Settings/GameSettingMenuPatch.cs | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Items/OptionItems/OptionTab.cs b/Items/OptionItems/OptionTab.cs index 4242a3a..d7a885d 100644 --- a/Items/OptionItems/OptionTab.cs +++ b/Items/OptionItems/OptionTab.cs @@ -64,16 +64,21 @@ internal class OptionTab var SettingsButton = UnityEngine.Object.Instantiate(GameSettingMenu.Instance.GameSettingsButton, GameSettingMenu.Instance.GameSettingsButton.transform.parent); TabButton = SettingsButton; SettingsButton.DestroyTextTranslators(); - SettingsButton.GetComponentInChildren().text = Name; + var title = SettingsButton.GetComponentInChildren(); + title?.SetText(Name); SettingsButton.gameObject.SetActive(true); SettingsButton.name = Name; SettingsButton.OnClick.RemoveAllListeners(); SettingsButton.OnMouseOver.RemoveAllListeners(); - SettingsButton.activeSprites.GetComponent().color = Color; - SettingsButton.inactiveSprites.GetComponent().color = Color; - SettingsButton.selectedSprites.GetComponent().color = Color; + var darkColor = Color * 0.5f; + SettingsButton.activeSprites.GetComponent().color = darkColor * 0.9f; + SettingsButton.inactiveSprites.GetComponent().color = darkColor * 0.8f; + SettingsButton.selectedSprites.GetComponent().color = darkColor; + SettingsButton.activeTextColor = Color * 0.9f; + SettingsButton.inactiveTextColor = Color * 0.8f; + SettingsButton.selectedTextColor = Color; SettingsButton.gameObject.GetComponent().size = new Vector2(2.5f, 0.6176f); diff --git a/Patches/Client/MainMenuPatch.cs b/Patches/Client/MainMenuPatch.cs index e354ece..6eff3b2 100644 --- a/Patches/Client/MainMenuPatch.cs +++ b/Patches/Client/MainMenuPatch.cs @@ -87,7 +87,6 @@ internal class MainMenuPatch }, "Mod Credits"); //"Credits" } - */ if (gitHubButton == null) { @@ -108,6 +107,7 @@ internal class MainMenuPatch () => Application.OpenURL(ModInfo.Discord), "Discord"); //"Discord" } + */ } internal static PassiveButton CreateButton(string name, Color32 normalColor, Color32 hoverColor, Action action, string label, Vector2? scale = null) diff --git a/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs b/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs index 4e8737b..afbd189 100644 --- a/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs +++ b/Patches/Gameplay/UI/Settings/GameSettingMenuPatch.cs @@ -176,6 +176,7 @@ static class GameSettingMenuPatch { case 3: BetterSettingsTab.AUTab.gameObject.SetActive(true); + BetterSettingsTab.TabButton?.SelectButton(true); __instance.MenuDescriptionText.text = BetterSettingsTab.Description; break; }