styyx-util 1.0
Utility Header for SKSE Plugin development
Loading...
Searching...
No Matches
StyyxUtil::UIUtil Struct Reference

#include <st-ui.h>

Static Public Member Functions

static void HelpMarker (const char *desc)
 Draw a ? that pops up some help text in SKSE Menu Framework.
template<class T>
static bool SettingSlider (const char *a_label, T &a_sliderVariable, const T &a_sliderMin, const T &a_sliderMax, const char *a_sliderFormat, const char *a_helpText, const float a_sliderWidth=200.0f, const std::function< void(T)> &a_onSliderChanged=nullptr)
 Template to easily set up a slider with help text and have it optionally run a function if the slider changed.
static bool SetCheckbox (const char *a_label, bool &a_settingVariable, const char *a_helpText, const std::function< void(bool)> &a_onCheckbox=nullptr)

Member Function Documentation

◆ HelpMarker()

void StyyxUtil::UIUtil::HelpMarker ( const char * desc)
inlinestatic

Draw a ? that pops up some help text in SKSE Menu Framework.

Parameters
descHelp text that should be shown
Note
Credits to: QTR-Modding
Here is the caller graph for this function:

◆ SetCheckbox()

bool StyyxUtil::UIUtil::SetCheckbox ( const char * a_label,
bool & a_settingVariable,
const char * a_helpText,
const std::function< void(bool)> & a_onCheckbox = nullptr )
inlinestatic
Here is the call graph for this function:

◆ SettingSlider()

template<class T>
bool StyyxUtil::UIUtil::SettingSlider ( const char * a_label,
T & a_sliderVariable,
const T & a_sliderMin,
const T & a_sliderMax,
const char * a_sliderFormat,
const char * a_helpText,
const float a_sliderWidth = 200.0f,
const std::function< void(T)> & a_onSliderChanged = nullptr )
inlinestatic

Template to easily set up a slider with help text and have it optionally run a function if the slider changed.

Template Parameters
TAny numeric type
Parameters
a_labelName of the slider (visible)
a_sliderVariableVariable of the slider to change
a_sliderMinMinimum value of the slider
a_sliderMaxMaximum value of the slider
a_sliderFormatFormatting for the slider
a_helpTextHelp text that's shown
a_sliderWidthSlider width. Default = 200.0
a_onSliderChangedFunction to run when the slider changed
Returns
True if slider changed
Note
Example. This Gives you a float slider with 2 decimals and changes a REX::TOML::F32 setting if the slider changes
SettingSlider("ManipToml", m_TempFloat, 0.0f, 100.0f, "%.2f", "This slider will change a toml setting", 300.0f, [&](float var){mySetting.SetValue(var);});
static bool SettingSlider(const char *a_label, T &a_sliderVariable, const T &a_sliderMin, const T &a_sliderMax, const char *a_sliderFormat, const char *a_helpText, const float a_sliderWidth=200.0f, const std::function< void(T)> &a_onSliderChanged=nullptr)
Template to easily set up a slider with help text and have it optionally run a function if the slider...
Definition st-ui.h:42
Here is the call graph for this function:

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