Class Selection
Selection cyclic renderer
Inheritance
Inherited Members
Namespace
Syntax
public class Selection : GraphicalCyclicWriter
Constructors
Selection()
Makes a new selection instance
Declaration
public Selection()
Selection(InputChoiceCategoryInfo[])
Makes a new selection instance
Declaration
public Selection(InputChoiceCategoryInfo[] categories)
Parameters
| Name | Type | Description |
|---|---|---|
| categories | InputChoiceCategoryInfo[] | Categories |
Selection(InputChoiceGroupInfo[])
Makes a new selection instance
Declaration
public Selection(InputChoiceGroupInfo[] groups)
Parameters
| Name | Type | Description |
|---|---|---|
| groups | InputChoiceGroupInfo[] | Groups |
Selection(InputChoiceInfo[])
Makes a new selection instance
Declaration
public Selection(InputChoiceInfo[] choices)
Parameters
| Name | Type | Description |
|---|---|---|
| choices | InputChoiceInfo[] | Choices |
Properties
AltBackgroundColor
Alternative option background color
Property Value
Declaration
public Color AltBackgroundColor { get; }
AltChoicePos
Alternative choice position (one-based)
Property Value
Declaration
public int AltChoicePos { get; set; }
AltForegroundColor
Alternative option foreground color
Property Value
Declaration
public Color AltForegroundColor { get; }
AltSelectedBackgroundColor
Selected alternative option background color
Property Value
Declaration
public Color AltSelectedBackgroundColor { get; }
AltSelectedForegroundColor
Selected alternative option foreground color
Property Value
Declaration
public Color AltSelectedForegroundColor { get; }
BackgroundColor
Option background color
Property Value
Declaration
public Color BackgroundColor { get; }
CurrentSelection
Current selection (zero-based)
Remarks
Use this property only if either CurrentSelections is not null or if ShowRadioButtons is not true. Otherwise, rely on the value of SelectedChoice
Property Value
Declaration
public int CurrentSelection { get; set; }
CurrentSelections
Current selections (null for single selection)
Property Value
Declaration
public int[]? CurrentSelections { get; set; }
DisabledBackgroundColor
Disabled option background color
Property Value
Declaration
public Color DisabledBackgroundColor { get; }
DisabledForegroundColor
Disabled option foreground color
Property Value
Declaration
public Color DisabledForegroundColor { get; }
Ellipsis
Whether to use ellipsis for selection entries or not
Property Value
Declaration
public bool Ellipsis { get; set; }
ForegroundColor
Option foreground color
Property Value
Declaration
public Color ForegroundColor { get; }
SelectedBackgroundColor
Selected option background color
Property Value
Declaration
public Color SelectedBackgroundColor { get; }
SelectedChoice
Selected choice (zero-based, -1 if ShowRadioButtons is not true or if CurrentSelections is not null)
Remarks
Use this property only if CurrentSelections is null and ShowRadioButtons is true. Otherwise, rely on the value of CurrentSelection
Property Value
Declaration
public int SelectedChoice { get; set; }
SelectedForegroundColor
Selected option foreground color
Property Value
Declaration
public Color SelectedForegroundColor { get; }
Selections
List of selection categories
Property Value
Declaration
public InputChoiceCategoryInfo[] Selections { get; set; }
Settings
Selection style settings
Property Value
Declaration
public SelectionStyleSettings Settings { get; set; }
ShowRadioButtons
Whether to show the radio buttons or not (ignored when CurrentSelections is not null)
Property Value
Declaration
public bool ShowRadioButtons { get; set; }
SliderColor
Slider foreground color
Property Value
Declaration
public Color SliderColor { get; }
SwapSelectedColors
Whether to swap the selected colors or not
Property Value
Declaration
public bool SwapSelectedColors { get; set; }
UseColors
Whether to use colors or not
Property Value
Declaration
public bool UseColors { get; set; }
Width
Element width
Property Value
Declaration
public override int Width { get; set; }
Overrides
Methods
CanGenerateSelectionHitbox(int, int, out (PointerHitbox hitbox, ChoiceHitboxType type, int related))
Checks to see whether the generation of the selection hitboxes is possible
Returns
True if generation is possible; false otherwise
Declaration
public bool CanGenerateSelectionHitbox(int selectionIdx, int hitboxIdx, out (PointerHitbox hitbox, ChoiceHitboxType type, int related) hitbox)
Parameters
| Name | Type | Description |
|---|---|---|
| selectionIdx | int | Selection index from all choices |
| hitboxIdx | int | Hitbox index |
| hitbox | (PointerHitbox hitbox, ChoiceHitboxType type, int related) | Pointer hitbox instances that are built for each selection |
CanGenerateSelectionHitbox(int, out (PointerHitbox hitbox, ChoiceHitboxType type, int related))
Checks to see whether the generation of the selection hitboxes is possible
Returns
True if generation is possible; false otherwise
Declaration
public bool CanGenerateSelectionHitbox(int hitboxIdx, out (PointerHitbox hitbox, ChoiceHitboxType type, int related) hitbox)
Parameters
| Name | Type | Description |
|---|---|---|
| hitboxIdx | int | Hitbox index |
| hitbox | (PointerHitbox hitbox, ChoiceHitboxType type, int related) | Pointer hitbox instances that are built for each selection |
GenerateSelectionHitbox(int)
Generates the selection hitboxes
Returns
Pointer hitbox instances that are built for each selection
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related) GenerateSelectionHitbox(int hitboxIdx)
Parameters
| Name | Type | Description |
|---|---|---|
| hitboxIdx | int | Hitbox index |
GenerateSelectionHitbox(int, int)
Generates the selection hitboxes
Returns
Pointer hitbox instances that are built for each selection
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related) GenerateSelectionHitbox(int selectionIdx, int hitboxIdx)
Parameters
| Name | Type | Description |
|---|---|---|
| selectionIdx | int | Selection index from all choices |
| hitboxIdx | int | Hitbox index |
GenerateSelectionHitboxes()
Generates the selection hitboxes
Returns
Pointer hitbox instances that are built for each selection
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related)[] GenerateSelectionHitboxes()
GenerateSelectionHitboxes(int)
Generates the selection hitboxes
Returns
Pointer hitbox instances that are built for each selection
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related)[] GenerateSelectionHitboxes(int selectionIdx)
Parameters
| Name | Type | Description |
|---|---|---|
| selectionIdx | int | Selection index from all choices |
GetHitboxIndex()
Gets the hitbox index from the selection index
Returns
Hitbox index that represents the selection index
Declaration
public int GetHitboxIndex()
GetHitboxIndex(int)
Gets the hitbox index from the selection index
Returns
Hitbox index that represents the selection index
Declaration
public int GetHitboxIndex(int selectionIdx)
Parameters
| Name | Type | Description |
|---|---|---|
| selectionIdx | int | Selection index from all choices |
InvalidateCache()
Forces refresh
Declaration
public void InvalidateCache()
Render()
Renders a selection
Returns
A string representation of the selection
Declaration
public override string Render()