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

◆ MakeCategoriesBar()

void Terraria.GameContent.UI.States.UICharacterCreation.MakeCategoriesBar ( UIElement categoryContainer)
inlineprivate

Definition at line 335 of file UICharacterCreation.cs.

336 {
337 float xPositionStart = -240f;
338 float xPositionPerId = 48f;
340 categoryContainer.Append(CreateColorPicker(CategoryId.HairColor, "Images/UI/CharCreation/ColorHair", xPositionStart, xPositionPerId));
341 categoryContainer.Append(CreateColorPicker(CategoryId.Eye, "Images/UI/CharCreation/ColorEye", xPositionStart, xPositionPerId));
342 categoryContainer.Append(CreateColorPicker(CategoryId.Skin, "Images/UI/CharCreation/ColorSkin", xPositionStart, xPositionPerId));
343 categoryContainer.Append(CreateColorPicker(CategoryId.Shirt, "Images/UI/CharCreation/ColorShirt", xPositionStart, xPositionPerId));
344 categoryContainer.Append(CreateColorPicker(CategoryId.Undershirt, "Images/UI/CharCreation/ColorUndershirt", xPositionStart, xPositionPerId));
345 categoryContainer.Append(CreateColorPicker(CategoryId.Pants, "Images/UI/CharCreation/ColorPants", xPositionStart, xPositionPerId));
346 categoryContainer.Append(CreateColorPicker(CategoryId.Shoes, "Images/UI/CharCreation/ColorShoes", xPositionStart, xPositionPerId));
347 _colorPickers[4].SetMiddleTexture(Main.Assets.Request<Texture2D>("Images/UI/CharCreation/ColorEyeBack", (AssetRequestMode)1));
348 _clothingStylesCategoryButton = CreatePickerWithoutClick(CategoryId.Clothing, "Images/UI/CharCreation/ClothStyleMale", xPositionStart, xPositionPerId);
349 _clothingStylesCategoryButton.OnLeftMouseDown += Click_ClothStyles;
352 _hairStylesCategoryButton = CreatePickerWithoutClick(CategoryId.HairStyle, "Images/UI/CharCreation/HairStyle_Hair", xPositionStart, xPositionPerId);
353 _hairStylesCategoryButton.OnLeftMouseDown += Click_HairStyles;
354 _hairStylesCategoryButton.SetMiddleTexture(Main.Assets.Request<Texture2D>("Images/UI/CharCreation/HairStyle_Arrow", (AssetRequestMode)1));
357 _charInfoCategoryButton = CreatePickerWithoutClick(CategoryId.CharInfo, "Images/UI/CharCreation/CharInfo", xPositionStart, xPositionPerId);
358 _charInfoCategoryButton.OnLeftMouseDown += Click_CharInfo;
363 {
366 VAlign = 1f,
367 HAlign = 0.5f,
368 Color = Color.Lerp(Color.White, new Color(63, 65, 151, 255), 0.85f) * 0.9f
369 };
370 categoryContainer.Append(element);
371 int num = 21;
373 {
374 Left = new StyleDimension(-num, 0f),
375 VAlign = 0.5f,
376 Top = new StyleDimension(-4f, 0f)
377 };
380 {
381 HAlign = 1f,
382 Left = new StyleDimension(12 + num, 0f),
383 VAlign = 0.5f,
384 Top = new StyleDimension(-4f, 0f)
385 };
389 categoryContainer.OnUpdate += UpdateHelpGlyphs;
390 }
void Click_HairStyles(UIMouseEvent evt, UIElement listeningElement)
void Click_CharInfo(UIMouseEvent evt, UIElement listeningElement)
UIColoredImageButton CreateColorPicker(CategoryId id, string texturePath, float xPositionStart, float xPositionPerId)
UIColoredImageButton CreatePickerWithoutClick(CategoryId id, string texturePath, float xPositionStart, float xPositionPerId)
void Click_ClothStyles(UIMouseEvent evt, UIElement listeningElement)
static string GenerateInputTag_ForCurrentGamemode(bool tagForGameplay, string triggerName)
StyleDimension Left
Definition UIElement.cs:25
void SetSnapPoint(string name, int id, Vector2? anchor=null, Vector2? offset=null)
Definition UIElement.cs:122
StyleDimension Width
Definition UIElement.cs:27
StyleDimension Top
Definition UIElement.cs:23
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static StyleDimension FromPixels(float pixels)
static StyleDimension FromPixelsAndPercent(float pixels, float percent)

References Terraria.GameContent.UI.States.UICharacterCreation._charInfoCategoryButton, Terraria.GameContent.UI.States.UICharacterCreation._clothingStylesCategoryButton, Terraria.GameContent.UI.States.UICharacterCreation._colorPickers, Terraria.GameContent.UI.States.UICharacterCreation._hairStylesCategoryButton, Terraria.GameContent.UI.States.UICharacterCreation._helpGlyphLeft, Terraria.GameContent.UI.States.UICharacterCreation._helpGlyphRight, Terraria.Main.Assets, Terraria.GameContent.UI.States.UICharacterCreation.Click_CharInfo(), Terraria.GameContent.UI.States.UICharacterCreation.Click_ClothStyles(), Terraria.GameContent.UI.States.UICharacterCreation.Click_HairStyles(), Terraria.GameContent.UI.States.UICharacterCreation.CreateColorPicker(), Terraria.GameContent.UI.States.UICharacterCreation.CreatePickerWithoutClick(), Terraria.UI.StyleDimension.FromPixels(), Terraria.UI.StyleDimension.FromPixelsAndPercent(), Terraria.GameInput.PlayerInput.GenerateInputTag_ForCurrentGamemode(), Terraria.UI.UIElement.HAlign, Terraria.UI.UIElement.Left, Microsoft.Xna.Framework.Color.Lerp(), Terraria.GameContent.UI.Elements.UIColoredImageButton.SetMiddleTexture(), Terraria.UI.UIElement.SetSnapPoint(), Terraria.UI.UIElement.Top, Terraria.GameContent.UI.States.UICharacterCreation.UpdateColorPickers(), Terraria.GameContent.UI.States.UICharacterCreation.UpdateHelpGlyphs(), Terraria.UI.UIElement.VAlign, Microsoft.Xna.Framework.Color.White, and Terraria.UI.UIElement.Width.

Referenced by Terraria.GameContent.UI.States.UICharacterCreation.BuildPage().