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

◆ HoverOverNPCs()

void Terraria.Main.HoverOverNPCs ( Rectangle mouseRectangle)
inlineprivate

Definition at line 55537 of file Main.cs.

55538 {
55539 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
55540 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
55541 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
55542 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
55543 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
55544 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
55545 //IL_0137: Unknown result type (might be due to invalid IL or missing references)
55546 //IL_054f: Unknown result type (might be due to invalid IL or missing references)
55547 //IL_0555: Unknown result type (might be due to invalid IL or missing references)
55548 //IL_055a: Unknown result type (might be due to invalid IL or missing references)
55549 //IL_055f: Unknown result type (might be due to invalid IL or missing references)
55550 //IL_038a: Unknown result type (might be due to invalid IL or missing references)
55551 //IL_0537: Unknown result type (might be due to invalid IL or missing references)
55552 //IL_053d: Unknown result type (might be due to invalid IL or missing references)
55553 //IL_0542: Unknown result type (might be due to invalid IL or missing references)
55554 //IL_0547: Unknown result type (might be due to invalid IL or missing references)
55555 //IL_051b: Unknown result type (might be due to invalid IL or missing references)
55556 //IL_0521: Unknown result type (might be due to invalid IL or missing references)
55557 //IL_0526: Unknown result type (might be due to invalid IL or missing references)
55558 //IL_052b: Unknown result type (might be due to invalid IL or missing references)
55559 Player player = Main.player[myPlayer];
55560 Rectangle value = default(Rectangle);
55561 Rectangle rectangle = default(Rectangle);
55562 Rectangle value2 = default(Rectangle);
55563 for (int i = 0; i < 200; i++)
55564 {
55565 NPC nPC = npc[i];
55566 if (!nPC.ShowNameOnHover || !(nPC.active & (nPC.shimmerTransparency == 0f || nPC.CanApplyHunterPotionEffects())))
55567 {
55568 continue;
55569 }
55570 int type = nPC.type;
55571 LoadNPC(type);
55572 nPC.position += nPC.netOffset;
55573 ((Rectangle)(ref value))._002Ector((int)nPC.Bottom.X - nPC.frame.Width / 2, (int)nPC.Bottom.Y - nPC.frame.Height, nPC.frame.Width, nPC.frame.Height);
55574 if (nPC.type >= 87 && nPC.type <= 92)
55575 {
55576 ((Rectangle)(ref value))._002Ector((int)((double)nPC.position.X + (double)nPC.width * 0.5 - 32.0), (int)((double)nPC.position.Y + (double)nPC.height * 0.5 - 32.0), 64, 64);
55577 }
55579 bool flag = ((Rectangle)(ref mouseRectangle)).Intersects(value);
55581 if (flag2 && ((nPC.type != 85 && nPC.type != 341 && nPC.type != 629 && nPC.aiStyle != 87) || nPC.ai[0] != 0f) && nPC.type != 488)
55582 {
55583 if (nPC.type == 685)
55584 {
55585 player.cursorItemIconEnabled = true;
55586 player.cursorItemIconID = 327;
55587 player.cursorItemIconText = "";
55588 player.noThrow = 2;
55589 if (!player.dead)
55590 {
55593 {
55594 npcChatRelease = false;
55596 {
55597 player.releaseInventory = false;
55598 }
55599 if (player.talkNPC != i && !player.tileInteractionHappened && TryFreeingElderSlime(i))
55600 {
55601 NPC.TransformElderSlime(i);
55603 }
55604 }
55605 }
55606 }
55607 else
55608 {
55610 bool vanillaCanChat = false;
55611 if (nPC.townNPC || nPC.type == 105 || nPC.type == 106 || nPC.type == 123 || nPC.type == 354 || nPC.type == 376 || nPC.type == 579 || nPC.type == 453 || nPC.type == 589)
55612 {
55613 vanillaCanChat = true;
55614 }
55616 {
55617 ((Rectangle)(ref rectangle))._002Ector((int)(player.position.X + (float)(player.width / 2) - (float)(Player.tileRangeX * 16)), (int)(player.position.Y + (float)(player.height / 2) - (float)(Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2);
55618 ((Rectangle)(ref value2))._002Ector((int)nPC.position.X, (int)nPC.position.Y, nPC.width, nPC.height);
55619 if (((Rectangle)(ref rectangle)).Intersects(value2))
55620 {
55621 flag3 = true;
55622 }
55623 }
55624 if (player.ownedProjectileCounts[651] > 0)
55625 {
55626 flag3 = false;
55627 }
55628 if (flag3 && !player.dead)
55629 {
55631 HoveringOverAnNPC = true;
55634 {
55635 npcChatRelease = false;
55637 {
55638 player.releaseInventory = false;
55639 }
55640 if (player.talkNPC != i && !player.tileInteractionHappened)
55641 {
55643 SetNPCShopIndex(0);
55644 InGuideCraftMenu = false;
55645 player.dropItemCheck();
55647 player.sign = -1;
55648 editSign = false;
55649 player.SetTalkNPC(i);
55650 playerInventory = false;
55651 player.chest = -1;
55652 Recipe.FindRecipes();
55653 npcChatText = nPC.GetChat();
55655 }
55656 }
55657 }
55658 if (flag && !player.mouseInterface)
55659 {
55660 player.cursorItemIconEnabled = false;
55661 string text = nPC.GivenOrTypeName;
55662 int num = i;
55663 if (nPC.realLife >= 0)
55664 {
55665 num = nPC.realLife;
55666 }
55667 if (npc[num].lifeMax > 1 && !npc[num].dontTakeDamage)
55668 {
55669 text = text + ": " + npc[num].life + "/" + npc[num].lifeMax;
55670 }
55671 MouseTextHackZoom(text);
55672 mouseText = true;
55673 nPC.position -= nPC.netOffset;
55674 break;
55675 }
55676 if (flag2)
55677 {
55678 nPC.position -= nPC.netOffset;
55679 break;
55680 }
55681 }
55682 }
55683 nPC.position -= nPC.netOffset;
55684 }
55685 }
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 ...
void MouseTextHackZoom(string text, string buffTooltip=null)
Definition Main.cs:19451
static string npcChatText
Definition Main.cs:1982
static int npcChatCornerItem
Definition Main.cs:1994
static bool npcChatRelease
Definition Main.cs:1970
void LoadNPC(int i)
Definition Main.cs:75389
static bool SmartInteractShowingGenuine
Definition Main.cs:2242
static bool TryFreeingElderSlime(int npcIndex)
Definition Main.cs:55687
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static bool editSign
Definition Main.cs:1972
static bool mouseRight
Definition Main.cs:644
static void SetNPCShopIndex(int index)
Definition Main.cs:52040
static void CancelHairWindow()
Definition Main.cs:56438
static int SmartInteractNPC
Definition Main.cs:2250
static bool mouseText
Definition Main.cs:2536
int currentNPCShowingChatBubble
Definition Main.cs:2150
static bool InGuideCraftMenu
Definition Main.cs:2056
static NPC[] npc
Definition Main.cs:1830
static bool playerInventory
Definition Main.cs:1912
static bool HoveringOverAnNPC
Definition Main.cs:2530
static Player[] player
Definition Main.cs:1960
static ? bool CanChat(NPC npc)
static void ModifyHoverBoundingBox(NPC npc, ref Rectangle boundingBox)
This serves as the central class from which NPC-related functions are carried out....
Definition NPCLoader.cs:26

References Terraria.Main.CancelHairWindow(), Terraria.ModLoader.NPCLoader.CanChat(), Terraria.Main.currentNPCShowingChatBubble, Terraria.Main.editSign, Terraria.Recipe.FindRecipes(), Terraria.Main.HoveringOverAnNPC, Terraria.Main.InGuideCraftMenu, Terraria.Main.LoadNPC(), Terraria.ModLoader.NPCLoader.ModifyHoverBoundingBox(), Terraria.Main.mouseRight, Terraria.Main.mouseText, Terraria.Main.MouseTextHackZoom(), Terraria.Main.myPlayer, Terraria.Main.npc, Terraria.Main.npcChatCornerItem, Terraria.Main.npcChatRelease, Terraria.Main.npcChatText, Terraria.Main.player, Terraria.Main.playerInventory, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.SetNPCShopIndex(), Terraria.GameInput.PlayerInput.SetZoom_MouseInWorld(), Terraria.Main.SmartInteractNPC, Terraria.Main.SmartInteractShowingGenuine, Terraria.Player.tileRangeX, Terraria.Player.tileRangeY, Terraria.NPC.TransformElderSlime(), Terraria.Main.TryFreeingElderSlime(), and Terraria.GameInput.PlayerInput.UsingGamepad.

Referenced by Terraria.Main.DrawMouseOver().

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