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

◆ GUIChatDrawInner()

void Terraria.Main.GUIChatDrawInner ( )
inlineprotected

Definition at line 36377 of file Main.cs.

36378 {
36379 if (player[myPlayer].talkNPC < 0 && player[myPlayer].sign == -1)
36380 {
36381 npcChatText = "";
36382 return;
36383 }
36384 Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(200, 200, 200, 200);
36385 int num = (mouseTextColor * 2 + 255) / 3;
36387 bool flag = InGameUI.CurrentState is UIVirtualKeyboard && PlayerInput.UsingGamepad;
36388 string textValue = npcChatText;
36389 bool num2 = player[myPlayer].talkNPC != -1 && CanDryadPlayStardewAnimation(LocalPlayer, npc[player[myPlayer].talkNPC]);
36390 if (player[myPlayer].talkNPC != -1 && npc[player[myPlayer].talkNPC].ai[0] == 24f && NPC.RerollDryadText == 2)
36391 {
36392 NPC.RerollDryadText = 1;
36393 }
36394 if (num2 && NPC.RerollDryadText == 1 && npc[player[myPlayer].talkNPC].ai[0] != 24f && player[myPlayer].talkNPC != -1 && npc[player[myPlayer].talkNPC].active && npc[player[myPlayer].talkNPC].type == 20)
36395 {
36396 NPC.RerollDryadText = 0;
36397 npcChatText = npc[player[myPlayer].talkNPC].GetChat();
36398 NPC.PreventJojaColaDialog = true;
36399 }
36400 if (num2 && !NPC.PreventJojaColaDialog)
36401 {
36402 textValue = Language.GetTextValue("StardewTalk.PlayerHasColaAndIsHoldingIt");
36403 }
36404 bool flag2 = player[myPlayer].talkNPC != -1;
36408 bool flag3 = false;
36409 if (editSign)
36410 {
36412 if (textBlinkerCount >= 20)
36413 {
36414 if (textBlinkerState == 0)
36415 {
36416 textBlinkerState = 1;
36417 }
36418 else
36419 {
36420 textBlinkerState = 0;
36421 }
36422 textBlinkerCount = 0;
36423 }
36424 if (textBlinkerState == 1)
36425 {
36426 flag3 = true;
36427 }
36428 instance.DrawWindowsIMEPanel(new Vector2(screenWidth / 2, 90f), 0.5f);
36429 }
36430 amountOfLines++;
36431 spriteBatch.Draw(TextureAssets.ChatBack.Value, new Vector2(screenWidth / 2 - TextureAssets.ChatBack.Width() / 2, 100f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.ChatBack.Width(), (amountOfLines + 1) * 30), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
36432 spriteBatch.Draw(TextureAssets.ChatBack.Value, new Vector2(screenWidth / 2 - TextureAssets.ChatBack.Width() / 2, 100 + (amountOfLines + 1) * 30), new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.ChatBack.Height() - 30, TextureAssets.ChatBack.Width(), 30), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
36433 for (int i = 0; i < amountOfLines; i++)
36434 {
36435 string text = textLines[i];
36436 if (text != null)
36437 {
36438 if (i == amountOfLines - 1 && flag3)
36439 {
36440 text += "|";
36441 }
36442 if (flag2)
36443 {
36445 }
36446 else
36447 {
36448 Utils.DrawBorderStringFourWay(spriteBatch, FontAssets.MouseText.Value, text, 170 + (screenWidth - 800) / 2, 120 + i * 30, color2, Microsoft.Xna.Framework.Color.Black, Vector2.Zero);
36449 }
36450 }
36451 }
36453 int num3 = 120 + amountOfLines * 30 + 30;
36454 num3 -= 235;
36455 UIVirtualKeyboard.ShouldHideText = !PlayerInput.SettingsForUI.ShowGamepadHints;
36457 {
36458 num3 = 9999;
36459 }
36460 UIVirtualKeyboard.OffsetDown = num3;
36461 if (npcChatCornerItem != 0)
36462 {
36463 Vector2 position = new Vector2(screenWidth / 2 + TextureAssets.ChatBack.Width() / 2, 100 + (amountOfLines + 1) * 30 + 30);
36464 position -= Vector2.One * 8f;
36465 Item item = new Item();
36466 item.netDefaults(npcChatCornerItem);
36467 float num4 = 1f;
36469 if (rectangle2.Width > 32 || rectangle2.Height > 32)
36470 {
36471 num4 = ((rectangle2.Width <= rectangle2.Height) ? (32f / (float)rectangle2.Height) : (32f / (float)rectangle2.Width));
36472 }
36473 spriteBatch.Draw(itemTexture, position, rectangle2, item.GetAlpha(Microsoft.Xna.Framework.Color.White), 0f, rectangle2.Size(), num4, SpriteEffects.None, 0f);
36474 if (item.color != default(Microsoft.Xna.Framework.Color))
36475 {
36476 spriteBatch.Draw(itemTexture, position, rectangle2, item.GetColor(item.color), 0f, rectangle2.Size(), num4, SpriteEffects.None, 0f);
36477 }
36478 if (new Microsoft.Xna.Framework.Rectangle((int)position.X - (int)((float)rectangle2.Width * num4), (int)position.Y - (int)((float)rectangle2.Height * num4), (int)((float)rectangle2.Width * num4), (int)((float)rectangle2.Height * num4)).Contains(new Microsoft.Xna.Framework.Point(mouseX, mouseY)))
36479 {
36480 cursorOverride = 2;
36482 {
36483 if (!drawingPlayerChat)
36484 {
36486 }
36488 {
36490 }
36491 }
36492 MouseText(item.Name, -11, 0);
36493 }
36494 }
36495 num = mouseTextColor;
36496 color2 = new Microsoft.Xna.Framework.Color(num, (int)((double)num / 1.1), num / 2, num);
36497 string focusText = "";
36498 string focusText2 = "";
36499 int num5 = player[myPlayer].statLifeMax2 - player[myPlayer].statLife;
36500 for (int j = 0; j < Player.maxBuffs; j++)
36501 {
36502 int num6 = player[myPlayer].buffType[j];
36504 {
36505 num5 += 100;
36506 }
36507 }
36508 if (NPC.downedGolemBoss)
36509 {
36510 num5 *= 200;
36511 }
36512 else if (NPC.downedPlantBoss)
36513 {
36514 num5 *= 150;
36515 }
36516 else if (NPC.downedMechBossAny)
36517 {
36518 num5 *= 100;
36519 }
36520 else if (hardMode)
36521 {
36522 num5 *= 60;
36523 }
36524 else if (NPC.downedBoss3 || NPC.downedQueenBee)
36525 {
36526 num5 *= 25;
36527 }
36528 else if (NPC.downedBoss2)
36529 {
36530 num5 *= 10;
36531 }
36532 else if (NPC.downedBoss1)
36533 {
36534 num5 *= 3;
36535 }
36536 if (expertMode)
36537 {
36538 num5 *= 2;
36539 }
36540 num5 = (int)((double)num5 * player[myPlayer].currentShoppingSettings.PriceAdjustment);
36541 string text2 = null;
36542 string text3 = null;
36543 if (player[myPlayer].sign > -1)
36544 {
36545 focusText = ((!editSign) ? Lang.inter[48].Value : Lang.inter[47].Value);
36546 }
36547 else if (npc[player[myPlayer].talkNPC].type == 20)
36548 {
36549 focusText = Lang.inter[28].Value;
36550 focusText2 = Lang.inter[49].Value;
36552 {
36553 focusText2 = Language.GetTextValue("StardewTalk.GiveColaButtonText");
36554 }
36555 }
36556 else if (NPCID.Sets.IsTownPet[npc[player[myPlayer].talkNPC].type])
36557 {
36558 focusText = Language.GetTextValue("UI.PetTheAnimal");
36559 }
36560 else if (npc[player[myPlayer].talkNPC].type == 207)
36561 {
36562 focusText = Lang.inter[28].Value;
36563 if (hardMode)
36564 {
36565 focusText2 = Lang.inter[107].Value;
36566 }
36567 }
36568 else if (npc[player[myPlayer].talkNPC].type == 453)
36569 {
36570 focusText = Lang.inter[28].Value;
36571 }
36572 else if (npc[player[myPlayer].talkNPC].type == 550)
36573 {
36574 focusText = Lang.inter[28].Value;
36575 focusText2 = Language.GetTextValue("UI.BartenderHelp");
36576 }
36577 else if (npc[player[myPlayer].talkNPC].type == 588)
36578 {
36579 focusText = Lang.inter[28].Value;
36580 }
36581 else if (npc[player[myPlayer].talkNPC].type == 633)
36582 {
36583 focusText = Lang.inter[28].Value;
36584 }
36585 else if (npc[player[myPlayer].talkNPC].type == 663)
36586 {
36587 focusText = Lang.inter[28].Value;
36588 }
36589 else if (npc[player[myPlayer].talkNPC].type == 353)
36590 {
36591 focusText = Lang.inter[28].Value;
36592 focusText2 = Language.GetTextValue("GameUI.HairStyle");
36593 }
36594 else if (npc[player[myPlayer].talkNPC].type == 368)
36595 {
36596 focusText = Lang.inter[28].Value;
36597 }
36598 else if (npc[player[myPlayer].talkNPC].type == 369)
36599 {
36600 focusText = Lang.inter[64].Value;
36601 }
36602 else if (npc[player[myPlayer].talkNPC].type == 208)
36603 {
36604 focusText = Lang.inter[28].Value;
36605 if (TOWMusicUnlocked)
36606 {
36607 focusText2 = Language.GetTextValue("GameUI.Music");
36608 }
36609 }
36610 else if (npc[player[myPlayer].talkNPC].type == 227)
36611 {
36612 focusText = Lang.inter[28].Value;
36613 focusText2 = Language.GetTextValue("GameUI.PainterDecor");
36614 }
36615 else if (npc[player[myPlayer].talkNPC].type == 17 || npc[player[myPlayer].talkNPC].type == 19 || npc[player[myPlayer].talkNPC].type == 38 || npc[player[myPlayer].talkNPC].type == 54 || npc[player[myPlayer].talkNPC].type == 107 || npc[player[myPlayer].talkNPC].type == 108 || npc[player[myPlayer].talkNPC].type == 124 || npc[player[myPlayer].talkNPC].type == 142 || npc[player[myPlayer].talkNPC].type == 160 || npc[player[myPlayer].talkNPC].type == 178 || npc[player[myPlayer].talkNPC].type == 207 || npc[player[myPlayer].talkNPC].type == 209 || npc[player[myPlayer].talkNPC].type == 228 || npc[player[myPlayer].talkNPC].type == 229)
36616 {
36617 focusText = Lang.inter[28].Value;
36618 if (npc[player[myPlayer].talkNPC].type == 107)
36619 {
36620 focusText2 = Lang.inter[19].Value;
36621 }
36622 }
36623 else if (npc[player[myPlayer].talkNPC].type == 37)
36624 {
36625 if (!IsItDay())
36626 {
36627 focusText = Lang.inter[50].Value;
36628 }
36629 }
36630 else if (npc[player[myPlayer].talkNPC].type == 22)
36631 {
36632 focusText = Lang.inter[51].Value;
36633 focusText2 = Lang.inter[25].Value;
36634 }
36635 else if (npc[player[myPlayer].talkNPC].type == 441)
36636 {
36637 if (player[myPlayer].taxMoney <= 0)
36638 {
36639 focusText = Lang.inter[89].Value;
36640 }
36641 else
36642 {
36643 string text4 = "";
36644 int num7 = 0;
36645 int num8 = 0;
36646 int num9 = 0;
36647 int num10 = 0;
36648 int taxMoney = player[myPlayer].taxMoney;
36649 taxMoney = (int)((double)taxMoney / player[myPlayer].currentShoppingSettings.PriceAdjustment);
36650 if (taxMoney < 0)
36651 {
36652 taxMoney = 0;
36653 }
36654 num5 = taxMoney;
36655 if (taxMoney >= 1000000)
36656 {
36657 num7 = taxMoney / 1000000;
36658 taxMoney -= num7 * 1000000;
36659 }
36660 if (taxMoney >= 10000)
36661 {
36662 num8 = taxMoney / 10000;
36663 taxMoney -= num8 * 10000;
36664 }
36665 if (taxMoney >= 100)
36666 {
36667 num9 = taxMoney / 100;
36668 taxMoney -= num9 * 100;
36669 }
36670 if (taxMoney >= 1)
36671 {
36672 num10 = taxMoney;
36673 }
36674 if (num7 > 0)
36675 {
36676 text4 = text4 + num7 + " " + Lang.inter[15].Value + " ";
36677 }
36678 if (num8 > 0)
36679 {
36680 text4 = text4 + num8 + " " + Lang.inter[16].Value + " ";
36681 }
36682 if (num9 > 0)
36683 {
36684 text4 = text4 + num9 + " " + Lang.inter[17].Value + " ";
36685 }
36686 if (num10 > 0)
36687 {
36688 text4 = text4 + num10 + " " + Lang.inter[18].Value + " ";
36689 }
36690 float num11 = (float)(int)mouseTextColor / 255f;
36691 if (num7 > 0)
36692 {
36693 color2 = new Microsoft.Xna.Framework.Color((byte)(220f * num11), (byte)(220f * num11), (byte)(198f * num11), mouseTextColor);
36694 }
36695 else if (num8 > 0)
36696 {
36697 color2 = new Microsoft.Xna.Framework.Color((byte)(224f * num11), (byte)(201f * num11), (byte)(92f * num11), mouseTextColor);
36698 }
36699 else if (num9 > 0)
36700 {
36701 color2 = new Microsoft.Xna.Framework.Color((byte)(181f * num11), (byte)(192f * num11), (byte)(193f * num11), mouseTextColor);
36702 }
36703 else if (num10 > 0)
36704 {
36705 color2 = new Microsoft.Xna.Framework.Color((byte)(246f * num11), (byte)(138f * num11), (byte)(96f * num11), mouseTextColor);
36706 }
36707 if (text4 == "")
36708 {
36709 focusText = Lang.inter[89].Value;
36710 }
36711 else
36712 {
36713 text4 = text4.Substring(0, text4.Length - 1);
36714 focusText = Lang.inter[89].Value + " (" + text4 + ")";
36715 }
36716 focusText = Lang.inter[89].Value;
36717 text3 = focusText;
36718 text2 = "";
36719 for (int k = 0; k < focusText.Length; k++)
36720 {
36721 text2 += " ";
36722 }
36723 focusText = focusText + text2 + " ";
36724 }
36725 }
36726 else if (npc[player[myPlayer].talkNPC].type == 18)
36727 {
36728 string text5 = "";
36729 int num12 = 0;
36730 int num13 = 0;
36731 int num14 = 0;
36732 int num15 = 0;
36733 int num16 = num5;
36734 if (num16 > 0 && num16 < 1)
36735 {
36736 num16 = 1;
36737 }
36738 if (num16 < 0)
36739 {
36740 num16 = 0;
36741 }
36742 num5 = num16;
36743 if (num16 >= 1000000)
36744 {
36745 num12 = num16 / 1000000;
36746 num16 -= num12 * 1000000;
36747 }
36748 if (num16 >= 10000)
36749 {
36750 num13 = num16 / 10000;
36751 num16 -= num13 * 10000;
36752 }
36753 if (num16 >= 100)
36754 {
36755 num14 = num16 / 100;
36756 num16 -= num14 * 100;
36757 }
36758 if (num16 >= 1)
36759 {
36760 num15 = num16;
36761 }
36762 if (num12 > 0)
36763 {
36764 text5 = text5 + num12 + " " + Lang.inter[15].Value + " ";
36765 }
36766 if (num13 > 0)
36767 {
36768 text5 = text5 + num13 + " " + Lang.inter[16].Value + " ";
36769 }
36770 if (num14 > 0)
36771 {
36772 text5 = text5 + num14 + " " + Lang.inter[17].Value + " ";
36773 }
36774 if (num15 > 0)
36775 {
36776 text5 = text5 + num15 + " " + Lang.inter[18].Value + " ";
36777 }
36778 float num17 = (float)(int)mouseTextColor / 255f;
36779 if (num12 > 0)
36780 {
36781 color2 = new Microsoft.Xna.Framework.Color((byte)(220f * num17), (byte)(220f * num17), (byte)(198f * num17), mouseTextColor);
36782 }
36783 else if (num13 > 0)
36784 {
36785 color2 = new Microsoft.Xna.Framework.Color((byte)(224f * num17), (byte)(201f * num17), (byte)(92f * num17), mouseTextColor);
36786 }
36787 else if (num14 > 0)
36788 {
36789 color2 = new Microsoft.Xna.Framework.Color((byte)(181f * num17), (byte)(192f * num17), (byte)(193f * num17), mouseTextColor);
36790 }
36791 else if (num15 > 0)
36792 {
36793 color2 = new Microsoft.Xna.Framework.Color((byte)(246f * num17), (byte)(138f * num17), (byte)(96f * num17), mouseTextColor);
36794 }
36795 if (text5 == "")
36796 {
36797 focusText = Lang.inter[54].Value;
36798 }
36799 else
36800 {
36801 text5 = text5.Substring(0, text5.Length - 1);
36802 focusText = Lang.inter[54].Value + " (" + text5 + ")";
36803 }
36804 }
36805 if (!flag)
36806 {
36808 if (text2 != null)
36809 {
36810 float num18 = 130 + amountOfLines * 30;
36811 float num19 = 180 + (screenWidth - 800) / 2;
36812 num19 += ChatManager.GetStringSize(FontAssets.MouseText.Value, text3, new Vector2(0.9f)).X - 20f;
36813 int taxMoney2 = player[myPlayer].taxMoney;
36814 taxMoney2 = (int)((double)taxMoney2 / player[myPlayer].currentShoppingSettings.PriceAdjustment);
36815 ItemSlot.DrawMoney(spriteBatch, "", num19, num18 - 40f, Utils.CoinsSplit(taxMoney2), horizontal: true);
36816 }
36817 }
36819 {
36820 return;
36821 }
36823 {
36824 player[myPlayer].mouseInterface = true;
36825 }
36827 {
36828 return;
36829 }
36830 mouseLeftRelease = false;
36831 player[myPlayer].releaseUseItem = false;
36832 player[myPlayer].mouseInterface = true;
36833 if (npcChatFocus1)
36834 {
36836 }
36837 else if (npcChatFocus2)
36838 {
36839 if (player[myPlayer].sign != -1)
36840 {
36841 if (editSign)
36842 {
36844 }
36845 else
36846 {
36848 }
36849 }
36850 else if (NPCID.Sets.IsTownPet[npc[player[myPlayer].talkNPC].type])
36851 {
36852 player[myPlayer].PetAnimal(player[myPlayer].talkNPC);
36853 }
36854 else if (npc[player[myPlayer].talkNPC].type == 369)
36855 {
36858 bool flag4 = false;
36860 {
36862 if (num20 != -1)
36863 {
36864 player[myPlayer].inventory[num20].stack--;
36865 if (player[myPlayer].inventory[num20].stack <= 0)
36866 {
36867 player[myPlayer].inventory[num20] = new Item();
36868 }
36869 flag4 = true;
36871 player[myPlayer].anglerQuestsFinished++;
36872 player[myPlayer].GetAnglerReward(npc[player[myPlayer].talkNPC], anglerQuestItemNetIDs[anglerQuest]);
36873 }
36874 }
36875 npcChatText = Lang.AnglerQuestChat(flag4);
36876 if (flag4)
36877 {
36878 anglerQuestFinished = true;
36879 if (netMode == 1)
36880 {
36881 NetMessage.SendData(75);
36882 }
36883 else
36884 {
36886 }
36888 }
36889 }
36890 else if (npc[player[myPlayer].talkNPC].type == 17)
36891 {
36892 OpenShop(1);
36893 }
36894 else if (npc[player[myPlayer].talkNPC].type == 19)
36895 {
36896 OpenShop(2);
36897 }
36898 else if (npc[player[myPlayer].talkNPC].type == 124)
36899 {
36900 OpenShop(8);
36901 }
36902 else if (npc[player[myPlayer].talkNPC].type == 142)
36903 {
36904 OpenShop(9);
36905 }
36906 else if (npc[player[myPlayer].talkNPC].type == 37)
36907 {
36908 if (netMode == 0)
36909 {
36910 NPC.SpawnSkeletron(myPlayer);
36911 }
36912 else
36913 {
36914 NetMessage.SendData(51, -1, -1, null, myPlayer, 1f);
36915 }
36916 npcChatText = "";
36917 }
36918 else if (npc[player[myPlayer].talkNPC].type == 20)
36919 {
36920 OpenShop(3);
36921 }
36922 else if (npc[player[myPlayer].talkNPC].type == 38)
36923 {
36924 OpenShop(4);
36925 }
36926 else if (npc[player[myPlayer].talkNPC].type == 54)
36927 {
36928 OpenShop(5);
36929 }
36930 else if (npc[player[myPlayer].talkNPC].type == 107)
36931 {
36932 OpenShop(6);
36933 }
36934 else if (npc[player[myPlayer].talkNPC].type == 108)
36935 {
36936 OpenShop(7);
36937 }
36938 else if (npc[player[myPlayer].talkNPC].type == 160)
36939 {
36940 OpenShop(10);
36941 }
36942 else if (npc[player[myPlayer].talkNPC].type == 178)
36943 {
36944 OpenShop(11);
36945 }
36946 else if (npc[player[myPlayer].talkNPC].type == 207)
36947 {
36948 OpenShop(12);
36949 }
36950 else if (npc[player[myPlayer].talkNPC].type == 208)
36951 {
36952 OpenShop(13);
36953 }
36954 else if (npc[player[myPlayer].talkNPC].type == 209)
36955 {
36956 OpenShop(14);
36957 }
36958 else if (npc[player[myPlayer].talkNPC].type == 227)
36959 {
36960 OpenShop(15);
36961 }
36962 else if (npc[player[myPlayer].talkNPC].type == 228)
36963 {
36964 OpenShop(16);
36965 }
36966 else if (npc[player[myPlayer].talkNPC].type == 229)
36967 {
36968 OpenShop(17);
36969 }
36970 else if (npc[player[myPlayer].talkNPC].type == 353)
36971 {
36972 OpenShop(18);
36973 }
36974 else if (npc[player[myPlayer].talkNPC].type == 368)
36975 {
36976 OpenShop(19);
36977 }
36978 else if (npc[player[myPlayer].talkNPC].type == 453)
36979 {
36980 OpenShop(20);
36981 }
36982 else if (npc[player[myPlayer].talkNPC].type == 550)
36983 {
36984 OpenShop(21);
36985 }
36986 else if (npc[player[myPlayer].talkNPC].type == 588)
36987 {
36988 OpenShop(22);
36989 }
36990 else if (npc[player[myPlayer].talkNPC].type == 633)
36991 {
36992 OpenShop(23);
36993 }
36994 else if (npc[player[myPlayer].talkNPC].type == 663)
36995 {
36996 OpenShop(24);
36997 }
36998 else if (npc[player[myPlayer].talkNPC].type == 22)
36999 {
37001 HelpText();
37002 }
37003 else if (npc[player[myPlayer].talkNPC].type == 441)
37004 {
37005 if (player[myPlayer].taxMoney > 0)
37006 {
37007 int taxMoney3 = player[myPlayer].taxMoney;
37008 taxMoney3 = (int)((double)taxMoney3 / player[myPlayer].currentShoppingSettings.PriceAdjustment);
37009 while (taxMoney3 > 0)
37010 {
37012 if (taxMoney3 > 1000000)
37013 {
37014 int num21 = taxMoney3 / 1000000;
37015 taxMoney3 -= 1000000 * num21;
37016 int number = Item.NewItem(source, (int)player[myPlayer].position.X, (int)player[myPlayer].position.Y, player[myPlayer].width, player[myPlayer].height, 74, num21);
37017 if (netMode == 1)
37018 {
37019 NetMessage.SendData(21, -1, -1, null, number, 1f);
37020 }
37021 continue;
37022 }
37023 if (taxMoney3 > 10000)
37024 {
37025 int num22 = taxMoney3 / 10000;
37026 taxMoney3 -= 10000 * num22;
37027 int number2 = Item.NewItem(source, (int)player[myPlayer].position.X, (int)player[myPlayer].position.Y, player[myPlayer].width, player[myPlayer].height, 73, num22);
37028 if (netMode == 1)
37029 {
37030 NetMessage.SendData(21, -1, -1, null, number2, 1f);
37031 }
37032 continue;
37033 }
37034 if (taxMoney3 > 100)
37035 {
37036 int num23 = taxMoney3 / 100;
37037 taxMoney3 -= 100 * num23;
37038 int number3 = Item.NewItem(source, (int)player[myPlayer].position.X, (int)player[myPlayer].position.Y, player[myPlayer].width, player[myPlayer].height, 72, num23);
37039 if (netMode == 1)
37040 {
37041 NetMessage.SendData(21, -1, -1, null, number3, 1f);
37042 }
37043 continue;
37044 }
37045 int num24 = taxMoney3;
37046 if (num24 < 1)
37047 {
37048 num24 = 1;
37049 }
37050 taxMoney3 -= num24;
37051 int number4 = Item.NewItem(source, (int)player[myPlayer].position.X, (int)player[myPlayer].position.Y, player[myPlayer].width, player[myPlayer].height, 71, num24);
37052 if (netMode == 1)
37053 {
37054 NetMessage.SendData(21, -1, -1, null, number4, 1f);
37055 }
37056 }
37057 npcChatText = Lang.dialog(rand.Next(380, 382));
37058 player[myPlayer].taxMoney = 0;
37059 }
37060 else
37061 {
37062 npcChatText = Lang.dialog(rand.Next(390, 401));
37063 }
37064 }
37065 else
37066 {
37067 if (npc[player[myPlayer].talkNPC].type != 18)
37068 {
37069 return;
37070 }
37072 if (num5 > 0)
37073 {
37074 if (player[myPlayer].BuyItem(num5))
37075 {
37078 player[myPlayer].HealEffect(player[myPlayer].statLifeMax2 - player[myPlayer].statLife);
37079 if ((double)player[myPlayer].statLife < (double)player[myPlayer].statLifeMax2 * 0.25)
37080 {
37081 npcChatText = Lang.dialog(227);
37082 }
37083 else if ((double)player[myPlayer].statLife < (double)player[myPlayer].statLifeMax2 * 0.5)
37084 {
37085 npcChatText = Lang.dialog(228);
37086 }
37087 else if ((double)player[myPlayer].statLife < (double)player[myPlayer].statLifeMax2 * 0.75)
37088 {
37089 npcChatText = Lang.dialog(229);
37090 }
37091 else
37092 {
37093 npcChatText = Lang.dialog(230);
37094 }
37095 player[myPlayer].statLife = player[myPlayer].statLifeMax2;
37096 for (int l = 0; l < Player.maxBuffs; l++)
37097 {
37098 int num25 = player[myPlayer].buffType[l];
37100 {
37101 player[myPlayer].DelBuff(l);
37102 l = -1;
37103 }
37104 }
37105 }
37106 else
37107 {
37108 int num26 = rand.Next(3);
37109 if (num26 == 0)
37110 {
37111 npcChatText = Lang.dialog(52);
37112 }
37113 if (num26 == 1)
37114 {
37115 npcChatText = Lang.dialog(53);
37116 }
37117 if (num26 == 2)
37118 {
37119 npcChatText = Lang.dialog(54);
37120 }
37121 }
37122 }
37123 else
37124 {
37125 int num27 = rand.Next(3);
37126 if (!ChildSafety.Disabled)
37127 {
37128 num27 = rand.Next(1, 3);
37129 }
37130 switch (num27)
37131 {
37132 case 0:
37133 npcChatText = Lang.dialog(55);
37134 break;
37135 case 1:
37136 npcChatText = Lang.dialog(56);
37137 break;
37138 case 2:
37139 npcChatText = Lang.dialog(57);
37140 break;
37141 }
37142 }
37143 }
37144 }
37145 else if (npcChatFocus4)
37146 {
37149 npcChatText = player[myPlayer].currentShoppingSettings.HappinessReport;
37150 }
37151 else
37152 {
37153 if (!npcChatFocus3 || player[myPlayer].talkNPC < 0)
37154 {
37155 return;
37156 }
37157 if (npc[player[myPlayer].talkNPC].type == 20)
37158 {
37160 npcChatText = Lang.GetDryadWorldStatusDialog(out var worldIsEntirelyPure);
37162 {
37163 NPC.PreventJojaColaDialog = true;
37164 NPC.RerollDryadText = 2;
37165 LocalPlayer.ConsumeItem(5275, reverseOrder: true);
37166 if (netMode == 1)
37167 {
37168 NetMessage.SendData(144);
37169 }
37170 else
37171 {
37172 NPC.HaveDryadDoStardewAnimation();
37173 }
37174 npcChatText = Language.GetTextValue("StardewTalk.PlayerGivesCola");
37175 }
37176 else if (worldIsEntirelyPure)
37177 {
37179 }
37180 }
37181 if (npc[player[myPlayer].talkNPC].type == 208)
37182 {
37184 int num28 = rand.Next(1, 4);
37185 npcChatText = Language.GetTextValue("PartyGirlSpecialText.Music" + num28);
37187 }
37188 else if (npc[player[myPlayer].talkNPC].type == 22)
37189 {
37190 playerInventory = true;
37191 npcChatText = "";
37193 InGuideCraftMenu = true;
37195 }
37196 else if (npc[player[myPlayer].talkNPC].type == 107)
37197 {
37198 playerInventory = true;
37199 npcChatText = "";
37201 InReforgeMenu = true;
37203 }
37204 else if (npc[player[myPlayer].talkNPC].type == 353)
37205 {
37207 }
37208 else if (npc[player[myPlayer].talkNPC].type == 207)
37209 {
37212 bool gotDye = false;
37214 if (num29 != -1)
37215 {
37216 player[myPlayer].inventory[num29].stack--;
37217 if (player[myPlayer].inventory[num29].stack <= 0)
37218 {
37219 player[myPlayer].inventory[num29] = new Item();
37220 }
37221 gotDye = true;
37223 player[myPlayer].GetDyeTraderReward(npc[player[myPlayer].talkNPC]);
37224 }
37225 npcChatText = Lang.DyeTraderQuestChat(gotDye);
37226 }
37227 else if (npc[player[myPlayer].talkNPC].type == 550)
37228 {
37230 HelpText();
37231 npcChatText = Lang.BartenderHelpText(npc[player[myPlayer].talkNPC]);
37232 }
37233 else if (npc[player[myPlayer].talkNPC].type == 227)
37234 {
37235 OpenShop(25);
37236 }
37237 }
37238 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
static void PlaySound(int type, Vector2 position, int style=1)
static void HandleSpecialEvent(Player player, int eventID)
static Asset< DynamicSpriteFont > MouseText
Definition FontAssets.cs:10
static Asset< Texture2D > ChatBack
static bool[] NurseCannotRemoveDebuff
Definition BuffID.cs:30
static readonly int Count
Definition BuffID.cs:1069
static bool[] ExoticPlantsForDyeTrade
Definition ItemID.cs:1056
static bool[] IsTownPet
Definition NPCID.cs:4099
static readonly LegacySoundStyle Item4
Definition SoundID.cs:422
static string GetTextValue(string key)
Definition Language.cs:15
void PrepareCache(string text)
Definition Main.cs:152
static bool drawingPlayerChat
Definition Main.cs:1739
static bool npcChatFocus1
Definition Main.cs:1827
static bool npcChatFocus2
Definition Main.cs:1829
static string npcChatText
Definition Main.cs:1825
static int npcChatCornerItem
Definition Main.cs:1837
static Item[] item
Definition Main.cs:1681
static SpriteBatch spriteBatch
Definition Main.cs:974
static bool anglerQuestFinished
Definition Main.cs:1847
static int myPlayer
Definition Main.cs:1801
static int netMode
Definition Main.cs:2095
static bool editSign
Definition Main.cs:1815
static bool CanDryadPlayStardewAnimation(Player player, NPC npc)
Definition Main.cs:37240
static bool expertMode
Definition Main.cs:2737
static void SubmitSignText()
Definition Main.cs:37441
void OpenShop(int shopIndex)
Definition Main.cs:37250
static int cursorOverride
Definition Main.cs:2181
static bool IsItDay()
Definition Main.cs:59621
static void DrawNPCChatButtons(int superColor, Microsoft.Xna.Framework.Color chatColor, int numLines, string focusText, string focusText3)
Definition Main.cs:37265
static void CloseNPCChatOrSign()
Definition Main.cs:37430
static bool mouseLeftRelease
Definition Main.cs:1755
static Main instance
Definition Main.cs:283
static bool npcChatFocus4
Definition Main.cs:1833
static byte mouseTextColor
Definition Main.cs:1751
static void OpenHairWindow()
Definition Main.cs:40649
static bool swapMusic
Definition Main.cs:1214
static bool InReforgeMenu
Definition Main.cs:1908
static List< string > anglerWhoFinishedToday
Definition Main.cs:1845
static void OpenPlayerChat()
Definition Main.cs:16984
int textBlinkerCount
Definition Main.cs:2389
static bool InGuideCraftMenu
Definition Main.cs:1906
static void HelpText()
Definition Main.cs:35624
static bool TOWMusicUnlocked
Definition Main.cs:1212
static UnifiedRandom rand
Definition Main.cs:1387
TextDisplayCache _textDisplayCache
Definition Main.cs:2425
static bool npcChatFocus3
Definition Main.cs:1831
static NPC[] npc
Definition Main.cs:1685
static bool playerInventory
Definition Main.cs:1759
static int screenWidth
Definition Main.cs:1719
static void GetItemDrawFrame(int item, out Texture2D itemTexture, out Microsoft.Xna.Framework.Rectangle itemFrame)
Definition Main.cs:25221
int textBlinkerState
Definition Main.cs:2391
static int mouseY
Definition Main.cs:606
static Player LocalPlayer
Definition Main.cs:2829
static bool hardMode
Definition Main.cs:1022
static Sign[] sign
Definition Main.cs:1701
static Player[] player
Definition Main.cs:1803
void MouseText(string cursorText, int rare=0, byte diff=0, int hackedMouseX=-1, int hackedMouseY=-1, int hackedScreenWidth=-1, int hackedScreenHeight=-1, int pushWidthX=0)
Definition Main.cs:18729
static int[] anglerQuestItemNetIDs
Definition Main.cs:1851
static int mouseX
Definition Main.cs:604
static int anglerQuest
Definition Main.cs:1849
static bool[] debuff
Definition Main.cs:784
static bool mouseLeft
Definition Main.cs:614
static bool AddChatText(DynamicSpriteFont font, string text, Vector2 baseScale)
static Vector2 DrawColorCodedStringWithShadow(SpriteBatch spriteBatch, DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, float rotation, Vector2 origin, Vector2 baseScale, out int hoveredSnippet, float maxWidth=-1f, float spread=2f)
static Vector2 GetStringSize(DynamicSpriteFont font, string text, Vector2 baseScale, float maxWidth=-1f)
static void GoToDefaultPage(int specialFlag=0)
static void OpenVirtualKeyboard(int keyboardContext)
static void DrawMoney(SpriteBatch sb, string text, float shopx, float shopy, int[] coinsArray, bool horizontal=false)
Definition ItemSlot.cs:2829
bool Contains(int x, int y)
Definition Rectangle.cs:92

References Terraria.Main._textDisplayCache, Terraria.UI.Chat.ChatManager.AddChatText(), Terraria.Main.TextDisplayCache.AmountOfLines, Terraria.Main.anglerQuest, Terraria.Lang.AnglerQuestChat(), Terraria.Main.anglerQuestFinished, Terraria.Main.anglerQuestItemNetIDs, Terraria.Main.anglerWhoFinishedToday, Terraria.Lang.BartenderHelpText(), Microsoft.Xna.Framework.Color.Black, Terraria.Main.CanDryadPlayStardewAnimation(), Terraria.GameContent.TextureAssets.ChatBack, Terraria.Main.CloseNPCChatOrSign(), Terraria.Utils.CoinsSplit(), Microsoft.Xna.Framework.Rectangle.Contains(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), Terraria.ID.BuffID.Count, Terraria.Main.cursorOverride, Terraria.Main.debuff, Terraria.Lang.dialog(), Terraria.GameContent.ChildSafety.Disabled, Terraria.NPC.downedBoss1, Terraria.NPC.downedBoss2, Terraria.NPC.downedBoss3, Terraria.NPC.downedGolemBoss, Terraria.NPC.downedMechBossAny, Terraria.NPC.downedPlantBoss, Terraria.NPC.downedQueenBee, Terraria.Utils.DrawBorderStringFourWay(), Terraria.UI.Chat.ChatManager.DrawColorCodedStringWithShadow(), Terraria.Main.drawingPlayerChat, Terraria.UI.ItemSlot.DrawMoney(), Terraria.Main.DrawNPCChatButtons(), Terraria.Lang.DyeTraderQuestChat(), Terraria.Main.editSign, Terraria.ID.ItemID.Sets.ExoticPlantsForDyeTrade, Terraria.Main.expertMode, Terraria.GameContent.UI.Chat.ItemTagHandler.GenerateTag(), Terraria.Lang.GetDryadWorldStatusDialog(), Terraria.Main.GetItemDrawFrame(), Terraria.UI.Chat.ChatManager.GetStringSize(), Terraria.Localization.Language.GetTextValue(), Terraria.UI.Gamepad.UILinkPointNavigator.GoToDefaultPage(), Terraria.GameContent.Achievements.AchievementsHelper.HandleAnglerService(), Terraria.GameContent.Achievements.AchievementsHelper.HandleNurseService(), Terraria.GameContent.Achievements.AchievementsHelper.HandleSpecialEvent(), Terraria.Main.hardMode, Terraria.NPC.HaveDryadDoStardewAnimation(), Terraria.Main.HelpText(), System.Text.RegularExpressions.i, Terraria.GameInput.PlayerInput.IgnoreMouseInterface, Terraria.Main.InGuideCraftMenu, Terraria.Main.InReforgeMenu, Terraria.Main.instance, Terraria.Lang.inter, Terraria.Main.IsItDay(), Terraria.ID.NPCID.Sets.IsTownPet, Terraria.Main.item, Terraria.ID.SoundID.Item4, Terraria.Main.LocalPlayer, Terraria.Player.maxBuffs, Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.MouseText(), Terraria.Main.mouseTextColor, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, System.Text.RegularExpressions.name, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Main.npc, Terraria.Main.npcChatCornerItem, Terraria.Main.npcChatFocus1, Terraria.Main.npcChatFocus2, Terraria.Main.npcChatFocus3, Terraria.Main.npcChatFocus4, Terraria.Main.npcChatText, Terraria.ID.BuffID.Sets.NurseCannotRemoveDebuff, Microsoft.Xna.Framework.Vector2.One, Terraria.Main.OpenHairWindow(), Terraria.Main.OpenPlayerChat(), Terraria.Main.OpenShop(), Terraria.UI.IngameFancyUI.OpenVirtualKeyboard(), Terraria.Main.player, Terraria.Main.playerInventory, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.TextDisplayCache.PrepareCache(), Terraria.NPC.PreventJojaColaDialog, Terraria.Main.rand, Terraria.NPC.RerollDryadText, Terraria.Main.screenWidth, Terraria.NetMessage.SendData(), Terraria.GameInput.PlayerInput.SettingsForUI.ShowGamepadHints, Terraria.Main.sign, System.Linq.source, Terraria.NPC.SpawnSkeletron(), Terraria.Main.spriteBatch, Terraria.Main.SubmitSignText(), Terraria.Main.swapMusic, System.text, Terraria.Main.textBlinkerCount, Terraria.Main.textBlinkerState, Terraria.Main.TextDisplayCache.TextLines, Terraria.Main.TOWMusicUnlocked, System.type, Terraria.GameInput.PlayerInput.UsingGamepad, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, System.X, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Main.GUIChatDraw().