Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
UIWorldCreation.cs
Go to the documentation of this file.
1using System;
3using System.Linq;
9using Terraria.ID;
10using Terraria.IO;
12using Terraria.Social;
13using Terraria.UI;
15
17
19{
20 private enum WorldSizeId
21 {
22 Small,
23 Medium,
24 Large
25 }
26
27 private enum WorldDifficultyId
28 {
29 Normal,
30 Expert,
31 Master,
32 Creative
33 }
34
35 private enum WorldEvilId
36 {
37 Random,
40 }
41
43
45
47
48 private string _optionwWorldName;
49
50 private string _optionSeed;
51
53
55
57
59
61
63
65
66 public const int MAX_NAME_LENGTH = 27;
67
68 public const int MAX_SEED_LENGTH = 40;
69
71 {
72 BuildPage();
73 }
74
75 private void BuildPage()
76 {
77 int num = 18;
80 {
82 Height = StyleDimension.FromPixels(434f + (float)num),
83 Top = StyleDimension.FromPixels(170f - (float)num),
84 HAlign = 0.5f,
85 VAlign = 0f
86 };
87 uIElement.SetPadding(0f);
90 {
92 Height = StyleDimension.FromPixels(280 + num),
94 BackgroundColor = new Color(33, 43, 79) * 0.8f
95 };
96 uIPanel.SetPadding(0f);
97 uIElement.Append(uIPanel);
100 {
104 HAlign = 1f
105 };
106 uIElement2.SetPadding(0f);
107 uIElement2.PaddingTop = 8f;
108 uIElement2.PaddingBottom = 12f;
109 uIPanel.Append(uIElement2);
111 }
112
114 {
116 {
119 HAlign = 0.5f,
120 VAlign = 0f
121 };
122 uIElement.SetPadding(10f);
123 uIElement.PaddingBottom = 0f;
124 uIElement.PaddingTop = 0f;
126 float num = 0f;
127 float num2 = 44f;
128 float num3 = 88f + num2;
129 float pixels = num2;
130 GroupOptionButton<bool> groupOptionButton = new GroupOptionButton<bool>(option: true, null, Language.GetText("UI.WorldCreationRandomizeNameDescription"), Color.White, "Images/UI/WorldCreation/IconRandomName")
131 {
133 Height = new StyleDimension(40f, 0f),
134 HAlign = 0f,
136 ShowHighlightWhenSelected = false
137 };
138 groupOptionButton.OnLeftMouseDown += ClickRandomizeName;
139 groupOptionButton.OnMouseOver += ShowOptionDescription;
140 groupOptionButton.OnMouseOut += ClearOptionDescription;
141 groupOptionButton.SetSnapPoint("RandomizeName", 0);
143 UICharacterNameButton uICharacterNameButton = new UICharacterNameButton(Language.GetText("UI.WorldCreationName"), Language.GetText("UI.WorldCreationNameEmpty"), Language.GetText("UI.WorldDescriptionName"))
144 {
146 HAlign = 0f,
147 Left = new StyleDimension(pixels, 0f),
149 };
150 uICharacterNameButton.OnLeftMouseDown += Click_SetName;
151 uICharacterNameButton.OnMouseOver += ShowOptionDescription;
152 uICharacterNameButton.OnMouseOut += ClearOptionDescription;
153 uICharacterNameButton.SetSnapPoint("Name", 0);
156 num += uICharacterNameButton.GetDimensions().Height + 4f;
157 GroupOptionButton<bool> groupOptionButton2 = new GroupOptionButton<bool>(option: true, null, Language.GetText("UI.WorldCreationRandomizeSeedDescription"), Color.White, "Images/UI/WorldCreation/IconRandomSeed")
158 {
160 Height = new StyleDimension(40f, 0f),
161 HAlign = 0f,
163 ShowHighlightWhenSelected = false
164 };
165 groupOptionButton2.OnLeftMouseDown += ClickRandomizeSeed;
166 groupOptionButton2.OnMouseOver += ShowOptionDescription;
167 groupOptionButton2.OnMouseOut += ClearOptionDescription;
168 groupOptionButton2.SetSnapPoint("RandomizeSeed", 0);
170 UICharacterNameButton uICharacterNameButton2 = new UICharacterNameButton(Language.GetText("UI.WorldCreationSeed"), Language.GetText("UI.WorldCreationSeedEmpty"), Language.GetText("UI.WorldDescriptionSeed"))
171 {
173 HAlign = 0f,
174 Left = new StyleDimension(pixels, 0f),
176 DistanceFromTitleToOption = 29f
177 };
178 uICharacterNameButton2.OnLeftMouseDown += Click_SetSeed;
179 uICharacterNameButton2.OnMouseOver += ShowOptionDescription;
180 uICharacterNameButton2.OnMouseOut += ClearOptionDescription;
181 uICharacterNameButton2.SetSnapPoint("Seed", 0);
185 {
188 HAlign = 1f,
189 VAlign = 0f
190 };
193 num += uICharacterNameButton2.GetDimensions().Height + 10f;
195 float usableWidthPercent = 1f;
197 num += 48f;
200 num += 48f;
203 num += 48f;
205 AddDescriptionPanel(uIElement, num, "desc");
207 }
208
209 private static void AddHorizontalSeparator(UIElement Container, float accumualtedHeight)
210 {
212 {
215 Color = Color.Lerp(Color.White, new Color(63, 65, 151, 255), 0.85f) * 0.9f
216 };
217 Container.Append(element);
218 }
219
220 private void SetDefaultOptions()
221 {
226 for (int i = 0; i < sizeButtons.Length; i++)
227 {
228 sizeButtons[i].SetCurrentOption(WorldSizeId.Medium);
229 }
230 _optionSize = WorldSizeId.Medium;
231 if (Main.ActivePlayerFileData.Player.difficulty == 3)
232 {
234 for (int i = 0; i < difficultyButtons.Length; i++)
235 {
236 difficultyButtons[i].SetCurrentOption(WorldDifficultyId.Creative);
237 }
240 }
241 else
242 {
244 for (int i = 0; i < difficultyButtons.Length; i++)
245 {
246 difficultyButtons[i].SetCurrentOption(WorldDifficultyId.Normal);
247 }
248 }
250 for (int i = 0; i < evilButtons.Length; i++)
251 {
252 evilButtons[i].SetCurrentOption(WorldEvilId.Random);
253 }
254 }
255
256 private void AddDescriptionPanel(UIElement container, float accumulatedHeight, string tagGroup)
257 {
258 float num = 0f;
259 UISlicedImage uISlicedImage = new UISlicedImage(Main.Assets.Request<Texture2D>("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode)1))
260 {
261 HAlign = 0.5f,
262 VAlign = 1f,
263 Width = StyleDimension.FromPixelsAndPercent((0f - num) * 2f, 1f),
264 Left = StyleDimension.FromPixels(0f - num),
267 };
268 uISlicedImage.SetSliceDepths(10);
269 uISlicedImage.Color = Color.LightGray * 0.7f;
270 container.Append(uISlicedImage);
271 UIText uIText = new UIText(Language.GetText("UI.WorldDescriptionDefault"), 0.82f)
272 {
273 HAlign = 0f,
274 VAlign = 0f,
278 };
279 uIText.PaddingLeft = 20f;
280 uIText.PaddingRight = 20f;
281 uIText.PaddingTop = 6f;
282 uISlicedImage.Append(uIText);
284 }
285
286 private void AddWorldSizeOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent)
287 {
288 WorldSizeId[] array = new WorldSizeId[3]
289 {
290 WorldSizeId.Small,
291 WorldSizeId.Medium,
292 WorldSizeId.Large
293 };
295 {
296 Lang.menu[92],
297 Lang.menu[93],
298 Lang.menu[94]
299 };
301 {
302 Language.GetText("UI.WorldDescriptionSizeSmall"),
303 Language.GetText("UI.WorldDescriptionSizeMedium"),
304 Language.GetText("UI.WorldDescriptionSizeLarge")
305 };
306 Color[] array4 = new Color[3]
307 {
308 Color.Cyan,
310 Color.LimeGreen
311 };
312 string[] array5 = new string[3] { "Images/UI/WorldCreation/IconSizeSmall", "Images/UI/WorldCreation/IconSizeMedium", "Images/UI/WorldCreation/IconSizeLarge" };
314 for (int i = 0; i < array6.Length; i++)
315 {
317 groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(-4 * (array6.Length - 1), 1f / (float)array6.Length * usableWidthPercent);
318 groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent);
319 groupOptionButton.HAlign = (float)i / (float)(array6.Length - 1);
321 groupOptionButton.OnLeftMouseDown += clickEvent;
322 groupOptionButton.OnMouseOver += ShowOptionDescription;
323 groupOptionButton.OnMouseOut += ClearOptionDescription;
324 groupOptionButton.SetSnapPoint(tagGroup, i);
325 container.Append(groupOptionButton);
327 }
329 }
330
331 private void AddWorldDifficultyOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent)
332 {
334 {
335 WorldDifficultyId.Creative,
336 WorldDifficultyId.Normal,
337 WorldDifficultyId.Expert,
338 WorldDifficultyId.Master
339 };
341 {
342 Language.GetText("UI.Creative"),
343 Language.GetText("UI.Normal"),
344 Language.GetText("UI.Expert"),
345 Language.GetText("UI.Master")
346 };
348 {
349 Language.GetText("UI.WorldDescriptionCreative"),
350 Language.GetText("UI.WorldDescriptionNormal"),
351 Language.GetText("UI.WorldDescriptionExpert"),
352 Language.GetText("UI.WorldDescriptionMaster")
353 };
354 Color[] array4 = new Color[4]
355 {
357 Color.White,
359 Main.hcColor
360 };
361 string[] array5 = new string[4] { "Images/UI/WorldCreation/IconDifficultyCreative", "Images/UI/WorldCreation/IconDifficultyNormal", "Images/UI/WorldCreation/IconDifficultyExpert", "Images/UI/WorldCreation/IconDifficultyMaster" };
363 for (int i = 0; i < array6.Length; i++)
364 {
366 groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(-1 * (array6.Length - 1), 1f / (float)array6.Length * usableWidthPercent);
367 groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent);
368 groupOptionButton.HAlign = (float)i / (float)(array6.Length - 1);
370 groupOptionButton.OnLeftMouseDown += clickEvent;
371 groupOptionButton.OnMouseOver += ShowOptionDescription;
372 groupOptionButton.OnMouseOut += ClearOptionDescription;
373 groupOptionButton.SetSnapPoint(tagGroup, i);
374 container.Append(groupOptionButton);
376 }
378 }
379
380 private void AddWorldEvilOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent)
381 {
382 WorldEvilId[] array = new WorldEvilId[3]
383 {
384 WorldEvilId.Random,
385 WorldEvilId.Corruption,
386 WorldEvilId.Crimson
387 };
389 {
390 Lang.misc[103],
391 Lang.misc[101],
392 Lang.misc[102]
393 };
395 {
396 Language.GetText("UI.WorldDescriptionEvilRandom"),
397 Language.GetText("UI.WorldDescriptionEvilCorrupt"),
398 Language.GetText("UI.WorldDescriptionEvilCrimson")
399 };
400 Color[] array4 = new Color[3]
401 {
402 Color.White,
404 Color.IndianRed
405 };
406 string[] array5 = new string[3] { "Images/UI/WorldCreation/IconEvilRandom", "Images/UI/WorldCreation/IconEvilCorruption", "Images/UI/WorldCreation/IconEvilCrimson" };
408 for (int i = 0; i < array6.Length; i++)
409 {
411 groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(-4 * (array6.Length - 1), 1f / (float)array6.Length * usableWidthPercent);
412 groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent);
413 groupOptionButton.HAlign = (float)i / (float)(array6.Length - 1);
415 groupOptionButton.OnLeftMouseDown += clickEvent;
416 groupOptionButton.OnMouseOver += ShowOptionDescription;
417 groupOptionButton.OnMouseOut += ClearOptionDescription;
418 groupOptionButton.SetSnapPoint(tagGroup, i);
419 container.Append(groupOptionButton);
421 }
423 }
424
432
440
452
464
476
477 private void UpdatePreviewPlate()
478 {
480 }
481
482 private void UpdateSliders()
483 {
485 for (int i = 0; i < sizeButtons.Length; i++)
486 {
487 sizeButtons[i].SetCurrentOption(_optionSize);
488 }
490 for (int i = 0; i < difficultyButtons.Length; i++)
491 {
492 difficultyButtons[i].SetCurrentOption(_optionDifficulty);
493 }
495 for (int i = 0; i < evilButtons.Length; i++)
496 {
497 evilButtons[i].SetCurrentOption(_optionEvil);
498 }
499 }
500
529
531 {
532 _descriptionText.SetText(Language.GetText("UI.WorldDescriptionDefault"));
533 }
534
536 {
538 {
541 VAlign = 1f,
542 HAlign = 0f,
544 };
545 uITextPanel.OnMouseOver += FadedMouseOver;
546 uITextPanel.OnMouseOut += FadedMouseOut;
547 uITextPanel.OnLeftMouseDown += Click_GoBack;
548 uITextPanel.SetSnapPoint("Back", 0);
551 {
554 VAlign = 1f,
555 HAlign = 1f,
557 };
558 uITextPanel2.OnMouseOver += FadedMouseOver;
559 uITextPanel2.OnMouseOut += FadedMouseOut;
560 uITextPanel2.OnLeftMouseDown += Click_NamingAndCreating;
561 uITextPanel2.SetSnapPoint("Create", 0);
563 }
564
570
572 {
574 ((UIPanel)evt.Target).BackgroundColor = new Color(73, 94, 171);
575 ((UIPanel)evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver;
576 }
577
579 {
580 ((UIPanel)evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f;
581 ((UIPanel)evt.Target).BorderColor = Color.Black;
582 }
583
592
601
603 {
605 if (string.IsNullOrEmpty(_optionwWorldName))
606 {
608 Main.clrInput();
610 uIVirtualKeyboard.SetMaxInputLength(27);
611 Main.MenuUI.SetState(uIVirtualKeyboard);
612 }
613 else
614 {
616 }
617 }
618
619 private void OnFinishedSettingName(string name)
620 {
621 _optionwWorldName = name.Trim();
623 GoBackHere();
624 }
625
637
648
649 private void GoBackHere()
650 {
651 Main.MenuUI.SetState(this);
652 }
653
654 private void OnFinishedNamingAndCreating(string name)
655 {
658 }
659
660 private void FinishCreatingWorld()
661 {
663 switch (_optionSize)
664 {
665 case WorldSizeId.Small:
666 Main.maxTilesX = 4200;
667 Main.maxTilesY = 1200;
668 break;
669 case WorldSizeId.Medium:
670 Main.maxTilesX = 6400;
671 Main.maxTilesY = 1800;
672 break;
673 case WorldSizeId.Large:
674 Main.maxTilesX = 8400;
675 Main.maxTilesY = 2400;
676 break;
677 }
679 switch (_optionDifficulty)
680 {
681 case WorldDifficultyId.Creative:
682 Main.GameMode = 3;
683 break;
684 case WorldDifficultyId.Normal:
685 Main.GameMode = 0;
686 break;
687 case WorldDifficultyId.Expert:
688 Main.GameMode = 1;
689 break;
690 case WorldDifficultyId.Master:
691 Main.GameMode = 2;
692 break;
693 }
694 switch (_optionEvil)
695 {
696 case WorldEvilId.Random:
697 WorldGen.WorldGenParam_Evil = -1;
698 break;
699 case WorldEvilId.Corruption:
700 WorldGen.WorldGenParam_Evil = 0;
701 break;
702 case WorldEvilId.Crimson:
703 WorldGen.WorldGenParam_Evil = 1;
704 break;
705 }
706 Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName = _optionwWorldName.Trim(), SocialAPI.Cloud != null && SocialAPI.Cloud.EnabledByDefault, Main.GameMode);
707 if (processedSeed.Length == 0)
708 {
709 Main.ActiveWorldFileData.SetSeedToRandom();
710 }
711 else
712 {
714 }
715 Main.menuMode = 10;
717 }
718
719 public static void ProcessSpecialWorldSeeds(string processedSeed)
720 {
721 WorldGen.noTrapsWorldGen = false;
722 WorldGen.notTheBees = false;
723 WorldGen.getGoodWorldGen = false;
724 WorldGen.tenthAnniversaryWorldGen = false;
725 WorldGen.dontStarveWorldGen = false;
726 WorldGen.tempRemixWorldGen = false;
727 WorldGen.tempTenthAnniversaryWorldGen = false;
728 WorldGen.everythingWorldGen = false;
729 if (processedSeed.ToLower() == "no traps" || processedSeed.ToLower() == "notraps")
730 {
731 WorldGen.noTrapsWorldGen = true;
732 }
733 if (processedSeed.ToLower() == "not the bees" || processedSeed.ToLower() == "not the bees!" || processedSeed.ToLower() == "notthebees")
734 {
735 WorldGen.notTheBees = true;
736 }
737 if (processedSeed.ToLower() == "for the worthy" || processedSeed.ToLower() == "fortheworthy")
738 {
739 WorldGen.getGoodWorldGen = true;
740 }
741 if (processedSeed.ToLower() == "don't dig up" || processedSeed.ToLower() == "dont dig up" || processedSeed.ToLower() == "dontdigup")
742 {
743 WorldGen.tempRemixWorldGen = true;
744 }
745 if (processedSeed.ToLower() == "celebrationmk10")
746 {
747 WorldGen.tempTenthAnniversaryWorldGen = true;
748 }
749 if (processedSeed.ToLower() == "constant" || processedSeed.ToLower() == "theconstant" || processedSeed.ToLower() == "the constant" || processedSeed.ToLower() == "eye4aneye" || processedSeed.ToLower() == "eyeforaneye")
750 {
751 WorldGen.dontStarveWorldGen = true;
752 }
753 if (processedSeed.ToLower() == "get fixed boi" || processedSeed.ToLower() == "getfixedboi")
754 {
755 WorldGen.noTrapsWorldGen = true;
756 WorldGen.notTheBees = true;
757 WorldGen.getGoodWorldGen = true;
758 WorldGen.tempTenthAnniversaryWorldGen = true;
759 WorldGen.dontStarveWorldGen = true;
760 WorldGen.tempRemixWorldGen = true;
761 WorldGen.everythingWorldGen = true;
762 }
763 }
764
765 private void ProcessSeed(out string processedSeed)
766 {
769 string[] array = _optionSeed.Split('.');
770 if (array.Length != 4)
771 {
772 return;
773 }
774 if (int.TryParse(array[0], out var result))
775 {
776 switch (result)
777 {
778 case 1:
779 _optionSize = WorldSizeId.Small;
780 break;
781 case 2:
782 _optionSize = WorldSizeId.Medium;
783 break;
784 case 3:
785 _optionSize = WorldSizeId.Large;
786 break;
787 }
788 }
789 if (int.TryParse(array[1], out result))
790 {
791 switch (result)
792 {
793 case 1:
795 break;
796 case 2:
798 break;
799 case 3:
801 break;
802 case 4:
804 break;
805 }
806 }
807 if (int.TryParse(array[2], out result))
808 {
809 switch (result)
810 {
811 case 1:
812 _optionEvil = WorldEvilId.Corruption;
813 break;
814 case 2:
815 _optionEvil = WorldEvilId.Crimson;
816 break;
817 }
818 }
819 processedSeed = array[3];
820 }
821
823 {
824 do
825 {
826 LocalizedText localizedText = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Composition."));
830 var obj = new
831 {
833 Location = localizedText3.Value,
834 Noun = localizedText4.Value
835 };
836 _optionwWorldName = localizedText.FormatWith(obj);
837 if (Main.rand.Next(10000) == 0)
838 {
839 _optionwWorldName = Language.GetTextValue("SpecialWorldName.TheConstant");
840 }
841 }
842 while (_optionwWorldName.Length > 27);
843 }
844
846 {
847 _optionSeed = Main.rand.Next().ToString();
848 }
849
850 public override void Draw(SpriteBatch spriteBatch)
851 {
852 base.Draw(spriteBatch);
853 SetupGamepadPoints(spriteBatch);
854 }
855
856 private void SetupGamepadPoints(SpriteBatch spriteBatch)
857 {
858 UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
859 int num = 3000;
861 SnapPoint snapPoint = null;
862 SnapPoint snapPoint2 = null;
863 SnapPoint snapPoint3 = null;
864 SnapPoint snapPoint4 = null;
865 SnapPoint snapPoint5 = null;
866 SnapPoint snapPoint6 = null;
867 for (int i = 0; i < snapPoints.Count; i++)
868 {
870 switch (snapPoint7.Name)
871 {
872 case "Back":
874 break;
875 case "Create":
877 break;
878 case "Name":
880 break;
881 case "Seed":
883 break;
884 case "RandomizeName":
886 break;
887 case "RandomizeSeed":
889 break;
890 }
891 }
897 uILinkPoint.Unlink();
899 num++;
902 uILinkPoint.Unlink();
904 num++;
907 uILinkPoint.Unlink();
909 num++;
912 uILinkPoint.Unlink();
914 num++;
917 uILinkPoint.Unlink();
919 num++;
922 uILinkPoint.Unlink();
924 num++;
926 for (int j = 0; j < snapGroup.Count; j++)
927 {
930 uILinkPoint.Unlink();
932 num++;
933 }
935 for (int k = 0; k < snapGroup2.Count; k++)
936 {
939 uILinkPoint.Unlink();
941 num++;
942 }
944 for (int l = 0; l < snapGroup3.Count; l++)
945 {
948 uILinkPoint.Unlink();
950 num++;
951 }
955 for (int m = 0; m < array.Length; m++)
956 {
957 array[m].Up = uILinkPoint7.ID;
958 }
959 if (true)
960 {
963 for (int n = 0; n < array3.Length; n++)
964 {
965 array3[n].Down = uILinkPoint2.ID;
966 }
967 array3[array3.Length - 1].Down = uILinkPoint3.ID;
968 uILinkPoint3.Up = array3[array3.Length - 1].ID;
969 uILinkPoint2.Up = array3[0].ID;
970 }
971 else
972 {
973 for (int num2 = 0; num2 < array2.Length; num2++)
974 {
975 array2[num2].Down = uILinkPoint2.ID;
976 }
977 array2[array2.Length - 1].Down = uILinkPoint3.ID;
978 uILinkPoint3.Up = array2[array2.Length - 1].ID;
979 uILinkPoint2.Up = array2[0].ID;
980 }
981 uILinkPoint3.Left = uILinkPoint2.ID;
982 uILinkPoint2.Right = uILinkPoint3.ID;
983 uILinkPoint5.Down = uILinkPoint7.ID;
984 uILinkPoint5.Left = uILinkPoint4.ID;
985 uILinkPoint4.Right = uILinkPoint5.ID;
986 uILinkPoint7.Up = uILinkPoint5.ID;
987 uILinkPoint7.Down = array[0].ID;
988 uILinkPoint7.Left = uILinkPoint6.ID;
989 uILinkPoint6.Right = uILinkPoint7.ID;
990 uILinkPoint6.Up = uILinkPoint4.ID;
991 uILinkPoint6.Down = array[0].ID;
992 uILinkPoint4.Down = uILinkPoint6.ID;
993 }
994
996 {
997 int num = Math.Max(topSide.Length, bottomSide.Length);
998 for (int i = 0; i < num; i++)
999 {
1000 int num2 = Math.Min(i, topSide.Length - 1);
1001 int num3 = Math.Min(i, bottomSide.Length - 1);
1002 topSide[num2].Down = bottomSide[num3].ID;
1003 bottomSide[num3].Up = topSide[num2].ID;
1004 }
1005 }
1006
1008 {
1009 for (int i = 1; i < pointsLine.Length - 1; i++)
1010 {
1011 pointsLine[i - 1].Right = pointsLine[i].ID;
1012 pointsLine[i].Left = pointsLine[i - 1].ID;
1013 pointsLine[i].Right = pointsLine[i + 1].ID;
1014 pointsLine[i + 1].Left = pointsLine[i].ID;
1015 }
1016 }
1017
1019 {
1020 List<SnapPoint> list = ptsOnPage.Where((SnapPoint a) => a.Name == groupName).ToList();
1021 list.Sort(SortPoints);
1022 return list;
1023 }
1024
1026 {
1027 return a.Id.CompareTo(b.Id);
1028 }
1029}
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static void PlaySound(int type, Vector2 position, int style=1)
void UpdateOption(byte difficulty, byte evil, byte size)
override void Draw(SpriteBatch spriteBatch)
void ClearOptionDescription(UIMouseEvent evt, UIElement listeningElement)
void ClickRandomizeSeed(UIMouseEvent evt, UIElement listeningElement)
void Click_NamingAndCreating(UIMouseEvent evt, UIElement listeningElement)
void AddWorldDifficultyOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent)
static void AddHorizontalSeparator(UIElement Container, float accumualtedHeight)
static void ProcessSpecialWorldSeeds(string processedSeed)
void MakeBackAndCreatebuttons(UIElement outerContainer)
void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement)
List< SnapPoint > GetSnapGroup(List< SnapPoint > ptsOnPage, string groupName)
void LoopHorizontalLineLinks(UILinkPoint[] pointsLine)
void Click_GoBack(UIMouseEvent evt, UIElement listeningElement)
void ClickDifficultyOption(UIMouseEvent evt, UIElement listeningElement)
void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement)
void ClickRandomizeName(UIMouseEvent evt, UIElement listeningElement)
void AddWorldEvilOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent)
void MakeInfoMenu(UIElement parentContainer)
void Click_SetName(UIMouseEvent evt, UIElement listeningElement)
GroupOptionButton< WorldDifficultyId >[] _difficultyButtons
void Click_SetSeed(UIMouseEvent evt, UIElement listeningElement)
void AddWorldSizeOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent)
void ClickSizeOption(UIMouseEvent evt, UIElement listeningElement)
void ShowOptionDescription(UIMouseEvent evt, UIElement listeningElement)
void SetupGamepadPoints(SpriteBatch spriteBatch)
void ClickEvilOption(UIMouseEvent evt, UIElement listeningElement)
GroupOptionButton< WorldSizeId >[] _sizeButtons
void EstablishUpDownRelationship(UILinkPoint[] topSide, UILinkPoint[] bottomSide)
GroupOptionButton< WorldEvilId >[] _evilButtons
void AddDescriptionPanel(UIElement container, float accumulatedHeight, string tagGroup)
static readonly Color FancyUIFatButtonMouseOver
Definition Colors.cs:91
static WorldFileData CreateMetadata(string name, bool cloudSave, int GameMode)
Definition WorldFile.cs:523
static LocalizedText[] menu
Definition Lang.cs:19
static LocalizedText[] misc
Definition Lang.cs:25
static LanguageSearchFilter CreateDialogFilter(string startsWith, object substitutions)
Definition Lang.cs:388
static LocalizedText SelectRandom(LanguageSearchFilter filter, UnifiedRandom random=null)
Definition Language.cs:65
static LocalizedText GetText(string key)
Definition Language.cs:10
static string GetTextValue(string key)
Definition Language.cs:15
static WorldFileData ActiveWorldFileData
Definition Main.cs:1946
static UserInterface MenuUI
Definition Main.cs:381
static Microsoft.Xna.Framework.Color creativeModeColor
Definition Main.cs:996
static Microsoft.Xna.Framework.Color mcColor
Definition Main.cs:992
static string worldName
Definition Main.cs:1260
static void OpenWorldSelectUI()
Definition Main.cs:49255
static int GameMode
Definition Main.cs:2685
static PlayerFileData ActivePlayerFileData
Definition Main.cs:1940
static void clrInput()
Definition Main.cs:18584
static UnifiedRandom rand
Definition Main.cs:1387
static IAssetRepository Assets
Definition Main.cs:209
static Terraria.Social.Base.CloudSocialModule Cloud
Definition SocialAPI.cs:18
static Dictionary< int, UILinkPoint > Points
static void SetPosition(int ID, Vector2 Position)
StyleDimension Height
Definition UIElement.cs:29
void Append(UIElement element)
Definition UIElement.cs:166
StyleDimension Left
Definition UIElement.cs:25
StyleDimension Width
Definition UIElement.cs:27
virtual void Recalculate()
Definition UIElement.cs:281
virtual List< SnapPoint > GetSnapPoints()
Definition UIElement.cs:267
StyleDimension Top
Definition UIElement.cs:23
static void setWorldSize()
Definition WorldGen.cs:3013
static Task CreateNewWorld(GenerationProgress progress=null)
Definition WorldGen.cs:3048
static Color MediumPurple
Definition Color.cs:246
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static StyleDimension FromPixels(float pixels)
static StyleDimension FromPercent(float percent)
static StyleDimension FromPixelsAndPercent(float pixels, float percent)