Elin Modding Docs Doc
Loading...
Searching...
No Matches
AM_Picker.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x0200013F RID: 319
6{
7 // Token: 0x17000216 RID: 534
8 // (get) Token: 0x060008E2 RID: 2274 RVA: 0x00038E0B File Offset: 0x0003700B
9 public override bool IsBuildMode
10 {
11 get
12 {
13 return true;
14 }
15 }
16
17 // Token: 0x17000217 RID: 535
18 // (get) Token: 0x060008E3 RID: 2275 RVA: 0x00038E0E File Offset: 0x0003700E
19 public override BaseTileSelector.HitType hitType
20 {
21 get
22 {
23 return EClass.core.screen.tileSelector.inspectHitType;
24 }
25 }
26
27 // Token: 0x17000218 RID: 536
28 // (get) Token: 0x060008E4 RID: 2276 RVA: 0x00038E24 File Offset: 0x00037024
29 public override BaseTileSelector.SelectType selectType
30 {
31 get
32 {
33 return BaseTileSelector.SelectType.Single;
34 }
35 }
36
37 // Token: 0x060008E5 RID: 2277 RVA: 0x00038E27 File Offset: 0x00037027
38 public override void OnUpdateCursor()
39 {
40 base.SetCursorOnMap(CursorSystem.Picker);
41 }
42
43 // Token: 0x17000219 RID: 537
44 // (get) Token: 0x060008E6 RID: 2278 RVA: 0x00038E34 File Offset: 0x00037034
45 public BuildMenu BM
46 {
47 get
48 {
49 return BuildMenu.Instance;
50 }
51 }
52
53 // Token: 0x060008E7 RID: 2279 RVA: 0x00038E3C File Offset: 0x0003703C
54 public override HitResult HitTest(Point point, Point start)
55 {
56 if (!this.Test(point, false).IsValid)
57 {
58 return HitResult.Default;
59 }
60 return HitResult.Valid;
61 }
62
63 // Token: 0x060008E8 RID: 2280 RVA: 0x00038E5E File Offset: 0x0003705E
64 public override void OnProcessTiles(Point point, int dir)
65 {
66 this.Test(point, true);
67 }
68
69 // Token: 0x060008E9 RID: 2281 RVA: 0x00038E6C File Offset: 0x0003706C
70 public override void OnRenderTile(Point point, HitResult result, int dir)
71 {
72 if (point.cell.HasWallOrFence && (result == HitResult.Valid || result == HitResult.Invalid))
73 {
74 EClass.screen.guide.DrawWall(point, (result == HitResult.Valid) ? EClass.Colors.blockColors.Valid : EClass.Colors.blockColors.Warning, false, 0f);
75 return;
76 }
77 base.OnRenderTile(point, result, dir);
78 }
79
80 // Token: 0x060008EA RID: 2282 RVA: 0x00038ED4 File Offset: 0x000370D4
81 public AM_Picker.Result TestBlock(Point point)
82 {
83 return new AM_Picker.Result
84 {
85 mat = point.matBlock,
86 source = this.TryGetRecipe(point.sourceBlock.RecipeID)
87 };
88 }
89
90 // Token: 0x060008EB RID: 2283 RVA: 0x00038F10 File Offset: 0x00037110
91 public AM_Picker.Result TestFloor(Point point)
92 {
93 AM_Picker.Result result = default(AM_Picker.Result);
94 if (point.cell._bridge == 0)
95 {
96 result.mat = point.matFloor;
97 result.source = this.TryGetRecipe(point.sourceFloor.RecipeID);
98 }
99 else
100 {
101 result.mat = point.cell.matBridge;
102 result.source = this.TryGetRecipe(point.cell.sourceBridge.RecipeID + "-b");
103 }
104 return result;
105 }
106
107 // Token: 0x060008EC RID: 2284 RVA: 0x00038F94 File Offset: 0x00037194
108 public AM_Picker.Result TestThing(Thing t)
109 {
110 AM_Picker.Result result = default(AM_Picker.Result);
111 if (t.trait.IsGround)
112 {
113 return result;
114 }
115 result.mat = t.material;
116 result.source = this.TryGetRecipe(t.sourceCard.RecipeID);
117 result.thing = t;
118 return result;
119 }
120
121 // Token: 0x060008ED RID: 2285 RVA: 0x00038FE8 File Offset: 0x000371E8
122 public AM_Picker.Result Test(Point point, bool select = false)
123 {
124 List<Card> list = point.ListCards(true);
125 for (int i = list.Count - 1; i >= 0; i--)
126 {
127 Card card = list[i];
128 if (card.isThing)
129 {
130 AM_Picker.Result result = this.TestThing(card.Thing);
131 if (result.IsValid)
132 {
133 if (select)
134 {
135 this.Select(result);
136 }
137 TraitHouseBoard traitHouseBoard = card.trait as TraitHouseBoard;
138 if (traitHouseBoard != null)
139 {
140 ActionMode.Build.houseBoard = traitHouseBoard;
141 }
142 return result;
143 }
144 }
145 }
146 if (point.HasBlock)
147 {
148 AM_Picker.Result result2 = this.TestBlock(point);
149 if (result2.IsValid)
150 {
151 if (select)
152 {
153 this.Select(result2);
154 }
155 return result2;
156 }
157 }
158 if (point.HasFloor)
159 {
160 AM_Picker.Result result3 = this.TestFloor(point);
161 if (result3.IsValid)
162 {
163 if (select)
164 {
165 this.Select(result3);
166 }
167 return result3;
168 }
169 }
170 return default(AM_Picker.Result);
171 }
172
173 // Token: 0x060008EE RID: 2286 RVA: 0x000390BC File Offset: 0x000372BC
174 public RecipeSource TryGetRecipe(string id)
175 {
176 return EClass.player.recipes.GetSource(id);
177 }
178
179 // Token: 0x060008EF RID: 2287 RVA: 0x000390CE File Offset: 0x000372CE
180 public new bool Select(AM_Picker.Result r)
181 {
182 ActionMode.ignoreSound = true;
183 this.BM.Select(r);
184 return true;
185 }
186
187 // Token: 0x1700021A RID: 538
188 // (get) Token: 0x060008F0 RID: 2288 RVA: 0x000390E3 File Offset: 0x000372E3
189 public bool CanActivate
190 {
191 get
192 {
193 return !base.IsActive && (EClass.debug.godBuild || (EClass.Branch != null && EClass.Branch.elements.Has(4005)));
194 }
195 }
196
197 // Token: 0x02000865 RID: 2149
198 public struct Result
199 {
200 // Token: 0x17001148 RID: 4424
201 // (get) Token: 0x06003A19 RID: 14873 RVA: 0x0013512A File Offset: 0x0013332A
202 public bool IsValid
203 {
204 get
205 {
206 return this.source != null;
207 }
208 }
209
210 // Token: 0x06003A1A RID: 14874 RVA: 0x00135138 File Offset: 0x00133338
211 public string GetText()
212 {
213 return string.Concat(new string[]
214 {
215 this.source.Name,
216 EClass.debug.showExtra ? (":" + this.source.id) : "",
217 "(",
218 this.mat.GetName(),
219 EClass.debug.showExtra ? (":" + this.mat.id.ToString()) : "",
220 ")",
221 EClass.player.recipes.IsKnown(this.source.id) ? "" : (Environment.NewLine + "noRecipe".lang())
222 });
223 }
224
225 // Token: 0x17001149 RID: 4425
226 // (get) Token: 0x06003A1B RID: 14875 RVA: 0x00135211 File Offset: 0x00133411
227 public string category
228 {
229 get
230 {
231 return this.source.recipeCat;
232 }
233 }
234
235 // Token: 0x040023F0 RID: 9200
236 public RecipeSource source;
237
238 // Token: 0x040023F1 RID: 9201
239 public SourceMaterial.Row mat;
240
241 // Token: 0x040023F2 RID: 9202
242 public Thing thing;
243 }
244}
Definition Card.cs:13
Definition Point.cs:11
Definition Thing.cs:10