Skip to content

Commit

Permalink
Add imgui_IsItemToggledOpen function
Browse files Browse the repository at this point in the history
  • Loading branch information
dri-richard committed Jun 9, 2024
1 parent dc65c4d commit ee2f748
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions imgui/src/extension_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,15 @@ static int imgui_IsItemHovered(lua_State* L)
return 1;
}

static int imgui_IsItemToggledOpen(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 1);
imgui_NewFrame();
bool toggled_open = ImGui::IsItemToggledOpen();
lua_pushboolean(L, toggled_open);
return 1;
}

static int imgui_GetItemRectMax(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 2);
Expand Down Expand Up @@ -2679,6 +2688,7 @@ static const luaL_reg Module_methods[] =
{"is_item_clicked", imgui_IsItemClicked},
{"is_item_double_clicked", imgui_IsItemDoubleClicked},
{"is_item_hovered", imgui_IsItemHovered},
{"is_item_toggled_open", imgui_IsItemToggledOpen},
{"get_item_rect_max", imgui_GetItemRectMax},
{"is_mouse_clicked", imgui_IsMouseClicked},
{"is_mouse_double_clicked", imgui_IsMouseDoubleClicked},
Expand Down

0 comments on commit ee2f748

Please sign in to comment.