Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerHoard.cs
1using System;
2using System.Linq;
3using UnityEngine;
4using UnityEngine.UI;
5
6// Token: 0x0200054D RID: 1357
7public class LayerHoard : ELayer
8{
9 // Token: 0x17000B22 RID: 2850
10 // (get) Token: 0x060024E0 RID: 9440 RVA: 0x000D044D File Offset: 0x000CE64D
11 public Hoard hoard
12 {
13 get
14 {
15 return ELayer.player.hoard;
16 }
17 }
18
19 // Token: 0x060024E1 RID: 9441 RVA: 0x000D045C File Offset: 0x000CE65C
20 public override void OnAfterInit()
21 {
22 ELayer.sources.collectibles.Init();
23 Msg.TalkHomeMemeber("layerHoard");
24 ActionMode.NoMap.Activate(true, false);
25 this.actor = Util.Instantiate<HoardActor>(this.actor, null);
26 if (this.hoard.items.Count == 0)
27 {
28 this.OnClickClear();
29 }
30 else
31 {
32 this.Reset();
33 }
34 base.InvokeRepeating("UpdateMousePos", 0f, 0.1f);
35 if (!ELayer.debug.debugHoard)
36 {
37 UIButton[] array = this.debugButtons;
38 for (int i = 0; i < array.Length; i++)
39 {
40 array[i].SetActive(false);
41 }
42 }
43 this.layoutMenu.RebuildLayout(true);
44 SoundManager.disableSpread = true;
45 ELayer.Sound.zone.enabled = false;
46 ELayer.scene.cam.enabled = false;
47 }
48
49 // Token: 0x060024E2 RID: 9442 RVA: 0x000D0534 File Offset: 0x000CE734
50 public void Reset()
51 {
52 this.actor.Activate();
53 this.textMode.text = "[" + ("h_" + this.hoard.mode.ToString()).lang() + "]";
54 }
55
56 // Token: 0x060024E3 RID: 9443 RVA: 0x000D058C File Offset: 0x000CE78C
57 public override void OnKill()
58 {
59 this.actor.Clear();
60 UnityEngine.Object.DestroyImmediate(this.actor.gameObject);
61 ActionMode.DefaultMode.Activate(true, false);
62 ELayer.ui.cg.alpha = 1f;
63 ELayer.Sound.maxSounds = ELayer.Sound._maxSounds;
64 SoundManager.disableSpread = false;
65 ELayer.Sound.zone.enabled = true;
66 ELayer.scene.cam.enabled = true;
67 }
68
69 // Token: 0x060024E4 RID: 9444 RVA: 0x000D0610 File Offset: 0x000CE810
70 private void Update()
71 {
72 if (this.textScore.gameObject.activeSelf && this.hoard.score != this.lastScore)
73 {
74 this.textScore.text = this.hoard.score.ToString() + " / " + this.hoard.hiScore.ToString();
75 this.lastScore = this.hoard.score;
76 }
77 if (Input.GetMouseButtonDown(2))
78 {
79 this.Reset();
80 }
81 if (ELayer.debug.enable)
82 {
83 if (Input.GetKeyDown(KeyCode.H))
84 {
85 this.hoard.hentai = true;
86 this.hoard.Add("lulu", 2, false);
87 this.hoard.Add("tentacle", 1, false);
88 this.hoard.Add("tentacle2", 1, false);
89 this.hoard.Add("tentacle3", 1, false);
90 this.hoard.Add("tentacle4", 2, false);
91 Msg.SayPic("UN_farris", "変態だー!", null);
92 this.Reset();
93 }
94 if (Input.GetKeyDown(KeyCode.M))
95 {
96 try
97 {
98 CollectibleActor collectibleActor = this.actor.actors.FirstOrDefault((CollectibleActor a) => a.item.id == "mani");
99 if (collectibleActor && collectibleActor.gameObject.activeInHierarchy)
100 {
101 Msg.Nerun("あ・・・", "UN_nerun");
102 RigidExplode rigidExplode = collectibleActor.gameObject.AddComponent<RigidExplode>();
103 rigidExplode.particle = this.actor.psExplode;
104 rigidExplode.radius *= 10f;
105 rigidExplode.force *= 10f;
106 rigidExplode.chance = 1f;
107 rigidExplode.intervalMin = (rigidExplode.intervalMax = 2f);
108 rigidExplode.rb = collectibleActor.GetComponent<Rigidbody2D>();
109 this.actor.updates.Add(rigidExplode);
110 }
111 }
112 catch
113 {
114 }
115 }
116 }
117 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
118 if (ELayer.ui.GetTopLayer() != this || (componentOf && componentOf.transform.IsChildOf(base.transform)) || this.hasMouseMoved)
119 {
120 this.idleTimer = 0f;
121 this.v = 1;
122 }
123 else
124 {
125 this.idleTimer += Time.deltaTime;
126 if (this.idleTimer > 1f)
127 {
128 this.v = -1;
129 }
130 }
131 (this.cg ?? ELayer.ui.cg).alpha += (float)this.v * Time.deltaTime * this.fadeSpeed;
132 ELayer.Sound.maxSounds = this.hoard.maxSounds;
133 }
134
135 // Token: 0x060024E5 RID: 9445 RVA: 0x000D08E8 File Offset: 0x000CEAE8
136 private void UpdateMousePos()
137 {
138 this.hasMouseMoved = ((Input.mousePosition - this.lastMousePos).magnitude > 15f);
139 this.lastMousePos = Input.mousePosition;
140 }
141
142 // Token: 0x060024E6 RID: 9446 RVA: 0x000D0928 File Offset: 0x000CEB28
143 public void AddRandom()
144 {
145 foreach (SourceCollectible.Row row in ELayer.sources.collectibles.rows)
146 {
147 if (!row.tag.Contains("noSpawn"))
148 {
149 int num = (row.num == 0) ? 10 : row.num;
150 this.hoard.Add(row.id, ELayer.rnd(ELayer.rnd(ELayer.rnd(ELayer.rnd(num + 1) + 1) + 1) + 1), false);
151 }
152 }
153 this.Reset();
154 }
155
156 // Token: 0x060024E7 RID: 9447 RVA: 0x000D09D8 File Offset: 0x000CEBD8
157 public void Generate()
158 {
159 this.hoard.Clear();
160 foreach (SourceCollectible.Row row in ELayer.sources.collectibles.rows)
161 {
162 if (!row.tag.Contains("noSpawn"))
163 {
164 this.hoard.Add(row.id);
165 }
166 }
167 this.hoard.mode = Hoard.Mode.lux;
168 this.Reset();
169 }
170
171 // Token: 0x060024E8 RID: 9448 RVA: 0x000D0A70 File Offset: 0x000CEC70
172 public void OnClickClear()
173 {
174 this.hoard.Clear();
175 this.hoard.Add("gold", 1, false);
176 this.Reset();
177 }
178
179 // Token: 0x060024E9 RID: 9449 RVA: 0x000D0A98 File Offset: 0x000CEC98
180 public void OnClickNextMode()
181 {
182 this.hoard.mode = this.hoard.mode.NextEnum<Hoard.Mode>();
183 Msg.Nerun("h_filter".lang(("h_" + this.hoard.mode.ToString()).lang(), null, null, null, null), "UN_nerun");
184 this.Reset();
185 }
186
187 // Token: 0x060024EA RID: 9450 RVA: 0x000D0B04 File Offset: 0x000CED04
188 public void OnClickConfig()
189 {
190 UIContextMenu uicontextMenu = ELayer.ui.contextMenu.Create("ContextHoard", true);
191 int max = this.actor.bgs.Length - 1;
192 uicontextMenu.AddSlider("room", (float n) => n.ToString() + " / " + max.ToString(), (float)this.hoard.bg, delegate(float v)
193 {
194 this.hoard.bg = (int)v;
195 this.actor.RefreshBG();
196 }, 0f, (float)max, true, false, false);
197 uicontextMenu.AddSlider("reflection", (float n) => n.ToString() + " %", (float)this.hoard.reflection, delegate(float v)
198 {
199 this.hoard.reflection = (int)v;
200 this.actor.RefreshBG();
201 }, 0f, 300f, true, false, false);
202 uicontextMenu.AddSlider("maxSounds", (float n) => n.ToString() ?? "", (float)this.hoard.maxSounds, delegate(float v)
203 {
204 this.hoard.maxSounds = (int)v;
205 }, 0f, 64f, true, false, false);
206 uicontextMenu.AddSlider("volume", (float n) => n.ToString() ?? "", (float)this.hoard.volume, delegate(float v)
207 {
208 this.hoard.volume = (int)v;
209 }, 0f, 200f, true, false, false);
210 uicontextMenu.AddToggle("voice", this.hoard.voice, delegate(bool on)
211 {
212 this.hoard.voice = on;
213 });
214 uicontextMenu.AddToggle("shadow", this.hoard.shadow, delegate(bool on)
215 {
216 this.hoard.shadow = on;
217 });
218 uicontextMenu.AddToggle("pixelPerfect", this.hoard.pixelPerfect, delegate(bool on)
219 {
220 this.hoard.pixelPerfect = on;
221 this.actor.RefreshZoom();
222 });
223 uicontextMenu.Show();
224 }
225
226 // Token: 0x04001462 RID: 5218
227 public HoardActor actor;
228
229 // Token: 0x04001463 RID: 5219
230 public bool autoList;
231
232 // Token: 0x04001464 RID: 5220
233 public int autoNum;
234
235 // Token: 0x04001465 RID: 5221
236 public float idleTimer;
237
238 // Token: 0x04001466 RID: 5222
239 public float fadeSpeed;
240
241 // Token: 0x04001467 RID: 5223
242 public CanvasGroup cg;
243
244 // Token: 0x04001468 RID: 5224
245 public UIText textMode;
246
247 // Token: 0x04001469 RID: 5225
248 public UIText textScore;
249
250 // Token: 0x0400146A RID: 5226
251 public UIText textTime;
252
253 // Token: 0x0400146B RID: 5227
254 public UIButton[] debugButtons;
255
256 // Token: 0x0400146C RID: 5228
257 public LayoutGroup layoutMenu;
258
259 // Token: 0x0400146D RID: 5229
260 private int lastScore;
261
262 // Token: 0x0400146E RID: 5230
263 public int v;
264
265 // Token: 0x0400146F RID: 5231
266 private Vector3 lastMousePos;
267
268 // Token: 0x04001470 RID: 5232
269 private bool hasMouseMoved;
270}
Definition Hoard.cs:10
Definition Msg.cs:7