Elin Modding Docs Doc
Loading...
Searching...
No Matches
ActionHint.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x020004F5 RID: 1269
6public class ActionHint : EMono
7{
8 // Token: 0x17000AEB RID: 2795
9 // (get) Token: 0x060021D0 RID: 8656 RVA: 0x000BAFBE File Offset: 0x000B91BE
10 public ActionMode mode
11 {
12 get
13 {
14 return EMono.scene.actionMode;
15 }
16 }
17
18 // Token: 0x17000AEC RID: 2796
19 // (get) Token: 0x060021D1 RID: 8657 RVA: 0x000BAFCA File Offset: 0x000B91CA
20 private BaseTileSelector ts
21 {
22 get
23 {
24 return EMono.screen.tileSelector;
25 }
26 }
27
28 // Token: 0x060021D2 RID: 8658 RVA: 0x000BAFD6 File Offset: 0x000B91D6
29 private void Awake()
30 {
31 this.moldDynamic = this.layoutDynamic.CreateMold(null);
32 this.oriPos = this.Rect().anchoredPosition;
33 }
34
35 // Token: 0x060021D3 RID: 8659 RVA: 0x000BB000 File Offset: 0x000B9200
36 public void Refresh()
37 {
38 if (this.mode == null)
39 {
40 return;
41 }
42 bool flag = EMono.core.IsGameStarted && this.mode.ShowActionHint;
43 base.gameObject.SetActive(flag);
44 if (!flag)
45 {
46 return;
47 }
48 this.extra.SetActive(true);
49 bool digRamp = this.mode == ActionMode.Dig && ActionMode.Dig.mode == TaskDig.Mode.Ramp;
50 bool mineRamp = this.mode == ActionMode.Mine && ActionMode.Mine.mode == TaskMine.Mode.Ramp;
51 this.groupRadio.SetActive(digRamp | mineRamp);
52 if (digRamp | mineRamp)
53 {
54 this.groupRadio.Init(0, delegate(int a)
55 {
56 if (digRamp)
57 {
58 if (a == 0)
59 {
60 ActionMode.Dig.ramp = 3;
61 }
62 if (a == 1)
63 {
64 ActionMode.Dig.ramp = 4;
65 }
66 if (a == 2)
67 {
68 ActionMode.Dig.ramp = 5;
69 }
70 ActionMode.Dig.OnCreateMold(false);
71 }
72 if (mineRamp)
73 {
74 if (a == 0)
75 {
76 ActionMode.Mine.ramp = 3;
77 }
78 if (a == 1)
79 {
80 ActionMode.Mine.ramp = 4;
81 }
82 if (a == 2)
83 {
84 ActionMode.Mine.ramp = 5;
85 }
86 ActionMode.Mine.OnCreateMold(false);
87 }
88 }, false);
89 this.groupRadio.ToggleInteractable(true);
90 }
91 this.dynamic = false;
92 this.layoutDynamic.DestroyChildren(false, true);
93 this.groupToggle.SetActive(this.dynamic);
94 this.UpdateText();
95 }
96
97 // Token: 0x060021D4 RID: 8660 RVA: 0x000BB110 File Offset: 0x000B9310
98 public void AddToggle(string lang, bool on, Action<bool> action)
99 {
100 UIButton uibutton = Util.Instantiate<UIButton>(this.moldDynamic, this.layoutDynamic);
101 uibutton.mainText.SetText(lang.lang());
102 uibutton.SetToggle(on, action);
103 this.dynamic = true;
104 }
105
106 // Token: 0x060021D5 RID: 8661 RVA: 0x000BB144 File Offset: 0x000B9344
107 public void UpdateText()
108 {
109 string hintText = this.mode.GetHintText();
110 base.gameObject.SetActive(EMono.scene.actionMode.ShowActionHint && !hintText.IsEmpty());
111 this.SetText(hintText, false);
112 this.buttonPick.SetActive(this.mode == ActionMode.Inspect && ActionMode.Inspect.CanPutAway());
113 this.buttonPick.SetOnClick(delegate
114 {
115 ActionMode.Inspect.TryPutAway();
116 });
117 }
118
119 // Token: 0x060021D6 RID: 8662 RVA: 0x000BB1DC File Offset: 0x000B93DC
120 public void Show(string lang, bool icon = true)
121 {
122 string text = lang.lang();
123 bool anime = text != this.lastText || !base.gameObject.activeSelf;
124 this.lastText = text;
125 this.iconNerun.SetActive(false);
126 base.gameObject.SetActive(true);
127 this.buttonPick.SetActive(false);
128 this.extra.SetActive(false);
129 this.SetText(text, anime);
130 }
131
132 // Token: 0x060021D7 RID: 8663 RVA: 0x000BB250 File Offset: 0x000B9450
133 public void SetText(string s, bool anime = false)
134 {
135 this.Rect().anchoredPosition = this.oriPos;
136 this.textTitle.SetText(s);
137 this.RebuildLayout(false);
138 if (anime)
139 {
140 this.animePop.Play(base.transform, null, -1f, 0f);
141 }
142 }
143
144 // Token: 0x0400114B RID: 4427
145 public Transform extra;
146
147 // Token: 0x0400114C RID: 4428
148 public LayoutGroup layoutDynamic;
149
150 // Token: 0x0400114D RID: 4429
151 public UIText textTitle;
152
153 // Token: 0x0400114E RID: 4430
154 public UIText textDetail;
155
156 // Token: 0x0400114F RID: 4431
157 public UIButton buttonPick;
158
159 // Token: 0x04001150 RID: 4432
160 public UIButton buttonSavePartialMap;
161
162 // Token: 0x04001151 RID: 4433
163 public UIButton buttonDeletePartialMap;
164
165 // Token: 0x04001152 RID: 4434
166 public UISelectableGroup groupRadio;
167
168 // Token: 0x04001153 RID: 4435
169 public UISelectableGroup groupToggle;
170
171 // Token: 0x04001154 RID: 4436
172 public Anime animePop;
173
174 // Token: 0x04001155 RID: 4437
175 public Image iconNerun;
176
177 // Token: 0x04001156 RID: 4438
178 public CanvasGroup cg;
179
180 // Token: 0x04001157 RID: 4439
181 [NonSerialized]
182 public bool dynamic;
183
184 // Token: 0x04001158 RID: 4440
185 private UIButton moldDynamic;
186
187 // Token: 0x04001159 RID: 4441
188 private Vector3 oriPos;
189
190 // Token: 0x0400115A RID: 4442
191 private string lastText;
192}
Definition EMono.cs:6