Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY authored Jun 7, 2024
1 parent 7c761c7 commit 88e4761
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/xrGame/player_hud_tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ void CHudTuner::OnFrame()
if (!g_player_hud)
return;

auto CalcColumnCount = [](float columnWidth) -> int {
auto calcColumnCount = [](float columnWidth) -> int
{
float windowWidth = ImGui::GetWindowWidth();
int columnCount = _max(1, static_cast<int>(windowWidth / columnWidth));
return columnCount;
Expand Down Expand Up @@ -189,7 +190,7 @@ void CHudTuner::OnFrame()

ImGui::SliderFloat("Debug Point Size", &debug_point_size, 0.00005f, 1.f, "%.5f");

if (ImGui::BeginTable("Show Debug Widgets", CalcColumnCount(210.f)))
if (ImGui::BeginTable("Show Debug Widgets", calcColumnCount(210.f)))
{
ImGui::TableNextColumn();
if (ImGui::RadioButton("Draw Fire Point", draw_fp)) { draw_fp = !draw_fp; };
Expand Down Expand Up @@ -276,7 +277,7 @@ void CHudTuner::OnFrame()
ImGui::Text("Bone Count = %i", ik->LL_BoneCount());
ImGui::Text("Root Bone = %s, ID: %i", ik->LL_BoneName_dbg(ik->LL_GetBoneRoot()), ik->LL_GetBoneRoot());

if (ImGui::BeginTable("Bone Visibility", CalcColumnCount(125.f)))
if (ImGui::BeginTable("Bone Visibility", calcColumnCount(125.f)))
{
for (const auto& [bone_name, bone_id] : *ik->LL_Bones())
{
Expand All @@ -296,7 +297,7 @@ void CHudTuner::OnFrame()
}

ImGui::NewLine();
if (ImGui::BeginTable("Animations", CalcColumnCount(125.f)))
if (ImGui::BeginTable("Animations", calcColumnCount(125.f)))
{
for (const auto& [anim_name, motion] : current_hud_item->m_hand_motions.m_anims)
{
Expand Down

0 comments on commit 88e4761

Please sign in to comment.