summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/MapBehaviour.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assembly-CSharp/MapBehaviour.cs')
-rw-r--r--Client/Assembly-CSharp/MapBehaviour.cs113
1 files changed, 113 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/MapBehaviour.cs b/Client/Assembly-CSharp/MapBehaviour.cs
new file mode 100644
index 0000000..85d6b39
--- /dev/null
+++ b/Client/Assembly-CSharp/MapBehaviour.cs
@@ -0,0 +1,113 @@
+using System;
+using UnityEngine;
+
+public class MapBehaviour : MonoBehaviour
+{
+ public bool IsOpen
+ {
+ get
+ {
+ return base.isActiveAndEnabled;
+ }
+ }
+
+ public bool IsOpenStopped
+ {
+ get
+ {
+ return this.IsOpen && this.countOverlay.isActiveAndEnabled;
+ }
+ }
+
+ public static MapBehaviour Instance;
+
+ public AlphaPulse ColorControl;
+
+ public SpriteRenderer HerePoint;
+
+ public MapCountOverlay countOverlay;
+
+ public InfectedOverlay infectedOverlay;
+
+ public MapTaskOverlay taskOverlay;
+
+ private void Awake()
+ {
+ MapBehaviour.Instance = this;
+ }
+
+ private void GenericShow()
+ {
+ base.transform.localScale = Vector3.one;
+ base.transform.localPosition = new Vector3(0f, 0f, -25f);
+ base.gameObject.SetActive(true);
+ }
+
+ public void ShowInfectedMap()
+ {
+ if (this.IsOpen)
+ {
+ this.Close();
+ return;
+ }
+ if (!PlayerControl.LocalPlayer.CanMove)
+ {
+ return;
+ }
+ PlayerControl.LocalPlayer.SetPlayerMaterialColors(this.HerePoint);
+ this.GenericShow();
+ this.infectedOverlay.gameObject.SetActive(true);
+ this.ColorControl.SetColor(Palette.ImpostorRed);
+ this.taskOverlay.Hide();
+ DestroyableSingleton<HudManager>.Instance.SetHudActive(false);
+ }
+
+ public void ShowNormalMap()
+ {
+ if (this.IsOpen)
+ {
+ this.Close();
+ return;
+ }
+ if (!PlayerControl.LocalPlayer.CanMove)
+ {
+ return;
+ }
+ PlayerControl.LocalPlayer.SetPlayerMaterialColors(this.HerePoint);
+ this.GenericShow();
+ this.taskOverlay.Show();
+ this.ColorControl.SetColor(new Color(0.05f, 0.2f, 1f, 1f));
+ DestroyableSingleton<HudManager>.Instance.SetHudActive(false);
+ }
+
+ public void ShowCountOverlay()
+ {
+ this.GenericShow();
+ this.countOverlay.gameObject.SetActive(true);
+ this.taskOverlay.Hide();
+ this.HerePoint.enabled = false;
+ DestroyableSingleton<HudManager>.Instance.SetHudActive(false);
+ }
+
+ public void FixedUpdate()
+ {
+ if (!ShipStatus.Instance)
+ {
+ return;
+ }
+ Vector3 vector = PlayerControl.LocalPlayer.transform.position;
+ vector /= ShipStatus.Instance.MapScale;
+ vector.z = -1f;
+ this.HerePoint.transform.localPosition = vector;
+ }
+
+ public void Close()
+ {
+ base.gameObject.SetActive(false);
+ this.countOverlay.gameObject.SetActive(false);
+ this.infectedOverlay.gameObject.SetActive(false);
+ this.taskOverlay.Hide();
+ this.HerePoint.enabled = true;
+ DestroyableSingleton<HudManager>.Instance.SetHudActive(true);
+ }
+}