Barotrauma Client Doc
Barotrauma.GUIDropDown Class Reference
Inheritance diagram for Barotrauma.GUIDropDown:
Barotrauma.GUIComponent EventInput.IKeyboardSubscriber

Public Member Functions

delegate bool OnSelectedHandler (GUIComponent selected, object obj=null)
 
void ReceiveTextInput (char inputChar)
 
void ReceiveTextInput (string text)
 
void ReceiveCommandInput (char command)
 
void ReceiveEditingInput (string text, int start, int length)
 
void ReceiveSpecialInput (Keys key)
 
 GUIDropDown (RectTransform rectT, LocalizedString text=null, int elementCount=4, string style="", bool selectMultiple=false, bool dropAbove=false, Alignment textAlignment=Alignment.CenterLeft)
 
GUIComponent AddItem (LocalizedString text, object userData=null, LocalizedString toolTip=null, Color? color=null, Color? textColor=null)
 
override void ClearChildren ()
 
IEnumerable< GUIComponentGetChildren ()
 
void SelectItem (object userData)
 
void Select (int index)
 
void RefreshListBoxParent ()
 
override void DrawManually (SpriteBatch spriteBatch, bool alsoChildren=false, bool recursive=true)
 By default, all the gui elements are drawn automatically in the same order they appear on the update list. More...
 
override void AddToGUIUpdateList (bool ignoreChildren=false, int order=0)
 
- Public Member Functions inherited from Barotrauma.GUIComponent
delegate bool SecondaryButtonDownHandler (GUIComponent component, object userData)
 
GetChild< T > ()
 
GetAnyChild< T > ()
 
IEnumerable< T > GetAllChildren< T > ()
 
IEnumerable< GUIComponentGetAllChildren ()
 Returns all child elements in the hierarchy. More...
 
GUIComponent GetChild (int index)
 
int GetChildIndex (GUIComponent child)
 
GUIComponent GetChildByUserData (object obj)
 
bool IsParentOf (GUIComponent component, bool recursive=true)
 
bool IsChildOf (GUIComponent component, bool recursive=true)
 
virtual void RemoveChild (GUIComponent child)
 
GUIComponent FindChild (Func< GUIComponent, bool > predicate, bool recursive=false)
 
GUIComponent FindChild (object userData, bool recursive=false)
 
IEnumerable< GUIComponentFindChildren (object userData)
 
IEnumerable< GUIComponentFindChildren (Func< GUIComponent, bool > predicate)
 
void SetAsFirstChild ()
 
void SetAsLastChild ()
 
void RemoveFromGUIUpdateList (bool alsoChildren=true)
 
void UpdateAuto (float deltaTime)
 Only GUI should call this method. Auto updating follows the order of GUI update list. This order can be tweaked by changing the UpdateOrder property. More...
 
void UpdateManually (float deltaTime, bool alsoChildren=false, bool recursive=true)
 By default, all the gui elements are updated automatically in the same order they appear on the update list. More...
 
virtual void ForceLayoutRecalculation ()
 
void ForceUpdate ()
 
void UpdateChildren (float deltaTime, bool recursive)
 Updates all the children manually. More...
 
void DrawAuto (SpriteBatch spriteBatch)
 Only GUI should call this method. Auto drawing follows the order of GUI update list. This order can be tweaked by changing the UpdateOrder property. More...
 
virtual void DrawChildren (SpriteBatch spriteBatch, bool recursive)
 Draws all the children manually. More...
 
void DrawToolTip (SpriteBatch spriteBatch)
 Creates and draws a tooltip. More...
 
virtual void Flash (Color? color=null, float flashDuration=1.5f, bool useRectangleFlash=false, bool useCircularFlash=false, Vector2? flashRectInflate=null)
 
void ImmediateFlash (Color? color=null)
 
void FadeOut (float duration, bool removeAfter, float wait=0.0f, Action onRemove=null)
 
void FadeIn (float wait, float duration)
 
void SlideIn (float wait, float duration, int amount, SlideDirection direction)
 
void SlideOut (float duration, int amount, SlideDirection direction)
 
