Fix button colors

This commit is contained in:
D1GQ committed 2025-10-18 21:30:03 -05:00
1 parent 40dfdf3015
commit c675450078
3 files changed
+11 -5

No files matched your search

+9 -4
View File
@@ -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<TextMeshPro>().text = Name;
var title = SettingsButton.GetComponentInChildren<TextMeshPro>();
title?.SetText(Name);
SettingsButton.gameObject.SetActive(true);
SettingsButton.name = Name;
SettingsButton.OnClick.RemoveAllListeners();
SettingsButton.OnMouseOver.RemoveAllListeners();
SettingsButton.activeSprites.GetComponent<SpriteRenderer>().color = Color;
SettingsButton.inactiveSprites.GetComponent<SpriteRenderer>().color = Color;
SettingsButton.selectedSprites.GetComponent<SpriteRenderer>().color = Color;
var darkColor = Color * 0.5f;
SettingsButton.activeSprites.GetComponent<SpriteRenderer>().color = darkColor * 0.9f;
SettingsButton.inactiveSprites.GetComponent<SpriteRenderer>().color = darkColor * 0.8f;
SettingsButton.selectedSprites.GetComponent<SpriteRenderer>().color = darkColor;
SettingsButton.activeTextColor = Color * 0.9f;
SettingsButton.inactiveTextColor = Color * 0.8f;
SettingsButton.selectedTextColor = Color;
SettingsButton.gameObject.GetComponent<BoxCollider2D>().size = new Vector2(2.5f, 0.6176f);
+1 -1
View File
@@ -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)
@@ -176,6 +176,7 @@ static class GameSettingMenuPatch
{
case 3:
BetterSettingsTab.AUTab.gameObject.SetActive(true);
BetterSettingsTab.TabButton?.SelectButton(true);
__instance.MenuDescriptionText.text = BetterSettingsTab.Description;
break;
}