Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Terraria.GameContent.UI.States.UICharacterCreation Class Reference

Public Member Functions

 UICharacterCreation (Player player)
 
override void Draw (SpriteBatch spriteBatch)
 
void TryMovingCategory (int direction)
 
delegate void MouseEvent (UIMouseEvent evt, UIElement listeningElement)
 
delegate void ScrollWheelEvent (UIScrollWheelEvent evt, UIElement listeningElement)
 
delegate void ElementEvent (UIElement affectedElement)
 
delegate void UIElementAction (UIElement element)
 
void SetSnapPoint (string name, int id, Vector2? anchor=null, Vector2? offset=null)
 
bool GetSnapPoint (out SnapPoint point)
 
virtual void ExecuteRecursively (UIElementAction action)
 
void Append (UIElement element)
 
void Remove ()
 
void RemoveChild (UIElement child)
 
void RemoveAllChildren ()
 
virtual void Update (GameTime gameTime)
 
Rectangle GetClippingRectangle (SpriteBatch spriteBatch)
 
virtual List< SnapPoint > GetSnapPoints ()
 
virtual void Recalculate ()
 
UIElement GetElementAt (Vector2 point)
 
virtual bool ContainsPoint (Vector2 point)
 
virtual Rectangle GetViewCullingArea ()
 
void SetPadding (float pixels)
 
virtual void RecalculateChildren ()
 
CalculatedStyle GetInnerDimensions ()
 
CalculatedStyle GetDimensions ()
 
CalculatedStyle GetOuterDimensions ()
 
void CopyStyle (UIElement element)
 
virtual void LeftMouseDown (UIMouseEvent evt)
 
virtual void LeftMouseUp (UIMouseEvent evt)
 
virtual void LeftClick (UIMouseEvent evt)
 
virtual void LeftDoubleClick (UIMouseEvent evt)
 
virtual void RightMouseDown (UIMouseEvent evt)
 
virtual void RightMouseUp (UIMouseEvent evt)
 
virtual void RightClick (UIMouseEvent evt)
 
virtual void RightDoubleClick (UIMouseEvent evt)
 
virtual void MouseOver (UIMouseEvent evt)
 
virtual void MouseOut (UIMouseEvent evt)
 
virtual void ScrollWheel (UIScrollWheelEvent evt)
 
void Activate ()
 
virtual void OnActivate ()
 
void DrawDebugHitbox (BasicDebugDrawer drawer, float colorIntensity=0f)
 
void Deactivate ()
 
virtual void OnDeactivate ()
 
void Initialize ()
 
virtual void OnInitialize ()
 
virtual int CompareTo (object obj)
 
int CompareTo (object? obj)
 
int CompareTo (T? other)
 

Public Attributes

StyleDimension Top
 
StyleDimension Left
 
StyleDimension Width
 
StyleDimension Height
 
StyleDimension MaxWidth = StyleDimension.Fill
 
StyleDimension MaxHeight = StyleDimension.Fill
 
StyleDimension MinWidth = StyleDimension.Empty
 
StyleDimension MinHeight = StyleDimension.Empty
 
bool IgnoresMouseInteraction
 
bool OverflowHidden
 
SamplerState OverrideSamplerState
 
float PaddingTop
 
float PaddingLeft
 
float PaddingRight
 
float PaddingBottom
 
float MarginTop
 
float MarginLeft
 
float MarginRight
 
float MarginBottom
 
float HAlign
 
float VAlign
 
bool UseImmediateMode
 

Static Public Attributes

const int MAX_NAME_LENGTH = 20
 

Protected Member Functions

virtual void DrawSelf (SpriteBatch spriteBatch)
 
virtual void DrawChildren (SpriteBatch spriteBatch)
 

Protected Attributes

readonly List< UIElementElements = new List<UIElement>()
 

Properties

UIElement Parent [get, private set]
 
int UniqueId [get, private set]
 
IEnumerable< UIElementChildren [get]
 
bool IsMouseHovering [get, private set]
 

Events

MouseEvent OnLeftMouseDown
 
MouseEvent OnLeftMouseUp
 
MouseEvent OnLeftClick
 
MouseEvent OnLeftDoubleClick
 
MouseEvent OnRightMouseDown
 
MouseEvent OnRightMouseUp
 
MouseEvent OnRightClick
 
MouseEvent OnRightDoubleClick
 
MouseEvent OnMouseOver
 
MouseEvent OnMouseOut
 
ScrollWheelEvent OnScrollWheel
 
ElementEvent OnUpdate
 

Private Types

enum  CategoryId {
  CharInfo , Clothing , HairStyle , HairColor ,
  Eye , Skin , Shirt , Undershirt ,
  Pants , Shoes , Count
}
 
enum  HSLSliderId { Hue , Saturation , Luminance }
 

Private Member Functions

void BuildPage ()
 
void MakeCharPreview (UIPanel container)
 
void MakeHairsylesMenu (UIElement middleInnerPanel)
 
void MakeClothStylesMenu (UIElement middleInnerPanel)
 
void MakeCategoriesBar (UIElement categoryContainer)
 
void UpdateHelpGlyphs (UIElement element)
 
UIColoredImageButton CreateColorPicker (CategoryId id, string texturePath, float xPositionStart, float xPositionPerId)
 
UIColoredImageButton CreatePickerWithoutClick (CategoryId id, string texturePath, float xPositionStart, float xPositionPerId)
 
