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

◆ SmartSelectLookup()

void Terraria.Player.SmartSelectLookup ( )
inline

Definition at line 15778 of file Player.cs.

15779 {
15780 if (selectedItem == 58)
15781 {
15782 return;
15783 }
15784 if (mouseInterface)
15785 {
15786 controlTorch = false;
15787 }
15788 if (controlTorch && itemAnimation == 0)
15789 {
15790 PlayerInput.smartSelectPointer.SmartSelectLookup_GetTargetTile(this, out var tX, out var tY);
15793 {
15795 }
15796 if (toolStrategy == 0 || toolStrategy == 4)
15797 {
15798 float num3 = Math.Abs((float)Main.mouseX + Main.screenPosition.X - (position.X + (float)(width / 2)));
15799 float num2 = Math.Abs((float)Main.mouseY + Main.screenPosition.Y - (position.Y + (float)(height / 2))) * 1.3f;
15800 if ((float)Math.Sqrt(num3 * num3 + num2 * num2) > 200f)
15801 {
15802 toolStrategy = 5;
15803 }
15804 }
15805 int modSelect = TileLoader.AutoSelect(tX, tY, this);
15806 if (modSelect >= 0)
15807 {
15809 return;
15810 }
15813 }
15815 {
15816 if (nonTorch == -1)
15817 {
15819 }
15822 }
15824 {
15825 if (nonTorch == -1)
15826 {
15828 }
15831 }
15832 else if (nonTorch > -1 && itemAnimation == 0)
15833 {
15835 nonTorch = -1;
15837 }
15838 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static SmartSelectGamepadPointer smartSelectPointer
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
static int AutoSelect(int i, int j, Player player)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
SelectionRadial DpadRadial
Definition Player.cs:991
bool mouseInterface
Definition Player.cs:1616
void SmartSelect_SelectItem(int t)
Definition Player.cs:16038
bool controlTorch
Definition Player.cs:1914
void SmartSelect_GetToolStrategy(int tX, int tY, out int toolStrategy, out bool wetTile)
Definition Player.cs:16047
void SmartSelect_PickToolForStrategy(int tX, int tY, int toolStrategy, bool wetTile)
Definition Player.cs:15850
SelectionRadial CircularRadial
Definition Player.cs:993
int _lastSmartCursorToolStrategy
Definition Player.cs:3171
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.Player._lastSmartCursorToolStrategy, Terraria.ModLoader.TileLoader.AutoSelect(), Terraria.Player.CircularRadial, Terraria.Player.controlTorch, Terraria.Player.DpadRadial, Terraria.Entity.height, Terraria.Player.inventory, Terraria.Player.itemAnimation, Terraria.Player.mouseInterface, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Player.nonTorch, Terraria.Entity.position, Terraria.Main.screenPosition, Terraria.Player.SelectionRadial.SelectedItem, Terraria.Player.selectedItem, Terraria.Player.SmartSelect_GetToolStrategy(), Terraria.Player.SmartSelect_PickToolForStrategy(), Terraria.Player.SmartSelect_SelectItem(), Terraria.GameInput.PlayerInput.smartSelectPointer, Terraria.Item.stack, Terraria.GameInput.PlayerInput.UsingGamepad, and Terraria.Entity.width.

Referenced by Terraria.Player.ItemCheck_Inner().

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