3106    {
 3107        Player player = Main.player[Main.myPlayer];
 
 3109        if (inv == null || inv[slot] == null || Main.mouseItem == null)
 3110        {
 3112        }
 3113        if (context == 0 || context == 1 || context == 2)
 3114        {
 3115            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3116            {
 3117                if (Main.mouseItem.type > 0)
 3118                {
 3120                    if (inv[slot].
type == Main.mouseItem.type && Main.mouseItem.stack < inv[slot].maxStack && inv[slot].maxStack > 1)
 
 3121                    {
 3123                    }
 3124                }
 3125                else
 3126                {
 3128                    {
 3129                        player.DpadRadial.ChangeBinding(slot);
 3130                    }
 3132                    if (inv[slot].maxStack > 1)
 3133                    {
 3135                    }
 3136                }
 3137                if (inv[slot].maxStack == 1 && 
Equippable(inv, context, slot))
 
 3138                {
 3141                    {
 3145                    }
 3146                }
 3149                {
 3150                    inv[slot].favorited = !inv[slot].favorited;
 3153                }
 3154            }
 3155            else if (Main.mouseItem.type > 0)
 3156            {
 3158            }
 3159        }
 3160        if (context == 3 || context == 4 || context == 32)
 3161        {
 3162            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3163            {
 3164                if (Main.mouseItem.type > 0)
 3165                {
 3167                    if (inv[slot].
type == Main.mouseItem.type && Main.mouseItem.stack < inv[slot].maxStack && inv[slot].maxStack > 1)
 
 3168                    {
 3170                    }
 3171                }
 3172                else
 3173                {
 3175                    if (inv[slot].maxStack > 1)
 3176                    {
 3178                    }
 3179                }
 3180                if (inv[slot].maxStack == 1 && 
Equippable(inv, context, slot))
 
 3181                {
 3184                    {
 3188                    }
 3189                }
 3190                if (context == 32)
 3191                {
 3194                    {
 3195                        inv[slot].favorited = !inv[slot].favorited;
 3198                    }
 3199                }
 3200            }
 3201            else if (Main.mouseItem.type > 0)
 3202            {
 3204            }
 3205        }
 3206        if (context == 15)
 3207        {
 3208            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3209            {
 3210                if (Main.mouseItem.type > 0)
 3211                {
 3212                    if (inv[slot].
type == Main.mouseItem.type && Main.mouseItem.stack < inv[slot].maxStack && inv[slot].maxStack > 1)
 
 3213                    {
 3215                    }
 3216                }
 3217                else
 3218                {
 3220                }
 3221            }
 3222            else if (Main.mouseItem.type > 0)
 3223            {
 3225            }
 3226        }
 3227        if (context == 8 || context == 9 || context == 16 || context == 17 || context == 18 || context == 19 || context == 20)
 3228        {
 3229            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3230            {
 3231                if (Main.mouseItem.type > 0)
 3232                {
 3234                    {
 3236                    }
 3237                }
 3239                {
 3241                }
 3242                if (context == 8 && slot >= 3)
 3243                {
 3244                    bool flag = player.hideVisibleAccessory[slot];
 3247                    {
 3248                        player.hideVisibleAccessory[slot] = !player.hideVisibleAccessory[slot];
 3250                        if (Main.netMode == 1)
 3251                        {
 3252                            NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3253                        }
 3256                    }
 3257                }
 3258                if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) && slot < 2)
 3259                {
 3260                    bool flag2 = player.hideMisc[slot];
 3263                    {
 3264                        if (slot == 0)
 3265                        {
 3266                            player.TogglePet();
 3267                        }
 3268                        if (slot == 1)
 3269                        {
 3270                            player.ToggleLight();
 3271                        }
 3273                        if (Main.netMode == 1)
 3274                        {
 3275                            NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3276                        }
 3279                    }
 3280                }
 3281            }
 3282            else
 3283            {
 3284                if (Main.mouseItem.type > 0 && 
Equippable(ref Main.mouseItem, context))
 
 3285                {
 3287                }
 3288                if (context == 8 && slot >= 3)
 3289                {
 3290                    int num = slot;
 3291                    if (num % 10 == 8 && !player.CanDemonHeartAccessoryBeShown())
 3292                    {
 3293                        num++;
 3294                    }
 3295                    bool flag3 = player.hideVisibleAccessory[num];
 3298                    {
 3299                        player.hideVisibleAccessory[num] = !player.hideVisibleAccessory[num];
 3301                        if (Main.netMode == 1)
 3302                        {
 3303                            NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3304                        }
 3307                    }
 3308                }
 3309                if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) && slot < 2)
 3310                {
 3311                    bool flag4 = player.hideMisc[slot];
 3314                    {
 3315                        if (slot == 0)
 3316                        {
 3317                            player.TogglePet();
 3318                        }
 3319                        if (slot == 1)
 3320                        {
 3321                            player.ToggleLight();
 3322                        }
 3323                        Main.mouseLeftRelease = false;
 3325                        if (Main.netMode == 1)
 3326                        {
 3327                            NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3328                        }
 3331                    }
 3332                }
 3333            }
 3334        }
 3335        switch (context)
 3336        {
 3337        case 12:
 3338        case 25:
 3339        case 27:
 3340        case 33:
 3341            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3342            {
 3343                if (Main.mouseItem.type > 0)
 3344                {
 3345                    if (Main.mouseItem.dye > 0)
 3346                    {
 3348                    }
 3349                }
 3350                else
 3351                {
 3353                }
 3354                if (context == 12 || context == 25 || context == 27 || context == 33)
 3355                {
 3356                    int num2 = -1;
 3357                    if (inv == player.dye)
 3358                    {
 3359                        num2 = slot;
 3360                    }
 3361                    if (inv == player.miscDyes)
 3362                    {
 3363                        num2 = 10 + slot;
 3364                    }
 3365                    if (num2 != -1)
 3366                    {
 3367                        if (num2 < 10)
 3368                        {
 3369                            bool flag7 = player.hideVisibleAccessory[slot];
 3372                            {
 3373                                player.hideVisibleAccessory[slot] = !player.hideVisibleAccessory[slot];
 3375                                if (Main.netMode == 1)
 3376                                {
 3377                                    NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3378                                }
 3381                            }
 3382                        }
 3383                        else
 3384                        {
 3385                            bool flag8 = player.hideMisc[slot];
 3388                            {
 3389                                player.hideMisc[slot] = !player.hideMisc[slot];
 3391                                if (Main.netMode == 1)
 3392                                {
 3393                                    NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3394                                }
 3397                            }
 3398                        }
 3399                    }
 3400                }
 3401            }
 3402            else if (Main.mouseItem.type > 0 && Main.mouseItem.dye > 0)
 3403            {
 3405            }
 3407        case 18:
 3408        {
 3409            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3410            {
 3411                if (Main.mouseItem.type > 0)
 3412                {
 3413                    if (Main.mouseItem.dye > 0)
 3414                    {
 3416                    }
 3417                }
 3418                else
 3419                {
 3421                }
 3422            }
 3423            else if (Main.mouseItem.type > 0 && Main.mouseItem.dye > 0)
 3424            {
 3426            }
 3427            bool enabledSuperCart = player.enabledSuperCart;
 3430            {
 3431                player.enabledSuperCart = !player.enabledSuperCart;
 3433                if (Main.netMode == 1)
 3434                {
 3435                    NetMessage.SendData(4, -1, -1, null, Main.myPlayer);
 3436                }
 3439            }
 3441        }
 3442        case 6:
 3443            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3444            {
 3446            }
 3447            else if (Main.mouseItem.type > 0)
 3448            {
 3450            }
 3452        case 5:
 3453        case 7:
 3454        {
 3455            bool flag6 = false;
 3456            if (context == 5)
 3457            {
 3458                flag6 = Main.mouseItem.Prefix(-3) || Main.mouseItem.type == 0;
 3459            }
 3460            if (context == 7)
 3461            {
 3462                flag6 = Main.mouseItem.material;
 3463            }
 3464            if (inv[slot].
type > 0 && inv[slot].stack > 0)
 
 3465            {
 3466                if (Main.mouseItem.type > 0)
 3467                {
 3468                    if (flag6)
 3469                    {
 3471                    }
 3472                }
 3473                else
 3474                {
 3476                }
 3477            }
 3478            else if (Main.mouseItem.type > 0 && flag6)
 3479            {
 3481            }
 3483        }
 3484        default:
 3485        {
 3487            bool flag5 = Main.mouseItem.type > 0 && (context == 0 || context == 1 || context == 2 || context == 6 || context == 15 || context == 7 || context == 4 || context == 32 || context == 3);
 3489            {
 3490                if (flag5 && string.IsNullOrEmpty(overrideInstructions))
 3491                {
 3494                    {
 3495                        player.DropSelectedItem();
 3498                    }
 3499                }
 3500                else if (!string.IsNullOrEmpty(overrideInstructions))
 3501                {
 3503                    int cursorOverride = Main.cursorOverride;
 3505                    if (-1 != Main.cursorOverride)
 3506                    {
 3509                        {
 3510                            bool mouseLeft = Main.mouseLeft;
 3511                            Main.mouseLeft = true;
 3513                            Main.mouseLeft = mouseLeft;
 3516                        }
 3517                    }
 3518                    Main.cursorOverride = cursorOverride;
 3520                }
 3521            }
 3523            {
 3525            }
 3527        }
 3528        }
 3529    }
static void PlaySound(int type, Vector2 position, int style=1)
 
static string GetTextValue(string key)
 
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()