Skip to content

Commit

Permalink
Lua: add size argument to imgui.button
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Apr 3, 2024
1 parent fedb985 commit 7a7c912
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mods/bindings/ImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ ImVec4 create_imvec4(sol::object obj) {
return out;
};

bool button(const char* label) {
bool button(const char* label, sol::object size_object) {
if (label == nullptr) {
label = "";
}

return ImGui::Button(label);
const auto size = create_imvec2(size_object);

return ImGui::Button(label, size);
}

bool small_button(const char* label) {
Expand Down

0 comments on commit 7a7c912

Please sign in to comment.