void Pulsate (Vector2 startScale, Vector2 endScale, float duration)
 
virtual void ApplyStyle (GUIComponentStyle style)
 
void ApplySizeRestrictions (GUIComponentStyle style)
 

Public Attributes

OnSelectedHandler OnSelected
 
OnSelectedHandler OnDropped
 
bool MustSelectAtLeastOne
 
- Public Attributes inherited from Barotrauma.GUIComponent
CursorState HoverCursor = CursorState.Default
 
bool AlwaysOverrideCursor = false
 
SecondaryButtonDownHandler OnSecondaryClicked
 
Action< GUIComponentOnAddedToGUIUpdateList
 
bool CanBeFocused
 
Dictionary< ComponentState, List< UISprite > > sprites
 
SpriteEffects SpriteEffects
 
object UserData
 
bool ExternalHighlight = false
 

Protected Member Functions

override void Update (float deltaTime)
 
- Protected Member Functions inherited from Barotrauma.GUIComponent
Rectangle ClampRect (Rectangle r)
 
 GUIComponent (string style, RectTransform rectT)
 This is the new constructor. More...
 
 GUIComponent (string style)
 
virtual Color GetColor (ComponentState state)
 
Color GetBlendedColor (Color targetColor, ref Color blendedColor)
 
virtual void Draw (SpriteBatch spriteBatch)
 
virtual void SetAlpha (float a)
 

Properties

bool Dropped [get, set]
 
bool AllowNonText [get, set]
 
object SelectedItemData [get]
 
override bool Enabled [get, set]
 
bool ButtonEnabled [get, set]
 
GUIComponent SelectedComponent [get]
 
override bool Selected [get, set]
 
GUIListBox ListBox [get]
 
object? SelectedData [get]
 
int SelectedIndex [get]
 
Color ButtonTextColor [get, set]
 
override GUIFont??? Font [get, set]
 
IEnumerable< object > SelectedDataMultiple [get]
 
IEnumerable< int > SelectedIndexMultiple [get]
 
LocalizedString Text [get, set]
 
override RichString ToolTip [get, set]
 
GUIImage DropDownIcon [get]
 
Vector4 Padding [get]
 
- Properties inherited from Barotrauma.GUIComponent
GUIComponent Parent [get]
 
IEnumerable< GUIComponentChildren [get]
 
bool AutoUpdate = true [get, set]
 
bool AutoDraw = true [get, set]
 
int UpdateOrder [get, set]
 
bool Bounce [get, set]
 
bool GlowOnSelect [get, set]
 
Vector2 UVOffset [get, set]
 
virtual float FlashTimer [get]
 
bool IgnoreLayoutGroups [get, set]
 
virtual GUIFont Font [get, set]
 
virtual RichString ToolTip [get, set]
 
GUIComponentStyle Style [get]
 
bool Visible [get, set]
 
virtual bool Enabled [get, set]
 
Vector2 Center [get]
 
virtual Rectangle Rect [get]
 
bool ClampMouseRectToParent = false [get, set]
 
virtual Rectangle? MouseRect [get]
 
virtual Color OutlineColor [get, set]
 
virtual bool Selected [get, set]
 
virtual ComponentState State [get, set]
 
int CountChildren [get]
 
Color DefaultColor [get, set]
 Currently only used for the fade effect in GUIListBox, should be set to the same value as Color but only assigned once More...
 
virtual Color Color [get, set]
 
virtual Color HoverColor [get, set]
 
virtual Color SelectedColor [get, set]
 
virtual Color DisabledColor [get, set]
 
virtual Color PressedColor [get, set]
 
TransitionMode ColorTransition [get]
 
SpriteFallBackState FallBackState [get]
 
float SpriteCrossFadeTime [get]
 
float ColorCrossFadeTime [get]
 
virtual bool PlaySoundOnSelect = false [get, set]
 
RectTransform RectTransform [get]
 
- Properties inherited from EventInput.IKeyboardSubscriber
bool Selected [get, set]
 

Additional Inherited Members

- Public Types inherited from Barotrauma.GUIComponent
enum class  ComponentState {
  None , Hover , Pressed , Selected ,
  HoverSelected
}
 
- Static Public Member Functions inherited from Barotrauma.GUIComponent
static void DrawToolTip (SpriteBatch spriteBatch, RichString toolTip, Vector2 pos)
 
static void DrawToolTip (SpriteBatch spriteBatch, RichString toolTip, Rectangle targetElement, Anchor anchor=Anchor.BottomCenter, Pivot pivot=Pivot.TopLeft)
 
static GUIComponent FromXML (ContentXElement element, RectTransform parent)
 
- Protected Attributes inherited from Barotrauma.GUIComponent
Alignment alignment
 
Identifier[] styleHierarchy
 
Color color
 
Color hoverColor
 
Color selectedColor
 
Color disabledColor
 
Color pressedColor
 
Color flashColor
 
float flashDuration = 1.5f
 
float flashTimer
 
bool enabled
 
ComponentState _state
 
ComponentState _previousState
 
bool isSelected
 
Color _currentColor
 

Detailed Description

Definition at line 10 of file GUIDropDown.cs.

Constructor & Destructor Documentation

◆ GUIDropDown()

Barotrauma.GUIDropDown.GUIDropDown ( RectTransform  rectT,
LocalizedString  text = null,
int  elementCount = 4,
string  style = "",
bool  selectMultiple = false,
bool  dropAbove = false,
Alignment  textAlignment = Alignment.CenterLeft 
)

Definition at line 169 of file GUIDropDown.cs.

Member Function Documentation

◆ AddItem()

GUIComponent Barotrauma.GUIDropDown.AddItem ( LocalizedString  text,
object  userData = null,
LocalizedString  toolTip = null,
Color color = null,
Color textColor = null 
)

Definition at line 247 of file GUIDropDown.cs.

◆ AddToGUIUpdateList()

override void Barotrauma.GUIDropDown.AddToGUIUpdateList ( bool  ignoreChildren = false,
int  order = 0 
)
virtual

Reimplemented from Barotrauma.GUIComponent.

Definition at line 431 of file GUIDropDown.cs.

◆ ClearChildren()

override void Barotrauma.GUIDropDown.ClearChildren ( )
virtual

Reimplemented from Barotrauma.GUIComponent.

Definition at line 302 of file GUIDropDown.cs.

◆ DrawManually()

override void Barotrauma.GUIDropDown.DrawManually ( SpriteBatch  spriteBatch,
bool  alsoChildren = false,
bool  recursive = true 
)
virtual

By default, all the gui elements are drawn automatically in the same order they appear on the update list.

Reimplemented from Barotrauma.GUIComponent.

Definition at line 419 of file GUIDropDown.cs.

◆ GetChildren()

IEnumerable<GUIComponent> Barotrauma.GUIDropDown.GetChildren ( )

Definition at line 307 of file GUIDropDown.cs.

◆ OnSelectedHandler()

delegate bool Barotrauma.GUIDropDown.OnSelectedHandler ( GUIComponent  selected,
object  obj = null 
)

◆ ReceiveCommandInput()

void Barotrauma.GUIDropDown.ReceiveCommandInput ( char  command)

Implements EventInput.IKeyboardSubscriber.

Definition at line 113 of file GUIDropDown.cs.

◆ ReceiveEditingInput()

void Barotrauma.GUIDropDown.ReceiveEditingInput ( string  text,
int  start,
int  length 
)

Implements EventInput.IKeyboardSubscriber.

Definition at line 114 of file GUIDropDown.cs.

◆ ReceiveSpecialInput()

void Barotrauma.GUIDropDown.ReceiveSpecialInput ( Keys  key)

Implements EventInput.IKeyboardSubscriber.

Definition at line 116 of file GUIDropDown.cs.

◆ ReceiveTextInput() [1/2]

void Barotrauma.GUIDropDown.ReceiveTextInput ( char  inputChar)

Implements EventInput.IKeyboardSubscriber.

Definition at line 108 of file GUIDropDown.cs.

◆ ReceiveTextInput() [2/2]

