VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::ChoiceRow< T > Struct Template Reference

#include <MenuBuilder.hpp>

Public Member Functions

MenuItem ToItem () const

Public Attributes

std::string Label
std::vector< Labeled< T > > Choices
std::function< void(int slot, const T &value)> Commit
std::optional< ChoiceIndex > Bind
int Index = 0
EnabledCondition Enabled
ChoiceApply Apply = ChoiceApply::AfterStep

Detailed Description

template<class T>
struct VoltMod::ChoiceRow< T >

A labeled choice list. A/D wraps through the values.

Definition at line 89 of file MenuBuilder.hpp.

Member Function Documentation

◆ ToItem()

template<class T>
MenuItem VoltMod::ChoiceRow< T >::ToItem ( ) const
inline

Definition at line 102 of file MenuBuilder.hpp.

References Apply, Bind, VoltMod::Internal::ChoiceItem(), Choices, Commit, Enabled, Index, and Label.

Member Data Documentation

◆ Apply

template<class T>
ChoiceApply VoltMod::ChoiceRow< T >::Apply = ChoiceApply::AfterStep

Definition at line 100 of file MenuBuilder.hpp.

Referenced by ToItem().

◆ Bind

template<class T>
std::optional<ChoiceIndex> VoltMod::ChoiceRow< T >::Bind

Optional external home for the selection; unset keeps it in the row.

Definition at line 96 of file MenuBuilder.hpp.

Referenced by ToItem().

◆ Choices

template<class T>
std::vector<Labeled<T> > VoltMod::ChoiceRow< T >::Choices

Definition at line 92 of file MenuBuilder.hpp.

Referenced by ToItem().

◆ Commit

template<class T>
std::function<void(int slot, const T& value)> VoltMod::ChoiceRow< T >::Commit

Runs on E, or shortly after the last step unless Apply says otherwise.

Definition at line 94 of file MenuBuilder.hpp.

Referenced by ToItem().

◆ Enabled

template<class T>
EnabledCondition VoltMod::ChoiceRow< T >::Enabled

Definition at line 99 of file MenuBuilder.hpp.

Referenced by ToItem().

◆ Index

template<class T>
int VoltMod::ChoiceRow< T >::Index = 0

Where an unbound row starts.

Definition at line 98 of file MenuBuilder.hpp.

Referenced by ToItem().

◆ Label

template<class T>
std::string VoltMod::ChoiceRow< T >::Label

Definition at line 91 of file MenuBuilder.hpp.

Referenced by ToItem().


The documentation for this struct was generated from the following file: