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

◆ AddWorldEvilOptions()

void Terraria.GameContent.UI.States.UIWorldCreation.AddWorldEvilOptions ( UIElement container,
float accumualtedHeight,
MouseEvent clickEvent,
string tagGroup,
float usableWidthPercent )
inlineprivate

Definition at line 380 of file UIWorldCreation.cs.

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 }
void ClearOptionDescription(UIMouseEvent evt, UIElement listeningElement)
void ShowOptionDescription(UIMouseEvent evt, UIElement listeningElement)
GroupOptionButton< WorldEvilId >[] _evilButtons
static LocalizedText GetText(string key)
Definition Language.cs:10
void Append(UIElement element)
Definition UIElement.cs:166
static Color MediumPurple
Definition Color.cs:246
static StyleDimension FromPercent(float percent)
static StyleDimension FromPixelsAndPercent(float pixels, float percent)

References Terraria.GameContent.UI.States.UIWorldCreation._evilButtons, Terraria.UI.UIElement.Append(), System.array, Terraria.GameContent.UI.States.UIWorldCreation.ClearOptionDescription(), Terraria.UI.StyleDimension.FromPercent(), Terraria.UI.StyleDimension.FromPixelsAndPercent(), Terraria.Localization.Language.GetText(), Microsoft.Xna.Framework.Color.MediumPurple, Terraria.Lang.misc, Terraria.GameContent.UI.States.UIWorldCreation.ShowOptionDescription(), and Microsoft.Xna.Framework.Color.White.

Referenced by Terraria.GameContent.UI.States.UIWorldCreation.MakeInfoMenu().