Skip to content

Commit

Permalink
Disable ImGui callbacks when not using ImGui
Browse files Browse the repository at this point in the history
  • Loading branch information
lipsanen committed Nov 9, 2024
1 parent 52e4113 commit 5932b31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spt/features/visualizations/imgui/imgui_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,8 @@ void SptImGui::RegisterHudCvarCheckbox(ConVar& var)

void SptImGui::RegisterHudCvarCallback(ConVar& var, const SptImGuiHudTextCallback& cb, bool putInCollapsible)
{
if (!Loaded())
return;
Assert(cb);
auto emp = SptImGuiFeature::hudCvars.emplace(var, cb, putInCollapsible);
AssertMsg(emp.second, "each hud cvar should not be registered more than once to imgui");
Expand Down

0 comments on commit 5932b31

Please sign in to comment.