Elin Modding Docs Doc
All Classes Namespaces
LayerInspect.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.Events;
5
6// Token: 0x0200055B RID: 1371
7public class LayerInspect : ELayer
8{
9 // Token: 0x06002542 RID: 9538 RVA: 0x000D3D90 File Offset: 0x000D1F90
10 public void SetItems(List<Thing> things)
11 {
12 foreach (Thing t in things)
13 {
14 this.items.Add(LayerInspect.GetItem(t));
15 }
16 this.Refresh();
17 }
18
19 // Token: 0x06002543 RID: 9539 RVA: 0x000D3DF0 File Offset: 0x000D1FF0
20 public void SetItemsOnHitPoint()
21 {
22 this.inspectMap = true;
23 this.items = LayerInspect.GetMenuItems();
24 this.Refresh();
25 }
26
27 // Token: 0x06002544 RID: 9540 RVA: 0x000D3E0A File Offset: 0x000D200A
28 public override void OnUpdateInput()
29 {
30 if (!this.inspectMap)
31 {
32 return;
33 }
34 if (Input.GetMouseButtonDown(0))
35 {
36 if (!ELayer.ui.isPointerOverUI && Scene.HitPoint.IsValid)
37 {
38 this.SetItemsOnHitPoint();
39 return;
40 }
41 }
42 else
43 {
44 bool anyKeyDown = Input.anyKeyDown;
45 }
46 }
47
48 // Token: 0x06002545 RID: 9541 RVA: 0x000D3E44 File Offset: 0x000D2044
49 public void Refresh()
50 {
51 this.list.Clear();
52 BaseList baseList = this.list;
53 UIList.Callback<LayerInspect.MenuItem, ButtonGeneral> callback = new UIList.Callback<LayerInspect.MenuItem, ButtonGeneral>();
54 callback.onClick = delegate(LayerInspect.MenuItem a, ButtonGeneral b)
55 {
56 if (a.action != null)
57 {
58 a.action();
59 }
60 };
61 callback.onInstantiate = delegate(LayerInspect.MenuItem a, ButtonGeneral b)
62 {
63 if (a.card != null)
64 {
65 b.SetCard(a.card, FontColor.Ignore);
66 return;
67 }
68 b.mainText.text = a.text;
69 if (a.renderRow != null)
70 {
71 a.renderRow.SetImage(b.icon, null, 0, true, 0, 0);
72 }
73 };
74 baseList.callbacks = callback;
75 this.list.AddCollection(this.items);
76 this.list.Refresh(false);
77 }
78
79 // Token: 0x06002546 RID: 9542 RVA: 0x000D3ED4 File Offset: 0x000D20D4
80 public static LayerInspect.MenuItem GetItem(Card t)
81 {
82 return new LayerInspect.MenuItem
83 {
84 card = t,
85 text = t.Name,
86 action = delegate()
87 {
88 if (t.isChara)
89 {
90 ELayer.ui.AddLayer<LayerChara>().SetChara(t.Chara);
91 return;
92 }
93 ELayer.ui.AddLayer<LayerInfo>().Set(t, false);
94 }
95 };
96 }
97
98 // Token: 0x06002547 RID: 9543 RVA: 0x000D3F24 File Offset: 0x000D2124
99 public static List<LayerInspect.MenuItem> GetMenuItems()
100 {
101 List<LayerInspect.MenuItem> list = new List<LayerInspect.MenuItem>();
102 Point point = Scene.HitPoint.Copy();
103 if (!point.IsValid)
104 {
105 return list;
106 }
107 foreach (Card card in point.ListCards(false))
108 {
109 if (card.isSynced)
110 {
111 list.Add(LayerInspect.GetItem(card));
112 }
113 }
114 if (point.area != null)
115 {
116 List<LayerInspect.MenuItem> list2 = list;
118 menuItem.text = point.area.Name;
119 menuItem.action = delegate()
120 {
121 };
122 list2.Add(menuItem);
123 }
124 if (point.cell.HasLiquid)
125 {
126 list.Add(new LayerInspect.MenuItem
127 {
128 text = point.cell.GetLiquidName(),
129 action = delegate()
130 {
131 ELayer.ui.AddLayer<LayerInfo>().SetLiquid(point.cell);
132 },
133 renderRow = point.cell.sourceEffect
134 });
135 }
136 if (point.matBlock.id != 0)
137 {
138 list.Add(new LayerInspect.MenuItem
139 {
140 text = point.cell.GetBlockName(),
141 action = delegate()
142 {
143 ELayer.ui.AddLayer<LayerInfo>().SetBlock(point.cell);
144 },
145 renderRow = point.cell.sourceBlock
146 });
147 }
148 if (point.matFloor.id != 0)
149 {
150 list.Add(new LayerInspect.MenuItem
151 {
152 text = point.cell.GetFloorName(),
153 action = delegate()
154 {
155 ELayer.ui.AddLayer<LayerInfo>().SetFloor(point.cell);
156 },
157 renderRow = point.cell.sourceFloor
158 });
159 }
160 if (point.cell.obj != 0)
161 {
162 list.Add(new LayerInspect.MenuItem
163 {
164 text = point.sourceObj.GetName(),
165 action = delegate()
166 {
167 ELayer.ui.AddLayer<LayerInfo>().SetObj(point.cell);
168 },
169 renderRow = point.cell.sourceObj
170 });
171 }
172 return list;
173 }
174
175 // Token: 0x040014D2 RID: 5330
176 public bool inspectMap;
177
178 // Token: 0x040014D3 RID: 5331
179 public UIList list;
180
181 // Token: 0x040014D4 RID: 5332
182 public List<LayerInspect.MenuItem> items = new List<LayerInspect.MenuItem>();
183
184 // Token: 0x02000A86 RID: 2694
185 public class MenuItem
186 {
187 // Token: 0x04002B04 RID: 11012
188 public string id;
189
190 // Token: 0x04002B05 RID: 11013
191 public string text;
192
193 // Token: 0x04002B06 RID: 11014
194 public UnityAction action;
195
196 // Token: 0x04002B07 RID: 11015
197 public Card card;
198
199 // Token: 0x04002B08 RID: 11016
200 public RenderRow renderRow;
201 }
202}
Definition Card.cs:13
Definition Point.cs:11
Definition Scene.cs:10
Definition Thing.cs:10