Enum Option
Introduction
EnumOption
is an option that allows cycling through an enumeration of values. It extends Option<E>
for enum types, providing a user interface for selecting from a predefined set of options.
Details
Supplier Requirement: Retrieves the current enum value.
Consumer Provision: Updates the enum value upon user interaction.
Name Parameter: Labels the option in the HUD.
Values Array: Holds the enumeration of possible values.
Interactivity
Click Response: Left-click cycles forward, right-click cycles backward through the enum values.
Render Behavior: Displays the option's name followed by the current enum value, with visual feedback for the active selection.
Example Usage
Ensure that the getter is synchronized with the setter; otherwise, the option will enter a soft lock, and the value will not update. (Meaning the getter and setter are updating the same variables or referencing the same variable)
Last updated
Was this helpful?