Barotrauma Client Doc
|
Public Types | |
enum class | SelectMode { SelectSingle , SelectMultiple , RequireShiftToSelectMultiple , None } |
enum class | DragMode { NoDragging , DragWithinBox , DragOutsideBox } |
enum class | Force { Yes , No } |
enum class | AutoScroll { Enabled , Disabled } |
enum class | TakeKeyBoardFocus { Yes , No } |
enum class | PlaySelectSound { Yes , No } |
Public Types inherited from Barotrauma.GUIComponent | |
enum class | ComponentState { None , Hover , Pressed , Selected , HoverSelected } |
Public Member Functions | |||
delegate bool | OnSelectedHandler (GUIComponent component, object obj) | ||
delegate object | CheckSelectedHandler () | ||
delegate void | OnRearrangedHandler (GUIListBox listBox, object obj) | ||
GUIListBox (RectTransform rectT, bool isHorizontal=false, Color? color=null, string style="", bool isScrollBarOnDefaultSide=true, bool useMouseDownToSelect=false) | |||
| |||
void | UpdateDimensions () | ||
void | Select (object userData, Force force=Force.No, AutoScroll autoScroll=AutoScroll.Enabled) | ||
Vector2 | CalculateTopOffset () | ||
void | ScrollToElement (GUIComponent component, PlaySelectSound playSelectSound=PlaySelectSound.No) | ||
Scrolls the list to the specific element. More... | |||
void | ScrollToEnd (float duration) | ||
override void | AddToGUIUpdateList (bool ignoreChildren=false, int order=0) | ||
override void | ForceLayoutRecalculation () | ||
void | RecalculateChildren () | ||
void | SelectNext (Force force=Force.No, AutoScroll autoScroll=AutoScroll.Enabled, TakeKeyBoardFocus takeKeyBoardFocus=TakeKeyBoardFocus.No, PlaySelectSound playSelectSound=PlaySelectSound.No) | ||
void | SelectPrevious (Force force=Force.No, AutoScroll autoScroll=AutoScroll.Enabled, TakeKeyBoardFocus takeKeyBoardFocus=TakeKeyBoardFocus.No, PlaySelectSound playSelectSound=PlaySelectSound.No) | ||
void | Select (int childIndex, Force force=Force.No, AutoScroll autoScroll=AutoScroll.Enabled, TakeKeyBoardFocus takeKeyBoardFocus=TakeKeyBoardFocus.No, PlaySelectSound playSelectSound=PlaySelectSound.No) | ||
void | Select (IEnumerable< GUIComponent > children) | ||
void | Deselect () | ||
void | UpdateScrollBarSize () | ||
override void | ClearChildren () | ||
override void | RemoveChild (GUIComponent child) | ||
override void | DrawChildren (SpriteBatch spriteBatch, bool recursive) | ||
Draws all the children manually. More... | |||
void | ReceiveTextInput (char inputChar) | ||
void | ReceiveTextInput (string text) | ||
void | ReceiveCommandInput (char command) | ||
void | ReceiveEditingInput (string text, int start, int length) | ||
void | ReceiveSpecialInput (Keys key) | ||
Public Member Functions inherited from Barotrauma.GUIComponent | |||
delegate bool | SecondaryButtonDownHandler (GUIComponent component, object userData) | ||
T | GetChild< T > () | ||
T | GetAnyChild< T > () | ||
IEnumerable< T > | GetAllChildren< T > () | ||
IEnumerable< GUIComponent > | GetAllChildren () | ||
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) | ||
GUIComponent | FindChild (Func< GUIComponent, bool > predicate, bool recursive=false) | ||
GUIComponent | FindChild (object userData, bool recursive=false) | ||
IEnumerable< GUIComponent > | FindChildren (object userData) | ||
IEnumerable< GUIComponent > | FindChildren (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... | |||
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 | 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... | |||
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 |
CheckSelectedHandler | CheckSelected |
OnRearrangedHandler | OnRearranged |
SelectMode | CurrentSelectMode = SelectMode.SelectSingle |
bool | HideChildrenOutsideFrame = true |
bool | ResizeContentToMakeSpaceForScrollBar = true |
bool | HideDraggedElement = false |
Public Attributes inherited from Barotrauma.GUIComponent | |
CursorState | HoverCursor = CursorState.Default |
bool | AlwaysOverrideCursor = false |
SecondaryButtonDownHandler | OnSecondaryClicked |
Action< GUIComponent > | OnAddedToGUIUpdateList |
bool | CanBeFocused |
Dictionary< ComponentState, List< UISprite > > | sprites |
SpriteEffects | SpriteEffects |
object | UserData |
bool | ExternalHighlight = false |
Protected Member Functions | |
override void | Update (float deltaTime) |
override void | Draw (SpriteBatch spriteBatch) |
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 | SetAlpha (float a) |
Protected Attributes | |
List< GUIComponent > | selected |
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 |
Properties | |
GUIFrame | ContentBackground [get] |
A frame drawn behind the content of the listbox More... | |
GUIFrame | Content [get] |
A frame that contains the contents of the listbox. The frame itself is not rendered. More... | |
GUIScrollBar | ScrollBar [get] |
bool? | SelectMultiple [get, set] |
bool | AllowMouseWheelScroll = true [get, set] |
bool | AllowArrowKeyScroll = true [get, set] |
bool | SmoothScroll [get, set] |
Scrolls the list smoothly More... | |
bool | ClampScrollToElements [get, set] |
Whether to only allow scrolling from one element to the next when smooth scrolling is enabled More... | |
bool | FadeElements [get, set] |
When set to true elements at the bottom of the list are gradually faded More... | |
bool | PadBottom [get, set] |
Adds enough extra padding to the bottom so the end of the scroll will only contain the last element More... | |
bool | SelectTop [get, set] |
When set to true always selects the topmost item on the list More... | |
bool | UseGridLayout [get, set] |
Vector4 | Padding [get, set] |
GUIComponent | SelectedComponent [get] |
override bool | Selected [get, set] |
IReadOnlyList< GUIComponent > | AllSelected [get] |
object? | SelectedData [get] |
int | SelectedIndex [get] |
float | BarScroll [get, set] |
float | BarSize [get] |
float | TotalSize [get] |
int | Spacing [get, set] |
override Color | Color [get, set] |
bool | ScrollBarEnabled = true [get, set] |
Disables the scroll bar without hiding it. More... | |
bool | KeepSpaceForScrollBar [get, set] |
bool | CanTakeKeyBoardFocus = true [get, set] |
bool | ScrollBarVisible [get, set] |
bool | AutoHideScrollBar = true [get, set] |
Automatically hides the scroll bar when the content fits in. More... | |
DragMode | CurrentDragMode [get, set] |
bool | HasDraggedElementIndexChanged [get] |
GUIComponent | DraggedElement [get, set] |
bool | CanInteractWhenUnfocusable = false [get, set] |
Setting this to true and CanBeFocused to false allows the list background to be unfocusable while the elements can still be interacted with. More... | |
override Rectangle? | MouseRect [get] |
override bool | PlaySoundOnSelect = false [get, set] |
bool | PlaySoundOnDragStop = false [get, set] |
GUISoundType? | SoundOnDragStart = null [get, set] |
GUISoundType? | SoundOnDragStop = null [get, set] |
Properties inherited from Barotrauma.GUIComponent | |
GUIComponent | Parent [get] |
IEnumerable< GUIComponent > | Children [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 | |
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) |
Definition at line 12 of file GUIListBox.cs.
|
strong |
Enumerator | |
---|---|
Enabled | |
Disabled |
Definition at line 329 of file GUIListBox.cs.
|
strong |
Enumerator | |
---|---|
NoDragging | |
DragWithinBox | |
DragOutsideBox |
Definition at line 238 of file GUIListBox.cs.
|
strong |
Enumerator | |
---|---|
Yes | |
No |
Definition at line 323 of file GUIListBox.cs.
|
strong |
Enumerator | |
---|---|
Yes | |
No |
Definition at line 341 of file GUIListBox.cs.
|
strong |
Enumerator | |
---|---|
SelectSingle | |
SelectMultiple | |
RequireShiftToSelectMultiple | |
None |
Definition at line 56 of file GUIListBox.cs.
|
strong |
Enumerator | |
---|---|
Yes | |
No |
Definition at line 335 of file GUIListBox.cs.
Barotrauma.GUIListBox.GUIListBox | ( | RectTransform | rectT, |
bool | isHorizontal = false , |
||
Color? | color = null , |
||
string | style = "" , |
||
bool | isScrollBarOnDefaultSide = true , |
||
bool | useMouseDownToSelect = false |
||
) |
isScrollBarOnDefaultSide | For horizontal listbox, default side is on the bottom. For vertical, it's on the right. |
Definition at line 354 of file GUIListBox.cs.
|
virtual |
Reimplemented from Barotrauma.GUIComponent.
Definition at line 814 of file GUIListBox.cs.
Vector2 Barotrauma.GUIListBox.CalculateTopOffset | ( | ) |
Definition at line 458 of file GUIListBox.cs.
delegate object Barotrauma.GUIListBox.CheckSelectedHandler | ( | ) |
|
virtual |
Reimplemented from Barotrauma.GUIComponent.
Definition at line 1243 of file GUIListBox.cs.
void Barotrauma.GUIListBox.Deselect | ( | ) |
Definition at line 1165 of file GUIListBox.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.GUIComponent.
Definition at line 1264 of file GUIListBox.cs.
|
virtual |
Draws all the children manually.
Reimplemented from Barotrauma.GUIComponent.
Definition at line 1258 of file GUIListBox.cs.
|
virtual |
Reimplemented from Barotrauma.GUIComponent.
Definition at line 874 of file GUIListBox.cs.
delegate void Barotrauma.GUIListBox.OnRearrangedHandler | ( | GUIListBox | listBox, |
object | obj | ||
) |
delegate bool Barotrauma.GUIListBox.OnSelectedHandler | ( | GUIComponent | component, |
object | obj | ||
) |
void Barotrauma.GUIListBox.RecalculateChildren | ( | ) |
Definition at line 881 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ReceiveCommandInput | ( | char | command | ) |
Implements EventInput.IKeyboardSubscriber.
Definition at line 1350 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ReceiveEditingInput | ( | string | text, |
int | start, | ||
int | length | ||
) |
Implements EventInput.IKeyboardSubscriber.
Definition at line 1351 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ReceiveSpecialInput | ( | Keys | key | ) |
Implements EventInput.IKeyboardSubscriber.
Definition at line 1353 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ReceiveTextInput | ( | char | inputChar | ) |
Implements EventInput.IKeyboardSubscriber.
Definition at line 1345 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ReceiveTextInput | ( | string | text | ) |
Implements EventInput.IKeyboardSubscriber.
Definition at line 1349 of file GUIListBox.cs.
|
virtual |
Reimplemented from Barotrauma.GUIComponent.
Definition at line 1249 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ScrollToElement | ( | GUIComponent | component, |
PlaySelectSound | playSelectSound = PlaySelectSound.No |
||
) |
Scrolls the list to the specific element.
component |
Definition at line 559 of file GUIListBox.cs.
void Barotrauma.GUIListBox.ScrollToEnd | ( | float | duration | ) |
Definition at line 592 of file GUIListBox.cs.
void Barotrauma.GUIListBox.Select | ( | IEnumerable< GUIComponent > | children | ) |
Definition at line 1156 of file GUIListBox.cs.
void Barotrauma.GUIListBox.Select | ( | int | childIndex, |
Force | force = Force.No , |
||
AutoScroll | autoScroll = AutoScroll.Enabled , |
||
TakeKeyBoardFocus | takeKeyBoardFocus = TakeKeyBoardFocus.No , |
||
PlaySelectSound | playSelectSound = PlaySelectSound.No |
||
) |
Definition at line 1056 of file GUIListBox.cs.
void Barotrauma.GUIListBox.Select | ( | object | userData, |
Force | force = Force.No , |
||
AutoScroll | autoScroll = AutoScroll.Enabled |
||
) |
Definition at line 440 of file GUIListBox.cs.
void Barotrauma.GUIListBox.SelectNext | ( | Force | force = Force.No , |
AutoScroll | autoScroll = AutoScroll.Enabled , |
||
TakeKeyBoardFocus | takeKeyBoardFocus = TakeKeyBoardFocus.No , |
||
PlaySelectSound | playSelectSound = PlaySelectSound.No |
||
) |
Definition at line 1018 of file GUIListBox.cs.
void Barotrauma.GUIListBox.SelectPrevious | ( | Force | force = Force.No , |
AutoScroll | autoScroll = AutoScroll.Enabled , |
||
TakeKeyBoardFocus | takeKeyBoardFocus = TakeKeyBoardFocus.No , |
||
PlaySelectSound | playSelectSound = PlaySelectSound.No |
||
) |
Definition at line 1037 of file GUIListBox.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.GUIComponent.
Definition at line 904 of file GUIListBox.cs.
void Barotrauma.GUIListBox.UpdateDimensions | ( | ) |
Definition at line 420 of file GUIListBox.cs.
void Barotrauma.GUIListBox.UpdateScrollBarSize | ( | ) |
Definition at line 1175 of file GUIListBox.cs.
CheckSelectedHandler Barotrauma.GUIListBox.CheckSelected |
Definition at line 20 of file GUIListBox.cs.
SelectMode Barotrauma.GUIListBox.CurrentSelectMode = SelectMode.SelectSingle |
Definition at line 64 of file GUIListBox.cs.
bool Barotrauma.GUIListBox.HideChildrenOutsideFrame = true |
Definition at line 75 of file GUIListBox.cs.
bool Barotrauma.GUIListBox.HideDraggedElement = false |
Definition at line 296 of file GUIListBox.cs.
OnRearrangedHandler Barotrauma.GUIListBox.OnRearranged |
Definition at line 23 of file GUIListBox.cs.
OnSelectedHandler Barotrauma.GUIListBox.OnSelected |
Definition at line 17 of file GUIListBox.cs.
bool Barotrauma.GUIListBox.ResizeContentToMakeSpaceForScrollBar = true |
Definition at line 77 of file GUIListBox.cs.
|
protected |
Definition at line 14 of file GUIListBox.cs.
|
getset |
Definition at line 85 of file GUIListBox.cs.
|
getset |
Definition at line 83 of file GUIListBox.cs.
|
get |
Definition at line 159 of file GUIListBox.cs.
|
getset |
Automatically hides the scroll bar when the content fits in.
Definition at line 235 of file GUIListBox.cs.
|
getset |
Definition at line 178 of file GUIListBox.cs.
|
get |
Definition at line 184 of file GUIListBox.cs.
|
getset |
Setting this to true and CanBeFocused to false allows the list background to be unfocusable while the elements can still be interacted with.
Definition at line 303 of file GUIListBox.cs.
|
getset |
Definition at line 216 of file GUIListBox.cs.
|
getset |
Whether to only allow scrolling from one element to the next when smooth scrolling is enabled
Definition at line 95 of file GUIListBox.cs.
|
getset |
Definition at line 196 of file GUIListBox.cs.
|
get |
A frame that contains the contents of the listbox. The frame itself is not rendered.
Definition at line 33 of file GUIListBox.cs.
|
get |
A frame drawn behind the content of the listbox
Definition at line 28 of file GUIListBox.cs.
|
getset |
Definition at line 246 of file GUIListBox.cs.
|
getset |
Definition at line 268 of file GUIListBox.cs.
|
getset |
When set to true elements at the bottom of the list are gradually faded
Definition at line 100 of file GUIListBox.cs.
|
get |
Definition at line 266 of file GUIListBox.cs.
|
getset |
Definition at line 214 of file GUIListBox.cs.
|
get |
Definition at line 305 of file GUIListBox.cs.
|
getset |
Adds enough extra padding to the bottom so the end of the scroll will only contain the last element
Definition at line 105 of file GUIListBox.cs.
|
getset |
Definition at line 130 of file GUIListBox.cs.
|
getset |
Definition at line 316 of file GUIListBox.cs.
|
getset |
Definition at line 314 of file GUIListBox.cs.
|
get |
Definition at line 34 of file GUIListBox.cs.
|
getset |
Disables the scroll bar without hiding it.
Definition at line 213 of file GUIListBox.cs.
|
getset |
Definition at line 218 of file GUIListBox.cs.
|
getset |
Definition at line 153 of file GUIListBox.cs.
|
get |
Definition at line 145 of file GUIListBox.cs.
|
get |
Definition at line 161 of file GUIListBox.cs.
|
get |
Definition at line 169 of file GUIListBox.cs.
|
getset |
Definition at line 66 of file GUIListBox.cs.
|
getset |
When set to true always selects the topmost item on the list
Definition at line 110 of file GUIListBox.cs.
|
getset |
Scrolls the list smoothly
Definition at line 90 of file GUIListBox.cs.
|
getset |
Definition at line 318 of file GUIListBox.cs.
|
getset |
Definition at line 320 of file GUIListBox.cs.
|
getset |
Definition at line 194 of file GUIListBox.cs.
|
get |
Definition at line 189 of file GUIListBox.cs.
|
getset |
Definition at line 112 of file GUIListBox.cs.