void MakeInfoMenu (UIElement parentContainer)
 
void UpdateDifficultyDescription (UIMouseEvent evt, UIElement listeningElement)
 
void MakeHSLMenu (UIElement parentContainer)
 
UIColoredSlider CreateHSLSlider (HSLSliderId id)
 
UIColoredSlider CreateHSLSliderButtonBase (HSLSliderId id)
 
void UpdateHSL_H ()
 
void UpdateHSL_S ()
 
void UpdateHSL_L ()
 
float GetHSLSliderPosition (HSLSliderId id)
 
void UpdateHSLValue (HSLSliderId id, float value)
 
Color GetHSLSliderColorAt (HSLSliderId id, float pointAt)
 
void ApplyPendingColor (Color pendingColor)
 
void UpdateHexText (Color pendingColor)
 
void MakeBackAndCreatebuttons (UIElement outerContainer)
 
void Click_GoBack (UIMouseEvent evt, UIElement listeningElement)
 
void FadedMouseOver (UIMouseEvent evt, UIElement listeningElement)
 
void FadedMouseOut (UIMouseEvent evt, UIElement listeningElement)
 
void Click_ColorPicker (UIMouseEvent evt, UIElement listeningElement)
 
void Click_ClothStyles (UIMouseEvent evt, UIElement listeningElement)
 
void Click_HairStyles (UIMouseEvent evt, UIElement listeningElement)
 
void Click_CharInfo (UIMouseEvent evt, UIElement listeningElement)
 
void Click_CharClothStyle (UIMouseEvent evt, UIElement listeningElement)
 
void Click_CharGenderMale (UIMouseEvent evt, UIElement listeningElement)
 
void Click_CharGenderFemale (UIMouseEvent evt, UIElement listeningElement)
 
void UpdateSelectedGender ()
 
void Click_CopyHex (UIMouseEvent evt, UIElement listeningElement)
 
void Click_PasteHex (UIMouseEvent evt, UIElement listeningElement)
 
void Click_CopyPlayerTemplate (UIMouseEvent evt, UIElement listeningElement)
 
void Click_PastePlayerTemplate (UIMouseEvent evt, UIElement listeningElement)
 
void Click_RandomizePlayer (UIMouseEvent evt, UIElement listeningElement)
 
void Click_Naming (UIMouseEvent evt, UIElement listeningElement)
 
void Click_NamingAndCreating (UIMouseEvent evt, UIElement listeningElement)
 
void OnFinishedNaming (string name)
 
void OnCanceledNaming ()
 
void OnFinishedNamingAndCreating (string name)
 
void FinishCreatingCharacter ()
 
void SetupPlayerStatsAndInventoryBasedOnDifficulty ()
 
bool GetHexColor (string hexString, out Vector3 hsl)
 
void Click_RandomizeSingleColor (UIMouseEvent evt, UIElement listeningElement)
 
void UnselectAllCategories ()
 
void SelectColorPicker (CategoryId selection)
 
void UpdateColorPickers ()
 
void SetupGamepadPoints (SpriteBatch spriteBatch)
 
void MoveToVisuallyClosestPoint ()
 
UILinkPoint GetAndSet (int ptid, SnapPoint snap)
 
bool PointWithName (SnapPoint a, string comp)
 
int SortPoints (SnapPoint a, SnapPoint b)
 
CalculatedStyle GetDimensionsBasedOnParentDimensions (CalculatedStyle parentDimensions)
 

Static Private Member Functions

static string GetHexText (Color pendingColor)
 
static Vector3 GetRandomColorVector ()
 
static Color ScaledHslToRgb (Vector3 hsl)
 
static Color ScaledHslToRgb (float hue, float saturation, float luminosity)
 
static Vector3 RgbToScaledHsl (Color color)
 

Private Attributes

int[] _validClothStyles = new int[10] { 0, 2, 1, 3, 8, 4, 6, 5, 7, 9 }
 
readonly Player _player
 
UIColoredImageButton[] _colorPickers
 
CategoryId _selectedPicker
 
Vector3 _currentColorHSL
 
UIColoredImageButton _clothingStylesCategoryButton
 
UIColoredImageButton _hairStylesCategoryButton
 
UIColoredImageButton _charInfoCategoryButton
 
UIElement _topContainer
 
UIElement _middleContainer
 
UIElement _hslContainer
 
UIElement _hairstylesContainer
 
UIElement _clothStylesContainer
 
UIElement _infoContainer
 
UIText _hslHexText
 
UIText _difficultyDescriptionText
 
UIElement _copyHexButton
 
UIElement _pasteHexButton
 
UIElement _randomColorButton
 
UIElement _copyTemplateButton
 
UIElement _pasteTemplateButton
 
UIElement _randomizePlayerButton
 
UIColoredImageButton _genderMale
 
UIColoredImageButton _genderFemale
 
UICharacterNameButton _charName
 
UIText _helpGlyphLeft
 
UIText _helpGlyphRight
 
UIGamepadHelper _helper
 
List< int > _foundPoints = new List<int>()
 
bool _isInitialized
 
CalculatedStyle _innerDimensions
 
CalculatedStyle _dimensions
 
CalculatedStyle _outerDimensions
 
SnapPoint _snapPoint
 

Static Private Attributes

static readonly RasterizerState OverflowHiddenRasterizerState
 
static int _idCounter = 0
 

Detailed Description

Definition at line 22 of file UICharacterCreation.cs.


The documentation for this class was generated from the following file: