Menus#
Create plugin settings UI using the xenon::ImGui namespace. All menu calls go in on_menu().
Structure#
Wrap your widgets in a CollapsingHeader so each plugin gets its own expandable section:
Widgets#
Checkbox#
Toggle a boolean on/off:
Sliders#
Adjust numeric values within a range:
static float fov = 60.f;
ImGui::SliderFloat("FOV", &fov, 10.f, 180.f);
static int32_t thickness = 2;
ImGui::SliderInt("Thickness", &thickness, 1, 10);
Combo (Dropdown)#
Select from a list of options:
Null-separated items
Combo items are a single string with \0 separators — not a C array of strings.
Text Label#
Display static text:
Tooltip#
Show a tooltip on the previous widget:
ImGui::Checkbox("Visible Only", &visibleOnly);
ImGui::Tooltip("Only show enemies not behind walls");
Separator#
Visual divider between sections:
Hotkey#
Let users bind a key:
Complete Example#
static bool g_enabled = true;
static bool g_showHealth = true;
static bool g_visibleOnly = false;
static float g_maxDist = 100.f;
static int32_t g_targetMode = 0;
extern "C" void on_menu()
{
if (ImGui::CollapsingHeader("Enemy ESP"))
{
ImGui::Checkbox("Enabled", &g_enabled);
ImGui::Separator();
ImGui::Checkbox("Show Health Bars", &g_showHealth);
ImGui::Checkbox("Visible Only", &g_visibleOnly);
ImGui::Tooltip("Skip enemies behind walls");
ImGui::SliderFloat("Max Distance", &g_maxDist, 10.f, 200.f);
ImGui::Combo("Target Mode", &g_targetMode, "Closest\0Lowest HP\0");
}
}
Persisting Settings#
Menu state lives in static variables. To persist between sessions, load in on_load and save in on_unload:
extern "C" void on_load()
{
g_enabled = Config::GetBool("enabled", true);
g_maxDist = Config::GetFloat("maxDist", 100.f);
g_targetMode = Config::GetInt("targetMode", 0);
}
extern "C" void on_unload()
{
Config::SetBool("enabled", g_enabled);
Config::SetFloat("maxDist", g_maxDist);
Config::SetInt("targetMode", g_targetMode);
Config::Save();
}
See the Config guide for more details.
See Also#
- ImGui API reference — all widgets with full signatures
- Config guide — persisting settings