summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/ChatBubble.cs
blob: 3c26a40da6549c830300c8a6bf6d8c3c81693acd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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;
	}
}