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

◆ OverrideHover() [1/2]

static void Terraria.UI.ItemSlot.OverrideHover ( Item[] inv,
int context = 0,
int slot = 0 )
inlinestatic

Definition at line 363 of file ItemSlot.cs.

364 {
365 //IL_04d1: Unknown result type (might be due to invalid IL or missing references)
366 Item item = inv[slot];
368 {
370 }
371 if (PlayerLoader.HoverSlot(Main.player[Main.myPlayer], inv, context, slot))
372 {
373 return;
374 }
376 if (NotUsingGamepad && Options.DisableLeftShiftTrashCan && !shiftForcedOn)
377 {
378 if (ControlInUse && !Options.DisableQuickTrash)
379 {
380 if (item.type > 0 && item.stack > 0 && !inv[slot].favorited)
381 {
382 switch (context)
383 {
384 case 0:
385 case 1:
386 case 2:
387 if (Main.npcShop > 0 && !item.favorited)
388 {
389 Main.cursorOverride = 10;
390 }
391 else
392 {
393 Main.cursorOverride = 6;
394 }
395 break;
396 case 3:
397 case 4:
398 case 7:
399 case 32:
400 if (Main.player[Main.myPlayer].ItemSpace(item).CanTakeItemToPersonalInventory)
401 {
402 Main.cursorOverride = 6;
403 }
404 break;
405 }
406 }
407 }
408 else if (ShiftInUse)
409 {
410 bool flag = false;
411 if (Main.LocalPlayer.tileEntityAnchor.IsInValidUseTileEntity())
412 {
413 flag = Main.LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotHover(inv, context, slot);
414 }
415 if (item.type > 0 && item.stack > 0 && !inv[slot].favorited && !flag)
416 {
417 switch (context)
418 {
419 case 0:
420 if (Main.CreativeMenu.IsShowingResearchMenu())
421 {
422 Main.cursorOverride = 9;
423 break;
424 }
425 goto case 1;
426 case 1:
427 case 2:
428 if (context == 0 && Main.InReforgeMenu)
429 {
430 if (item.Prefix(-3))
431 {
432 Main.cursorOverride = 9;
433 }
434 }
435 else if (context == 0 && Main.InGuideCraftMenu)
436 {
437 if (item.material)
438 {
439 Main.cursorOverride = 9;
440 }
441 }
442 else if (Main.player[Main.myPlayer].chest != -1 && ChestUI.TryPlacingInChest(item, justCheck: true, context))
443 {
444 Main.cursorOverride = 9;
445 }
446 break;
447 case 3:
448 case 4:
449 case 32:
450 if (Main.player[Main.myPlayer].ItemSpace(item).CanTakeItemToPersonalInventory)
451 {
452 Main.cursorOverride = 8;
453 }
454 break;
455 case 5:
456 case 7:
457 case 8:
458 case 9:
459 case 10:
460 case 11:
461 case 12:
462 case 16:
463 case 17:
464 case 18:
465 case 19:
466 case 20:
467 case 23:
468 case 24:
469 case 25:
470 case 26:
471 case 27:
472 case 29:
473 case 33:
474 if (Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory)
475 {
476 Main.cursorOverride = 7;
477 }
478 break;
479 }
480 }
481 }
482 }
483 else if (ShiftInUse)
484 {
485 bool flag2 = false;
486 if (Main.LocalPlayer.tileEntityAnchor.IsInValidUseTileEntity())
487 {
488 flag2 = Main.LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotHover(inv, context, slot);
489 }
490 if (item.type > 0 && item.stack > 0 && !inv[slot].favorited && !flag2)
491 {
492 switch (context)
493 {
494 case 0:
495 case 1:
496 case 2:
497 if (Main.npcShop > 0 && !item.favorited)
498 {
499 if (!Options.DisableQuickTrash)
500 {
501 Main.cursorOverride = 10;
502 }
503 }
504 else if (context == 0 && Main.CreativeMenu.IsShowingResearchMenu())
505 {
506 Main.cursorOverride = 9;
507 }
508 else if (context == 0 && Main.InReforgeMenu)
509 {
510 if (item.Prefix(-3))
511 {
512 Main.cursorOverride = 9;
513 }
514 }
515 else if (context == 0 && Main.InGuideCraftMenu)
516 {
517 if (item.material)
518 {
519 Main.cursorOverride = 9;
520 }
521 }
522 else if (Main.player[Main.myPlayer].chest != -1)
523 {
524 if (ChestUI.TryPlacingInChest(item, justCheck: true, context))
525 {
526 Main.cursorOverride = 9;
527 }
528 }
529 else if (!Options.DisableQuickTrash)
530 {
531 Main.cursorOverride = 6;
532 }
533 break;
534 case 3:
535 case 4:
536 case 32:
537 if (Main.player[Main.myPlayer].ItemSpace(item).CanTakeItemToPersonalInventory)
538 {
539 Main.cursorOverride = 8;
540 }
541 break;
542 case 5:
543 case 7:
544 case 8:
545 case 9:
546 case 10:
547 case 11:
548 case 12:
549 case 16:
550 case 17:
551 case 18:
552 case 19:
553 case 20:
554 case 23:
555 case 24:
556 case 25:
557 case 26:
558 case 27:
559 case 29:
560 case 33:
561 if (Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory)
562 {
563 Main.cursorOverride = 7;
564 }
565 break;
566 }
567 }
568 }
569 if (((KeyboardState)(ref Main.keyState)).IsKeyDown(Main.FavoriteKey) && (canFavoriteAt[context] || (Main.drawingPlayerChat && canShareAt[context])))
570 {
571 if (item.type > 0 && item.stack > 0 && Main.drawingPlayerChat)
572 {
573 Main.cursorOverride = 2;
574 }
575 else if (item.type > 0 && item.stack > 0)
576 {
577 Main.cursorOverride = 3;
578 }
579 }
580 }
static bool HoverSlot(Player player, Item[] inventory, int context, int slot)
This is where all ModPlayer hooks are gathered and called.
static bool ShiftForcedOn
Definition ItemSlot.cs:139
static bool NotUsingGamepad
Definition ItemSlot.cs:186
static bool ShiftInUse
Definition ItemSlot.cs:172
static bool ControlInUse
Definition ItemSlot.cs:184
static bool[] canShareAt
Definition ItemSlot.cs:145
static bool[] canFavoriteAt
Definition ItemSlot.cs:143
static int GetGamepadPointForSlot(Item[] inv, int context, int slot)
Definition ItemSlot.cs:2715

References Terraria.UI.ItemSlot.canFavoriteAt, Terraria.UI.ItemSlot.canShareAt, Terraria.UI.ItemSlot.ControlInUse, Terraria.Main.CreativeMenu, Terraria.UI.ItemSlot.Options.DisableLeftShiftTrashCan, Terraria.UI.ItemSlot.Options.DisableQuickTrash, Terraria.Main.drawingPlayerChat, Terraria.Item.favorited, Terraria.Main.FavoriteKey, Terraria.UI.ItemSlot.GetGamepadPointForSlot(), Terraria.ModLoader.PlayerLoader.HoverSlot(), Terraria.Main.InGuideCraftMenu, Terraria.Main.InReforgeMenu, Terraria.Main.keyState, Terraria.Main.LocalPlayer, Terraria.Item.material, Terraria.Main.myPlayer, Terraria.UI.ItemSlot.NotUsingGamepad, Terraria.Main.npcShop, Terraria.Main.player, Terraria.Item.Prefix(), Terraria.UI.ItemSlot.ShiftForcedOn, Terraria.UI.ItemSlot.ShiftInUse, Terraria.Item.stack, Terraria.UI.Gamepad.UILinkPointNavigator.SuggestUsage(), Terraria.UI.ChestUI.TryPlacingInChest(), Terraria.Item.type, and Terraria.GameInput.PlayerInput.UsingGamepad.

+ Here is the call graph for this function: