3569 {
3570 Player player = Main.player[Main.myPlayer];
3572 if (
inv ==
null ||
inv[
slot] ==
null || Main.mouseItem ==
null)
3573 {
3575 }
3576 if (context == 0 || context == 1 || context == 2)
3577 {
3579 {
3580 if (Main.mouseItem.type > 0)
3581 {
3583 if (
inv[
slot].type == Main.mouseItem.type && Main.mouseItem.stack <
inv[
slot].maxStack &&
inv[
slot].maxStack > 1)
3584 {
3586 }
3587 }
3588 else
3589 {
3591 {
3592 player.DpadRadial.ChangeBinding(
slot);
3593 }
3596 {
3598 }
3599 }
3601 {
3604 {
3608 }
3609 }
3612 {
3616 }
3617 }
3618 else if (Main.mouseItem.type > 0)
3619 {
3621 }
3622 }
3623 if (context == 3 || context == 4 || context == 32)
3624 {
3626 {
3627 if (Main.mouseItem.type > 0)
3628 {
3630 if (
inv[
slot].type == Main.mouseItem.type && Main.mouseItem.stack <
inv[
slot].maxStack &&
inv[
slot].maxStack > 1)
3631 {
3633 }
3634 }
3635 else
3636 {
3639 {
3641 }
3642 }
3644 {
3647 {
3651 }
3652 }
3653 if (context == 32)
3654 {
3657 {
3661 }
3662 }
3663 }
3664 else if (Main.mouseItem.type > 0)
3665 {
3667 }
3668 }
3669 if (context == 15)
3670 {
3672 {
3673 if (Main.mouseItem.type > 0)
3674 {
3675 if (
inv[
slot].type == Main.mouseItem.type && Main.mouseItem.stack <
inv[
slot].maxStack &&
inv[
slot].maxStack > 1)
3676 {
3678 }
3679 }
3680 else
3681 {
3683 }
3684 }
3685 else if (Main.mouseItem.type > 0)
3686 {
3688 }
3689 }
3690 if (context == 8 || context == 9 || context == 16 || context == 17 || context == 18 || context == 19 || context == 20)
3691 {
3693 {
3694 if (Main.mouseItem.type > 0)
3695 {
3697 {
3699 }
3700 }
3702 {
3704 }
3705 if (context == 8 &&
slot >= 3)
3706 {
3707 bool flag = player.hideVisibleAccessory[
slot];
3710 {
3711 player.hideVisibleAccessory[
slot] = !player.hideVisibleAccessory[
slot];
3713 if (Main.netMode == 1)
3714 {
3715 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3716 }
3719 }
3720 }
3721 if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) &&
slot < 2)
3722 {
3726 {
3728 {
3729 player.TogglePet();
3730 }
3732 {
3733 player.ToggleLight();
3734 }
3736 if (Main.netMode == 1)
3737 {
3738 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3739 }
3742 }
3743 }
3744 }
3745 else
3746 {
3747 if (Main.mouseItem.type > 0 &&
Equippable(
ref Main.mouseItem, context))
3748 {
3750 }
3751 if (context == 8 &&
slot >= 3)
3752 {
3754 if (
num % 10 == 8 && !player.CanDemonHeartAccessoryBeShown())
3755 {
3757 }
3758 bool flag3 = player.hideVisibleAccessory[
num];
3761 {
3762 player.hideVisibleAccessory[
num] = !player.hideVisibleAccessory[
num];
3764 if (Main.netMode == 1)
3765 {
3766 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3767 }
3770 }
3771 }
3772 if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) &&
slot < 2)
3773 {
3777 {
3779 {
3780 player.TogglePet();
3781 }
3783 {
3784 player.ToggleLight();
3785 }
3786 Main.mouseLeftRelease = false;
3788 if (Main.netMode == 1)
3789 {
3790 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3791 }
3794 }
3795 }
3796 }
3797 }
3798 switch (context)
3799 {
3800 case 12:
3801 case 25:
3802 case 27:
3803 case 33:
3805 {
3806 if (Main.mouseItem.type > 0)
3807 {
3808 if (Main.mouseItem.dye > 0)
3809 {
3811 }
3812 }
3813 else
3814 {
3816 }
3817 if (context == 12 || context == 25 || context == 27 || context == 33)
3818 {
3820 if (
inv == player.dye)
3821 {
3823 }
3824 if (
inv == player.miscDyes)
3825 {
3827 }
3829 {
3831 {
3832 bool flag7 = player.hideVisibleAccessory[
slot];
3835 {
3836 player.hideVisibleAccessory[
slot] = !player.hideVisibleAccessory[
slot];
3838 if (Main.netMode == 1)
3839 {
3840 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3841 }
3844 }
3845 }
3846 else
3847 {
3851 {
3852 player.hideMisc[
slot] = !player.hideMisc[
slot];
3854 if (Main.netMode == 1)
3855 {
3856 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3857 }
3860 }
3861 }
3862 }
3863 }
3864 }
3865 else if (Main.mouseItem.type > 0 && Main.mouseItem.dye > 0)
3866 {
3868 }
3870 case 18:
3871 {
3873 {
3874 if (Main.mouseItem.type > 0)
3875 {
3876 if (Main.mouseItem.dye > 0)
3877 {
3879 }
3880 }
3881 else
3882 {
3884 }
3885 }
3886 else if (Main.mouseItem.type > 0 && Main.mouseItem.dye > 0)
3887 {
3889 }
3890 bool enabledSuperCart = player.enabledSuperCart;
3893 {
3894 player.enabledSuperCart = !player.enabledSuperCart;
3896 if (Main.netMode == 1)
3897 {
3898 NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
3899 }
3902 }
3904 }
3905 case 6:
3907 {
3909 }
3910 else if (Main.mouseItem.type > 0)
3911 {
3913 }
3915 case 5:
3916 case 7:
3917 {
3919 if (context == 5)
3920 {
3921 flag6 = Main.mouseItem.Prefix(-3) || Main.mouseItem.type == 0;
3922 }
3923 if (context == 7)
3924 {
3925 flag6 = Main.mouseItem.material;
3926 }
3928 {
3929 if (Main.mouseItem.type > 0)
3930 {
3932 {
3934 }
3935 }
3936 else
3937 {
3939 }
3940 }
3941 else if (Main.mouseItem.type > 0 &&
flag6)
3942 {
3944 }
3946 }
3947 default:
3948 {
3950 bool flag5 = Main.mouseItem.type > 0 && (context == 0 || context == 1 || context == 2 || context == 6 || context == 15 || context == 7 || context == 4 || context == 32 || context == 3);
3952 {
3954 {
3957 {
3958 player.DropSelectedItem();
3961 }
3962 }
3964 {
3966 int cursorOverride = Main.cursorOverride;
3968 if (-1 != Main.cursorOverride)
3969 {
3972 {
3973 bool mouseLeft = Main.mouseLeft;
3974 Main.mouseLeft = true;
3976 Main.mouseLeft = mouseLeft;
3979 }
3980 }
3981 Main.cursorOverride = cursorOverride;
3983 }
3984 }
3986 {
3988 }
3990 }
3991 }
3992 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
static bool isEquipLocked(int type)
static bool TryEnteringFastUseMode(Item[] inv, int context, int slot, Player player, ref string s)
static void OverrideHover(ref Item inv, int context=0)
static void SwapEquip(ref Item inv, int context=0)
static bool ShiftForcedOn
static bool Equippable(ref Item inv, int context=0)
static string GetOverrideInstructions(Item[] inv, int context, int slot)
static void LeftClick(ref Item inv, int context=0)
static bool CanDoSimulatedClickAction()
static bool TryEnteringBuildingMode(Item[] inv, int context, int slot, Player player, ref string s)
static bool CanExecuteCommand()