Elin Modding Docs Doc
Loading...
Searching...
No Matches
UIQueue.cs
1using System;
2using DG.Tweening;
3using DG.Tweening.Core;
4using DG.Tweening.Plugins.Options;
5using UnityEngine;
6using UnityEngine.UI;
7
8// Token: 0x020005F1 RID: 1521
9public class UIQueue : EMono
10{
11 // Token: 0x17000C08 RID: 3080
12 // (get) Token: 0x060029D3 RID: 10707 RVA: 0x000EBF68 File Offset: 0x000EA168
13 public QueueManager queues
14 {
15 get
16 {
17 return EMono.player.queues;
18 }
19 }
20
21 // Token: 0x060029D4 RID: 10708 RVA: 0x000EBF74 File Offset: 0x000EA174
22 private void OnEnable()
23 {
24 UIQueue.Instance = this;
25 }
26
27 // Token: 0x060029D5 RID: 10709 RVA: 0x000EBF7C File Offset: 0x000EA17C
28 private void OnDisable()
29 {
30 UIQueue.Instance = null;
31 }
32
33 // Token: 0x060029D6 RID: 10710 RVA: 0x000EBF84 File Offset: 0x000EA184
34 public void OnAdd(Queue q, bool insert = false)
35 {
36 UIButton uibutton = q.button = Util.Instantiate<UIButton>(this.mold, this.layout);
37 uibutton.onClick.AddListener(delegate()
38 {
39 if (q.CanCancel)
40 {
41 this.queues.Cancel(q);
42 }
43 });
44 if (insert)
45 {
46 uibutton.transform.SetAsFirstSibling();
47 }
48 uibutton.tooltip.onShowTooltip = delegate(UITooltip a)
49 {
50 string text = q.interaction.GetType().ToString() + "\n";
51 text += q.interaction.status.ToString();
52 a.textMain.SetText(text);
53 };
54 uibutton.transform.DOScale(0f, 0.2f).From<TweenerCore<Vector3, Vector3, VectorOptions>>();
55 }
56
57 // Token: 0x060029D7 RID: 10711 RVA: 0x000EC01C File Offset: 0x000EA21C
58 public void OnRemove(Queue q)
59 {
60 if (!q.button.interactable)
61 {
62 return;
63 }
64 q.button.interactable = false;
65 q.button.transform.DOScale(0f, 0.3f).OnComplete(delegate
66 {
67 if (q.button.gameObject)
68 {
69 UnityEngine.Object.DestroyImmediate(q.button.gameObject);
70 }
71 });
72 }
73
74 // Token: 0x060029D8 RID: 10712 RVA: 0x000EC08B File Offset: 0x000EA28B
75 public void OnSetOwner()
76 {
77 if (!this.mold)
78 {
79 this.mold = this.layout.CreateMold(null);
80 }
81 this.layout.DestroyChildren(false, true);
82 }
83
84 // Token: 0x060029D9 RID: 10713 RVA: 0x000EC0B9 File Offset: 0x000EA2B9
85 private void Update()
86 {
87 if (this.queues.list.Count > 0 && !this.queues.currentQueue.interaction.IsRunning)
88 {
89 this.OnRemove(this.queues.currentQueue);
90 }
91 }
92
93 // Token: 0x040017AB RID: 6059
94 public static UIQueue Instance;
95
96 // Token: 0x040017AC RID: 6060
97 public LayoutGroup layout;
98
99 // Token: 0x040017AD RID: 6061
100 public UIButton mold;
101}
Definition EMono.cs:6
Definition Queue.cs:5