Table of Contents

Class ControlCategory

Namespace
RichHudFramework.UI.Client
Assembly
RichHudClient.dll

Represents a horizontally scrolling row of ControlTiles within a ControlPage in the RichHudTerminal.

public class ControlCategory : IEnumerable<ControlTile>, IEnumerable
Inheritance
ControlCategory
Implements

Examples

new ControlCategory()
{
    HeaderText = "ControlCategory",
    SubheaderText = "Contains terminal controls grouped into ControlTiles",
    TileContainer =
    {
        new ControlTile()
        {
            new TerminalOnOffButton()
            {
                Name = "TerminalOnOffButton",
                ControlChangedHandler = (obj, args) =>
                {
                    var toggle = obj as TerminalOnOffButton;
                    ExceptionHandler.SendChatMessage($"{toggle.Name} = {toggle.Value}");
                },
                ToolTip = "Alternative to checkbox. Functionally identical."
            },
            new TerminalSlider()
            {
                Name = "TerminalSlider",
                ValueText = "0",
                Min = 0f, Max = 100f, Value = 0f,
                ControlChangedHandler = (obj, args) =>
                {
                    var slider = obj as TerminalSlider;
                    slider.ValueText = $"{slider.Value:G4}";
                    ExceptionHandler.SendChatMessage($"Slider value changed: {slider.Value:G3}");
                },
                ToolTip = "Slider based on 32-bit float value with customizable value text."
            },
        },
    }
}

Constructors

ControlCategory()

public ControlCategory()

Properties

Enabled

Determines whether or not the category will be drawn in the menu.

public bool Enabled { get; set; }

Property Value

bool

HeaderText

The primary header text displayed above the category.

public string HeaderText { get; set; }

Property Value

string

ID

Unique identifier used by the Framework API.

public object ID { get; }

Property Value

object

SubheaderText

The secondary description/subheader text displayed below the header.

public string SubheaderText { get; set; }

Property Value

string

TileContainer

Nested collection initializer utility property

public IControlCategory TileContainer { get; }

Property Value

IControlCategory

Tiles

Read-only collection of ControlTiles assigned to this category.

public IReadOnlyList<ControlTile> Tiles { get; }

Property Value

IReadOnlyList<ControlTile>

Methods

Add(ControlTile)

Adds a ControlTile to the category.

public void Add(ControlTile tile)

Parameters

tile ControlTile

Explicit Interface Implementations

IEnumerable<ControlTile>.GetEnumerator()

Returns an enumerator that iterates through the collection.

IEnumerator<ControlTile> IEnumerable<ControlTile>.GetEnumerator()

Returns

IEnumerator<ControlTile>

An enumerator that can be used to iterate through the collection.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

An IEnumerator object that can be used to iterate through the collection.