Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerEmbark.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6// Token: 0x02000541 RID: 1345
7public class LayerEmbark : ELayer
8{
9 // Token: 0x17000B1F RID: 2847
10 // (get) Token: 0x0600247D RID: 9341 RVA: 0x000CDCEB File Offset: 0x000CBEEB
11 public GameBlueprint bp
12 {
13 get
14 {
15 return ELayer.game.bp;
16 }
17 }
18
19 // Token: 0x17000B20 RID: 2848
20 // (get) Token: 0x0600247E RID: 9342 RVA: 0x000CDCF7 File Offset: 0x000CBEF7
21 public LayerTitle title
22 {
23 get
24 {
25 return LayerTitle.Instance;
26 }
27 }
28
29 // Token: 0x0600247F RID: 9343 RVA: 0x000CDD00 File Offset: 0x000CBF00
30 public override void OnAfterAddLayer()
31 {
32 LayerEmbark.Instance = this;
33 if (ELayer.game == null)
34 {
35 Game.Create(null);
36 }
37 if (this.bp.map != null)
38 {
39 this.mapPreview.SetMap(this.bp.map);
40 }
41 if (!LayerTitle.actor)
42 {
43 LayerTitle.actor = Util.Instantiate<EmbarkActor>(this.moldActor, null);
44 }
45 this.RefreshMembers();
46 this.SwitchMode(LayerEmbark.Mode.top);
47 ELayer.ui.AddLayer<LayerEditBio>();
48 }
49
50 // Token: 0x06002480 RID: 9344 RVA: 0x000CDD78 File Offset: 0x000CBF78
51 public void OnClickBack()
52 {
53 if (this.mode == LayerEmbark.Mode.previewMap && this.lastMode != LayerEmbark.Mode.map)
54 {
55 SE.Click();
56 }
57 this.SwitchMode(LayerEmbark.Mode.top);
58 }
59
60 // Token: 0x06002481 RID: 9345 RVA: 0x000CDD98 File Offset: 0x000CBF98
61 public void SwitchMode(int i)
62 {
63 this.SwitchMode(i.ToEnum<LayerEmbark.Mode>());
64 }
65
66 // Token: 0x06002482 RID: 9346 RVA: 0x000CDDA8 File Offset: 0x000CBFA8
67 public void SwitchMode(LayerEmbark.Mode _mode)
68 {
69 bool flag = this.lastMode == LayerEmbark.Mode.map;
70 if (_mode == LayerEmbark.Mode.top && this.mode == LayerEmbark.Mode.previewMap && flag)
71 {
72 _mode = LayerEmbark.Mode.map;
73 }
74 this.lastMode = this.mode;
75 this.mode = _mode;
76 this.goPreviewMap.SetActive(this.mode == LayerEmbark.Mode.previewMap);
77 this.goTop.SetActive(this.mode == LayerEmbark.Mode.top);
78 this.goMembers.SetActive(this.mode == LayerEmbark.Mode.member);
79 this.buttonEmbark.SetActive(this.mode == LayerEmbark.Mode.top);
80 this.goMap.SetActive(this.mode == LayerEmbark.Mode.map);
81 switch (this.mode)
82 {
83 case LayerEmbark.Mode.top:
84 this.mapPreview.transform.SetParent(this.mapHolder1, false);
85 ELayer.ui.hud.hint.Show("hintEmbarkTop".lang(), false);
86 this.selector.WriteNote(ELayer.player.zone);
87 return;
88 case LayerEmbark.Mode.previewMap:
89 SE.Play("click_paper");
90 ELayer.ui.hud.hint.Show("hintEmbarkPreview".lang(), false);
91 this.RerollPreviewMap();
92 return;
93 case LayerEmbark.Mode.member:
94 ELayer.ui.AddLayer<LayerEditBio>().SetChara(null, delegate
95 {
96 this.RefreshMembers();
97 this.SwitchMode(LayerEmbark.Mode.top);
98 });
99 return;
100 case LayerEmbark.Mode.map:
101 this.mapPreview.transform.SetParent(this.mapHolder2, false);
102 ELayer.ui.hud.hint.Show("hintEmbarkMap".lang(), false);
103 return;
104 default:
105 return;
106 }
107 }
108
109 // Token: 0x06002483 RID: 9347 RVA: 0x000CDF39 File Offset: 0x000CC139
110 public override bool OnBack()
111 {
112 if (this.mode == LayerEmbark.Mode.map)
113 {
114 return false;
115 }
116 if (this.mode != LayerEmbark.Mode.top)
117 {
118 this.SwitchMode(LayerEmbark.Mode.top);
119 return false;
120 }
121 return base.OnBack();
122 }
123
124 // Token: 0x06002484 RID: 9348 RVA: 0x000CDF5D File Offset: 0x000CC15D
125 private void Update()
126 {
127 if (this.mode == LayerEmbark.Mode.map)
128 {
129 ActionMode.Title.InputMovement();
130 }
131 }
132
133 // Token: 0x06002485 RID: 9349 RVA: 0x000CDF72 File Offset: 0x000CC172
134 public override void OnKill()
135 {
136 }
137
138 // Token: 0x06002486 RID: 9350 RVA: 0x000CDF74 File Offset: 0x000CC174
139 public void RerollPreviewMap()
140 {
141 if (this.firstPreview)
142 {
143 for (int i = 0; i < 8; i++)
144 {
145 UIMapPreview p = Util.Instantiate<UIMapPreview>(this.moldPreview, this.gridPreview);
146 this.previews.Add(p);
147 p.button.onClick.AddListener(delegate()
148 {
149 if (!p.thread.done)
150 {
151 SE.Beep();
152 return;
153 }
154 this.OnClickPreview(p);
155 });
156 }
157 this.firstPreview = false;
158 }
159 foreach (UIMapPreview uimapPreview in this.previews)
160 {
161 uimapPreview.GenerateMap(this.bp);
162 }
163 }
164
165 // Token: 0x06002487 RID: 9351 RVA: 0x000CE03C File Offset: 0x000CC23C
166 public void OnClickPreview(UIMapPreview preview)
167 {
168 this.bp.map = preview.map;
169 this.bp.genSetting = preview.thread.bp.genSetting;
170 this.mapPreview.SetMap(this.bp.map);
171 this.SwitchMode(LayerEmbark.Mode.top);
172 }
173
174 // Token: 0x06002488 RID: 9352 RVA: 0x000CE094 File Offset: 0x000CC294
175 public void RefreshMembers()
176 {
177 this.listMembers.Clear();
178 this.listMembers.callbacks = new UIList.Callback<Chara, ButtonChara>
179 {
180 onInstantiate = delegate(Chara a, ButtonChara b)
181 {
182 b.SetChara(a, ButtonChara.Mode.Embark);
183 a.elements.ListBestSkills();
184 b.item.button2.SetActive(a == ELayer.player.chara);
185 b.item.button1.SetActive(a == ELayer.player.chara);
186 b.item.button1.onClick.AddListener(delegate()
187 {
188 ELayer.ui.AddLayer<LayerEditBio>().SetChara(null, delegate
189 {
190 this.RefreshMembers();
191 });
192 });
193 }
194 };
195 foreach (Chara chara in this.bp.charas)
196 {
197 if (chara.IsPCC)
198 {
199 this.listMembers.Add(chara);
200 }
201 }
202 this.listMembers.Refresh(false);
203 }
204
205 // Token: 0x06002489 RID: 9353 RVA: 0x000CE134 File Offset: 0x000CC334
206 public void RerollPC()
207 {
208 this.bp.charas.Remove(ELayer.player.chara);
209 this.bp.charas.Insert(0, ELayer.player.chara);
210 (this.listMembers.buttons[0].component as ButtonChara).SetChara(ELayer.player.chara, ButtonChara.Mode.Embark);
211 }
212
213 // Token: 0x0600248A RID: 9354 RVA: 0x000CE1A2 File Offset: 0x000CC3A2
214 public void RerollMembers()
215 {
216 this.bp.RerollChara();
217 this.RefreshMembers();
218 }
219
220 // Token: 0x0600248B RID: 9355 RVA: 0x000CE1B5 File Offset: 0x000CC3B5
221 public string GetAlias()
222 {
223 if (ELayer.rnd(4) == 0)
224 {
225 return ELayer.player.title;
226 }
227 return this.bp.charas.RandomItem<Chara>().Name;
228 }
229
230 // Token: 0x0600248C RID: 9356 RVA: 0x000CE1DF File Offset: 0x000CC3DF
231 public void RerollPlayerAlias()
232 {
233 ELayer.player.title = WordGen.Get("title");
234 }
235
236 // Token: 0x0600248D RID: 9357 RVA: 0x000CE1F5 File Offset: 0x000CC3F5
237 public void RerollPlayerName()
238 {
239 ELayer.player.chara.c_altName = NameGen.getRandomName();
240 }
241
242 // Token: 0x0600248E RID: 9358 RVA: 0x000CE20B File Offset: 0x000CC40B
243 public void OnEndEditPlayerName()
244 {
245 ELayer.player.chara.c_altName = this.inputPlayerName.text;
246 }
247
248 // Token: 0x0600248F RID: 9359 RVA: 0x000CE228 File Offset: 0x000CC428
249 public void ListPlayerAlias()
250 {
251 ELayer.ui.AddLayer<LayerList>().SetStringList(() => WordGen.GetList("title"), delegate(int a, string b)
252 {
253 ELayer.player.title = b;
254 }, true);
255 }
256
257 // Token: 0x040013F1 RID: 5105
258 public static LayerEmbark Instance;
259
260 // Token: 0x040013F2 RID: 5106
261 public UIMapPreview mapPreview;
262
263 // Token: 0x040013F3 RID: 5107
264 public GameObject goTop;
265
266 // Token: 0x040013F4 RID: 5108
267 public GameObject goPreviewMap;
268
269 // Token: 0x040013F5 RID: 5109
270 public GameObject goMembers;
271
272 // Token: 0x040013F6 RID: 5110
273 public GameObject goMap;
274
275 // Token: 0x040013F7 RID: 5111
276 public UICharaMaker maker;
277
278 // Token: 0x040013F8 RID: 5112
279 public UIMapSelector selector;
280
281 // Token: 0x040013F9 RID: 5113
282 public UIList listMembers;
283
284 // Token: 0x040013FA RID: 5114
285 public InputField inputHomeName;
286
287 // Token: 0x040013FB RID: 5115
288 public InputField inputPlayerAlias;
289
290 // Token: 0x040013FC RID: 5116
291 public InputField inputSupplyType;
292
293 // Token: 0x040013FD RID: 5117
294 public InputField inputRegion;
295
296 // Token: 0x040013FE RID: 5118
297 public InputField inputEra;
298
299 // Token: 0x040013FF RID: 5119
300 public InputField inputPlayerName;
301
302 // Token: 0x04001400 RID: 5120
303 public UICardInfo cardInfo;
304
305 // Token: 0x04001401 RID: 5121
306 public UIButton buttonRerollSupply;
307
308 // Token: 0x04001402 RID: 5122
309 public UIButton toggleSkipQuests;
310
311 // Token: 0x04001403 RID: 5123
312 public UIButton buttonEmbark;
313
314 // Token: 0x04001404 RID: 5124
315 public UISelectableGroup groupGameMode;
316
317 // Token: 0x04001405 RID: 5125
318 public RectTransform mapHolder1;
319
320 // Token: 0x04001406 RID: 5126
321 public RectTransform mapHolder2;
322
323 // Token: 0x04001407 RID: 5127
324 public LayerEmbark.Mode mode;
325
326 // Token: 0x04001408 RID: 5128
327 public LayerEmbark.Mode lastMode;
328
329 // Token: 0x04001409 RID: 5129
330 public EmbarkActor moldActor;
331
332 // Token: 0x0400140A RID: 5130
333 public GridLayoutGroup gridPreview;
334
335 // Token: 0x0400140B RID: 5131
336 public UIMapPreview moldPreview;
337
338 // Token: 0x0400140C RID: 5132
339 public List<UIMapPreview> previews;
340
341 // Token: 0x0400140D RID: 5133
342 private bool firstPreview = true;
343
344 // Token: 0x02000A5D RID: 2653
345 public enum Mode
346 {
347 // Token: 0x04002A83 RID: 10883
348 top,
349 // Token: 0x04002A84 RID: 10884
350 previewMap,
351 // Token: 0x04002A85 RID: 10885
352 member,
353 // Token: 0x04002A86 RID: 10886
354 map
355 }
356}
Definition Chara.cs:12
Definition Game.cs:10