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

◆ DrawMenu()

void Terraria.Main.DrawMenu ( GameTime gameTime)
inlineprotected

Definition at line 45228 of file Main.cs.

45229 {
45230 if (!IsEngineLoaded)
45231 {
45232 IsEngineLoaded = true;
45233 if (Main.OnEngineLoad != null)
45234 {
45235 Main.OnEngineLoad();
45236 }
45237 }
45240 int num = menuMode;
45241 if (menuMode <= 1 && slimeRain)
45242 {
45243 StopSlimeRain();
45244 }
45245 render = false;
45246 SceneMetrics.Reset();
45247 drawingPlayerChat = false;
45248 chatMonitor.Clear();
45250 screenPosition.Y = (float)(worldSurface * 16.0 - (double)screenHeight);
45251 MenuXMovement = 4f;
45253 {
45254 playOldTile = true;
45255 if (starGame)
45256 {
45257 playOldTile = false;
45258 }
45259 }
45260 screenPosition.X += MenuXMovement;
45261 if (screenPosition.X > 2.1474835E+09f)
45262 {
45263 screenPosition.X = 0f;
45264 }
45265 if (screenPosition.X < -2.1474835E+09f)
45266 {
45267 screenPosition.X = 0f;
45268 }
45269 Star.UpdateStars();
45270 Cloud.UpdateClouds();
45271 DrawFPS();
45272 background = 0;
45273 byte b = (byte)((255 + tileColor.R * 2) / 3);
45275 if (WorldGen.remixWorldGen)
45276 {
45278 if ((double)logoRotation < 3.04)
45279 {
45280 logoRotation += logoRotationSpeed * 0.0016f;
45281 if (logoRotationSpeed < 0f)
45282 {
45283 logoRotationSpeed = 0f;
45284 }
45285 }
45286 if ((double)logoRotation > 3.22)
45287 {
45289 }
45290 else if ((double)logoRotation < 3.06)
45291 {
45293 }
45294 if (logoRotationSpeed < 20f && logoRotationDirection == 1f)
45295 {
45296 logoRotationSpeed += 1f;
45297 }
45298 else if (logoRotationSpeed > -20f && logoRotationDirection == -1f)
45299 {
45300 logoRotationSpeed -= 1f;
45301 }
45302 logoScale += logoScaleSpeed * 9E-05f;
45303 if (logoScale > 1f)
45304 {
45305 logoScaleDirection = -1f;
45306 }
45307 else if (logoScale < 0.9f)
45308 {
45309 logoScaleDirection = 1f;
45310 }
45311 if (logoScaleSpeed < 50f && logoScaleDirection == 1f)
45312 {
45313 logoScaleSpeed += 1f;
45314 }
45315 else if (logoScaleSpeed > -50f && logoScaleDirection == -1f)
45316 {
45317 logoScaleSpeed -= 1f;
45318 }
45319 }
45320 else if (WorldGen.drunkWorldGen)
45321 {
45323 if (logoRotationSpeed > 0f)
45324 {
45325 logoRotationSpeed += 1500f;
45326 }
45327 else
45328 {
45329 logoRotationSpeed -= 1500f;
45330 }
45331 logoScale -= 0.05f;
45332 if (logoScale < 0f)
45333 {
45334 logoScale = 0f;
45335 }
45336 }
45337 else
45338 {
45339 if ((double)logoRotation > 0.09)
45340 {
45341 logoRotation += logoRotationSpeed * 0.0016f;
45342 if (logoRotationSpeed > 0f)
45343 {
45344 logoRotationSpeed = 0f;
45345 }
45346 }
45348 if ((double)logoRotation > 0.08)
45349 {
45351 }
45352 else if ((double)logoRotation < -0.08)
45353 {
45355 }
45356 if (logoRotationSpeed < 20f && logoRotationDirection == 1f)
45357 {
45358 logoRotationSpeed += 1f;
45359 }
45360 else if (logoRotationSpeed > -20f && logoRotationDirection == -1f)
45361 {
45362 logoRotationSpeed -= 1f;
45363 }
45364 logoScale += logoScaleSpeed * 9E-06f;
45365 if ((double)logoScale > 1.35)
45366 {
45367 logoScaleDirection = -1f;
45368 }
45369 else if (logoScale < 1f)
45370 {
45371 logoScaleDirection = 1f;
45372 }
45373 if (logoScaleSpeed < 50f && logoScaleDirection == 1f)
45374 {
45375 logoScaleSpeed += 1f;
45376 }
45377 else if (logoScaleSpeed > -50f && logoScaleDirection == -1f)
45378 {
45379 logoScaleSpeed -= 1f;
45380 }
45381 }
45382 Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color((byte)((float)(int)color.R * ((float)LogoA / 255f)), (byte)((float)(int)color.G * ((float)LogoA / 255f)), (byte)((float)(int)color.B * ((float)LogoA / 255f)), (byte)((float)(int)color.A * ((float)LogoA / 255f)));
45383 Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color((byte)((float)(int)color.R * ((float)LogoB / 255f)), (byte)((float)(int)color.G * ((float)LogoB / 255f)), (byte)((float)(int)color.B * ((float)LogoB / 255f)), (byte)((float)(int)color.A * ((float)LogoB / 255f)));
45384 if (playOldTile)
45385 {
45386 spriteBatch.Draw(TextureAssets.Logo3.Value, new Vector2(screenWidth / 2, 100f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height()), color2, logoRotation, new Vector2(TextureAssets.Logo.Width() / 2, TextureAssets.Logo.Height() / 2), logoScale, SpriteEffects.None, 0f);
45387 spriteBatch.Draw(TextureAssets.Logo4.Value, new Vector2(screenWidth / 2, 100f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height()), color3, logoRotation, new Vector2(TextureAssets.Logo.Width() / 2, TextureAssets.Logo.Height() / 2), logoScale, SpriteEffects.None, 0f);
45388 }
45389 else
45390 {
45391 spriteBatch.Draw(TextureAssets.Logo.Value, new Vector2(screenWidth / 2, 100f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height()), color2, logoRotation, new Vector2(TextureAssets.Logo.Width() / 2, TextureAssets.Logo.Height() / 2), logoScale, SpriteEffects.None, 0f);
45392 spriteBatch.Draw(TextureAssets.Logo2.Value, new Vector2(screenWidth / 2, 100f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height()), color3, logoRotation, new Vector2(TextureAssets.Logo.Width() / 2, TextureAssets.Logo.Height() / 2), logoScale, SpriteEffects.None, 0f);
45393 }
45394 if (dayTime && !WorldGen.remixWorldGen)
45395 {
45396 LogoA += 2;
45397 if (LogoA > 255)
45398 {
45399 LogoA = 255;
45400 }
45401 LogoB--;
45402 if (LogoB < 0)
45403 {
45404 LogoB = 0;
45405 }
45406 }
45407 else
45408 {
45409 LogoB += 2;
45410 if (LogoB > 255)
45411 {
45412 LogoB = 255;
45413 }
45414 LogoA--;
45415 if (LogoA < 0)
45416 {
45417 LogoA = 0;
45418 LogoT = true;
45419 }
45420 }
45421 int num2 = 250;
45422 int num3 = screenWidth / 2;
45423 int num4 = 80;
45424 int num5 = 0;
45425 int num6 = menuMode;
45426 int num7 = 0;
45427 int num8 = 0;
45428 bool flag = false;
45429 bool flag2 = false;
45430 bool flag3 = false;
45431 int num9 = 0;
45432 bool[] array = new bool[maxMenuItems];
45433 bool[] array2 = new bool[maxMenuItems];
45434 bool[] array3 = new bool[maxMenuItems];
45435 int[] array4 = new int[maxMenuItems];
45436 int[] array5 = new int[maxMenuItems];
45437 byte[] array6 = new byte[maxMenuItems];
45438 float[] array7 = new float[maxMenuItems];
45439 bool[] array8 = new bool[maxMenuItems];
45440 bool flag4 = false;
45441 bool flag5 = UILinkPointNavigator.Shortcuts.BackButtonInUse && !UILinkPointNavigator.Shortcuts.BackButtonLock;
45442 for (int i = 0; i < maxMenuItems; i++)
45443 {
45444 array[i] = false;
45445 array2[i] = false;
45446 array4[i] = 0;
45447 array5[i] = 0;
45448 array7[i] = 1f;
45449 }
45450 string[] array9 = new string[maxMenuItems];
45451 if (menuMode == -1)
45452 {
45453 menuMode = 0;
45454 }
45455 if (Program.LoadedEverything)
45456 {
45457 GamepadMainMenuHandler.CanRun = true;
45458 }
45459 if (menuMode == 1212)
45460 {
45461 array9[0] = Lang.menu[102].Value;
45462 num4 = 50;
45463 num2 = 200;
45464 num4 = 33;
45465 num2 = 200;
45466 array4[0] = -20;
45467 array4[1] = 25;
45468 array4[2] = 25;
45469 array4[3] = 25;
45470 array4[4] = 25;
45471 array4[5] = 25;
45472 array4[6] = 25;
45473 array4[7] = 25;
45474 array4[8] = 25;
45475 array4[9] = 25;
45476 array[0] = true;
45477 array9[1] = Language.GetTextValue("Language.English");
45478 array9[2] = Language.GetTextValue("Language.German");
45479 array9[3] = Language.GetTextValue("Language.Italian");
45480 array9[4] = Language.GetTextValue("Language.French");
45481 array9[5] = Language.GetTextValue("Language.Spanish");
45482 array9[6] = Language.GetTextValue("Language.Russian");
45483 array9[7] = Language.GetTextValue("Language.Chinese");
45484 array9[8] = Language.GetTextValue("Language.Portuguese");
45485 array9[9] = Language.GetTextValue("Language.Polish");
45486 num5 = 10;
45487 for (int j = 0; j < num5; j++)
45488 {
45489 array7[j] = 0.75f;
45490 }
45491 array7[0] = 1f;
45492 if (selectedMenu >= 1)
45493 {
45494 changeTheTitle = true;
45496 menuMode = 0;
45498 SaveSettings();
45499 }
45500 }
45501 else if (menuMode == 1213)
45502 {
45503 array9[0] = Lang.menu[102].Value;
45504 array[0] = true;
45505 array9[1] = Language.GetTextValue("Language.English");
45506 array9[2] = Language.GetTextValue("Language.German");
45507 array9[3] = Language.GetTextValue("Language.Italian");
45508 array9[4] = Language.GetTextValue("Language.French");
45509 array9[5] = Language.GetTextValue("Language.Spanish");
45510 array9[6] = Language.GetTextValue("Language.Russian");
45511 array9[7] = Language.GetTextValue("Language.Chinese");
45512 array9[8] = Language.GetTextValue("Language.Portuguese");
45513 array9[9] = Language.GetTextValue("Language.Polish");
45514 array9[10] = Lang.menu[5].Value;
45515 num5 = 11;
45516 if (selectedMenu == 10 || flag5)
45517 {
45518 flag5 = false;
45519 menuMode = 11;
45521 }
45522 else if (selectedMenu >= 1)
45523 {
45524 changeTheTitle = true;
45527 SaveSettings();
45528 }
45529 num4 = 33;
45530 num2 = 200;
45531 array4[0] = -20;
45532 array4[10] = 10;
45533 for (int k = 0; k < num5; k++)
45534 {
45535 array7[k] = 0.75f;
45536 }
45537 array7[0] = 0.85f;
45538 array7[10] = 0.95f;
45539 }
45540 else if (netMode == 2)
45541 {
45542 bool flag6 = true;
45543 for (int l = 0; l < 8; l++)
45544 {
45545 if (l >= 255)
45546 {
45547 continue;
45548 }
45549 try
45550 {
45551 array9[l] = Netplay.Clients[l].StatusText;
45552 if (Netplay.Clients[l].IsActive && showSpam)
45553 {
45554 ref string reference = ref array9[l];
45555 reference = reference + " (" + NetMessage.buffer[l].spamCount + ")";
45556 }
45557 }
45558 catch
45559 {
45560 array9[l] = "";
45561 }
45562 array[l] = true;
45563 if (array9[l] != "" && array9[l] != null)
45564 {
45565 flag6 = false;
45566 }
45567 }
45568 if (flag6)
45569 {
45570 array9[0] = Lang.menu[0].Value;
45571 array9[1] = Lang.menu[1].Value + Netplay.ListenPort + ".";
45572 }
45573 num5 = 11;
45574 array9[9] = statusText;
45575 array[9] = true;
45576 num2 = 170;
45577 num4 = 30;
45578 array4[10] = 20;
45579 array4[10] = 40;
45580 array9[10] = Lang.menu[2].Value;
45581 if (selectedMenu == 10 || flag5)
45582 {
45583 flag5 = false;
45584 Netplay.Disconnect = true;
45586 }
45587 }
45588 else if (menuMode == 31)
45589 {
45591 {
45593 uIVirtualKeyboard.HideContents = HidePassword;
45595 menuMode = 888;
45596 }
45597 string serverPassword = Netplay.ServerPassword;
45598 PlayerInput.WritingText = true;
45599 instance.HandleIME();
45600 Netplay.ServerPassword = GetInputText(Netplay.ServerPassword);
45601 if (serverPassword != Netplay.ServerPassword)
45602 {
45604 }
45605 array9[0] = Lang.menu[3].Value;
45607 if (textBlinkerCount >= 20)
45608 {
45609 if (textBlinkerState == 0)
45610 {
45611 textBlinkerState = 1;
45612 }
45613 else
45614 {
45615 textBlinkerState = 0;
45616 }
45617 textBlinkerCount = 0;
45618 }
45619 array9[1] = Netplay.ServerPassword;
45620 if (HidePassword)
45621 {
45622 array9[1] = "";
45623 for (int m = 0; m < Netplay.ServerPassword.Length; m++)
45624 {
45625 array9[1] += "*";
45626 }
45627 }
45628 if (textBlinkerState == 1)
45629 {
45630 array9[1] += "|";
45631 array5[1] = 1;
45632 }
45633 else
45634 {
45635 array9[1] += " ";
45636 }
45637 array[0] = true;
45638 array[1] = true;
45639 array4[1] = -20;
45640 array4[2] = 20;
45641 array9[2] = Lang.menu[4].Value;
45642 array9[3] = Lang.menu[5].Value;
45643 num5 = 4;
45644 if (selectedMenu == 3 || flag5)
45645 {
45646 flag5 = false;
45648 }
45649 else if (selectedMenu == 2 || inputTextEnter)
45650 {
45652 }
45653 }
45654 else if ((netMode == 1 && menuMode != 888) || menuMode == 14)
45655 {
45656 num5 = 2;
45657 array9[0] = statusText;
45658 array[0] = true;
45659 num2 = 300;
45660 int num10 = statusText.Split('\n').Length - 1;
45661 array7[0] = 1f - (float)num10 * 0.04f;
45662 array4[0] = num10 * -18;
45663 array4[1] = num10 * 28;
45664 array9[1] = Lang.menu[6].Value;
45665 gameTips.Update();
45666 gameTips.Draw();
45667 if (selectedMenu == 1 || flag5)
45668 {
45669 flag5 = false;
45670 Netplay.InvalidateAllOngoingIPSetAttempts();
45671 Netplay.Disconnect = true;
45672 Netplay.Connection.Socket.Close();
45674 menuMode = 0;
45675 netMode = 0;
45676 if (tServer != null)
45677 {
45678 try
45679 {
45680 tServer.Kill();
45681 tServer = null;
45682 }
45683 catch
45684 {
45685 }
45686 }
45687 }
45688 }
45689 else if (menuMode == 882)
45690 {
45691 num5 = 2;
45692 array[0] = true;
45693 num2 = 300;
45694 array9[0] = statusText;
45695 array9[1] = Lang.menu[6].Value;
45696 if (selectedMenu == 1 || flag5)
45697 {
45698 flag5 = false;
45700 menuMode = 0;
45701 netMode = 0;
45702 if (SocialAPI.Network != null)
45703 {
45704 SocialAPI.Network.CancelJoin();
45705 }
45706 }
45707 }
45708 else if (menuMode == 30)
45709 {
45711 {
45713 uIVirtualKeyboard2.HideContents = HidePassword;
45715 menuMode = 888;
45716 }
45717 string serverPassword2 = Netplay.ServerPassword;
45718 PlayerInput.WritingText = true;
45719 instance.HandleIME();
45720 Netplay.ServerPassword = GetInputText(Netplay.ServerPassword);
45721 if (serverPassword2 != Netplay.ServerPassword)
45722 {
45724 }
45725 array9[0] = Lang.menu[7].Value;
45727 if (textBlinkerCount >= 20)
45728 {
45729 if (textBlinkerState == 0)
45730 {
45731 textBlinkerState = 1;
45732 }
45733 else
45734 {
45735 textBlinkerState = 0;
45736 }
45737 textBlinkerCount = 0;
45738 }
45739 array9[1] = Netplay.ServerPassword;
45740 if (HidePassword)
45741 {
45742 array9[1] = "";
45743 for (int n = 0; n < Netplay.ServerPassword.Length; n++)
45744 {
45745 array9[1] += "*";
45746 }
45747 }
45748 if (textBlinkerState == 1)
45749 {
45750 array9[1] += "|";
45751 array5[1] = 1;
45752 }
45753 else
45754 {
45755 array9[1] += " ";
45756 }
45757 array[0] = true;
45758 array[1] = true;
45759 array4[1] = -20;
45760 array4[2] = 20;
45761 array9[2] = Lang.menu[4].Value;
45762 array9[3] = Lang.menu[5].Value;
45763 num5 = 4;
45764 if (selectedMenu == 3 || flag5)
45765 {
45766 flag5 = false;
45768 }
45769 else if (selectedMenu == 2 || inputTextEnter || autoPass)
45770 {
45772 }
45773 }
45774 else if (menuMode == 889)
45775 {
45776 num2 = 200;
45777 num4 = 60;
45778 array4[1] = 30;
45779 array4[2] = 30;
45780 array4[3] = 30;
45781 array4[4] = 70;
45782 array4[5] = 70;
45783 num5 = 6;
45784 array9[0] = Lang.menu[135].Value;
45785 array9[4] = Lang.menu[144].Value;
45786 array9[5] = Lang.menu[5].Value;
45787 array[0] = true;
45788 if (!MenuServerMode.HasFlag(ServerMode.Lobby))
45789 {
45791 array[2] = true;
45792 array[3] = true;
45793 array9[1] = Lang.menu[136].Value;
45794 array9[2] = "";
45795 array9[3] = "";
45796 }
45797 else
45798 {
45799 array9[1] = Lang.menu[137].Value;
45800 if (MenuServerMode.HasFlag(ServerMode.FriendsCanJoin))
45801 {
45802 array9[2] = Lang.menu[139].Value;
45803 if (MenuServerMode.HasFlag(ServerMode.FriendsOfFriends))
45804 {
45805 array9[3] = Lang.menu[143].Value;
45806 }
45807 else
45808 {
45809 array9[3] = Lang.menu[142].Value;
45810 }
45811 }
45812 else
45813 {
45814 array9[2] = Lang.menu[138].Value;
45815 if (MenuServerMode.HasFlag(ServerMode.FriendsOfFriends))
45816 {
45817 array9[3] = Lang.menu[141].Value;
45818 }
45819 else
45820 {
45821 array9[3] = Lang.menu[140].Value;
45822 }
45823 }
45824 }
45825 if (flag5)
45826 {
45827 flag5 = false;
45828 selectedMenu = 5;
45829 }
45830 switch (selectedMenu)
45831 {
45832 case 1:
45833 MenuServerMode ^= ServerMode.Lobby;
45835 break;
45836 case 2:
45837 MenuServerMode ^= ServerMode.FriendsCanJoin;
45839 break;
45840 case 3:
45841 MenuServerMode ^= ServerMode.FriendsOfFriends;
45843 break;
45844 case 4:
45845 clrInput();
45846 Netplay.ServerPassword = "";
45847 GetInputText("");
45848 autoPass = false;
45849 menuMode = 30;
45851 break;
45852 case 5:
45853 menuMode = 6;
45855 break;
45856 }
45857 }
45858 else if (menuMode == 15)
45859 {
45860 num5 = 2;
45861 array9[0] = statusText;
45862 array[0] = true;
45863 num2 = 80;
45864 num4 = 400;
45865 array9[1] = Lang.menu[5].Value;
45866 if (selectedMenu == 1 || flag5)
45867 {
45868 flag5 = false;
45869 Netplay.Disconnect = true;
45871 menuMode = 0;
45872 netMode = 0;
45873 }
45874 }
45875 else if (menuMode == 200)
45876 {
45877 num5 = 3;
45878 array9[0] = Lang.menu[9].Value;
45879 array[0] = true;
45880 num2 -= 30;
45881 array4[1] = 70;
45882 array4[2] = 50;
45883 array9[1] = Lang.menu[10].Value;
45884 array9[2] = Lang.menu[6].Value;
45885 if (selectedMenu == 1)
45886 {
45887 if (FileUtilities.Exists(worldPathName + ".bak", ActiveWorldFileData.IsCloudSave))
45888 {
45892 WorldGen.playWorld();
45893 menuMode = 10;
45894 }
45895 else
45896 {
45898 menuMode = 0;
45899 netMode = 0;
45900 }
45901 }
45902 if (selectedMenu == 2 || flag5)
45903 {
45904 flag5 = false;
45906 menuMode = 0;
45907 netMode = 0;
45908 }
45909 }
45910 else if (menuMode == 201)
45911 {
45912 num5 = 3;
45913 array9[0] = Lang.menu[9].Value;
45914 array[0] = true;
45915 array[1] = true;
45916 num2 -= 30;
45917 array4[1] = -30;
45918 array4[2] = 50;
45919 array9[1] = Lang.menu[11].Value;
45920 array9[2] = Lang.menu[5].Value;
45921 if (selectedMenu == 2 || flag5)
45922 {
45923 flag5 = false;
45925 menuMode = 0;
45926 netMode = 0;
45927 }
45928 }
45929 else if (menuMode == 10)
45930 {
45931 num5 = 1;
45932 array9[0] = statusText;
45933 array[0] = true;
45934 num2 = 300;
45935 gameTips.Update();
45936 gameTips.Draw();
45937 }
45938 else if (menuMode == 100)
45939 {
45940 num5 = 1;
45941 array9[0] = statusText;
45942 array[0] = true;
45943 num2 = 300;
45944 }
45945 else if (menuMode == 0)
45946 {
45949 DD2Event.Ongoing = false;
45950 eclipse = false;
45951 pumpkinMoon = false;
45952 snowMoon = false;
45953 ServerSideCharacter = false;
45954 menuMultiplayer = false;
45955 menuServer = false;
45956 netMode = 0;
45958 int num11 = 0;
45959 num2 = 220;
45960 num5 = 7;
45961 num4 = 52;
45962 array9[num11] = Lang.menu[12].Value;
45963 if (selectedMenu == num11)
45964 {
45967 menuMode = 1;
45968 }
45969 num11++;
45970 array9[num11] = Lang.menu[13].Value;
45971 if (selectedMenu == num11)
45972 {
45974 menuMode = 12;
45975 }
45976 num11++;
45977 array9[num11] = Lang.menu[131].Value;
45978 if (selectedMenu == num11)
45979 {
45981 menuMode = 888;
45982 MenuUI.SetState(AchievementsMenu);
45983 }
45984 num11++;
45985 if (SocialAPI.Workshop != null)
45986 {
45987 array9[num11] = Language.GetText("UI.Workshop").Value;
45988 if (selectedMenu == num11)
45989 {
45991 menuMode = 888;
45993 uIWorkshopHub.EnterHub();
45994 MenuUI.SetState(uIWorkshopHub);
45995 }
45996 }
45997 else
45998 {
45999 array9[num11] = Language.GetText("UI.ResourcePacks").Value;
46000 if (selectedMenu == num11)
46001 {
46004 }
46005 }
46006 num11++;
46007 array9[num11] = Lang.menu[14].Value;
46008 if (selectedMenu == num11)
46009 {
46011 menuMode = 11;
46012 }
46013 num11++;
46014 array9[num11] = Language.GetText("UI.Credits").Value;
46015 if (selectedMenu == num11)
46016 {
46018 menuMode = 3000;
46019 SkyManager.Instance.Activate("CreditsRoll", default(Vector2));
46020 }
46021 num11++;
46022 array9[num11] = Lang.menu[15].Value;
46023 if (selectedMenu == num11)
46024 {
46025 GameAskedToQuit = true;
46026 }
46027 num11++;
46028 }
46029 else if (menuMode == 1)
46030 {
46032 }
46033 else if (menuMode == 2)
46034 {
46035 flag4 = true;
46036 if (selectedMenu == 0)
46037 {
46038 menuMode = 17;
46040 selColor = PendingPlayer.hairColor;
46041 }
46042 if (selectedMenu == 1)
46043 {
46044 menuMode = 18;
46046 selColor = PendingPlayer.eyeColor;
46047 }
46048 if (selectedMenu == 2)
46049 {
46050 menuMode = 19;
46052 selColor = PendingPlayer.skinColor;
46053 }
46054 if (selectedMenu == 3)
46055 {
46056 menuMode = 20;
46058 }
46059 array9[0] = Lang.menu[18].Value;
46060 array9[1] = Lang.menu[19].Value;
46061 array9[2] = Lang.menu[20].Value;
46062 array9[3] = Lang.menu[21].Value;
46063 num2 = 220;
46064 for (int num12 = 0; num12 < 9; num12++)
46065 {
46066 if (num12 < 6)
46067 {
46068 array7[num12] = 0.75f;
46069 }
46070 else
46071 {
46072 array7[num12] = 0.9f;
46073 }
46074 }
46075 num4 = 38;
46076 array4[6] = 6;
46077 array4[7] = 12;
46078 array4[8] = 18;
46079 num7 = screenWidth / 2 - 16;
46080 num8 = 176;
46081 if (PendingPlayer.Male)
46082 {
46083 array9[4] = Lang.menu[22].Value;
46084 }
46085 else
46086 {
46087 array9[4] = Lang.menu[23].Value;
46088 }
46089 if (selectedMenu == 4)
46090 {
46091 if (PendingPlayer.Male)
46092 {
46094 PendingPlayer.Male = false;
46095 }
46096 else
46097 {
46099 PendingPlayer.Male = true;
46100 }
46101 }
46102 if (PendingPlayer.difficulty == 2)
46103 {
46104 array9[5] = Lang.menu[24].Value;
46105 array6[5] = PendingPlayer.difficulty;
46106 }
46107 else if (PendingPlayer.difficulty == 1)
46108 {
46109 array9[5] = Lang.menu[25].Value;
46110 array6[5] = PendingPlayer.difficulty;
46111 }
46112 else
46113 {
46114 array9[5] = Lang.menu[26].Value;
46115 }
46116 if (selectedMenu == 5)
46117 {
46119 menuMode = 222;
46120 }
46121 if (selectedMenu == 7)
46122 {
46124 PendingPlayer.hair = rand.Next(51);
46125 PendingPlayer.eyeColor = randColor();
46126 while (PendingPlayer.eyeColor.R + PendingPlayer.eyeColor.G + PendingPlayer.eyeColor.B > 300)
46127 {
46128 PendingPlayer.eyeColor = randColor();
46129 }
46130 PendingPlayer.hairColor = randColor();
46131 PendingPlayer.pantsColor = randColor();
46132 PendingPlayer.shirtColor = randColor();
46133 PendingPlayer.shoeColor = randColor();
46134 PendingPlayer.skinColor = randColor();
46135 float num13 = (float)rand.Next(60, 120) * 0.01f;
46136 if (num13 > 1f)
46137 {
46138 num13 = 1f;
46139 }
46140 PendingPlayer.skinColor.R = (byte)((float)rand.Next(240, 255) * num13);
46141 PendingPlayer.skinColor.G = (byte)((float)rand.Next(110, 140) * num13);
46142 PendingPlayer.skinColor.B = (byte)((float)rand.Next(75, 110) * num13);
46143 PendingPlayer.underShirtColor = randColor();
46144 int num14 = PendingPlayer.hair + 1;
46145 if (num14 == 5 || num14 == 6 || num14 == 7 || num14 == 10 || num14 == 12 || num14 == 19 || num14 == 22 || num14 == 23 || num14 == 26 || num14 == 27 || num14 == 30 || num14 == 33)
46146 {
46147 PendingPlayer.Male = false;
46148 }
46149 else
46150 {
46151 PendingPlayer.Male = true;
46152 }
46153 PendingPlayer.skinVariant = rand.Next(PlayerVariantID.Count);
46154 }
46155 array9[7] = Lang.menu[27].Value;
46156 array9[6] = Lang.menu[28].Value;
46157 array9[8] = Lang.menu[5].Value;
46158 num5 = 9;
46159 if (selectedMenu == 8 || flag5)
46160 {
46161 flag5 = false;
46163 menuMode = 1;
46164 }
46165 else if (selectedMenu == 6)
46166 {
46168 PendingPlayer.name = "";
46169 menuMode = 3;
46170 clrInput();
46171 }
46172 }
46173 else if (menuMode == 222)
46174 {
46175 if (focusMenu == 3)
46176 {
46177 array9[0] = Lang.menu[29].Value;
46178 }
46179 else if (focusMenu == 2)
46180 {
46181 array9[0] = Lang.menu[30].Value;
46182 }
46183 else if (focusMenu == 1)
46184 {
46185 array9[0] = Lang.menu[31].Value;
46186 }
46187 else
46188 {
46189 array9[0] = Lang.menu[32].Value;
46190 }
46191 num4 = 50;
46192 array4[1] = 25;
46193 array4[2] = 25;
46194 array4[3] = 25;
46195 array[0] = true;
46196 array9[1] = Lang.menu[26].Value;
46197 array9[2] = Lang.menu[25].Value;
46198 array6[2] = 1;
46199 array9[3] = Lang.menu[24].Value;
46200 array6[3] = 2;
46201 num5 = 4;
46202 if (selectedMenu == 1)
46203 {
46204 PendingPlayer.difficulty = 0;
46205 menuMode = 2;
46206 }
46207 else if (selectedMenu == 2)
46208 {
46209 menuMode = 2;
46210 PendingPlayer.difficulty = 1;
46211 }
46212 else if (selectedMenu == 3)
46213 {
46214 PendingPlayer.difficulty = 2;
46215 menuMode = 2;
46216 }
46217 }
46218 else if (menuMode == 20)
46219 {
46220 flag4 = true;
46221 if (selectedMenu == 0)
46222 {
46223 menuMode = 21;
46225 selColor = PendingPlayer.shirtColor;
46226 }
46227 if (selectedMenu == 1)
46228 {
46229 menuMode = 22;
46231 selColor = PendingPlayer.underShirtColor;
46232 }
46233 if (selectedMenu == 2)
46234 {
46235 menuMode = 23;
46237 selColor = PendingPlayer.pantsColor;
46238 }
46239 if (selectedMenu == 3)
46240 {
46241 selColor = PendingPlayer.shoeColor;
46242 menuMode = 24;
46244 }
46245 if (selectedMenu == 5 || flag5)
46246 {
46247 flag5 = false;
46249 menuMode = 2;
46250 }
46251 if (selectedMenu == 4)
46252 {
46255 }
46256 num7 = screenWidth / 2 - 16;
46257 num8 = 210;
46258 num2 = 260;
46259 num4 = 50;
46260 num5 = 6;
46261 array9[0] = Lang.menu[33].Value;
46262 array9[1] = Lang.menu[34].Value;
46263 array9[2] = Lang.menu[35].Value;
46264 array9[3] = Lang.menu[36].Value;
46265 array9[4] = Lang.menu[127].Value;
46266 array9[5] = Lang.menu[5].Value;
46267 array4[5] = 20;
46268 }
46269 else if (menuMode == 17)
46270 {
46271 flag4 = true;
46272 num7 = screenWidth / 2 - 16;
46273 num8 = 210;
46274 flag = true;
46275 num9 = 390;
46276 num2 = 260;
46277 num4 = 60;
46278 PendingPlayer.hairColor = selColor;
46279 num5 = 3;
46280 array9[0] = Lang.menu[37].Value + " " + (PendingPlayer.hair + 1);
46281 array9[1] = Lang.menu[38].Value;
46282 array[1] = true;
46283 array4[2] = 150;
46284 array4[1] = 10;
46285 array9[2] = Lang.menu[5].Value;
46286 int num15 = 51;
46287 if (focusMenu == 0)
46288 {
46289 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 9;
46290 }
46291 if (selectedMenu == 0)
46292 {
46294 PendingPlayer.hair++;
46295 if (PendingPlayer.hair >= num15)
46296 {
46297 PendingPlayer.hair = 0;
46298 }
46299 }
46300 else if (selectedMenu2 == 0)
46301 {
46303 PendingPlayer.hair--;
46304 if (PendingPlayer.hair < 0)
46305 {
46306 PendingPlayer.hair = num15 - 1;
46307 }
46308 }
46309 if (selectedMenu == 2 || flag5)
46310 {
46311 flag5 = false;
46312 menuMode = 2;
46314 }
46315 }
46316 else if (menuMode == 18)
46317 {
46318 flag4 = true;
46319 num7 = screenWidth / 2 - 16;
46320 num8 = 210;
46321 flag = true;
46322 num9 = 370;
46323 num2 = 240;
46324 num4 = 60;
46325 PendingPlayer.eyeColor = selColor;
46326 num5 = 3;
46327 array9[0] = "";
46328 array9[1] = Lang.menu[39].Value;
46329 array[1] = true;
46330 array4[2] = 170;
46331 array4[1] = 10;
46332 array9[2] = Lang.menu[5].Value;
46333 if (selectedMenu == 2 || flag5)
46334 {
46335 flag5 = false;
46336 menuMode = 2;
46338 }
46339 }
46340 else if (menuMode == 19)
46341 {
46342 flag4 = true;
46343 num7 = screenWidth / 2 - 16;
46344 num8 = 210;
46345 flag = true;
46346 num9 = 370;
46347 num2 = 240;
46348 num4 = 60;
46349 PendingPlayer.skinColor = selColor;
46350 num5 = 3;
46351 array9[0] = "";
46352 array9[1] = Lang.menu[40].Value;
46353 array[1] = true;
46354 array4[2] = 170;
46355 array4[1] = 10;
46356 array9[2] = Lang.menu[5].Value;
46357 if (selectedMenu == 2 || flag5)
46358 {
46359 flag5 = false;
46360 menuMode = 2;
46362 }
46363 }
46364 else if (menuMode == 21)
46365 {
46366 flag4 = true;
46367 num7 = screenWidth / 2 - 16;
46368 num8 = 210;
46369 flag = true;
46370 num9 = 370;
46371 num2 = 240;
46372 num4 = 60;
46373 PendingPlayer.shirtColor = selColor;
46374 num5 = 3;
46375 array9[0] = "";
46376 array9[1] = Lang.menu[41].Value;
46377 array[1] = true;
46378 array4[2] = 170;
46379 array4[1] = 10;
46380 array9[2] = Lang.menu[5].Value;
46381 if (selectedMenu == 2 || flag5)
46382 {
46383 flag5 = false;
46384 menuMode = 20;
46386 }
46387 }
46388 else if (menuMode == 22)
46389 {
46390 flag4 = true;
46391 num7 = screenWidth / 2 - 16;
46392 num8 = 210;
46393 flag = true;
46394 num9 = 370;
46395 num2 = 240;
46396 num4 = 60;
46397 PendingPlayer.underShirtColor = selColor;
46398 num5 = 3;
46399 array9[0] = "";
46400 array9[1] = Lang.menu[42].Value;
46401 array[1] = true;
46402 array4[2] = 170;
46403 array4[1] = 10;
46404 array9[2] = Lang.menu[5].Value;
46405 if (selectedMenu == 2 || flag5)
46406 {
46407 flag5 = false;
46408 menuMode = 20;
46410 }
46411 }
46412 else if (menuMode == 23)
46413 {
46414 flag4 = true;
46415 num7 = screenWidth / 2 - 16;
46416 num8 = 210;
46417 flag = true;
46418 num9 = 370;
46419 num2 = 240;
46420 num4 = 60;
46421 PendingPlayer.pantsColor = selColor;
46422 num5 = 3;
46423 array9[0] = "";
46424 array9[1] = Lang.menu[43].Value;
46425 array[1] = true;
46426 array4[2] = 170;
46427 array4[1] = 10;
46428 array9[2] = Lang.menu[5].Value;
46429 if (selectedMenu == 2 || flag5)
46430 {
46431 flag5 = false;
46432 menuMode = 20;
46434 }
46435 }
46436 else if (menuMode == 24)
46437 {
46438 flag4 = true;
46439 num7 = screenWidth / 2 - 16;
46440 num8 = 210;
46441 flag = true;
46442 num9 = 370;
46443 num2 = 240;
46444 num4 = 60;
46445 PendingPlayer.shoeColor = selColor;
46446 num5 = 3;
46447 array9[0] = "";
46448 array9[1] = Lang.menu[44].Value;
46449 array[1] = true;
46450 array4[2] = 170;
46451 array4[1] = 10;
46452 array9[2] = Lang.menu[5].Value;
46453 if (selectedMenu == 2 || flag5)
46454 {
46455 flag5 = false;
46456 menuMode = 20;
46458 }
46459 }
46460 else if (menuMode == 3)
46461 {
46463 uIVirtualKeyboard3.SetMaxInputLength(20);
46464 menuMode = 888;
46465 MenuUI.SetState(uIVirtualKeyboard3);
46466 }
46467 else if (menuMode != 4)
46468 {
46469 if (menuMode == 5)
46470 {
46471 array9[0] = Lang.menu[46].Value + " " + PlayerList[selectedPlayer].Player.name + "?";
46472 array[0] = true;
46473 array9[1] = Lang.menu[104].Value;
46474 array9[2] = Lang.menu[105].Value;
46475 num5 = 3;
46476 if (selectedMenu == 1)
46477 {
46480 menuMode = 1;
46481 }
46482 else if (selectedMenu == 2 || flag5)
46483 {
46484 flag5 = false;
46486 menuMode = 1;
46487 }
46488 }
46489 else if (menuMode == 6)
46490 {
46491 menuMode = 888;
46492 MenuUI.SetState(_worldSelectMenu);
46493 }
46494 else if (menuMode == -7)
46495 {
46496 num2 = 200;
46497 num4 = 60;
46498 array4[2] = 30;
46499 array4[3] = 30;
46500 array4[4] = 30;
46501 array6[3] = 1;
46502 array6[4] = 2;
46503 array4[5] = 70;
46504 if (focusMenu == 2)
46505 {
46506 array9[1] = Language.GetTextValue("UI.WorldDescriptionNormal");
46507 }
46508 else if (focusMenu == 3)
46509 {
46510 array9[1] = Language.GetTextValue("UI.WorldDescriptionExpert");
46511 }
46512 else if (focusMenu == 4)
46513 {
46514 array9[1] = Language.GetTextValue("UI.WorldDescriptionMaster");
46515 }
46516 array9[0] = Lang.menu[32].Value;
46517 array[0] = true;
46518 array[1] = true;
46519 array9[2] = Language.GetTextValue("UI.Normal");
46520 array9[3] = Language.GetTextValue("UI.Expert");
46521 array9[4] = Language.GetTextValue("UI.Master");
46522 array9[5] = Language.GetTextValue("UI.Back");
46523 num5 = 6;
46524 if (selectedMenu == 2)
46525 {
46526 GameMode = 0;
46528 menuMode = 7;
46530 {
46531 menuMode = -71;
46532 }
46533 }
46534 else if (selectedMenu == 3)
46535 {
46536 GameMode = 1;
46538 menuMode = 7;
46540 {
46541 menuMode = -71;
46542 }
46543 }
46544 else if (selectedMenu == 4)
46545 {
46546 GameMode = 2;
46548 menuMode = 7;
46550 {
46551 menuMode = -71;
46552 }
46553 }
46554 else if (selectedMenu == 5 || flag5)
46555 {
46556 flag5 = false;
46558 menuMode = 16;
46559 }
46560 clrInput();
46561 }
46562 else if (menuMode == -71)
46563 {
46564 num2 = 200;
46565 num4 = 60;
46566 array4[1] = 30;
46567 array4[2] = 30;
46568 array4[3] = 30;
46569 array4[4] = 70;
46570 num5 = 5;
46571 int num16 = 0;
46572 array9[num16] = Lang.misc[100].Value;
46573 array[num16] = true;
46574 num16++;
46575 array9[num16] = Lang.misc[101].Value;
46576 if (selectedMenu == num16)
46577 {
46578 WorldGen.WorldGenParam_Evil = 0;
46580 menuMode = 7;
46581 }
46582 num16++;
46583 array9[num16] = Lang.misc[102].Value;
46584 if (selectedMenu == num16)
46585 {
46586 WorldGen.WorldGenParam_Evil = 1;
46588 menuMode = 7;
46589 }
46590 num16++;
46591 array9[num16] = Lang.misc[103].Value;
46592 if (selectedMenu == num16)
46593 {
46594 WorldGen.WorldGenParam_Evil = -1;
46596 menuMode = 7;
46597 }
46598 num16++;
46599 array9[num16] = Language.GetTextValue("UI.Back");
46600 if (selectedMenu == num16 || flag5)
46601 {
46602 flag5 = false;
46604 menuMode = -7;
46605 }
46606 num16++;
46607 clrInput();
46608 }
46609 else if (menuMode == 7)
46610 {
46611 menuMode = 888;
46612 MenuUI.SetState(new UIVirtualKeyboard(Lang.menu[48].Value, "", OnWorldNamed, CreateGoToMenuEvent(-7)));
46613 }
46614 else if (menuMode == 5000)
46615 {
46616 menuMode = 888;
46618 }
46619 else if (menuMode == 8)
46620 {
46621 num2 = 180;
46622 num4 = 40;
46623 num5 = 8;
46624 array4[7] += 30;
46625 for (int num17 = 0; num17 < num5; num17++)
46626 {
46627 array7[num17] = 0.8f;
46628 }
46629 array9[7] = Lang.menu[5].Value;
46630 for (int num18 = 0; num18 < 7; num18++)
46631 {
46632 if (num18 < WorldList.Count)
46633 {
46634 array9[num18] = WorldList[num18 + menuSkip].Name;
46635 if (WorldList[num18 + menuSkip].GameMode == 1)
46636 {
46637 array6[num18] = 1;
46638 }
46639 else if (WorldList[num18 + menuSkip].GameMode == 2)
46640 {
46641 array6[num18] = 2;
46642 }
46643 }
46644 else
46645 {
46646 array9[num18] = null;
46647 }
46648 }
46649 if (WorldList.Count > 7 + menuSkip)
46650 {
46651 array9[6] = Language.GetTextValue("UI.More");
46652 array9[6] = "â–¼";
46653 array7[6] = 0.6f;
46654 array4[6] += 8;
46655 menuWide[6] = true;
46656 }
46657 if (menuSkip > 0)
46658 {
46659 array9[0] = "â–²";
46660 array7[0] = 0.6f;
46661 array4[0] += 8;
46662 menuWide[0] = true;
46663 }
46664 if (selectedMenu == 0 && menuSkip > 0)
46665 {
46667 menuSkip -= 5;
46668 if (menuSkip < 0)
46669 {
46670 menuSkip = 0;
46671 }
46672 }
46673 else if (selectedMenu == 6 && menuSkip < WorldList.Count - 7)
46674 {
46676 menuSkip += 5;
46677 if (menuSkip >= PlayerList.Count - 7)
46678 {
46679 menuSkip = WorldList.Count - 7;
46680 }
46681 }
46682 else if (selectedMenu == 7 || flag5)
46683 {
46684 flag5 = false;
46686 menuMode = 6;
46687 }
46688 else if (selectedMenu >= 0)
46689 {
46692 menuMode = 9;
46693 }
46694 }
46695 else if (menuMode == 9)
46696 {
46697 array9[0] = Lang.menu[46].Value + " " + WorldList[selectedWorld].Name + "?";
46698 array[0] = true;
46699 array9[1] = Lang.menu[104].Value;
46700 array9[2] = Lang.menu[105].Value;
46701 num5 = 3;
46702 if (selectedMenu == 1)
46703 {
46706 menuMode = 6;
46707 }
46708 else if (selectedMenu == 2 || flag5)
46709 {
46711 menuMode = 6;
46712 }
46713 }
46714 else if (menuMode == 3000)
46715 {
46716 num5 = 1;
46717 num2 = 500;
46718 array7[0] = 0.9f;
46719 array9[0] = Lang.menu[5].Value;
46720 if (selectedMenu == 0 || flag5)
46721 {
46722 flag5 = false;
46724 menuMode = 0;
46725 }
46726 }
46727 else if (menuMode == 11)
46728 {
46729 num2 = 210;
46730 num4 = 37;
46731 num5 = 8;
46732 array4[num5 - 1] = 8;
46733 for (int num19 = 0; num19 < num5; num19++)
46734 {
46735 array7[num19] = 0.75f;
46736 }
46737 int num20 = 0;
46738 array9[num20] = Lang.menu[114].Value;
46739 if (selectedMenu == num20)
46740 {
46742 menuMode = 112;
46743 }
46744 num20++;
46745 array9[num20] = Lang.menu[210].Value;
46746 if (selectedMenu == num20)
46747 {
46749 menuMode = 1112;
46750 }
46751 num20++;
46752 array9[num20] = Lang.menu[63].Value;
46753 if (selectedMenu == num20)
46754 {
46756 menuMode = 1111;
46757 }
46758 num20++;
46759 array9[num20] = Lang.menu[65].Value;
46760 if (selectedMenu == num20)
46761 {
46763 menuMode = 26;
46764 }
46765 num20++;
46766 array9[num20] = Lang.menu[218].Value;
46767 if (selectedMenu == num20)
46768 {
46770 menuMode = 1125;
46771 }
46772 num20++;
46773 array9[num20] = Lang.menu[219].Value;
46774 if (selectedMenu == num20)
46775 {
46777 menuMode = 1127;
46778 }
46779 num20++;
46780 array9[num20] = Lang.menu[103].Value;
46781 if (selectedMenu == num20)
46782 {
46784 menuMode = 1213;
46785 }
46786 num20++;
46787 array9[num20] = Lang.menu[5].Value;
46788 if (selectedMenu == num20 || flag5)
46789 {
46790 flag5 = false;
46792 menuMode = 0;
46793 SaveSettings();
46794 }
46795 }
46796 else if (menuMode == 112)
46797 {
46798 num2 = 250;
46799 num4 = 52;
46800 num5 = 5;
46801 array4[num5 - 1] = 18;
46802 for (int num21 = 0; num21 < num5; num21++)
46803 {
46804 array7[num21] = 0.78f;
46805 }
46806 int num22 = 0;
46807 if (autoSave)
46808 {
46809 array9[num22] = Lang.menu[67].Value;
46810 }
46811 else
46812 {
46813 array9[num22] = Lang.menu[68].Value;
46814 }
46815 if (selectedMenu == num22)
46816 {
46818 if (autoSave)
46819 {
46820 autoSave = false;
46821 }
46822 else
46823 {
46824 autoSave = true;
46825 }
46826 }
46827 num22++;
46828 if (autoPause)
46829 {
46830 array9[num22] = Lang.menu[69].Value;
46831 }
46832 else
46833 {
46834 array9[num22] = Lang.menu[70].Value;
46835 }
46836 if (selectedMenu == num22)
46837 {
46839 if (autoPause)
46840 {
46841 autoPause = false;
46842 }
46843 else
46844 {
46845 autoPause = true;
46846 }
46847 }
46848 num22++;
46849 if (mapEnabled)
46850 {
46851 array9[num22] = Lang.menu[112].Value;
46852 }
46853 else
46854 {
46855 array9[num22] = Lang.menu[113].Value;
46856 }
46857 if (selectedMenu == num22)
46858 {
46860 if (mapEnabled)
46861 {
46862 mapEnabled = false;
46863 }
46864 else
46865 {
46866 mapEnabled = true;
46867 }
46868 }
46869 num22++;
46870 array9[num22] = (HidePassword ? Lang.menu[212].Value : Lang.menu[211].Value);
46871 if (selectedMenu == num22)
46872 {
46875 }
46876 num22++;
46877 array9[num22] = Lang.menu[5].Value;
46878 if (selectedMenu == num22 || flag5)
46879 {
46880 flag5 = false;
46881 menuMode = 11;
46883 }
46884 }
46885 else if (menuMode == 1112)
46886 {
46887 num2 = 210;
46888 num4 = 32;
46889 num5 = 10;
46890 array4[num5 - 1] = 18;
46891 for (int num23 = 0; num23 < num5; num23++)
46892 {
46893 array7[num23] = 0.7f;
46894 }
46895 int num24 = 0;
46896 if (showItemText)
46897 {
46898 array9[num24] = Lang.menu[71].Value;
46899 }
46900 else
46901 {
46902 array9[num24] = Lang.menu[72].Value;
46903 }
46904 if (selectedMenu == num24)
46905 {
46907 if (showItemText)
46908 {
46909 showItemText = false;
46910 }
46911 else
46912 {
46913 showItemText = true;
46914 }
46915 }
46916 num24++;
46917 array9[num24] = Lang.menu[123].Value + " " + Lang.menu[124 + invasionProgressMode].Value;
46918 if (selectedMenu == num24)
46919 {
46922 if (invasionProgressMode >= 3)
46923 {
46925 }
46926 }
46927 num24++;
46928 array9[num24] = (placementPreview ? Lang.menu[128].Value : Lang.menu[129].Value);
46929 if (selectedMenu == num24)
46930 {
46933 }
46934 num24++;
46935 array9[num24] = (ItemSlot.Options.HighlightNewItems ? Lang.inter[117].Value : Lang.inter[116].Value);
46936 if (selectedMenu == num24)
46937 {
46939 ItemSlot.Options.HighlightNewItems = !ItemSlot.Options.HighlightNewItems;
46940 }
46941 num24++;
46942 array9[num24] = (MouseShowBuildingGrid ? Lang.menu[229].Value : Lang.menu[230].Value);
46943 if (selectedMenu == num24)
46944 {
46947 }
46948 num24++;
46949 array9[num24] = (GamepadDisableInstructionsDisplay ? Lang.menu[241].Value : Lang.menu[242].Value);
46950 if (selectedMenu == num24)
46951 {
46954 }
46955 num24++;
46956 string textValue = Language.GetTextValue("UI.MinimapFrame_" + MinimapFrameManagerInstance.ActiveSelectionKeyName);
46957 array9[num24] = Language.GetTextValue("UI.SelectMapBorder", textValue);
46958 if (selectedMenu == num24)
46959 {
46960 MinimapFrameManagerInstance.CycleSelection();
46961 }
46962 num24++;
46963 string activeSetKeyName = ResourceSetsManager.ActiveSetKeyName;
46964 string textValue2 = Language.GetTextValue("UI.HealthManaStyle_" + activeSetKeyName);
46965 array9[num24] = Language.GetTextValue("UI.SelectHealthStyle", textValue2);
46966 if (selectedMenu == num24)
46967 {
46968 ResourceSetsManager.CycleResourceSet();
46969 }
46970 num24++;
46971 array9[num24] = Language.GetTextValue(BigProgressBarSystem.ShowText ? "UI.ShowBossLifeTextOn" : "UI.ShowBossLifeTextOff");
46972 if (selectedMenu == num24)
46973 {
46975 }
46976 num24++;
46977 array9[num24] = Lang.menu[5].Value;
46978 if (selectedMenu == num24 || flag5)
46979 {
46980 flag5 = false;
46981 menuMode = 11;
46983 }
46984 }
46985 else if (menuMode == 1111)
46986 {
46987 bgScroll = (int)Math.Round((1f - caveParallax) * 500f);
46988 int num25 = 0;
46989 array9[num25] = Lang.menu[51].Value;
46990 if (selectedMenu == num25)
46991 {
46993 menuMode = 111;
46994 }
46995 num25++;
46996 array9[num25] = Lang.menu[52].Value;
46997 if (selectedMenu == num25)
46998 {
47000 menuMode = 28;
47001 }
47002 num25++;
47003 array9[num25] = Lang.menu[(int)(247 + FrameSkipMode)].Value;
47004 if (selectedMenu == num25)
47005 {
47008 }
47009 num25++;
47010 array9[num25] = Language.GetTextValue("UI.LightMode_" + Lighting.Mode);
47011 if (selectedMenu == num25)
47012 {
47014 Lighting.NextLightMode();
47015 }
47016 num25++;
47017 switch (qaStyle)
47018 {
47019 case 0:
47020 array9[num25] = Lang.menu[59].Value;
47021 break;
47022 case 1:
47023 array9[num25] = Lang.menu[60].Value;
47024 break;
47025 case 2:
47026 array9[num25] = Lang.menu[61].Value;
47027 break;
47028 default:
47029 array9[num25] = Lang.menu[62].Value;
47030 break;
47031 }
47032 if (selectedMenu == num25)
47033 {
47035 if (++qaStyle > 3)
47036 {
47037 qaStyle = 0;
47038 }
47039 }
47040 num25++;
47041 array9[num25] = (BackgroundEnabled ? Lang.menu[100].Value : Lang.menu[101].Value);
47042 if (selectedMenu == num25)
47043 {
47046 }
47047 num25++;
47048 array9[num25] = (ChildSafety.Disabled ? Lang.menu[132].Value : Lang.menu[133].Value);
47049 if (selectedMenu == num25)
47050 {
47052 ChildSafety.Disabled = !ChildSafety.Disabled;
47053 }
47054 num25++;
47055 array9[num25] = (SettingsEnabled_MinersWobble ? Lang.menu[250].Value : Lang.menu[251].Value);
47056 if (selectedMenu == num25)
47057 {
47060 }
47061 num25++;
47062 array9[num25] = (SettingsEnabled_TilesSwayInWind ? Language.GetTextValue("UI.TilesSwayInWindOn") : Language.GetTextValue("UI.TilesSwayInWindOff"));
47063 if (selectedMenu == num25)
47064 {
47067 }
47068 num25++;
47069 array9[num25] = Language.GetTextValue("UI.Effects");
47070 if (selectedMenu == num25)
47071 {
47073 menuMode = 2008;
47074 }
47075 int num26 = num25;
47076 int num27 = num26;
47077 array9[num27] = Lang.menu[5].Value;
47078 array4[num27] = 8;
47079 if (selectedMenu == num27 || flag5)
47080 {
47081 flag5 = false;
47083 SaveSettings();
47084 menuMode = 11;
47085 }
47086 num2 = 186;
47087 num4 = 30;
47088 num5 = num27 + 1;
47089 for (int num28 = 0; num28 < num26; num28++)
47090 {
47091 array7[num28] = 0.6f;
47092 }
47093 }
47094 else if (menuMode == 2008)
47095 {
47096 num2 = 240;
47097 num4 = 60;
47098 num5 = 6;
47099 array9[0] = "";
47100 array9[1] = Language.GetTextValue("UI.Effects");
47101 array[1] = true;
47102 array4[1] = 10;
47103 array9[2] = Language.GetTextValue("GameUI.StormEffects", UseStormEffects ? Language.GetTextValue("GameUI.Enabled") : Language.GetTextValue("GameUI.Disabled"));
47104 array7[2] = 0.8f;
47105 array9[3] = Language.GetTextValue("GameUI.HeatDistortion", UseHeatDistortion ? Language.GetTextValue("GameUI.Enabled") : Language.GetTextValue("GameUI.Disabled"));
47106 array7[3] = 0.8f;
47107 array9[4] = Language.GetTextValue("GameUI.WaveQuality", WaveQuality switch
47108 {
47109 1 => Language.GetTextValue("GameUI.QualityLow"),
47110 2 => Language.GetTextValue("GameUI.QualityMedium"),
47111 3 => Language.GetTextValue("GameUI.QualityHigh"),
47112 _ => Language.GetTextValue("GameUI.QualityOff"),
47113 });
47114 array7[4] = 0.8f;
47115 array9[5] = Lang.menu[5].Value;
47116 if (selectedMenu == 2)
47117 {
47119 }
47120 if (selectedMenu == 3)
47121 {
47123 }
47124 if (selectedMenu == 4)
47125 {
47126 WaveQuality = (WaveQuality + 1) % 4;
47127 }
47128 if (selectedMenu == 5 || flag5)
47129 {
47130 flag5 = false;
47131 menuMode = 1111;
47133 }
47134 }
47135 else if (menuMode == 111)
47136 {
47137 for (int num29 = 0; num29 < 9; num29++)
47138 {
47139 array7[num29] = 0.85f;
47140 }
47141 num2 = 210;
47142 num4 = 55;
47143 int num30 = 0;
47144 array9[num30] = Lang.menu[73].Value + ": " + PendingResolutionWidth + "x" + PendingResolutionHeight;
47145 if (selectedMenu == num30)
47146 {
47148 int num31 = 0;
47149 for (int num32 = 0; num32 < numDisplayModes; num32++)
47150 {
47152 {
47153 num31 = num32;
47154 break;
47155 }
47156 }
47157 num31 = (num31 + 1) % numDisplayModes;
47160 }
47161 num30++;
47163 {
47164 array9[num30] = Lang.menu[PendingBorderlessState ? 245 : 246].Value;
47165 if (selectedMenu == num30)
47166 {
47169 }
47170 num30++;
47171 }
47172 array9[num30] = (graphics.IsFullScreen ? Lang.menu[49].Value : Lang.menu[50].Value);
47173 if (selectedMenu == num30)
47174 {
47176 }
47177 num30++;
47178 array4[num30] = 100;
47179 array9[num30] = Lang.menu[134].Value;
47180 if (selectedMenu == num30)
47181 {
47183 {
47187 }
47189 menuMode = 1111;
47190 }
47191 num30++;
47192 array9[num30] = Lang.menu[5].Value;
47193 array4[num30] = 100;
47194 if (selectedMenu == num30 || flag5)
47195 {
47196 flag5 = false;
47197 PendingResolutionWidth = graphics.PreferredBackBufferWidth;
47198 PendingResolutionHeight = graphics.PreferredBackBufferHeight;
47200 menuMode = 1111;
47202 }
47203 num30++;
47204 num5 = num30;
47205 }
47206 else if (menuMode == 1125)
47207 {
47208 num2 = 232;
47209 num4 = 38;
47210 num5 = 7;
47211 array4[num5 - 1] = 18;
47212 for (int num33 = 0; num33 < num5; num33++)
47213 {
47214 array7[num33] = 0.73f;
47215 }
47216 int num34 = 0;
47217 array9[num34] = Lang.menu[64].Value;
47218 if (selectedMenu == num34)
47219 {
47223 menuMode = 25;
47224 }
47225 num34++;
47226 array9[num34] = Lang.menu[217].Value;
47227 if (selectedMenu == num34)
47228 {
47232 menuMode = 252;
47233 }
47234 num34++;
47235 array9[num34] = (cSmartCursorModeIsToggleAndNotHold ? Lang.menu[121].Value : Lang.menu[122].Value);
47236 if (selectedMenu == num34)
47237 {
47240 }
47241 num34++;
47242 array9[num34] = (Player.SmartCursorSettings.SmartAxeAfterPickaxe ? Lang.menu[214].Value : Lang.menu[213].Value);
47243 if (selectedMenu == num34)
47244 {
47246 Player.SmartCursorSettings.SmartAxeAfterPickaxe = !Player.SmartCursorSettings.SmartAxeAfterPickaxe;
47247 }
47248 num34++;
47249 array9[num34] = (Player.SmartCursorSettings.SmartBlocksEnabled ? Lang.menu[215].Value : Lang.menu[216].Value);
47250 if (selectedMenu == num34)
47251 {
47253 Player.SmartCursorSettings.SmartBlocksEnabled = !Player.SmartCursorSettings.SmartBlocksEnabled;
47254 }
47255 num34++;
47256 switch (LockOnHelper.UseMode)
47257 {
47258 case LockOnHelper.LockOnMode.FocusTarget:
47259 array9[num34] = Lang.menu[232].Value;
47260 break;
47261 case LockOnHelper.LockOnMode.TargetClosest:
47262 array9[num34] = Lang.menu[233].Value;
47263 break;
47264 case LockOnHelper.LockOnMode.ThreeDS:
47265 array9[num34] = Lang.menu[234].Value;
47266 break;
47267 }
47268 if (selectedMenu == num34)
47269 {
47272 }
47273 num34++;
47274 array9[num34] = Lang.menu[5].Value;
47275 if (selectedMenu == num34 || flag5)
47276 {
47277 flag5 = false;
47278 menuMode = 11;
47280 }
47281 }
47282 else if (menuMode == 25)
47283 {
47284 flag = true;
47285 num9 = 320;
47286 num2 = 200;
47287 num4 = 10;
47290 num5 = 3;
47291 array9[0] = "";
47292 array9[1] = Lang.menu[64].Value;
47293 array[1] = true;
47294 array4[2] = 250;
47295 array4[1] = 10;
47296 array9[2] = Lang.menu[5].Value;
47297 if (selectedMenu == 2 || flag5)
47298 {
47299 flag5 = false;
47300 menuMode = 1125;
47302 }
47303 }
47304 else if (menuMode == 252)
47305 {
47306 flag = true;
47307 num9 = 320;
47308 num2 = 200;
47309 num4 = 10;
47312 num5 = 3;
47313 array9[0] = "";
47314 array9[1] = Lang.menu[217].Value;
47315 array[1] = true;
47316 array4[2] = 250;
47317 array4[1] = 10;
47318 array9[2] = Lang.menu[5].Value;
47319 if (selectedMenu == 2 || flag5)
47320 {
47321 flag5 = false;
47322 menuMode = 1125;
47324 }
47325 }
47326 else if (menuMode == 26)
47327 {
47328 flag2 = true;
47329 num2 = 200;
47330 num4 = 10;
47331 num5 = 3;
47332 array9[0] = "";
47333 array9[1] = Lang.menu[65].Value;
47334 array[1] = true;
47335 array4[2] = 250;
47336 array4[1] = 10;
47337 array9[2] = Lang.menu[5].Value;
47338 if (selectedMenu == 2 || flag5)
47339 {
47340 flag5 = false;
47341 menuMode = 11;
47343 }
47344 }
47345 else if (menuMode == 28)
47346 {
47347 caveParallax = 1f - (float)bgScroll / 500f;
47348 flag3 = true;
47349 num2 = 240;
47350 num4 = 60;
47351 num5 = 3;
47352 array9[0] = "";
47353 array9[1] = Lang.menu[52].Value;
47354 array[1] = true;
47355 array4[2] = 170;
47356 array4[1] = 10;
47357 array9[2] = Lang.menu[5].Value;
47358 if (selectedMenu == 2 || flag5)
47359 {
47360 flag5 = false;
47361 menuMode = 1111;
47363 }
47364 }
47365 else if (menuMode == 272727)
47366 {
47367 num2 = 200;
47368 num4 = 30;
47369 num5 = 14;
47370 string[] array10 = new string[12]
47371 {
47373 null, null
47374 };
47375 if (setKey >= 0)
47376 {
47377 array10[setKey] = "_";
47378 }
47379 array9[0] = Lang.menu[106].Value + array10[0];
47380 array9[1] = Lang.menu[107].Value + array10[1];
47381 array9[2] = Lang.menu[108].Value + array10[2];
47382 array9[3] = Lang.menu[109].Value + array10[3];
47383 array9[4] = Lang.menu[110].Value + array10[4];
47384 array9[5] = Lang.menu[111].Value + array10[5];
47385 for (int num35 = 0; num35 < 6; num35++)
47386 {
47387 array8[num35] = true;
47388 array7[num35] = 0.55f;
47389 array5[num35] = -140;
47390 }
47391 array7[6] = 0.8f;
47392 array7[6] = 0.8f;
47393 array4[6] = 6;
47394 array9[6] = Lang.menu[86].Value;
47395 array4[7] = 16;
47396 array9[7] = Lang.menu[5].Value;
47397 if (selectedMenu == 7 || flag5)
47398 {
47399 flag5 = false;
47400 menuMode = 11;
47402 }
47403 else if (selectedMenu == 6)
47404 {
47405 cMapStyle = "Tab";
47406 cMapFull = "M";
47407 cMapZoomIn = "Add";
47408 cMapZoomOut = "Subtract";
47409 cMapAlphaUp = "PageUp";
47410 cMapAlphaDown = "PageDown";
47411 setKey = -1;
47413 }
47414 else if (selectedMenu >= 0)
47415 {
47417 }
47418 if (setKey >= 0)
47419 {
47421 if (pressedKeys.Count > 0)
47422 {
47423 string text = string.Concat(pressedKeys[0]);
47424 if (text != "None")
47425 {
47426 if (setKey == 0)
47427 {
47428 cMapStyle = text;
47429 }
47430 if (setKey == 1)
47431 {
47432 cMapFull = text;
47433 }
47434 if (setKey == 2)
47435 {
47436 cMapZoomIn = text;
47437 }
47438 if (setKey == 3)
47439 {
47440 cMapZoomOut = text;
47441 }
47442 if (setKey == 4)
47443 {
47444 cMapAlphaUp = text;
47445 }
47446 if (setKey == 5)
47447 {
47449 }
47450 setKey = -1;
47451 }
47452 }
47453 }
47454 }
47455 else if (menuMode == 27)
47456 {
47457 num2 = 176;
47458 num4 = 22;
47459 num5 = 16;
47460 string[] array11 = new string[14]
47461 {
47464 };
47465 if (setKey >= 0)
47466 {
47467 array11[setKey] = "_";
47468 }
47469 array9[0] = Lang.menu[74].Value + array11[0];
47470 array9[1] = Lang.menu[75].Value + array11[1];
47471 array9[2] = Lang.menu[76].Value + array11[2];
47472 array9[3] = Lang.menu[77].Value + array11[3];
47473 array9[4] = Lang.menu[78].Value + array11[4];
47474 array9[5] = Lang.menu[79].Value + array11[5];
47475 array9[6] = Lang.menu[80].Value + array11[6];
47476 array9[7] = Lang.menu[81].Value + array11[7];
47477 array9[8] = Lang.menu[82].Value + array11[8];
47478 array9[9] = Lang.menu[83].Value + array11[9];
47479 array9[10] = Lang.menu[84].Value + array11[10];
47480 array9[11] = Lang.menu[85].Value + array11[11];
47481 array9[12] = Lang.menu[120].Value + array11[12];
47482 array9[13] = Lang.menu[130].Value + array11[13];
47483 for (int num36 = 0; num36 < 14; num36++)
47484 {
47485 array8[num36] = true;
47486 array7[num36] = 0.45f;
47487 array5[num36] = -80;
47488 }
47489 array7[14] = 0.8f;
47490 array4[14] = 6;
47491 array9[14] = Lang.menu[86].Value;
47492 array7[15] = 0.8f;
47493 array4[15] = 16;
47494 array9[15] = Lang.menu[5].Value;
47495 if (selectedMenu == 15 || flag5)
47496 {
47497 flag5 = false;
47498 menuMode = 11;
47500 }
47501 else if (selectedMenu == 14)
47502 {
47504 setKey = -1;
47506 }
47507 else if (selectedMenu >= 0)
47508 {
47510 }
47511 if (setKey >= 0)
47512 {
47514 if (pressedKeys2.Count > 0)
47515 {
47516 string text2 = string.Concat(pressedKeys2[0]);
47517 if (text2 != "None")
47518 {
47519 if (setKey == 0)
47520 {
47521 cUp = text2;
47522 }
47523 if (setKey == 1)
47524 {
47525 cDown = text2;
47526 }
47527 if (setKey == 2)
47528 {
47529 cLeft = text2;
47530 }
47531 if (setKey == 3)
47532 {
47533 cRight = text2;
47534 }
47535 if (setKey == 4)
47536 {
47537 cJump = text2;
47538 }
47539 if (setKey == 5)
47540 {
47541 cThrowItem = text2;
47542 }
47543 if (setKey == 6)
47544 {
47545 cInv = text2;
47546 }
47547 if (setKey == 7)
47548 {
47549 cHeal = text2;
47550 }
47551 if (setKey == 8)
47552 {
47553 cMana = text2;
47554 }
47555 if (setKey == 9)
47556 {
47557 cBuff = text2;
47558 }
47559 if (setKey == 10)
47560 {
47561 cHook = text2;
47562 }
47563 if (setKey == 11)
47564 {
47565 cTorch = text2;
47566 }
47567 if (setKey == 12)
47568 {
47569 cSmart = text2;
47570 }
47571 if (setKey == 13)
47572 {
47573 cMount = text2;
47574 }
47575 setKey = -1;
47576 }
47577 }
47578 }
47579 }
47580 else if (menuMode == 1127)
47581 {
47582 num2 = 250;
47583 num4 = 52;
47584 num5 = 4;
47585 array4[num5 - 1] = 18;
47586 for (int num37 = 0; num37 < num5; num37++)
47587 {
47588 array7[num37] = 0.78f;
47589 }
47590 int num38 = 0;
47591 array9[num38] = (ReversedUpDownArmorSetBonuses ? Lang.menu[220].Value : Lang.menu[221].Value);
47592 if (selectedMenu == num38)
47593 {
47596 }
47597 num38++;
47599 {
47600 array9[num38] = Lang.menu[253].Value;
47601 }
47602 else
47603 {
47604 array9[num38] = (ItemSlot.Options.DisableLeftShiftTrashCan ? Lang.menu[224].Value : Lang.menu[223].Value);
47605 }
47606 if (selectedMenu == num38)
47607 {
47610 {
47611 ItemSlot.Options.DisableQuickTrash = false;
47612 ItemSlot.Options.DisableLeftShiftTrashCan = true;
47613 }
47615 {
47616 ItemSlot.Options.DisableLeftShiftTrashCan = false;
47617 }
47618 else
47619 {
47620 ItemSlot.Options.DisableQuickTrash = true;
47621 ItemSlot.Options.DisableLeftShiftTrashCan = false;
47622 }
47623 }
47624 num38++;
47625 array9[num38] = Lang.menu[222].Value;
47626 if (selectedMenu == num38)
47627 {
47629 menuMode = 888;
47630 MenuUI.SetState(ManageControlsMenu);
47631 }
47632 num38++;
47633 array9[num38] = Lang.menu[5].Value;
47634 if (selectedMenu == num38 || flag5)
47635 {
47636 flag5 = false;
47637 menuMode = 11;
47639 }
47640 }
47641 else if (menuMode == 12)
47642 {
47643 int num39 = ((SocialAPI.Network != null) ? 1 : 0);
47644 menuServer = false;
47645 array9[0] = Lang.menu[(SocialAPI.Network != null) ? 146 : 87].Value;
47646 array9[1] = Lang.menu[145].Value;
47647 array9[1 + num39] = Lang.menu[88].Value;
47648 array9[2 + num39] = Lang.menu[5].Value;
47649 if (selectedMenu == 0)
47650 {
47651 LoadPlayers();
47652 menuMultiplayer = true;
47655 menuMode = 1;
47656 }
47657 else if (selectedMenu == 1 + num39)
47658 {
47659 LoadPlayers();
47662 menuMode = 1;
47663 menuMultiplayer = true;
47664 menuServer = true;
47665 }
47666 else if (selectedMenu == 1)
47667 {
47669 SocialAPI.Friends.OpenJoinInterface();
47670 }
47671 else if (selectedMenu == 2 + num39 || flag5)
47672 {
47673 flag5 = false;
47675 menuMode = 0;
47676 }
47677 num5 = 3 + num39;
47678 }
47679 else if (menuMode == 13)
47680 {
47682 {
47683 num2 = 180;
47684 num4 = 30;
47685 int num40 = 0;
47686 array9[num40] = Lang.menu[89].Value.Replace(":", "");
47687 if (selectedMenu == num40)
47688 {
47691 menuMode = 888;
47692 }
47693 array7[num40] = 0.6f;
47694 array4[num40] = 40;
47695 num40++;
47696 for (int num41 = 0; num41 <= 6; num41++)
47697 {
47698 if (recentWorld[num41] != null && recentWorld[num41] != "")
47699 {
47700 array9[num40] = recentWorld[num41] + " (" + recentIP[num41] + ":" + recentPort[num41] + ")";
47701 }
47702 else
47703 {
47704 array9[num40] = "";
47705 array[num40] = true;
47706 }
47707 array7[num40] = 0.6f;
47708 array4[num40] = 40;
47709 if (selectedMenu == num40)
47710 {
47711 autoPass = false;
47712 Netplay.ListenPort = recentPort[num41];
47713 getIP = recentIP[num41];
47714 Netplay.SetRemoteIPAsync(getIP, StartClientGameplay);
47715 menuMode = 14;
47716 statusText = Language.GetTextValue("Net.ConnectingTo", getIP);
47717 }
47718 num40++;
47719 }
47720 array4[num40] = 64;
47721 array9[num40] = Lang.menu[5].Value;
47722 if (selectedMenu == num40 || flag5)
47723 {
47724 flag5 = false;
47726 menuMode = 1;
47727 }
47728 num40++;
47729 num5 = num40;
47730 }
47731 else
47732 {
47733 string text3 = getIP;
47734 PlayerInput.WritingText = true;
47735 instance.HandleIME();
47737 if (text3 != getIP)
47738 {
47740 }
47741 num5 = 11;
47742 num2 = 180;
47743 num4 = 30;
47744 array9[0] = Lang.menu[89].Value;
47745 array[0] = true;
47746 array9[1] = getIP;
47747 array4[1] = 19;
47748 if (textBlinkerState == 1)
47749 {
47750 array9[1] += "|";
47751 array5[1] = 1;
47752 }
47753 else
47754 {
47755 array9[1] += " ";
47756 }
47757 array[1] = true;
47758 array4[9] = 44;
47759 array9[9] = Lang.menu[4].Value;
47760 array2[9] = true;
47761 if (getIP != "")
47762 {
47763 if (getIP.Substring(0, 1) == " ")
47764 {
47765 getIP = "";
47766 }
47767 for (int num42 = 0; num42 < getIP.Length; num42++)
47768 {
47769 if (getIP != " ")
47770 {
47771 array2[9] = false;
47772 }
47773 }
47774 }
47775 array4[10] = 64;
47776 array9[10] = Lang.menu[5].Value;
47777 for (int num43 = 2; num43 <= 8; num43++)
47778 {
47779 int num44 = num43 - 2;
47780 if (recentWorld[num44] != null && recentWorld[num44] != "")
47781 {
47782 array9[num43] = recentWorld[num44] + " (" + recentIP[num44] + ":" + recentPort[num44] + ")";
47783 }
47784 else
47785 {
47786 array9[num43] = "";
47787 array[num43] = true;
47788 }
47789 array7[num43] = 0.6f;
47790 array4[num43] = 40;
47791 }
47792 if (selectedMenu >= 2 && selectedMenu < 9)
47793 {
47794 autoPass = false;
47795 int num45 = selectedMenu - 2;
47796 Netplay.ListenPort = recentPort[num45];
47797 getIP = recentIP[num45];
47798 Netplay.SetRemoteIPAsync(getIP, StartClientGameplay);
47799 menuMode = 14;
47800 statusText = Language.GetTextValue("Net.ConnectingTo", getIP);
47801 }
47802 if (selectedMenu == 10 || flag5)
47803 {
47804 flag5 = false;
47806 menuMode = 1;
47807 }
47808 if (selectedMenu == 9 || (!array2[2] && inputTextEnter))
47809 {
47811 }
47813 if (textBlinkerCount >= 20)
47814 {
47815 if (textBlinkerState == 0)
47816 {
47817 textBlinkerState = 1;
47818 }
47819 else
47820 {
47821 textBlinkerState = 0;
47822 }
47823 textBlinkerCount = 0;
47824 }
47825 }
47826 }
47827 else if (menuMode == 131)
47828 {
47830 {
47832 uIVirtualKeyboard4.CustomTextValidationForUpdate = IsGoodPortAddress;
47833 uIVirtualKeyboard4.CustomTextValidationForSubmit = IsGoodPortAddress;
47835 menuMode = 888;
47836 }
47837 int num46 = 7777;
47838 PlayerInput.WritingText = true;
47839 instance.HandleIME();
47840 string text4 = getPort;
47842 if (text4 != getPort)
47843 {
47845 }
47846 array9[0] = Lang.menu[90].Value;
47847 array2[2] = true;
47848 if (getPort != "")
47849 {
47850 bool flag7 = false;
47851 try
47852 {
47854 if (num46 > 0 && num46 <= 65535)
47855 {
47856 flag7 = true;
47857 }
47858 }
47859 catch
47860 {
47861 }
47862 if (flag7)
47863 {
47864 array2[2] = false;
47865 }
47866 }
47868 if (textBlinkerCount >= 20)
47869 {
47870 if (textBlinkerState == 0)
47871 {
47872 textBlinkerState = 1;
47873 }
47874 else
47875 {
47876 textBlinkerState = 0;
47877 }
47878 textBlinkerCount = 0;
47879 }
47880 array9[1] = getPort;
47881 if (textBlinkerState == 1)
47882 {
47883 array9[1] += "|";
47884 array5[1] = 1;
47885 }
47886 else
47887 {
47888 array9[1] += " ";
47889 }
47890 array[0] = true;
47891 array[1] = true;
47892 array4[1] = -20;
47893 array4[2] = 20;
47894 array9[2] = Lang.menu[4].Value;
47895 array9[3] = Lang.menu[5].Value;
47896 num5 = 4;
47897 if (selectedMenu == 3 || flag5)
47898 {
47899 flag5 = false;
47901 menuMode = 1;
47902 }
47903 if (selectedMenu == 2 || (!array2[2] && inputTextEnter))
47904 {
47906 }
47907 }
47908 else if (menuMode == 16)
47909 {
47910 num2 = 200;
47911 num4 = 60;
47912 array4[1] = 30;
47913 array4[2] = 30;
47914 array4[3] = 30;
47915 array4[4] = 70;
47916 array9[0] = Lang.menu[91].Value;
47917 array[0] = true;
47918 array9[1] = Lang.menu[92].Value;
47919 array9[2] = Lang.menu[93].Value;
47920 array9[3] = Lang.menu[94].Value;
47921 array9[4] = Lang.menu[5].Value;
47922 num5 = 5;
47923 if (selectedMenu == 4 || flag5)
47924 {
47925 flag5 = false;
47926 menuMode = 6;
47928 }
47929 else if (selectedMenu > 0)
47930 {
47931 if (selectedMenu == 1)
47932 {
47933 maxTilesX = 4200;
47934 maxTilesY = 1200;
47935 }
47936 else if (selectedMenu == 2)
47937 {
47938 maxTilesX = 6400;
47939 maxTilesY = 1800;
47940 }
47941 else
47942 {
47943 maxTilesX = 8400;
47944 maxTilesY = 8400;
47945 }
47946 clrInput();
47947 menuMode = -7;
47949 WorldGen.setWorldSize();
47950 }
47951 }
47952 else if (menuMode == 1000000)
47953 {
47954 num5 = 2;
47955 array9[0] = statusText;
47956 array[0] = true;
47957 num2 = 220;
47958 num4 = 250;
47959 array9[1] = Lang.menu[5].Value;
47960 if (selectedMenu == 1 || flag5)
47961 {
47962 flag5 = false;
47964 menuMode = 6;
47965 netMode = 0;
47966 }
47967 }
47968 else if (menuMode == 1000001)
47969 {
47970 num5 = 2;
47971 array9[0] = statusText;
47972 array[0] = true;
47973 num2 = 220;
47974 num4 = 250;
47976 if (rejectionMenuInfo != null)
47977 {
47978 array9[0] = rejectionMenuInfo.TextToShow;
47979 }
47980 array9[1] = Lang.menu[5].Value;
47981 if (selectedMenu == 1 || flag5)
47982 {
47983 flag5 = false;
47984 ReturnFromRejectionMenuAction returnFromRejectionMenuAction = null;
47985 if (RejectionMenuInfo != null)
47986 {
47988 }
47990 {
47992 }
47993 else
47994 {
47996 menuMode = 0;
47997 netMode = 0;
47998 }
47999 }
48000 }
48001 }
48002 if (menuMode == 888)
48003 {
48005 {
48007 }
48008 }
48009 else
48010 {
48011 MenuUI.SetState(null);
48012 }
48014 {
48015 UILinkPointNavigator.Shortcuts.BackButtonLock = true;
48016 }
48017 int num47 = focusMenu;
48018 if (menuMode != num6)
48019 {
48020 if (menuMode == 10 || netMode == 1 || menuMode == 14)
48021 {
48022 gameTips.ClearTips();
48023 }
48024 blockMouse = true;
48025 menuSkip = 0;
48026 num5 = 0;
48028 {
48029 num47 = (focusMenu = -1);
48030 mouseX = (mouseY = (PlayerInput.MouseX = (PlayerInput.MouseY = 0)));
48031 }
48032 for (int num48 = 0; num48 < maxMenuItems; num48++)
48033 {
48034 menuItemScale[num48] = 0.8f;
48035 }
48036 }
48037 if (!mouseLeft)
48038 {
48039 blockMouse = true;
48040 }
48041 selectedMenu = -1;
48042 selectedMenu2 = -1;
48043 focusMenu = -1;
48045 if (!flag)
48046 {
48047 grabColorSlider = 0;
48048 hBar = -1f;
48049 sBar = -1f;
48050 lBar = -1f;
48051 aBar = -1f;
48052 }
48053 if (flag)
48054 {
48055 if (!mouseLeft)
48056 {
48057 grabColorSlider = 0;
48058 blockMouse = false;
48059 }
48060 int num49 = focusColor;
48061 focusColor = 0;
48062 int num50 = num9;
48063 int num51 = screenWidth / 2 - TextureAssets.Hue.Width() / 2;
48064 int num52 = 167;
48066 float num53 = vector.X;
48067 float num54 = vector.Y;
48068 float luminosity = vector.Z;
48069 float num55 = (float)(int)selColor.A / 255f;
48070 if (hBar == -1f || sBar == -1f || lBar == -1f || aBar == -1f)
48071 {
48072 hBar = num53;
48073 sBar = num54;
48074 lBar = luminosity;
48075 aBar = num55;
48076 }
48077 else
48078 {
48079 num53 = hBar;
48080 num54 = sBar;
48081 luminosity = lBar;
48082 num55 = aBar;
48083 }
48085 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 1)
48086 {
48088 }
48089 spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float)num51 + (float)(TextureAssets.Hue.Width() - 2) * hBar - (float)(TextureAssets.ColorSlider.Width() / 2), num50 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2), Microsoft.Xna.Framework.Color.White);
48090 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 1)
48091 {
48092 focusColor = 1;
48093 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 5;
48094 if (flag8 && !blockMouse)
48095 {
48096 grabColorSlider = 1;
48097 num53 = mouseX - num51;
48098 num53 /= (float)TextureAssets.Hue.Width();
48099 if (num53 < 0f)
48100 {
48101 num53 = 0f;
48102 }
48103 if (num53 > 1f)
48104 {
48105 num53 = 1f;
48106 }
48107 hBar = num53;
48108 }
48109 }
48111 num50 += 26;
48113 for (int num56 = 0; num56 <= num52; num56++)
48114 {
48115 float saturation = (float)num56 / (float)num52;
48117 spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2(num51 + num56 + 5, num50 + 4), color4);
48118 }
48119 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 2)
48120 {
48122 }
48123 spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float)num51 + (float)(TextureAssets.Hue.Width() - 2) * sBar - (float)(TextureAssets.ColorSlider.Width() / 2), num50 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2), Microsoft.Xna.Framework.Color.White);
48124 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 2)
48125 {
48126 focusColor = 2;
48127 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 6;
48128 if (flag8 && !blockMouse)
48129 {
48130 grabColorSlider = 2;
48131 num54 = mouseX - num51;
48132 num54 /= (float)TextureAssets.Hue.Width();
48133 if (num54 < 0f)
48134 {
48135 num54 = 0f;
48136 }
48137 if (num54 > 1f)
48138 {
48139 num54 = 1f;
48140 }
48141 sBar = num54;
48142 }
48143 }
48145 num50 += 26;
48147 float num57 = 0.15f;
48148 if (menuMode == 252)
48149 {
48150 num57 = 0f;
48151 }
48152 for (int num58 = 0; num58 <= num52; num58++)
48153 {
48154 float luminosity2 = (float)num58 / (float)num52;
48156 spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2(num51 + num58 + 5, num50 + 4), color5);
48157 }
48158 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 3)
48159 {
48161 }
48162 spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float)num51 + (float)(TextureAssets.Hue.Width() - 2) * ((lBar - num57) / (1f - num57)) - (float)(TextureAssets.ColorSlider.Width() / 2), num50 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2), Microsoft.Xna.Framework.Color.White);
48163 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 3)
48164 {
48165 focusColor = 3;
48166 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 7;
48167 if (flag8 && !blockMouse)
48168 {
48169 grabColorSlider = 3;
48171 luminosity /= (float)TextureAssets.Hue.Width();
48172 if (luminosity < 0f)
48173 {
48174 luminosity = 0f;
48175 }
48176 if (luminosity > 1f)
48177 {
48178 luminosity = 1f;
48179 }
48180 luminosity = (lBar = luminosity * (1f - num57) + num57);
48181 }
48182 }
48184 bool flag9 = false;
48185 if (menuMode == 252)
48186 {
48187 num50 += 26;
48188 flag9 = true;
48191 for (int num59 = 0; num59 <= num52; num59++)
48192 {
48193 float num60 = (float)num59 / (float)num52;
48195 spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2(num51 + num59 + 5, num50 + 4), color7);
48196 }
48197 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 4)
48198 {
48200 }
48201 spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float)num51 + (float)(TextureAssets.Hue.Width() - 2) * aBar - (float)(TextureAssets.ColorSlider.Width() / 2), num50 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2), Microsoft.Xna.Framework.Color.White);
48202 if ((mouseX > num51 - 4 && mouseX < num51 + TextureAssets.Hue.Width() + 4 && mouseY > num50 - 4 && mouseY < num50 + TextureAssets.Hue.Height() + 4 && grabColorSlider == 0) || grabColorSlider == 4)
48203 {
48204 focusColor = 4;
48205 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 8;
48206 if (mouseLeft && !blockMouse)
48207 {
48208 grabColorSlider = 4;
48209 num55 = mouseX - num51;
48210 num55 /= (float)TextureAssets.Hue.Width();
48211 if (num55 < 0f)
48212 {
48213 num55 = 0f;
48214 }
48215 if (num55 > 1f)
48216 {
48217 num55 = 1f;
48218 }
48219 aBar = num55;
48220 }
48221 }
48223 }
48224 if (num49 != focusColor)
48225 {
48227 }
48229 if (flag9)
48230 {
48231 selColor.A = (byte)(aBar * 255f);
48232 }
48233 }
48234 else if (flag)
48235 {
48236 string text5 = "";
48237 for (int num61 = 0; num61 < 6; num61++)
48238 {
48239 int num62 = num9;
48240 int num63 = 370 + screenWidth / 2 - 400;
48241 if (num61 == 0)
48242 {
48243 text5 = Lang.menu[95].Value;
48244 }
48245 if (num61 == 1)
48246 {
48247 text5 = Lang.menu[96].Value;
48248 num62 += 30;
48249 }
48250 if (num61 == 2)
48251 {
48252 text5 = Lang.menu[97].Value;
48253 num62 += 60;
48254 }
48255 if (num61 == 3)
48256 {
48257 text5 = string.Concat(selColor.R);
48258 num63 += 90;
48259 }
48260 if (num61 == 4)
48261 {
48262 text5 = string.Concat(selColor.G);
48263 num63 += 90;
48264 num62 += 30;
48265 }
48266 if (num61 == 5)
48267 {
48268 text5 = string.Concat(selColor.B);
48269 num63 += 90;
48270 num62 += 60;
48271 }
48272 for (int num64 = 0; num64 < 5; num64++)
48273 {
48275 if (num64 == 4)
48276 {
48277 color8 = color;
48278 color8.R = (byte)((255 + color8.R) / 2);
48279 color8.G = (byte)((255 + color8.R) / 2);
48280 color8.B = (byte)((255 + color8.R) / 2);
48281 }
48282 int num65 = 255;
48283 int num66 = color8.R - (255 - num65);
48284 if (num66 < 0)
48285 {
48286 num66 = 0;
48287 }
48288 color8 = new Microsoft.Xna.Framework.Color((byte)num66, (byte)num66, (byte)num66, (byte)num65);
48289 int num67 = 0;
48290 int num68 = 0;
48291 if (num64 == 0)
48292 {
48293 num67 = -2;
48294 }
48295 if (num64 == 1)
48296 {
48297 num67 = 2;
48298 }
48299 if (num64 == 2)
48300 {
48301 num68 = -2;
48302 }
48303 if (num64 == 3)
48304 {
48305 num68 = 2;
48306 }
48308 }
48309 }
48310 bool flag10 = false;
48311 for (int num69 = 0; num69 < 2; num69++)
48312 {
48313 for (int num70 = 0; num70 < 3; num70++)
48314 {
48315 int num71 = num9 + num70 * 30 - 12;
48316 int num72 = 360 + screenWidth / 2 - 400;
48317 float num73 = 0.9f;
48318 if (num69 == 0)
48319 {
48320 num72 -= 70;
48321 num71 += 2;
48322 }
48323 else
48324 {
48325 num72 -= 40;
48326 }
48327 text5 = "-";
48328 if (num69 == 1)
48329 {
48330 text5 = "+";
48331 }
48332 Vector2 vector2 = new Vector2(24f, 24f);
48333 int num74 = 142;
48334 if (mouseX > num72 && (float)mouseX < (float)num72 + vector2.X && mouseY > num71 + 13 && (float)mouseY < (float)(num71 + 13) + vector2.Y)
48335 {
48336 if (focusColor != (num69 + 1) * (num70 + 10))
48337 {
48339 }
48340 focusColor = (num69 + 1) * (num70 + 10);
48341 flag10 = true;
48342 num74 = 255;
48343 if (mouseLeft)
48344 {
48345 if (colorDelay <= 1)
48346 {
48347 if (colorDelay == 0)
48348 {
48349 colorDelay = 40;
48350 }
48351 else
48352 {
48353 colorDelay = 3;
48354 }
48355 int num75 = num69;
48356 if (num69 == 0)
48357 {
48358 num75 = -1;
48359 if (selColor.R + selColor.G + selColor.B <= 150)
48360 {
48361 num75 = 0;
48362 }
48363 }
48364 if (num70 == 0 && selColor.R + num75 >= 0 && selColor.R + num75 <= 255)
48365 {
48366 selColor.R = (byte)(selColor.R + num75);
48367 }
48368 if (num70 == 1 && selColor.G + num75 >= 0 && selColor.G + num75 <= 255)
48369 {
48370 selColor.G = (byte)(selColor.G + num75);
48371 }
48372 if (num70 == 2 && selColor.B + num75 >= 0 && selColor.B + num75 <= 255)
48373 {
48374 selColor.B = (byte)(selColor.B + num75);
48375 }
48376 }
48377 colorDelay--;
48378 }
48379 else
48380 {
48381 colorDelay = 0;
48382 }
48383 }
48384 for (int num76 = 0; num76 < 5; num76++)
48385 {
48387 if (num76 == 4)
48388 {
48389 color9 = color;
48390 color9.R = (byte)((255 + color9.R) / 2);
48391 color9.G = (byte)((255 + color9.R) / 2);
48392 color9.B = (byte)((255 + color9.R) / 2);
48393 }
48394 int num77 = color9.R - (255 - num74);
48395 if (num77 < 0)
48396 {
48397 num77 = 0;
48398 }
48399 color9 = new Microsoft.Xna.Framework.Color((byte)num77, (byte)num77, (byte)num77, (byte)num74);
48400 int num78 = 0;
48401 int num79 = 0;
48402 if (num76 == 0)
48403 {
48404 num78 = -2;
48405 }
48406 if (num76 == 1)
48407 {
48408 num78 = 2;
48409 }
48410 if (num76 == 2)
48411 {
48412 num79 = -2;
48413 }
48414 if (num76 == 3)
48415 {
48416 num79 = 2;
48417 }
48419 }
48420 }
48421 }
48422 if (!flag10)
48423 {
48424 focusColor = 0;
48425 colorDelay = 0;
48426 }
48427 }
48428 if (flag2)
48429 {
48430 float x = screenWidth / 2 - 40 + 37;
48431 int num80 = 320;
48432 string text6 = "";
48433 for (int num81 = 0; num81 < 6; num81++)
48434 {
48435 int num82 = num80;
48436 int num83 = 370 + screenWidth / 2 - 400 + 37;
48437 switch (num81)
48438 {
48439 case 0:
48440 text6 = Lang.menu[98].Value;
48441 num82 += 30;
48442 break;
48443 case 1:
48444 text6 = Lang.menu[99].Value;
48445 break;
48446 case 2:
48447 text6 = Lang.menu[119].Value;
48448 num82 += 60;
48449 break;
48450 case 3:
48451 text6 = Math.Round(musicVolume * 100f) + "%";
48452 num83 += 90;
48453 break;
48454 case 4:
48455 text6 = Math.Round(soundVolume * 100f) + "%";
48456 num83 += 90;
48457 num82 += 30;
48458 break;
48459 case 5:
48460 text6 = Math.Round(ambientVolume * 100f) + "%";
48461 num83 += 90;
48462 num82 += 60;
48463 break;
48464 }
48466 color10.R = (byte)((255 + color10.R) / 2);
48467 color10.G = (byte)((255 + color10.R) / 2);
48468 color10.B = (byte)((255 + color10.R) / 2);
48469 int num84 = 255;
48470 int num85 = color10.R - (255 - num84);
48471 if (num85 < 0)
48472 {
48473 num85 = 0;
48474 }
48475 Utils.DrawBorderStringFourWay(textColor: new Microsoft.Xna.Framework.Color((byte)num85, (byte)num85, (byte)num85, (byte)num84), sb: spriteBatch, font: FontAssets.DeathText.Value, text: text6, x: num83, y: num82, borderColor: Microsoft.Xna.Framework.Color.Black, origin: Vector2.Zero, scale: 0.5f);
48476 }
48477 int rightHover = IngameOptions.rightHover;
48478 IngameOptions.rightHover = -1;
48479 if (!mouseLeft)
48480 {
48481 IngameOptions.rightLock = -1;
48482 }
48483 IngameOptions.valuePosition = new Vector2(x, num80 - 18 + 30);
48484 GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0f));
48485 float num86 = IngameOptions.DrawValueBar(spriteBatch, 1f, musicVolume);
48486 if (IngameOptions.inBar || IngameOptions.rightLock == 3)
48487 {
48488 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 2;
48489 IngameOptions.rightHover = 3;
48490 if (flag8 && IngameOptions.rightLock == 3)
48491 {
48493 }
48494 }
48495 IngameOptions.valuePosition = new Vector2(x, num80 - 18 + 60);
48496 GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0f));
48497 float num87 = IngameOptions.DrawValueBar(spriteBatch, 1f, soundVolume);
48498 if (IngameOptions.inBar || IngameOptions.rightLock == 2)
48499 {
48500 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 3;
48501 IngameOptions.rightHover = 2;
48502 if (flag8 && IngameOptions.rightLock == 2)
48503 {
48505 }
48506 }
48507 IngameOptions.valuePosition = new Vector2(x, num80 - 18 + 90);
48508 GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0f));
48509 float num88 = IngameOptions.DrawValueBar(spriteBatch, 1f, ambientVolume);
48510 if (IngameOptions.inBar || IngameOptions.rightLock == 4)
48511 {
48512 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 4;
48513 IngameOptions.rightHover = 4;
48514 if (flag8 && IngameOptions.rightLock == 4)
48515 {
48517 }
48518 }
48519 if (IngameOptions.rightHover != -1)
48520 {
48521 IngameOptions.rightLock = IngameOptions.rightHover;
48522 }
48523 if (IngameOptions.rightHover != rightHover)
48524 {
48526 }
48527 }
48528 if (flag3)
48529 {
48530 int num89 = 400;
48531 string text7 = "";
48532 for (int num90 = 0; num90 < 4; num90++)
48533 {
48534 int num91 = num89;
48535 int num92 = 370 + screenWidth / 2 - 400;
48536 if (num90 == 0)
48537 {
48538 text7 = Lang.menu[52].Value + ": " + bgScroll;
48539 }
48540 for (int num93 = 0; num93 < 5; num93++)
48541 {
48543 if (num93 == 4)
48544 {
48545 color11 = color;
48546 color11.R = (byte)((255 + color11.R) / 2);
48547 color11.G = (byte)((255 + color11.R) / 2);
48548 color11.B = (byte)((255 + color11.R) / 2);
48549 }
48550 int num94 = 255;
48551 int num95 = color11.R - (255 - num94);
48552 if (num95 < 0)
48553 {
48554 num95 = 0;
48555 }
48556 color11 = new Microsoft.Xna.Framework.Color((byte)num95, (byte)num95, (byte)num95, (byte)num94);
48557 int num96 = 0;
48558 int num97 = 0;
48559 if (num93 == 0)
48560 {
48561 num96 = -2;
48562 }
48563 if (num93 == 1)
48564 {
48565 num96 = 2;
48566 }
48567 if (num93 == 2)
48568 {
48569 num97 = -2;
48570 }
48571 if (num93 == 3)
48572 {
48573 num97 = 2;
48574 }
48576 }
48577 }
48578 IngameOptions.rightHover = -1;
48579 if (!mouseLeft)
48580 {
48581 IngameOptions.rightLock = -1;
48582 }
48583 IngameOptions.valuePosition = new Vector2(screenWidth / 2 - 40, num89 + 12);
48584 GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0f));
48585 float num98 = IngameOptions.DrawValueBar(spriteBatch, 1f, (float)bgScroll / 100f);
48586 if (IngameOptions.inBar || IngameOptions.rightLock == 2)
48587 {
48588 UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 1;
48589 IngameOptions.rightHover = 2;
48590 if (flag8 && IngameOptions.rightLock == 2)
48591 {
48592 bgScroll = (int)(num98 * 100f);
48593 caveParallax = 1f - (float)bgScroll / 500f;
48594 }
48595 }
48596 if (IngameOptions.rightHover != -1)
48597 {
48598 IngameOptions.rightLock = IngameOptions.rightHover;
48599 }
48600 }
48601 bool flag11 = false;
48602 for (int num99 = 0; num99 < num5; num99++)
48603 {
48604 if (array9[num99] == null)
48605 {
48606 continue;
48607 }
48608 Vector2 vector3 = FontAssets.DeathText.Value.MeasureString(array9[num99]);
48609 vector3.X *= 0.5f;
48610 vector3.Y *= 0.5f;
48611 for (int num100 = 0; num100 < 5; num100++)
48612 {
48614 if (num100 == 4)
48615 {
48616 switch (array6[num99])
48617 {
48618 case 0:
48619 color12 = color;
48620 break;
48621 case 1:
48622 color12 = mcColor;
48623 break;
48624 case 2:
48625 color12 = hcColor;
48626 break;
48627 case 3:
48629 break;
48630 case 4:
48631 case 5:
48632 case 6:
48634 break;
48635 default:
48636 color12 = color;
48637 break;
48638 }
48639 color12.R = (byte)((255 + color12.R) / 2);
48640 color12.G = (byte)((255 + color12.G) / 2);
48641 color12.B = (byte)((255 + color12.B) / 2);
48642 }
48643 int num101 = (int)(255f * (menuItemScale[num99] * 2f - 1f));
48644 if (array[num99])
48645 {
48646 num101 = 255;
48647 }
48648 int num102 = color12.R - (255 - num101);
48649 if (num102 < 0)
48650 {
48651 num102 = 0;
48652 }
48653 int num103 = color12.G - (255 - num101);
48654 if (num103 < 0)
48655 {
48656 num103 = 0;
48657 }
48658 int num104 = color12.B - (255 - num101);
48659 if (num104 < 0)
48660 {
48661 num104 = 0;
48662 }
48663 if (num47 == num99 && num100 == 4)
48664 {
48665 float num105 = (float)num101 / 255f;
48666 num102 = (int)((float)num102 * (1f - num105) + 255f * num105);
48667 num103 = (int)((float)num103 * (1f - num105) + 215f * num105);
48668 num104 = (int)((float)num104 * (1f - num105) + 0f * num105);
48669 }
48670 color12 = new Microsoft.Xna.Framework.Color((byte)num102, (byte)num103, (byte)num104, (byte)num101);
48671 if (array3[num99])
48672 {
48673 if (num100 == 4)
48674 {
48675 color12.R = (byte)(color12.R * mouseTextColor / 300);
48676 color12.G = (byte)(color12.G * mouseTextColor / 300);
48677 color12.B = (byte)(color12.B * mouseTextColor / 300);
48678 color12.A = (byte)(color12.A * mouseTextColor / 300);
48679 }
48680 else
48681 {
48682 color12.A -= (byte)(mouseTextColor / 5);
48683 }
48684 }
48685 int num106 = 0;
48686 int num107 = 0;
48687 if (num100 == 0)
48688 {
48689 num106 = -2;
48690 }
48691 if (num100 == 1)
48692 {
48693 num106 = 2;
48694 }
48695 if (num100 == 2)
48696 {
48697 num107 = -2;
48698 }
48699 if (num100 == 3)
48700 {
48701 num107 = 2;
48702 }
48703 float num108 = menuItemScale[num99];
48704 if (menuMode == 15 && num99 == 0)
48705 {
48706 num108 *= 0.35f;
48707 }
48708 else if (menuMode == 1000000 && num99 == 0)
48709 {
48710 num108 *= 0.75f;
48711 }
48712 else if (netMode == 2)
48713 {
48714 num108 *= 0.5f;
48715 }
48716 num108 *= array7[num99];
48717 if (!array8[num99])
48718 {
48720 }
48721 else
48722 {
48724 }
48725 }
48726 if (!array[num99] && !array2[num99])
48727 {
48729 }
48730 if (!array8[num99])
48731 {
48732 int num109 = 0;
48733 menuWide[num99] = false;
48734 Vector2 vector4 = FontAssets.DeathText.Value.MeasureString(array9[num99]) * array7[num99];
48735 if (!((float)mouseX > (float)num3 - vector4.X * 0.5f + (float)array5[num99] - (float)num109) || !((float)mouseX < (float)num3 + vector4.X * 0.5f * array7[num99] + (float)array5[num99] + (float)num109) || mouseY <= num2 + num4 * num99 + array4[num99] || !((float)mouseY < (float)(num2 + num4 * num99 + array4[num99]) + 50f * array7[num99]) || !hasFocus)
48736 {
48737 continue;
48738 }
48739 focusMenu = num99;
48740 if (array[num99] || array2[num99])
48741 {
48742 focusMenu = -1;
48743 continue;
48744 }
48745 if (num47 != focusMenu)
48746 {
48747 flag11 = true;
48748 }
48750 {
48752 }
48754 {
48756 }
48757 continue;
48758 }
48759 Vector2 vector5 = FontAssets.DeathText.Value.MeasureString(array9[num99]) * array7[num99];
48760 if (mouseX <= num3 + array5[num99] || !((float)mouseX < (float)num3 + vector5.X + (float)array5[num99]) || mouseY <= num2 + num4 * num99 + array4[num99] || !((float)mouseY < (float)(num2 + num4 * num99 + array4[num99]) + 50f * array7[num99]) || !hasFocus)
48761 {
48762 continue;
48763 }
48764 focusMenu = num99;
48765 if (array[num99] || array2[num99])
48766 {
48767 focusMenu = -1;
48768 continue;
48769 }
48770 if (num47 != focusMenu)
48771 {
48772 flag11 = true;
48773 }
48775 {
48777 }
48779 {
48781 }
48782 }
48783 if (flag11 && num47 != focusMenu)
48784 {
48786 }
48788 {
48789 Vector2 vector6 = new Vector2((float)Math.Cos(GlobalTimeWrappedHourly * ((float)Math.PI * 2f)), (float)Math.Sin(GlobalTimeWrappedHourly * ((float)Math.PI * 2f) * 2f)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f;
48791 }
48792 for (int num110 = 0; num110 < maxMenuItems; num110++)
48793 {
48794 if (num110 == focusMenu)
48795 {
48796 if (menuItemScale[num110] < 1f)
48797 {
48798 menuItemScale[num110] += 0.02f;
48799 }
48800 if (menuItemScale[num110] > 1f)
48801 {
48802 menuItemScale[num110] = 1f;
48803 }
48804 }
48805 else if ((double)menuItemScale[num110] > 0.8)
48806 {
48807 menuItemScale[num110] -= 0.02f;
48808 }
48809 }
48810 if (flag4)
48811 {
48812 spriteBatch.End();
48815 pendingPlayer.PlayerFrame();
48816 pendingPlayer.position.X = (float)num7 + screenPosition.X;
48817 pendingPlayer.position.Y = (float)num8 + screenPosition.Y;
48818 PlayerRenderer.DrawPlayer(Camera, pendingPlayer, pendingPlayer.position, 0f, Vector2.Zero);
48819 spriteBatch.End();
48821 }
48822 float num111 = 0f;
48823 if (!WorldGen.drunkWorldGen && menuMode == 0)
48824 {
48826 num111 += 32f;
48827 }
48828 if (!WorldGen.drunkWorldGen)
48829 {
48830 DrawVersionNumber(color, num111);
48831 num111 += 20f;
48832 }
48833 spriteBatch.End();
48839 if (fadeCounter > 0)
48840 {
48842 byte b2 = 0;
48843 fadeCounter--;
48844 float num112 = (float)fadeCounter / 120f * 255f;
48845 if (quickSplash)
48846 {
48847 num112 = (float)fadeCounter / 75f * 255f;
48848 }
48849 b2 = (byte)num112;
48852 }
48853 spriteBatch.End();
48854 if (mouseLeft)
48855 {
48856 mouseLeftRelease = false;
48857 }
48858 else
48859 {
48860 mouseLeftRelease = true;
48861 }
48862 if (mouseRight)
48863 {
48864 mouseRightRelease = false;
48865 }
48866 else
48867 {
48868 mouseRightRelease = true;
48869 }
48870 if (menuMode == num)
48871 {
48872 GamepadMainMenuHandler.LastDrew = num;
48873 }
48874 }
static readonly BlendState AlphaBlend
Definition BlendState.cs:36
static readonly RasterizerState CullCounterClockwise
static readonly SamplerState PointClamp
static void DrawString(this SpriteBatch spriteBatch, DynamicSpriteFont spriteFont, string text, Vector2 position, Color color)
static int ToInt32(object? value)
Definition Convert.cs:1320
static double Cos(double d)
static decimal Round(decimal d)
Definition Math.cs:1096
static double Sin(double a)
const double PI
Definition Math.cs:16
static void PlaySound(int type, Vector2 position, int style=1)
ReturnFromRejectionMenuAction ExitAction
static Asset< DynamicSpriteFont > DeathText
Definition FontAssets.cs:12
static Asset< Texture2D > ColorHighlight
static Asset< Texture2D > Logo3
static Asset< Texture2D > Fade
static Asset< Texture2D > Hue
static Asset< Texture2D > ColorSlider
static Asset< Texture2D > ColorBlip
static Asset< Texture2D > Logo
static Asset< Texture2D > Logo2
static Asset< Texture2D > ColorBar
static Asset< Texture2D > Logo4
static List< Keys > GetPressedKeys()
static readonly int Count
static LocalizedText GetText(string key)
Definition Language.cs:10
static string GetTextValue(string key)
Definition Language.cs:15
int grabColorSlider
Definition Main.cs:2519
bool quickSplash
Definition Main.cs:2537
static SceneMetrics SceneMetrics
Definition Main.cs:1344
static bool render
Definition Main.cs:760
static int WaveQuality
Definition Main.cs:425
static int focusColor
Definition Main.cs:2499
float logoRotationDirection
Definition Main.cs:2355
static bool autoPause
Definition Main.cs:1324
static bool SettingsUnlock_WorldEvil
Definition Main.cs:243
static string GetInputText(string oldString, bool allowMultiLine=false)
Definition Main.cs:18593
static float lBar
Definition Main.cs:2515
static bool LogoT
Definition Main.cs:1256
static GameTipsDisplay gameTips
Definition Main.cs:2343
static bool InvisibleCursorForGamepad
Definition Main.cs:267
static void OnSubmitServerIP(string inputText)
Definition Main.cs:48994
static int selectedPlayer
Definition Main.cs:2375
static List< WorldFileData > WorldList
Definition Main.cs:1944
static int LogoA
Definition Main.cs:1252
static bool slimeRain
Definition Main.cs:1166
static string cMapZoomIn
Definition Main.cs:2185
static int maxTilesY
Definition Main.cs:1116
Microsoft.Xna.Framework.Color randColor()
Definition Main.cs:44899
float logoScaleDirection
Definition Main.cs:2361
static bool UseHeatDistortion
Definition Main.cs:429
static bool drawingPlayerChat
Definition Main.cs:1739
static int colorDelay
Definition Main.cs:2501
static ColorSlidersSet mouseBorderColorSlider
Definition Main.cs:2201
static string cTorch
Definition Main.cs:2133
static float sBar
Definition Main.cs:2513
static void DrawVersionNumber(Microsoft.Xna.Framework.Color menuColor, float upBump)
Definition Main.cs:49013
static UIManageControls ManageControlsMenu
Definition Main.cs:1150
static void ClearPendingPlayerSelectCallbacks()
Definition Main.cs:62938
static int selectedWorld
Definition Main.cs:2377
static WorldFileData ActiveWorldFileData
Definition Main.cs:1946
static Microsoft.Xna.Framework.Color hcColor
Definition Main.cs:994
static bool cSmartCursorModeIsToggleAndNotHold
Definition Main.cs:2143
static float ambientVolume
Definition Main.cs:1423
static UIWorldSelect _worldSelectMenu
Definition Main.cs:1148
static int LogoB
Definition Main.cs:1254
static void OpenResourcePacksMenu(UIState uiStateToGoBackTo)
Definition Main.cs:49261
static void OnSubmitServerPort(string candidatePort)
Definition Main.cs:48985
static void StartClientGameplay()
Definition Main.cs:45207
static bool autoPass
Definition Main.cs:2507
static UIAchievementsMenu AchievementsMenu
Definition Main.cs:1152
static SpriteBatch spriteBatch
Definition Main.cs:974
static string cHook
Definition Main.cs:2131
static UserInterface MenuUI
Definition Main.cs:381
static double worldSurface
Definition Main.cs:1272
static string cInv
Definition Main.cs:2135
static void ResetKeyBindings()
Definition Main.cs:49330
float logoRotation
Definition Main.cs:2353
static void LoadPlayers()
Definition Main.cs:3718
static Microsoft.Xna.Framework.Color highVersionColor
Definition Main.cs:1000
void OnSubmitServerPassword()
Definition Main.cs:48913
float logoRotationSpeed
Definition Main.cs:2357
static int screenBorderlessPendingResizes
Definition Main.cs:1727
static int netMode
Definition Main.cs:2095
static string cBuff
Definition Main.cs:2129
static Microsoft.Xna.Framework.Color tileColor
Definition Main.cs:1270
static bool starGame
Definition Main.cs:2597
static int[] displayHeight
Definition Main.cs:1924
static void SetResolution(int width, int height)
Definition Main.cs:62997
static Process tServer
Definition Main.cs:984
static Microsoft.Xna.Framework.Color selColor
Definition Main.cs:2497
static bool hasFocus
Definition Main.cs:1781
static IPlayerRenderer PlayerRenderer
Definition Main.cs:291
static string cMapAlphaUp
Definition Main.cs:2189
static void ClearVisualPostProcessEffects()
Definition Main.cs:49052
static bool mouseRight
Definition Main.cs:616
static bool dayTime
Definition Main.cs:1282
static int PendingResolutionHeight
Definition Main.cs:1966
RejectionMenuInfo RejectionMenuInfo
Definition Main.cs:2533
float logoScaleSpeed
Definition Main.cs:2363
static bool SettingsEnabled_MinersWobble
Definition Main.cs:245
static Vector2 screenLastPosition
Definition Main.cs:1717
static bool changeTheTitle
Definition Main.cs:698
static void EraseWorld(int i)
Definition Main.cs:4437
static PlayerResourceSetsManager ResourceSetsManager
Definition Main.cs:2261
static string cMapFull
Definition Main.cs:2193
static Vector2 DrawThickCursor(bool smart=false)
Definition Main.cs:45092
static bool mouseLeftRelease
Definition Main.cs:1755
static string cDown
Definition Main.cs:2117
void OnSeedSelected(string text)
Definition Main.cs:45169
static Microsoft.Xna.Framework.Color mcColor
Definition Main.cs:992
static Main instance
Definition Main.cs:283
static bool PendingBorderlessState
Definition Main.cs:1968
static IssueReportsIndicator IssueReporterIndicator
Definition Main.cs:1882
static bool UseStormEffects
Definition Main.cs:427
static bool _blockFancyUIWhileLoading
Definition Main.cs:2523
static bool blockMouse
Definition Main.cs:2521
static string worldPathName
Definition Main.cs:2837
static OnPlayerSelected _pendingCharacterSelect
Definition Main.cs:385
static int screenHeight
Definition Main.cs:1721
static Vector2 screenPosition
Definition Main.cs:1715
static void DrawCursor(Vector2 bonus, bool smart=false)
Definition Main.cs:45012
static string cMount
Definition Main.cs:2139
static float MenuXMovement
Definition Main.cs:2531
static void CycleFrameSkipMode()
Definition Main.cs:48876
static int setKey
Definition Main.cs:2503
static bool IsGoodPortAddress(string text)
Definition Main.cs:48971
static bool menuServer
Definition Main.cs:2093
static void OnSubmitServerPasswordFromRequest()
Definition Main.cs:48893
static byte mouseTextColor
Definition Main.cs:1751
static void StopSlimeRain(bool announce=true)
Definition Main.cs:61545
static string cLeft
Definition Main.cs:2115
static int[] recentPort
Definition Main.cs:798
static bool BackgroundEnabled
Definition Main.cs:802
static List< PlayerFileData > PlayerList
Definition Main.cs:1938
static Matrix UIScaleMatrix
Definition Main.cs:2619
static Microsoft.Xna.Framework.Color OurFavoriteColor
Definition Main.cs:902
static int maxTilesX
Definition Main.cs:1114
static bool GameAskedToQuit
Definition Main.cs:223
static int GameMode
Definition Main.cs:2685
bool playOldTile
Definition Main.cs:2305
static bool showItemText
Definition Main.cs:1238
static IChatMonitor chatMonitor
Definition Main.cs:2339
static Microsoft.Xna.Framework.Color mouseColor
Definition Main.cs:2203
static string cRight
Definition Main.cs:2119
static bool IsEngineLoaded
Definition Main.cs:942
static SamplerState SamplerStateForCursor
Definition Main.cs:980
static void DrawPendingMouseText()
Definition Main.cs:41922
static void DrawSocialMediaButtons(Microsoft.Xna.Framework.Color menuColor, float upBump)
Definition Main.cs:49002
int selectedMenu
Definition Main.cs:2371
static string cJump
Definition Main.cs:2121
int textBlinkerCount
Definition Main.cs:2389
static bool mouseRightRelease
Definition Main.cs:1757
static float hBar
Definition Main.cs:2511
static bool eclipse
Definition Main.cs:1312
static bool HidePassword
Definition Main.cs:257
static int qaStyle
Definition Main.cs:762
static string[] recentIP
Definition Main.cs:796
static void OpenCharacterSelectUI()
Definition Main.cs:49236
static int fadeCounter
Definition Main.cs:1380
static bool alreadyGrabbingSunOrMoon
Definition Main.cs:1294
float[] menuItemScale
Definition Main.cs:2367
static string getPort
Definition Main.cs:2089
static bool SettingsEnabled_TilesSwayInWind
Definition Main.cs:1372
static Microsoft.Xna.Framework.Color errorColor
Definition Main.cs:1002
static string cMapAlphaDown
Definition Main.cs:2191
static bool autoSave
Definition Main.cs:1240
static void ErasePlayer(int i)
Definition Main.cs:4413
static void clrInput()
Definition Main.cs:18584
static UnifiedRandom rand
Definition Main.cs:1387
float logoScale
Definition Main.cs:2359
static int[] displayWidth
Definition Main.cs:1922
static int numDisplayModes
Definition Main.cs:1920
static Vector3 rgbToHsl(Microsoft.Xna.Framework.Color newColor)
Definition Main.cs:44972
static float caveParallax
Definition Main.cs:1216
static bool screenBorderless
Definition Main.cs:1725
static string cThrowItem
Definition Main.cs:2123
static ColorSlidersSet mouseColorSlider
Definition Main.cs:2199
static int menuSkip
Definition Main.cs:2381
static bool mapEnabled
Definition Main.cs:906
static string getIP
Definition Main.cs:2087
static void ToggleFullScreen()
Definition Main.cs:62987
static void CanceledGivingServerPassword()
Definition Main.cs:48899
void OnWorldNamed(string text)
Definition Main.cs:45184
int focusMenu
Definition Main.cs:2369
static int invasionProgressMode
Definition Main.cs:1984
static Action CreateGoToMenuEvent(int menu)
Definition Main.cs:45192
static string cMapStyle
Definition Main.cs:2195
static MinimapFrameManager MinimapFrameManagerInstance
Definition Main.cs:2259
static int screenWidth
Definition Main.cs:1719
static string cSmart
Definition Main.cs:2137
static bool IsBorderlessDisplayAvailable()
Definition Main.cs:49195
static void CycleClothingStyle(Player plr)
Definition Main.cs:49267
int textBlinkerState
Definition Main.cs:2391
static int PendingResolutionWidth
Definition Main.cs:1964
static Microsoft.Xna.Framework.Color hslToRgb(Vector3 hslVector)
Definition Main.cs:44913
static float musicVolume
Definition Main.cs:1421
static bool snowMoon
Definition Main.cs:1300
static bool pumpkinMoon
Definition Main.cs:1298
static string cHeal
Definition Main.cs:2125
static bool placementPreview
Definition Main.cs:1342
bool[] menuWide
Definition Main.cs:2525
static int mouseY
Definition Main.cs:606
static bool ReversedUpDownArmorSetBonuses
Definition Main.cs:259
static int menuMode
Definition Main.cs:2379
static Player PendingPlayer
Definition Main.cs:1942
static string cMapZoomOut
Definition Main.cs:2187
static string[] recentWorld
Definition Main.cs:794
static bool SaveSettings()
Definition Main.cs:3806
static bool inputTextEnter
Definition Main.cs:1745
static int maxMenuItems
Definition Main.cs:2365
static ServerMode MenuServerMode
Definition Main.cs:1427
static bool ServerSideCharacter
Definition Main.cs:397
static float soundVolume
Definition Main.cs:1425
static int background
Definition Main.cs:1264
static bool GamepadDisableInstructionsDisplay
Definition Main.cs:271
static string statusText
Definition Main.cs:1258
void OnCharacterNamed(string text)
Definition Main.cs:45161
static void ExitServerPasswordMenu()
Definition Main.cs:48958
static string cUp
Definition Main.cs:2113
static float aBar
Definition Main.cs:2517
static bool showSpam
Definition Main.cs:566
static int mouseX
Definition Main.cs:604
static float GlobalTimeWrappedHourly
Definition Main.cs:405
static GraphicsDeviceManager graphics
Definition Main.cs:972
static bool MouseShowBuildingGrid
Definition Main.cs:263
void DrawFPS()
Definition Main.cs:20012
static Microsoft.Xna.Framework.Color MouseBorderColor
Definition Main.cs:261
static string cMana
Definition Main.cs:2127
static int bgScroll
Definition Main.cs:2505
int selectedMenu2
Definition Main.cs:2373
static bool mouseLeft
Definition Main.cs:614
static bool menuMultiplayer
Definition Main.cs:2091
static Terraria.Social.Base.NetSocialModule Network
Definition SocialAPI.cs:20
static Terraria.Social.Base.WorkshopSocialModule Workshop
Definition SocialAPI.cs:24
static Terraria.Social.Base.FriendsSocialModule Friends
Definition SocialAPI.cs:14
static void SetPosition(int ID, Vector2 Position)
static bool HighlightNewItems
Definition ItemSlot.cs:26
static bool DisableLeftShiftTrashCan
Definition ItemSlot.cs:22
static bool DisableQuickTrash
Definition ItemSlot.cs:24
static UserInterface ActiveInstance
static bool Exists(string path, bool cloud)
static void Move(string source, string destination, bool cloud, bool overwrite=true, bool forceDeleteSourceFile=false)

