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
UnityInputDevice.cs
Go to the documentation of this file.
1using System;
3using UnityEngine;
4
5namespace InControl
6{
7 // Token: 0x0200005C RID: 92
9 {
10 // Token: 0x17000144 RID: 324
11 // (get) Token: 0x0600043A RID: 1082 RVA: 0x0000DCD0 File Offset: 0x0000BED0
12 // (set) Token: 0x0600043B RID: 1083 RVA: 0x0000DCE4 File Offset: 0x0000BEE4
13 public int JoystickId
14 {
16 get
17 {
18 return this.<JoystickId>k__BackingField;
19 }
21 private set
22 {
24 }
25 }
26
27 // Token: 0x17000145 RID: 325
28 // (get) Token: 0x0600043C RID: 1084 RVA: 0x0000DCF8 File Offset: 0x0000BEF8
30 {
31 get
32 {
33 return this.profile;
34 }
35 }
36
37 // Token: 0x0600043D RID: 1085 RVA: 0x0000DD0C File Offset: 0x0000BF0C
39 {
40 }
41
42 // Token: 0x0600043E RID: 1086 RVA: 0x0000DD1C File Offset: 0x0000BF1C
43 public void RefreshProfile()
44 {
45 base.ClearControls();
48 bool invert = inputDeviceProfile.analogMappings.invert;
49 string deviceNotes = inputDeviceProfile.deviceNotes;
50 if (inputDeviceProfile == null)
51 {
52 }
53 string text;
54 string text2;
55 if (("Cannot map control \"" == null || "Cannot map control \"" != null) && (text == null || text != null) && ("\" as InputControlType." == null || "\" as InputControlType." != null) && (text2 == null || text2 != null) && (" in profile \"" == null || " in profile \"" != null))
56 {
57 string deviceName = this.profile.deviceName;
58 if ((deviceName == null || deviceName != null) && ("\" because this target is reserved as an alias. The mapping will be ignored." == null || "\" because this target is reserved as an alias. The mapping will be ignored." != null))
59 {
60 string text3;
62 return;
63 }
64 }
66 }
67
68 // Token: 0x0600043F RID: 1087 RVA: 0x0000DEEC File Offset: 0x0000C0EC
70 {
71 int num = 1;
72 if (num == 0)
73 {
74 }
75 base..ctor();
78 if (joystickId != 0)
79 {
80 if (num == 0)
81 {
82 }
83 this.<SortOrder>k__BackingField = num;
84 }
87 if (num == 0)
88 {
89 }
90 string deviceName = this.profile.deviceName;
92 this.<Name>k__BackingField = deviceName;
93 string deviceNotes = inputDeviceProfile.deviceNotes;
94 this.<Meta>k__BackingField = deviceNotes;
95 InputDeviceClass deviceClass = inputDeviceProfile.deviceClass;
96 bool invert = inputDeviceProfile.analogMappings.invert;
97 string deviceNotes2 = inputDeviceProfile.deviceNotes;
98 if (inputDeviceProfile == null)
99 {
100 }
101 string text;
102 string text2;
103 if (("Cannot map control \"" == null || "Cannot map control \"" != null) && (text == null || text != null) && ("\" as InputControlType." == null || "\" as InputControlType." != null) && (text2 == null || text2 != null) && (" in profile \"" == null || " in profile \"" != null))
104 {
105 string deviceName2 = deviceProfile.deviceName;
106 if ((deviceName2 == null || deviceName2 != null) && ("\" because this target is reserved as an alias. The mapping will be ignored." == null || "\" because this target is reserved as an alias. The mapping will be ignored." != null))
107 {
108 string text3;
110 return;
111 }
112 }
113 throw new ArrayTypeMismatchException();
114 }
115
116 // Token: 0x06000440 RID: 1088 RVA: 0x0000E0F8 File Offset: 0x0000C2F8
117 public override void Update(ulong updateTick, float deltaTime)
118 {
119 InputControlMapping[] analogMappings = this.profile.analogMappings;
120 bool invert = analogMappings.invert;
121 bool raw = analogMappings.raw;
123 if (analogMappings != null)
124 {
126 if (analogMappings == null)
127 {
128 }
129 float num;
130 bool flag = Utility.IsZero(num);
131 }
132 float num2;
133 bool flag2 = inputControl.UpdateWithValue(num2, updateTick, deltaTime);
136 }
137
138 // Token: 0x06000441 RID: 1089 RVA: 0x0000E190 File Offset: 0x0000C390
139 private static void SetupAnalogQueries()
140 {
141 string text2;
142 string text3;
143 string text = "joystick " + text2 + " analog " + text3;
144 }
145
146 // Token: 0x06000442 RID: 1090 RVA: 0x0000E1B4 File Offset: 0x0000C3B4
147 private static void SetupButtonQueries()
148 {
149 string text2;
150 string text3;
151 string text = "joystick " + text2 + " button " + text3;
152 }
153
154 // Token: 0x06000443 RID: 1091 RVA: 0x0000E1D8 File Offset: 0x0000C3D8
155 public override bool ReadRawButtonState(int index)
156 {
157 int num = this.<JoystickId>k__BackingField;
158 bool flag;
159 return flag;
160 }
161
162 // Token: 0x06000444 RID: 1092 RVA: 0x0000E1F0 File Offset: 0x0000C3F0
163 public override float ReadRawAnalogValue(int index)
164 {
165 /*
166An exception occurred when decompiling this method (06000444)
167
168ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Single InControl.UnityInputDevice::ReadRawAnalogValue(System.Int32)
169
170 ---> System.Exception: Basic block has to end with unconditional control flow.
171{
172 Block_0:
173 stloc:int32(var_0_06, ldfld:int32(UnityInputDevice::<JoystickId>k__BackingField, ldloc:UnityInputDevice(this)))
174}
175
176 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
177 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
178 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
179 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
180 --- End of inner exception stack trace ---
181 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
182 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
183*/;
184 }
185
186 // Token: 0x17000146 RID: 326
187 // (get) Token: 0x06000445 RID: 1093 RVA: 0x0000E204 File Offset: 0x0000C404
188 public override bool IsSupportedOnThisPlatform
189 {
190 get
191 {
193 return inputDeviceProfile == null || inputDeviceProfile.IsSupportedOnThisPlatform;
194 }
195 }
196
197 // Token: 0x17000147 RID: 327
198 // (get) Token: 0x06000446 RID: 1094 RVA: 0x0000E224 File Offset: 0x0000C424
199 public override bool IsKnown
200 {
201 get
202 {
203 /*
204An exception occurred when decompiling this method (06000446)
205
206ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean InControl.UnityInputDevice::get_IsKnown()
207
208 ---> System.Exception: Basic block has to end with unconditional control flow.
209{
210 Block_0:
211 stloc:InputDeviceProfile(var_0_06, ldfld:InputDeviceProfile(UnityInputDevice::profile, ldloc:UnityInputDevice(this)))
212}
213
214 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
215 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
216 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
217 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
218 --- End of inner exception stack trace ---
219 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
220 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
221*/;
222 }
223 }
224
225 // Token: 0x17000148 RID: 328
226 // (get) Token: 0x06000447 RID: 1095 RVA: 0x0000E238 File Offset: 0x0000C438
227 public override int NumUnknownButtons
228 {
229 get
230 {
231 return 20;
232 }
233 }
234
235 // Token: 0x17000149 RID: 329
236 // (get) Token: 0x06000448 RID: 1096 RVA: 0x0000E248 File Offset: 0x0000C448
237 public override int NumUnknownAnalogs
238 {
239 get
240 {
241 return 20;
242 }
243 }
244
245 // Token: 0x040003CD RID: 973
246 private static string[,] analogQueries;
247
248 // Token: 0x040003CE RID: 974
249 private static string[,] buttonQueries;
250
251 // Token: 0x040003CF RID: 975
252 public const int MaxDevices = 10;
253
254 // Token: 0x040003D0 RID: 976
255 public const int MaxButtons = 20;
256
257 // Token: 0x040003D1 RID: 977
258 public const int MaxAnalogs = 20;
259
260 // Token: 0x040003D2 RID: 978
262 private int <JoystickId>k__BackingField;
263
264 // Token: 0x040003D3 RID: 979
266 }
267}
class f__AnonymousType0<< Count > j__TPar
InputControlMapping[] analogMappings
override float ReadRawAnalogValue(int index)
UnityInputDevice(int joystickId, string joystickName)
readonly InputDeviceProfile profile
override bool IsSupportedOnThisPlatform
int< JoystickId > k__BackingField
override bool ReadRawButtonState(int index)
override void Update(ulong updateTick, float deltaTime)
UnityInputDevice(InputDeviceProfile deviceProfile, int joystickId, string joystickName)
static bool IsZero(float value)
Definition Utility.cs:219
static void LogError(object message)
Definition Debug.cs:62