ImGui#
Defined in ImGui.hpp. Menu widgets for plugin settings. Call these from on_menu().
All functions are in the xenon::ImGui namespace. These are thin wrappers around the host's menu system, not the full Dear ImGui library.
CollapsingHeader#
Creates a collapsible section. Returns true when expanded.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Header text |
if (ImGui::CollapsingHeader("My Settings"))
{
// Widgets here only show when expanded
ImGui::Checkbox("Enabled", &enabled);
}
Tip
Always wrap your menu widgets inside a CollapsingHeader. This keeps the plugin list organized.
Checkbox#
Displays a checkbox. Modifies *value when toggled. Returns true if the value changed.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Checkbox label |
value |
bool* |
Pointer to the boolean state |
SliderFloat#
Float slider. Returns true if the value changed.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Slider label |
value |
float* |
Pointer to the float value |
min |
float |
Minimum value |
max |
float |
Maximum value |
SliderInt#
Integer slider. Returns true if the value changed.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Slider label |
value |
int32_t* |
Pointer to the integer value |
min |
int32_t |
Minimum value |
max |
int32_t |
Maximum value |
Combo#
Dropdown selector. Returns true if the selection changed.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Combo label |
currentItem |
int32_t* |
Pointer to the selected index (0-based) |
items |
const char* |
Null-separated item list |
Items must be null-separated
The items string uses null bytes (\0) as separators, not commas or newlines. This is different from a C array of strings.
Text#
Displays a static text label.
| Parameter | Type | Description |
|---|---|---|
text |
const char* |
The text to display |
Tooltip#
Shows a tooltip on the previously drawn widget when hovered.
| Parameter | Type | Description |
|---|---|---|
text |
const char* |
Tooltip text |
ImGui::Checkbox("Visible Only", &visibleOnly);
ImGui::Tooltip("Only show enemies that are not behind walls");
Separator#
Draws a horizontal line to visually separate sections.
ImGui::Checkbox("Option A", &a);
ImGui::Checkbox("Option B", &b);
ImGui::Separator();
ImGui::SliderFloat("Range", &range, 0.f, 100.f);
Hotkey#
Hotkey binding widget. The user clicks the widget and presses a key to bind it. Returns true if the binding changed.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Widget label |
value |
uint32_t* |
Pointer to the virtual key code |
static uint32_t toggleKey = VK::Insert;
ImGui::Hotkey("Toggle Key", &toggleKey);
// Then in on_frame:
if (IsKeyDown(toggleKey))
enabled = !enabled;
ColorSliders#
Displays 4 integer sliders (R, G, B, A) for editing a Color. Returns true if any channel changed.
| Parameter | Type | Description |
|---|---|---|
label |
const char* |
Base label (suffixed with " R", " G", " B", " A") |
color |
Color* |
Pointer to the color to edit |
This replaces the common pattern of declaring 4 separate int32_t variables and 4 SliderInt calls.