void Barotrauma.GUIDropDown.ReceiveTextInput ( string  text)

Implements EventInput.IKeyboardSubscriber.

Definition at line 112 of file GUIDropDown.cs.

◆ RefreshListBoxParent()

void Barotrauma.GUIDropDown.RefreshListBoxParent ( )

Definition at line 388 of file GUIDropDown.cs.

◆ Select()

void Barotrauma.GUIDropDown.Select ( int  index)

Definition at line 349 of file GUIDropDown.cs.

◆ SelectItem()

void Barotrauma.GUIDropDown.SelectItem ( object  userData)

Definition at line 337 of file GUIDropDown.cs.

◆ Update()

override void Barotrauma.GUIDropDown.Update ( float  deltaTime)
protectedvirtual

Reimplemented from Barotrauma.GUIComponent.

Definition at line 440 of file GUIDropDown.cs.

Member Data Documentation

◆ MustSelectAtLeastOne

bool Barotrauma.GUIDropDown.MustSelectAtLeastOne

Definition at line 143 of file GUIDropDown.cs.

◆ OnDropped

OnSelectedHandler Barotrauma.GUIDropDown.OnDropped

Definition at line 14 of file GUIDropDown.cs.

◆ OnSelected

OnSelectedHandler Barotrauma.GUIDropDown.OnSelected

Definition at line 13 of file GUIDropDown.cs.

Property Documentation

◆ AllowNonText

bool Barotrauma.GUIDropDown.AllowNonText
getset

Definition at line 27 of file GUIDropDown.cs.

◆ ButtonEnabled

bool Barotrauma.GUIDropDown.ButtonEnabled
getset

Definition at line 44 of file GUIDropDown.cs.

◆ ButtonTextColor

Color Barotrauma.GUIDropDown.ButtonTextColor
getset

Definition at line 93 of file GUIDropDown.cs.

◆ DropDownIcon

GUIImage Barotrauma.GUIDropDown.DropDownIcon
get

Definition at line 165 of file GUIDropDown.cs.

◆ Dropped

bool Barotrauma.GUIDropDown.Dropped
getset

Definition at line 25 of file GUIDropDown.cs.

◆ Enabled

override bool Barotrauma.GUIDropDown.Enabled
getset

Definition at line 38 of file GUIDropDown.cs.

◆ Font

override GUIFont??? Barotrauma.GUIDropDown.Font
getset

Definition at line 99 of file GUIDropDown.cs.

◆ ListBox

GUIListBox Barotrauma.GUIDropDown.ListBox
get

Definition at line 71 of file GUIDropDown.cs.

◆ Padding

Vector4 Barotrauma.GUIDropDown.Padding
get

Definition at line 167 of file GUIDropDown.cs.

◆ Selected

override bool Barotrauma.GUIDropDown.Selected
getset

Definition at line 59 of file GUIDropDown.cs.

◆ SelectedComponent

GUIComponent Barotrauma.GUIDropDown.SelectedComponent
get

Definition at line 54 of file GUIDropDown.cs.

◆ SelectedData

object? Barotrauma.GUIDropDown.SelectedData
get

Definition at line 76 of file GUIDropDown.cs.

◆ SelectedDataMultiple

IEnumerable<object> Barotrauma.GUIDropDown.SelectedDataMultiple
get

Definition at line 132 of file GUIDropDown.cs.

◆ SelectedIndex

int Barotrauma.GUIDropDown.SelectedIndex
get

Definition at line 84 of file GUIDropDown.cs.

◆ SelectedIndexMultiple

IEnumerable<int> Barotrauma.GUIDropDown.SelectedIndexMultiple
get

Definition at line 138 of file GUIDropDown.cs.

◆ SelectedItemData

object Barotrauma.GUIDropDown.SelectedItemData
get

Definition at line 29 of file GUIDropDown.cs.

◆ Text

LocalizedString Barotrauma.GUIDropDown.Text
getset

Definition at line 145 of file GUIDropDown.cs.

◆ ToolTip

override RichString Barotrauma.GUIDropDown.ToolTip
getset

Definition at line 151 of file GUIDropDown.cs.