1321 {
1322 Player player = Main.player[Main.myPlayer];
1323 inv[slot].newAndShiny = false;
1324 if (player.itemAnimation > 0)
1325 {
1326 return;
1327 }
1328 if (context == 15)
1329 {
1330 HandleShopSlot(inv, slot, rightClickIsValid: true, leftClickIsValid: false);
1331 }
1332 else
1333 {
1334 if (!Main.mouseRight)
1335 {
1336 return;
1337 }
1338 if (context == 0 && Main.mouseRightRelease)
1339 {
1341 }
1343 {
1344 if (Main.mouseRightRelease)
1345 {
1347 }
1348 return;
1349 }
1350 switch (context)
1351 {
1352 case 9:
1353 case 11:
1354 if (Main.mouseRightRelease)
1355 {
1357 }
1358 break;
1359 case 12:
1360 case 25:
1361 case 27:
1362 case 33:
1363 if (Main.mouseRightRelease)
1364 {
1366 }
1367 break;
1368 case 0:
1369 case 3:
1370 case 4:
1371 case 32:
1372 if (inv[slot].maxStack == 1)
1373 {
1374 if (Main.mouseRightRelease)
1375 {
1377 }
1378 break;
1379 }
1380 goto default;
1381 default:
1382 {
1383 if (Main.stackSplit > 1)
1384 {
1385 break;
1386 }
1387 bool flag = true;
1388 bool flag2 = inv[slot].maxStack <= 1 && inv[slot].stack <= 1;
1389 if (context == 0 && flag2)
1390 {
1391 flag = false;
1392 }
1393 if (context == 3 && flag2)
1394 {
1395 flag = false;
1396 }
1397 if (context == 4 && flag2)
1398 {
1399 flag = false;
1400 }
1401 if (context == 32 && flag2)
1402 {
1403 flag = false;
1404 }
1405 if (!flag)
1406 {
1407 break;
1408 }
1409 int num = Main.superFastStack + 1;
1410 for (
int i = 0;
i < num;
i++)
1411 {
1412 if ((Main.mouseItem.IsTheSameAs(inv[slot]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0))
1413 {
1417 }
1418 }
1419 break;
1420 }
1421 }
1422 }
1423 }
static void PlaySound(int type, Vector2 position, int style=1)
static bool[] OpenableBag
static void HandleShopSlot(Item[] inv, int slot, bool rightClickIsValid, bool leftClickIsValid)
static void SwapEquip(ref Item inv, int context=0)
static void PickupItemIntoMouse(Item[] inv, int context, int slot, Player player)
static void SwapVanityEquip(Item[] inv, int context, int slot, Player player)
static void TryPickupDyeToCursor(int context, Item[] inv, int slot, Player player)
static void RefreshStackSplitCooldown()
static void TryItemSwap(Item item)
static void TryOpenContainer(Item item, Player player)