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

◆ TryEnteringBuildingMode()

static bool Terraria.UI.ItemSlot.TryEnteringBuildingMode ( Item[] inv,
int context,
int slot,
Player player,
ref string s )
inlinestaticprivate

Definition at line 4034 of file ItemSlot.cs.

4035 {
4036 int num = 0;
4037 if (IsABuildingItem(Main.mouseItem))
4038 {
4039 num = 1;
4040 }
4041 if (num == 0 && Main.mouseItem.stack <= 0 && context == 0 && IsABuildingItem(inv[slot]))
4042 {
4043 num = 2;
4044 }
4045 if (num > 0)
4046 {
4047 Item item = Main.mouseItem;
4048 if (num == 1)
4049 {
4050 item = Main.mouseItem;
4051 }
4052 if (num == 2)
4053 {
4054 item = inv[slot];
4055 }
4056 if (num != 1 || player.ItemSpace(item).CanTakeItemToPersonalInventory)
4057 {
4058 if (item.damage > 0 && item.ammo == 0)
4059 {
4060 s += PlayerInput.BuildCommand(Lang.misc[60].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]);
4061 }
4062 else if (item.createTile >= 0 || item.createWall > 0)
4063 {
4064 s += PlayerInput.BuildCommand(Lang.misc[61].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]);
4065 }
4066 else
4067 {
4068 s += PlayerInput.BuildCommand(Lang.misc[63].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]);
4069 }
4070 if (CanExecuteCommand() && PlayerInput.Triggers.JustPressed.QuickMount)
4071 {
4073 }
4074 return true;
4075 }
4076 }
4077 return false;
4078 }
static TriggersPack Triggers
static string BuildCommand(string CommandText, bool Last, params List< string >[] Bindings)
static KeyConfiguration ProfileGamepadUI
static bool IsABuildingItem(Item item)
Definition ItemSlot.cs:4080
static bool CanExecuteCommand()
Definition ItemSlot.cs:3563

References Terraria.Item.ammo, Terraria.GameInput.PlayerInput.BuildCommand(), Terraria.UI.ItemSlot.CanExecuteCommand(), Terraria.Player.ItemSpaceStatus.CanTakeItemToPersonalInventory, Terraria.Item.createTile, Terraria.Item.createWall, Terraria.Item.damage, Terraria.GameInput.PlayerInput.EnterBuildingMode(), Terraria.UI.ItemSlot.IsABuildingItem(), Terraria.Player.ItemSpace(), Terraria.Lang.misc, Terraria.Main.mouseItem, Terraria.GameInput.PlayerInput.ProfileGamepadUI, and Terraria.GameInput.PlayerInput.Triggers.

Referenced by Terraria.UI.ItemSlot.GetGamepadInstructions().

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