From 00c9841ff60cf659e547a9e127b1bb7ba230101b Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Thu, 12 Nov 2020 03:35:01 +0100 Subject: [PATCH] Histogram option for all graphs --- src/hud_elements.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/hud_elements.cpp b/src/hud_elements.cpp index 7e17f523..1dd071a2 100644 --- a/src/hud_elements.cpp +++ b/src/hud_elements.cpp @@ -477,10 +477,18 @@ void HudElements::graphs(){ } ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); ImGui::TableNextRow(); - ImGui::PlotLines("", arr.data(), - arr.size(), 0, - NULL, HUDElements.min, HUDElements.max, - ImVec2(ImGui::GetContentRegionAvailWidth() * 2.5, 50)); + if (!HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_histogram]){ + ImGui::PlotLines("", arr.data(), + arr.size(), 0, + NULL, HUDElements.min, HUDElements.max, + ImVec2(ImGui::GetContentRegionAvailWidth() * 2.5, 50)); + } else { + ImGui::PlotHistogram("", arr.data(), + arr.size(), 0, + NULL, HUDElements.min, HUDElements.max, + ImVec2(ImGui::GetContentRegionAvailWidth() * 2.5, 50)); + } + ImGui::PopStyleColor(1); }