References Terraria.Main._blockFancyUIWhileLoading, Terraria.Main._pendingCharacterSelect, Terraria.Main._worldSelectMenu, Terraria.Main.aBar, Terraria.Main.AchievementsMenu, Terraria.UI.UserInterface.ActiveInstance, Terraria.Main.ActiveWorldFileData, Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Terraria.Main.alreadyGrabbingSunOrMoon, Terraria.Main.ambientVolume, System.array, Terraria.Main.autoPass, Terraria.Main.autoPause, Terraria.Main.autoSave, Terraria.UI.Gamepad.UILinkPointNavigator.Shortcuts.BackButtonInUse, Terraria.UI.Gamepad.UILinkPointNavigator.Shortcuts.BackButtonLock, Terraria.Main.background, Terraria.Main.BackgroundEnabled, Terraria.Main.bgScroll, Microsoft.Xna.Framework.Color.Black, Terraria.Main.blockMouse, Terraria.NetMessage.buffer, Terraria.Main.CanceledGivingServerPassword(), Terraria.Main.caveParallax, Terraria.Main.cBuff, Terraria.Main.cDown, Terraria.Main.changeTheTitle, Terraria.Main.chatMonitor, Terraria.Main.cHeal, Terraria.Main.cHook, Terraria.Main.cInv, Terraria.Main.cJump, Terraria.Main.ClearPendingPlayerSelectCallbacks(), Terraria.Main.ClearVisualPostProcessEffects(), Terraria.Main.cLeft, Terraria.Netplay.Clients, Terraria.Main.clrInput(), Terraria.Main.cMana, Terraria.Main.cMapAlphaDown, Terraria.Main.cMapAlphaUp, Terraria.Main.cMapFull, Terraria.Main.cMapStyle, Terraria.Main.cMapZoomIn, Terraria.Main.cMapZoomOut, Terraria.Main.cMount, Terraria.GameContent.TextureAssets.ColorBar, Terraria.GameContent.TextureAssets.ColorBlip, Terraria.Main.colorDelay, Terraria.GameContent.TextureAssets.ColorHighlight, Terraria.GameContent.TextureAssets.ColorSlider, Terraria.Netplay.Connection, System.Math.Cos(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.ID.PlayerVariantID.Count, Terraria.Main.CreateGoToMenuEvent(), Terraria.Main.cRight, Terraria.Main.cSmart, Terraria.Main.cSmartCursorModeIsToggleAndNotHold, Terraria.Main.cThrowItem, Terraria.Main.cTorch, Microsoft.Xna.Framework.Graphics.RasterizerState.CullCounterClockwise, Terraria.Main.cUp, Terraria.Main.CycleClothingStyle(), Terraria.Main.CycleFrameSkipMode(), Terraria.GameInput.LockOnHelper.CycleUseModes(), Terraria.Main.dayTime, Terraria.GameContent.FontAssets.DeathText, Terraria.GameContent.ChildSafety.Disabled, Terraria.UI.ItemSlot.Options.DisableLeftShiftTrashCan, Terraria.UI.ItemSlot.Options.DisableQuickTrash, Terraria.Main.displayHeight, Terraria.Main.displayWidth, Terraria.GameContent.UI.WorkshopPublishingIndicator.Draw(), Terraria.Utils.DrawBorderStringFourWay(), Terraria.Main.DrawCursor(), Terraria.Main.DrawFPS(), Terraria.Main.drawingPlayerChat, Terraria.Main.DrawPendingMouseText(), Terraria.Main.DrawSocialMediaButtons(), ReLogic.Graphics.DynamicSpriteFontExtensionMethods.DrawString(), Terraria.Main.DrawThickCursor(), Terraria.IngameOptions.DrawValueBar(), Terraria.Main.DrawVersionNumber(), Terraria.WorldGen.drunkWorldGen, System.E, Terraria.Main.eclipse, Terraria.Main.ErasePlayer(), Terraria.Main.EraseWorld(), Terraria.Main.errorColor, Terraria.Utilities.FileUtilities.Exists(), Terraria.DataStructures.RejectionMenuInfo.ExitAction, Terraria.Main.ExitServerPasswordMenu(), Terraria.GameContent.TextureAssets.Fade, Terraria.Main.fadeCounter, Terraria.Main.focusColor, Terraria.Main.focusMenu, Terraria.Social.SocialAPI.Friends, Terraria.Main.GameAskedToQuit, Terraria.Main.GameMode, Terraria.Main.GamepadDisableInstructionsDisplay, Terraria.Main.gameTips, Terraria.Main.GetInputText(), Terraria.Main.getIP, Terraria.Main.getPort, Terraria.GameInput.PlayerInput.GetPressedKeys(), Terraria.Localization.Language.GetText(), Terraria.Localization.Language.GetTextValue(), Terraria.Main.GlobalTimeWrappedHourly, Terraria.Main.grabColorSlider, Terraria.Main.graphics, Terraria.Main.hasFocus, Terraria.Main.hBar, Terraria.Main.hcColor, Terraria.Main.HidePassword, Terraria.UI.ItemSlot.Options.HighlightNewItems, Terraria.Main.highVersionColor, Terraria.Main.hslToRgb(), Terraria.GameContent.TextureAssets.Hue, System.Text.RegularExpressions.i, Terraria.IngameOptions.inBar, Terraria.Main.inputTextEnter, Terraria.Graphics.Effects.SkyManager.Instance, Terraria.Localization.LanguageManager.Instance, Terraria.Main.instance, Terraria.Lang.inter, Terraria.Netplay.InvalidateAllOngoingIPSetAttempts(), Terraria.Main.invasionProgressMode, Terraria.Main.InvisibleCursorForGamepad, Terraria.Main.IsBorderlessDisplayAvailable(), Terraria.Main.IsEngineLoaded, Terraria.Main.IsGoodPortAddress(), Terraria.Main.IssueReporterIndicator, Terraria.Main.lBar, Terraria.Program.LoadedEverything, Terraria.Main.LoadPlayers(), Terraria.GameContent.TextureAssets.Logo, Terraria.GameContent.TextureAssets.Logo2, Terraria.GameContent.TextureAssets.Logo3, Terraria.GameContent.TextureAssets.Logo4, Terraria.Main.LogoA, Terraria.Main.LogoB, Terraria.Main.logoRotation, Terraria.Main.logoRotationDirection, Terraria.Main.logoRotationSpeed, Terraria.Main.logoScale, Terraria.Main.logoScaleDirection, Terraria.Main.logoScaleSpeed, Terraria.Main.LogoT, Terraria.Main.ManageControlsMenu, Terraria.Main.mapEnabled, Terraria.Main.maxMenuItems, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.mcColor, Terraria.Lang.menu, Terraria.UI.Gamepad.GamepadMainMenuHandler.MenuItemPositions, Terraria.Main.menuItemScale, Terraria.Main.menuMode, Terraria.Main.menuMultiplayer, Terraria.Main.menuServer, Terraria.Main.MenuServerMode, Terraria.Main.menuSkip, Terraria.Main.MenuUI, Terraria.Main.menuWide, Terraria.Main.MenuXMovement, Terraria.Main.MinimapFrameManagerInstance, Terraria.Lang.misc, Terraria.Lighting.Mode, Terraria.Main.MouseBorderColor, Terraria.Main.mouseBorderColorSlider, Terraria.Main.mouseColor, Terraria.Main.mouseColorSlider, Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.Main.mouseRight, Terraria.Main.mouseRightRelease, Terraria.Main.MouseShowBuildingGrid, Terraria.Main.mouseTextColor, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Utilities.FileUtilities.Move(), Terraria.Main.musicVolume, Terraria.Main.netMode, Terraria.Social.SocialAPI.Network, Terraria.Lighting.NextLightMode(), Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Terraria.Main.numDisplayModes, Terraria.Main.OnCharacterNamed(), Terraria.Main.OnEngineLoad, Terraria.Main.OnSeedSelected(), Terraria.Main.OnSubmitServerIP(), Terraria.Main.OnSubmitServerPassword(), Terraria.Main.OnSubmitServerPasswordFromRequest(), Terraria.Main.OnSubmitServerPort(), Terraria.Main.OnWorldNamed(), Terraria.Main.OpenCharacterSelectUI(), Terraria.Main.OpenResourcePacksMenu(), Terraria.Main.OurFavoriteColor, Terraria.Main.PendingBorderlessState, Terraria.Main.PendingPlayer, Terraria.Main.PendingResolutionHeight, Terraria.Main.PendingResolutionWidth, System.Math.PI, Terraria.Main.placementPreview, Terraria.Main.PlayerList, Terraria.Main.PlayerRenderer, Terraria.Main.playOldTile, Terraria.Audio.SoundEngine.PlaySound(), Terraria.WorldGen.playWorld(), Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp, Terraria.Main.pumpkinMoon, Terraria.Main.qaStyle, Terraria.Main.quickSplash, Terraria.Main.rand, Terraria.Main.randColor(), Terraria.Main.recentIP, Terraria.Main.recentPort, Terraria.Main.recentWorld, Terraria.Main.RejectionMenuInfo, Terraria.WorldGen.remixWorldGen, Terraria.Main.render, Terraria.SceneMetrics.Reset(), Terraria.Main.ResetKeyBindings(), Terraria.Main.ResourceSetsManager, Terraria.Main.ReversedUpDownArmorSetBonuses, Terraria.Main.rgbToHsl(), Terraria.IngameOptions.rightHover, Terraria.IngameOptions.rightLock, System.Math.Round(), Terraria.Main.SamplerStateForCursor, Terraria.Main.SaveSettings(), Terraria.Main.sBar, Terraria.Main.screenBorderless, Terraria.Main.screenBorderlessPendingResizes, Terraria.Main.screenHeight, Terraria.Main.screenLastPosition, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.selColor, Terraria.Main.selectedMenu, Terraria.Main.selectedMenu2, Terraria.Main.selectedPlayer, Terraria.Main.selectedWorld, Terraria.Netplay.ServerPassword, Terraria.Main.ServerSideCharacter, Terraria.Main.setKey, Terraria.UI.Gamepad.UILinkPointNavigator.SetPosition(), Terraria.Netplay.SetRemoteIPAsync(), Terraria.Main.SetResolution(), Terraria.Main.SettingsEnabled_MinersWobble, Terraria.Main.SettingsEnabled_TilesSwayInWind, Terraria.Main.SettingsUnlock_WorldEvil, Terraria.WorldGen.setWorldSize(), Terraria.GameInput.PlayerInput.SettingsForUI.ShowGamepadHints, Terraria.Main.showItemText, Terraria.Main.showSpam, Terraria.GameContent.UI.BigProgressBar.BigProgressBarSystem.ShowText, System.Math.Sin(), Terraria.Main.slimeRain, Terraria.Player.SmartCursorSettings.SmartAxeAfterPickaxe, Terraria.Player.SmartCursorSettings.SmartBlocksEnabled, Terraria.Main.snowMoon, Terraria.Main.soundVolume, Terraria.Main.spriteBatch, Terraria.Main.starGame, Terraria.Main.StartClientGameplay(), System.state, Terraria.Main.statusText, Terraria.Main.StopSlimeRain(), System.text, Terraria.Main.textBlinkerCount, Terraria.Main.textBlinkerState, Terraria.Main.tileColor, Terraria.Main.ToggleFullScreen(), Terraria.GameContent.UI.BigProgressBar.BigProgressBarSystem.ToggleShowText(), System.Convert.ToInt32(), Terraria.Main.tServer, Terraria.Main.UIScaleMatrix, Terraria.UI.Gamepad.GamepadMainMenuHandler.Update(), Terraria.Cloud.UpdateClouds(), Terraria.Star.UpdateStars(), Terraria.Main.UseHeatDistortion, Terraria.GameInput.LockOnHelper.UseMode, Terraria.Main.UseStormEffects, Terraria.GameInput.PlayerInput.UsingGamepad, Terraria.IngameOptions.valuePosition, Microsoft.Xna.Framework.Graphics.Vector2, Terraria.Main.WaveQuality, Microsoft.Xna.Framework.Color.White, Terraria.Social.SocialAPI.Workshop, Terraria.Main.WorldList, Terraria.Main.worldPathName, Terraria.Main.worldSurface, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Main.DoDraw().