Skip to content

Commit

Permalink
Don't display in/out/machines if number is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
adepierre committed Sep 20, 2024
1 parent aab674a commit 7e562f8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ficsit-companion/src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,10 @@ void App::RenderLeftPanel()
ImGui::SeparatorText("Machines");
for (auto& [machine, n] : total_machines)
{
if (n.GetNumerator() == 0)
{
continue;
}
// No visible color change when hovered/click
ImGui::PushStyleColor(ImGuiCol_::ImGuiCol_HeaderHovered, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_::ImGuiCol_HeaderActive, ImVec4(0, 0, 0, 0));
Expand Down Expand Up @@ -1233,6 +1237,10 @@ void App::RenderLeftPanel()
ImGui::SeparatorText("Inputs");
for (auto& [item, n] : inputs)
{
if (n.GetNumerator() == 0)
{
continue;
}
if (settings.diff_in_out)
{
if (const auto out_it = outputs.find(item); out_it != outputs.end())
Expand Down Expand Up @@ -1275,6 +1283,10 @@ void App::RenderLeftPanel()
ImGui::SeparatorText("Outputs");
for (auto& [item, n] : outputs)
{
if (n.GetNumerator() == 0)
{
continue;
}
if (settings.diff_in_out)
{
if (const auto in_it = inputs.find(item); in_it != inputs.end())
Expand Down Expand Up @@ -1315,6 +1327,10 @@ void App::RenderLeftPanel()
}
for (auto& [item, n] : intermediates)
{
if (n.GetNumerator() == 0)
{
continue;
}
ImGui::SetNextItemWidth(rate_width);
ImGui::BeginDisabled();
ImGui::InputText("##rate", &n.GetStringFloat(), ImGuiInputTextFlags_ReadOnly);
Expand Down

0 comments on commit 7e562f8

Please sign in to comment.