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

◆ AddWorldSizeOptions()

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

Definition at line 286 of file UIWorldCreation.cs.

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 }
void ClearOptionDescription(UIMouseEvent evt, UIElement listeningElement)
void ShowOptionDescription(UIMouseEvent evt, UIElement listeningElement)
GroupOptionButton< WorldSizeId >[] _sizeButtons
static LocalizedText GetText(string key)
Definition Language.cs:10
void Append(UIElement element)
Definition UIElement.cs:166
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static StyleDimension FromPercent(float percent)
static StyleDimension FromPixelsAndPercent(float pixels, float percent)

References Terraria.GameContent.UI.States.UIWorldCreation._sizeButtons, Terraria.UI.UIElement.Append(), System.array, Terraria.GameContent.UI.States.UIWorldCreation.ClearOptionDescription(), Microsoft.Xna.Framework.Color.Cyan, Terraria.UI.StyleDimension.FromPercent(), Terraria.UI.StyleDimension.FromPixelsAndPercent(), Terraria.Localization.Language.GetText(), Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.Color.LimeGreen, Terraria.Lang.menu, and Terraria.GameContent.UI.States.UIWorldCreation.ShowOptionDescription().

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