From 9f514924b6adb1d4413fe7911492e17c3992e075 Mon Sep 17 00:00:00 2001 From: kikkin_yo_azzez <69381115+USBMenus@users.noreply.github.com> Date: Mon, 12 Aug 2024 02:34:22 -0500 Subject: [PATCH] feat(Lua): expose imgui separatortext to lua (#3554) --- docs/lua/tables/ImGui.md | 4 ++++ src/lua/bindings/imgui.hpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/docs/lua/tables/ImGui.md b/docs/lua/tables/ImGui.md index 82a1c58b..85515a3e 100644 --- a/docs/lua/tables/ImGui.md +++ b/docs/lua/tables/ImGui.md @@ -331,6 +331,10 @@ You can find all the supported functions and overloads below. -- ImGui.Separator() ImGui.Separator + -- ImGui.SeparatorText(...) + -- Parameters: text (text) + ImGui.SeparatorText("some text") + -- ImGui.SameLine(...) -- Parameters: float (offset_from_start_x) [O], float (spacing) [O] -- Overloads diff --git a/src/lua/bindings/imgui.hpp b/src/lua/bindings/imgui.hpp index 92cb52b2..6e35bb76 100644 --- a/src/lua/bindings/imgui.hpp +++ b/src/lua/bindings/imgui.hpp @@ -1,4 +1,5 @@ #pragma once +#include "imgui.h" namespace lua::imgui { @@ -417,6 +418,10 @@ namespace lua::imgui { ImGui::Separator(); } + inline void SeparatorText(const char* label) + { + ImGui::SeparatorText(label); + } inline void SameLine() { ImGui::SameLine(); @@ -3338,6 +3343,7 @@ namespace lua::imgui #pragma region Cursor / Layout ImGui.set_function("Separator", Separator); + ImGui.set_function("SeparatorText", SeparatorText); ImGui.set_function("SameLine", sol::overload(sol::resolve(SameLine), sol::resolve(SameLine))); ImGui.set_function("NewLine", NewLine); ImGui.set_function("Spacing", Spacing);