Properly color + round chatroom message entry
This commit is contained in:
@@ -4,16 +4,14 @@ using UnityEngine.UI;
|
||||
|
||||
public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler
|
||||
{
|
||||
private Image bgImg;
|
||||
private Button optionsButton;
|
||||
private static ChatroomMenuEntry activeEntry;
|
||||
|
||||
public void Init(Image bgImgArg, Button optionsButtonArg)
|
||||
public void Init(Button optionsButtonArg)
|
||||
{
|
||||
bgImg = bgImgArg;
|
||||
optionsButton = optionsButtonArg;
|
||||
var color = BazookaManager.Instance.GetColorSettingMenuBackground();
|
||||
bgImg.color = new Color((((float)color[0]) + 26f) / 255f, (((float)color[1]) + 26f) / 255f, (((float)color[2]) + 26f) / 255f);
|
||||
gameObject.GetComponent<Image>().color = new Color((((float)color[0]) + 24f) / 255f, (((float)color[1]) + 24f) / 255f, (((float)color[2]) + 24f) / 255f);
|
||||
optionsButton.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
@@ -74,14 +72,14 @@ public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerEx
|
||||
{
|
||||
activeEntry = this;
|
||||
var color = BazookaManager.Instance.GetColorSettingMenuBackground();
|
||||
bgImg.color = new Color((((float)color[0]) + 36f) / 255f, (((float)color[1]) + 36f) / 255f, (((float)color[2]) + 36f) / 255f);
|
||||
gameObject.GetComponent<Image>().color = new Color((((float)color[0]) + 36f) / 255f, (((float)color[1]) + 36f) / 255f, (((float)color[2]) + 36f) / 255f);
|
||||
optionsButton.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void Deactivate()
|
||||
{
|
||||
var color = BazookaManager.Instance.GetColorSettingMenuBackground();
|
||||
bgImg.color = new Color((((float)color[0]) + 26f) / 255f, (((float)color[1]) + 26f) / 255f, (((float)color[2]) + 26f) / 255f);
|
||||
gameObject.GetComponent<Image>().color = new Color((((float)color[0]) + 24f) / 255f, (((float)color[1]) + 24f) / 255f, (((float)color[2]) + 24f) / 255f);
|
||||
optionsButton.gameObject.SetActive(false);
|
||||
if (activeEntry == this) activeEntry = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user