From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Client/Assembly-CSharp/ChatBubble.cs | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Client/Assembly-CSharp/ChatBubble.cs (limited to 'Client/Assembly-CSharp/ChatBubble.cs') diff --git a/Client/Assembly-CSharp/ChatBubble.cs b/Client/Assembly-CSharp/ChatBubble.cs new file mode 100644 index 0000000..3c26a40 --- /dev/null +++ b/Client/Assembly-CSharp/ChatBubble.cs @@ -0,0 +1,83 @@ +using System; +using UnityEngine; + +internal class ChatBubble : PoolableBehavior +{ + public SpriteRenderer ChatFace; + + public SpriteRenderer Xmark; + + public SpriteRenderer votedMark; + + public TextRenderer NameText; + + public TextRenderer TextArea; + + public SpriteRenderer Background; + + public void SetLeft() + { + base.transform.localPosition = new Vector3(-3f, 0f, 0f); + this.ChatFace.flipX = false; + this.ChatFace.transform.localScale = new Vector3(1f, 1f, 1f); + this.ChatFace.transform.localPosition = new Vector3(0f, 0.07f, 0f); + this.Xmark.transform.localPosition = new Vector3(-0.15f, -0.13f, -0.0001f); + this.votedMark.transform.localPosition = new Vector3(-0.15f, -0.13f, -0.0001f); + this.NameText.transform.localPosition = new Vector3(0.5f, 0.34f, 0f); + this.NameText.RightAligned = false; + this.TextArea.transform.localPosition = new Vector3(0.5f, 0.09f, 0f); + this.TextArea.RightAligned = false; + } + + public void SetNotification() + { + base.transform.localPosition = new Vector3(-2.75f, 0f, 0f); + this.ChatFace.flipX = false; + this.ChatFace.transform.localScale = new Vector3(0.75f, 0.75f, 1f); + this.ChatFace.transform.localPosition = new Vector3(0f, 0.18f, 0f); + this.Xmark.transform.localPosition = new Vector3(-0.15f, -0.13f, -0.0001f); + this.votedMark.transform.localPosition = new Vector3(-0.15f, -0.13f, -0.0001f); + this.NameText.transform.localPosition = new Vector3(0.5f, 0.34f, 0f); + this.NameText.RightAligned = false; + this.TextArea.transform.localPosition = new Vector3(0.5f, 0.09f, 0f); + this.TextArea.RightAligned = false; + this.TextArea.Text = string.Empty; + } + + public void SetRight() + { + base.transform.localPosition = new Vector3(-2.35f, 0f, 0f); + this.ChatFace.flipX = true; + this.ChatFace.transform.localScale = new Vector3(1f, 1f, 1f); + this.ChatFace.transform.localPosition = new Vector3(4.75f, 0.07f, 0f); + this.Xmark.transform.localPosition = new Vector3(0.15f, -0.13f, -0.0001f); + this.votedMark.transform.localPosition = new Vector3(0.15f, -0.13f, -0.0001f); + this.NameText.transform.localPosition = new Vector3(4.35f, 0.34f, 0f); + this.NameText.RightAligned = true; + this.TextArea.transform.localPosition = new Vector3(4.35f, 0.09f, 0f); + this.TextArea.RightAligned = true; + } + + public void SetName(string playerName, bool isDead, bool voted, Color color) + { + this.NameText.Text = (playerName ?? "..."); + this.NameText.Color = color; + this.NameText.RefreshMesh(); + if (isDead) + { + this.Xmark.enabled = true; + this.Background.color = Palette.HalfWhite; + } + if (voted) + { + this.votedMark.enabled = true; + } + } + + public override void Reset() + { + this.Xmark.enabled = false; + this.votedMark.enabled = false; + this.Background.color = Color.white; + } +} -- cgit v1.1-26-g67d0