Properly color + round chatroom message entry

This commit is contained in:
2026-02-07 22:28:27 -07:00
parent 98f59eeaab
commit f1db4d83c2
4 changed files with 886 additions and 368 deletions

View File

@@ -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;
}