Skip to content

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:

extern "C" void on_menu()
{
    if (ImGui::CollapsingHeader("My Plugin"))
    {
        // Widgets here
    }
}

Widgets#

Checkbox#

Toggle a boolean on/off:

static bool enabled = true;
ImGui::Checkbox("Enabled", &enabled);

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:

static int32_t mode = 0;
ImGui::Combo("Target", &mode, "Head\0Body\0Nearest\0");

Null-separated items

Combo items are a single string with \0 separators — not a C array of strings.

// CORRECT:
ImGui::Combo("Mode", &mode, "Option A\0Option B\0");

// WRONG:
const char* items[] = {"A", "B"};
ImGui::Combo("Mode", &mode, items, 2);  // Not supported!

Text Label#

Display static text:

ImGui::Text("Version 1.0");

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:

ImGui::Checkbox("Option A", &a);
ImGui::Separator();
ImGui::Checkbox("Option B", &b);

Hotkey#

Let users bind a key:

static uint32_t toggleKey = VK::Insert;
ImGui::Hotkey("Toggle Key", &toggleKey);

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#