Skip to content

Commit

Permalink
Merge pull request #611 from Nats-ji/imgui1.84.2
Browse files Browse the repository at this point in the history
imgui 1.84.2
  • Loading branch information
Yamashi authored Sep 9, 2021
2 parents 8640e32 + 26f308f commit 24e20d0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/sol_imgui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,16 @@ selected, activated = ImGui.MenuItem("Label", "ALT+F4", selected, true)
ImGui.SetTabItemClosed("MyDockedWindow")
```

## Disabling
```lua
-- ImGui.BeginDisabled()
-- ImGui.BeginDisabled(disabled) -- bool: disabled
-- ImGui.EndDisabled()
ImGui.BeginDisabled()
ImGui.BeginDisabled(false)
ImGui.EndDisabled()
```

## Clipping
```lua
-- ImGui.PushClipRect(...)
Expand Down
28 changes: 23 additions & 5 deletions src/sol_imgui/sol_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,11 @@ namespace sol_ImGui
// Drag and Drop
// TODO: Drag and Drop ==> UNSUPPORTED

// Disabling
inline void BeginDisabled() { ImGui::BeginDisabled(); }
inline void BeginDisabled(bool disabled) { ImGui::BeginDisabled(disabled); }
inline void EndDisabled() { ImGui::EndDisabled(); }

// Clipping
inline void PushClipRect(float min_x, float min_y, float max_x, float max_y, bool intersect_current) { ImGui::PushClipRect({ min_x, min_y }, { max_x, max_y }, intersect_current); }
inline void PopClipRect() { ImGui::PopClipRect(); }
Expand Down Expand Up @@ -1748,6 +1753,7 @@ namespace sol_ImGui

lua.new_usertype<ImGuiStyle>("ImGuiStyle",
"Alpha" , &ImGuiStyle::Alpha,
"DisabledAlpha" , &ImGuiStyle::DisabledAlpha,
"WindowPadding" , &ImGuiStyle::WindowPadding,
"WindowRounding" , &ImGuiStyle::WindowRounding,
"WindowBorderSize" , &ImGuiStyle::WindowBorderSize,
Expand Down Expand Up @@ -1925,6 +1931,7 @@ namespace sol_ImGui
#pragma region Style
lua.new_enum("ImGuiStyleVar",
"Alpha" , ImGuiStyleVar_Alpha,
"DisabledAlpha" , ImGuiStyleVar_DisabledAlpha,
"WindowPadding" , ImGuiStyleVar_WindowPadding,
"WindowRounding" , ImGuiStyleVar_WindowRounding,
"WindowBorderSize" , ImGuiStyleVar_WindowBorderSize,
Expand Down Expand Up @@ -2041,12 +2048,12 @@ namespace sol_ImGui
"InputRGB" , ImGuiColorEditFlags_InputRGB,
"InputHSV" , ImGuiColorEditFlags_InputHSV,

"_OptionsDefault" , ImGuiColorEditFlags__OptionsDefault,
"_OptionsDefault" , ImGuiColorEditFlags_DefaultOptions_,

"_DisplayMask" , ImGuiColorEditFlags__DisplayMask,
"_DataTypeMask" , ImGuiColorEditFlags__DataTypeMask,
"_PickerMask" , ImGuiColorEditFlags__PickerMask,
"_InputMask" , ImGuiColorEditFlags__InputMask
"_DisplayMask" , ImGuiColorEditFlags_DisplayMask_,
"_DataTypeMask" , ImGuiColorEditFlags_DataTypeMask_,
"_PickerMask" , ImGuiColorEditFlags_PickerMask_,
"_InputMask" , ImGuiColorEditFlags_InputMask_
);
#pragma endregion ColorEdit Flags

Expand Down Expand Up @@ -2152,6 +2159,7 @@ namespace sol_ImGui
lua.new_enum("ImGuiTableColumnFlags",
// Input configuration flags
"None" , ImGuiTableColumnFlags_None,
"Disabled" , ImGuiTableColumnFlags_Disabled,
"DefaultHide" , ImGuiTableColumnFlags_DefaultHide,
"DefaultSort" , ImGuiTableColumnFlags_DefaultSort,
"WidthStretch" , ImGuiTableColumnFlags_WidthStretch,
Expand All @@ -2163,6 +2171,7 @@ namespace sol_ImGui
"NoSort" , ImGuiTableColumnFlags_NoSort,
"NoSortAscending" , ImGuiTableColumnFlags_NoSortAscending,
"NoSortDescending" , ImGuiTableColumnFlags_NoSortDescending,
"NoHeaderLabel" , ImGuiTableColumnFlags_NoHeaderLabel,
"NoHeaderWidth" , ImGuiTableColumnFlags_NoHeaderWidth,
"PreferSortAscending" , ImGuiTableColumnFlags_PreferSortAscending,
"PreferSortDescending" , ImGuiTableColumnFlags_PreferSortDescending,
Expand Down Expand Up @@ -2944,6 +2953,15 @@ namespace sol_ImGui
ImGui.set_function("SetTabItemClosed" , SetTabItemClosed);
#pragma endregion Tab Bars, Tabs

#pragma region Disabling
ImGui.set_function("BeginDisabled" , sol::overload(
sol::resolve<void()>(BeginDisabled),
sol::resolve<void(bool)>(BeginDisabled)
));
ImGui.set_function("EndDisabled" , EndDisabled);

#pragma endregion Disabling

#pragma region Clipping
ImGui.set_function("PushClipRect" , PushClipRect);
ImGui.set_function("PopClipRect" , PopClipRect);
Expand Down
2 changes: 1 addition & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set_xmakever("2.5.3")
set_languages("cxx20")
set_arch("x64")

add_requires("spdlog", "nlohmann_json", "hopscotch-map", "minhook", "mem", "imgui 1.83", "sol2", "tiltedcore 0.2.3", "sqlite3", "luajit")
add_requires("spdlog", "nlohmann_json", "hopscotch-map", "minhook", "mem", "imgui 1.84.2", "sol2", "tiltedcore 0.2.3", "sqlite3", "luajit")
add_requireconfs("sol2", { configs = { includes_lua = false } })
add_requireconfs("luajit", { configs = { gc64 = true } })

Expand Down

0 comments on commit 24e20d0

Please sign in to comment.