terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
TouchButtonControl.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3
4namespace InControl
5{
6 // Token: 0x02000046 RID: 70
8 {
9 // Token: 0x06000362 RID: 866 RVA: 0x0000ADEC File Offset: 0x00008FEC
10 public override void CreateControl()
11 {
14 }
15
16 // Token: 0x06000363 RID: 867 RVA: 0x0000AE08 File Offset: 0x00009008
17 public override void DestroyControl()
18 {
19 this.button.Delete();
20 if (this.currentTouch != null)
21 {
22 }
23 }
24
25 // Token: 0x06000364 RID: 868 RVA: 0x0000AE28 File Offset: 0x00009028
26 public override void ConfigureControl()
27 {
29 float x = this.offset.x;
30 float y = this.offset.y;
32 Vector2 vector = this.offset;
33 bool flag = this.lockAspectRatio;
34 this.button.Update(true);
35 }
36
37 // Token: 0x06000365 RID: 869 RVA: 0x0000AE78 File Offset: 0x00009078
38 public override void DrawGizmos()
39 {
42 }
43
44 // Token: 0x06000366 RID: 870 RVA: 0x0000AE94 File Offset: 0x00009094
45 private void Update()
46 {
47 if (this.dirty)
48 {
49 return;
50 }
52 long num = 0L;
53 touchSprite.Update(num != 0L);
54 }
55
56 // Token: 0x06000367 RID: 871 RVA: 0x0000AEBC File Offset: 0x000090BC
57 public override void SubmitControlState(ulong updateTick, float deltaTime)
58 {
60 int num;
61 for (;;)
62 {
63 bool flag = this.pressureSensitive;
64 touch = this.currentTouch;
65 if (flag)
66 {
67 if (touch != null)
68 {
69 break;
70 }
71 if (this.allowSlideToggle)
72 {
73 goto Block_3;
74 }
75 }
76 else
77 {
78 if (num != 0)
79 {
80 goto Block_2;
81 }
82 if (this.allowSlideToggle)
83 {
84 goto Block_4;
85 }
86 }
87 }
88 float maximumPossiblePressure = touch.maximumPossiblePressure;
89 float pressure = touch.pressure;
90 bool flag2 = this.buttonState;
92 this.buttonState = false;
93 bool state = touchSprite.state;
94 touchSprite.state = false;
95 num = 1;
96 touchSprite.<Dirty>k__BackingField = num != 0;
98 return;
99 Block_2:
101 bool flag3 = this.buttonState;
102 return;
103 Block_3:
104 int touchCount = TouchManager.TouchCount;
107 bool flag4 = touchSprite2.Contains(touch2);
108 float maximumPossiblePressure2 = touch2.maximumPossiblePressure;
109 float pressure2 = touch2.pressure;
110 if (touchSprite2 == null)
111 {
112 }
113 float num2 = Utility.Max(deltaTime, deltaTime);
114 return;
115 Block_4:
116 if (this.buttonState)
117 {
119 if (touchSprite3.state)
120 {
121 int num3 = 256;
123 }
124 }
126 bool flag5 = this.buttonState;
127 }
128
129 // Token: 0x06000368 RID: 872 RVA: 0x0000B024 File Offset: 0x00009224
130 public override void CommitControlState(ulong updateTick, float deltaTime)
131 {
133 base.CommitButton(buttonTarget);
134 }
135
136 // Token: 0x06000369 RID: 873 RVA: 0x0000B040 File Offset: 0x00009240
137 public override void TouchBegan(Touch touch)
138 {
139 if (this.currentTouch == null)
140 {
141 bool flag = this.button.Contains(touch);
142 bool flag2 = this.buttonState;
144 this.buttonState = true;
145 bool state = touchSprite.state;
146 touchSprite.state = 257 != 0;
148 }
149 }
150
151 // Token: 0x0600036A RID: 874 RVA: 0x0000B090 File Offset: 0x00009290
152 public override void TouchMoved(Touch touch)
153 {
155 }
156
157 // Token: 0x0600036B RID: 875 RVA: 0x0000B0DC File Offset: 0x000092DC
158 public override void TouchEnded(Touch touch)
159 {
161 }
162
163 // Token: 0x17000112 RID: 274
164 // (get) Token: 0x0600036C RID: 876 RVA: 0x0000B114 File Offset: 0x00009314
165 // (set) Token: 0x0600036D RID: 877 RVA: 0x0000B128 File Offset: 0x00009328
166 private bool ButtonState
167 {
168 get
169 {
170 return this.buttonState;
171 }
172 set
173 {
174 bool flag = this.buttonState;
176 bool state = touchSprite.state;
177 touchSprite.<Dirty>k__BackingField = true;
178 }
179 }
180
181 // Token: 0x17000113 RID: 275
182 // (get) Token: 0x0600036E RID: 878 RVA: 0x0000B154 File Offset: 0x00009354
183 // (set) Token: 0x0600036F RID: 879 RVA: 0x0000B180 File Offset: 0x00009380
185 {
186 get
187 {
188 /*
189An exception occurred when decompiling this method (0600036E)
190
191ICSharpCode.Decompiler.DecompilerException: Error decompiling UnityEngine.Vector3 InControl.TouchButtonControl::get_ButtonPosition()
192
193 ---> System.Exception: Basic block has to end with unconditional control flow.
194{
195 IL_0016:
196 stloc:Vector3(var_3_1C, callgetter:Vector3(Transform::get_position, ldloc:Transform(var_2)))
197}
198
199 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
200 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
201 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
202 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
203 --- End of inner exception stack trace ---
204 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
205 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
206*/;
207 }
208 set
209 {
211 if (touchSprite.<Ready>k__BackingField)
212 {
214 return;
215 }
216 }
217 }
218
219 // Token: 0x17000114 RID: 276
220 // (get) Token: 0x06000370 RID: 880 RVA: 0x0000B1A4 File Offset: 0x000093A4
221 // (set) Token: 0x06000371 RID: 881 RVA: 0x0000B1B8 File Offset: 0x000093B8
223 {
224 get
225 {
226 return this.anchor;
227 }
228 set
229 {
232 this.dirty = true;
233 }
234 }
235
236 // Token: 0x17000115 RID: 277
237 // (get) Token: 0x06000372 RID: 882 RVA: 0x0000B1DC File Offset: 0x000093DC
238 // (set) Token: 0x06000373 RID: 883 RVA: 0x0000B204 File Offset: 0x00009404
240 {
241 get
242 {
243 float x = this.offset.x;
244 float y = this.offset.y;
245 Vector2 vector;
246 return vector;
247 }
248 set
249 {
250 float x = this.offset.x;
251 float y = this.offset.y;
252 this.dirty = true;
253 }
254 }
255
256 // Token: 0x17000116 RID: 278
257 // (get) Token: 0x06000374 RID: 884 RVA: 0x0000B230 File Offset: 0x00009430
258 // (set) Token: 0x06000375 RID: 885 RVA: 0x0000B244 File Offset: 0x00009444
260 {
261 get
262 {
263 return this.offsetUnitType;
264 }
265 set
266 {
269 this.dirty = true;
270 }
271 }
272
273 // Token: 0x06000376 RID: 886 RVA: 0x0000B268 File Offset: 0x00009468
275 {
276 this.offset.x = 0f;
278 base..ctor();
279 }
280
281 // Token: 0x040002EE RID: 750
283 [Header("Position")]
285
286 // Token: 0x040002EF RID: 751
289
290 // Token: 0x040002F0 RID: 752
293
294 // Token: 0x040002F1 RID: 753
296 private bool lockAspectRatio = true;
297
298 // Token: 0x040002F2 RID: 754
299 [Header("Options")]
301
302 // Token: 0x040002F3 RID: 755
303 public bool allowSlideToggle;
304
305 // Token: 0x040002F4 RID: 756
306 public bool toggleOnLeave;
307
308 // Token: 0x040002F5 RID: 757
309 public bool pressureSensitive;
310
311 // Token: 0x040002F6 RID: 758
312 [Header("Sprites")]
314
315 // Token: 0x040002F7 RID: 759
316 private bool buttonState;
317
318 // Token: 0x040002F8 RID: 760
320
321 // Token: 0x040002F9 RID: 761
322 private bool dirty;
323 }
324}
class f__AnonymousType0<< Count > j__TPar
TouchControl.ButtonTarget target
override void TouchBegan(Touch touch)
override void TouchEnded(Touch touch)
override void SubmitControlState(ulong updateTick, float deltaTime)
override void TouchMoved(Touch touch)
override void CommitControlState(ulong updateTick, float deltaTime)
void CommitButton(TouchControl.ButtonTarget target)
static Touch GetTouch(int touchIndex)
bool Contains(Vector2 testWorldPoint)
float maximumPossiblePressure
Definition Touch.cs:202
static float Max(float v0, float v1)
Definition Utility.cs:276