TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ Update()

void Terraria.Player.SelectionRadial.Update ( )
inline

Definition at line 437 of file Player.cs.

438 {
439 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
440 //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
441 //IL_0102: Unknown result type (might be due to invalid IL or missing references)
442 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
443 //IL_0109: Unknown result type (might be due to invalid IL or missing references)
444 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
445 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
446 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
447 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
448 //IL_0134: Unknown result type (might be due to invalid IL or missing references)
449 //IL_0146: Unknown result type (might be due to invalid IL or missing references)
450 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
451 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
452 switch (Mode)
453 {
454 case SelectionMode.Dpad4:
455 if (PlayerInput.Triggers.JustPressed.DpadRadial1)
456 {
458 }
459 if (PlayerInput.Triggers.JustPressed.DpadRadial2)
460 {
462 }
463 if (PlayerInput.Triggers.JustPressed.DpadRadial3)
464 {
466 }
467 if (PlayerInput.Triggers.JustPressed.DpadRadial4)
468 {
470 }
471 break;
472 case SelectionMode.RadialCircular:
473 case SelectionMode.RadialQuicks:
474 {
475 for (int i = 0; i < RadialCount; i++)
476 {
477 Bindings[i] = i;
478 }
479 if ((Mode != SelectionMode.RadialCircular || !PlayerInput.Triggers.Current.RadialHotbar) && (Mode != SelectionMode.RadialQuicks || !PlayerInput.Triggers.Current.RadialQuickbar))
480 {
481 break;
482 }
483 bool flag = Mode == SelectionMode.RadialCircular;
484 float num = (float)Math.PI * 2f / (float)RadialCount / 2f;
485 Vector2 vector = PlayerInput.GamepadThumbstickRight.RotatedBy(-(float)Math.PI / 2f + num);
486 if (((Vector2)(ref vector)).Length() == 0f)
487 {
488 vector = PlayerInput.GamepadThumbstickLeft.RotatedBy(-(float)Math.PI / 2f + num);
489 }
490 int num2 = -1;
491 if (((Vector2)(ref vector)).Length() > 0.3f)
492 {
493 num2 = (int)((vector.ToRotation() + (float)Math.PI) / ((float)Math.PI * 2f / (float)RadialCount));
494 if (num2 >= RadialCount)
495 {
496 num2 -= RadialCount;
497 }
498 }
499 if ((num2 != -1 || !flag) && _SelectedBinding != num2 && (num2 != -1 || !(vector != Vector2.Zero)))
500 {
502 }
503 break;
504 }
505 }
506 }
static TriggersPack Triggers
static Vector2 GamepadThumbstickLeft
static Vector2 GamepadThumbstickRight

References Terraria.Player.SelectionRadial._SelectedBinding, Terraria.Player.SelectionRadial.Bindings, Terraria.Player.SelectionRadial.ChangeSelection(), Terraria.GameInput.PlayerInput.GamepadThumbstickLeft, Terraria.GameInput.PlayerInput.GamepadThumbstickRight, Terraria.Player.SelectionRadial.RadialCount, and Terraria.GameInput.PlayerInput.Triggers.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: