diff --git a/LobbyCompatibility/Behaviours/ButtonEventHandler.cs b/LobbyCompatibility/Behaviours/ButtonEventHandler.cs index cf42f43..f447996 100644 --- a/LobbyCompatibility/Behaviours/ButtonEventHandler.cs +++ b/LobbyCompatibility/Behaviours/ButtonEventHandler.cs @@ -65,6 +65,18 @@ public void SetButtonImageData(Image image, Sprite normalSprite, Sprite highligh _image = image; _normalSprite = normalSprite; _highlightedSprite = highlightedSprite; + + SetColor(normalColor, highlightedColor); + SetHighlighted(false); + } + + /// + /// Sets the button's color data + /// + /// Color to use when the button is not highlighted + /// Color to use when the button is highlighted + public void SetColor(Color normalColor, Color highlightedColor) + { _normalColor = normalColor; _highlightedColor = highlightedColor; diff --git a/LobbyCompatibility/Behaviours/ModdedLobbySlot.cs b/LobbyCompatibility/Behaviours/ModdedLobbySlot.cs index 174e4e3..7b19bd5 100644 --- a/LobbyCompatibility/Behaviours/ModdedLobbySlot.cs +++ b/LobbyCompatibility/Behaviours/ModdedLobbySlot.cs @@ -7,6 +7,7 @@ using UnityEngine.UI; using Image = UnityEngine.UI.Image; using Color = UnityEngine.Color; +using System.Linq; namespace LobbyCompatibility.Behaviours; @@ -18,6 +19,7 @@ public class ModdedLobbySlot : MonoBehaviour { private List _buttonEventHandlers = new(); private RectTransform? _buttonTransform; + private Button? _joinButton; private LobbyDiff? _lobbyDiff; private LobbySlot? _lobbySlot; private Transform? _parentContainer; @@ -36,8 +38,8 @@ internal void Setup(LobbySlot lobbySlot) return; // Find "Join Lobby" button template - var joinButton = GetComponentInChildren