diff --git a/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h b/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h index b3c7e0e7d8..e3c923d9d9 100644 --- a/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h +++ b/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h @@ -36,6 +36,8 @@ namespace ImGui::LYImGuiUtils void SetHistogramBinCount(int count) { m_histogramBinCount = count; } + ImGui::LYImGuiUtils::HistogramContainer* FindContainerByName(const char* name); + //! Needs to be public for l-value access for ImGui::MenuItem() bool m_show = true; diff --git a/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp b/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp index 62e8eb7b33..2534475712 100644 --- a/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp +++ b/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp @@ -77,6 +77,17 @@ namespace ImGui::LYImGuiUtils } } } + + ImGui::LYImGuiUtils::HistogramContainer* HistogramGroup::FindContainerByName(const char* name) + { + const auto iterator = m_histogramIndexByName.find(name); + if (iterator != m_histogramIndexByName.end()) + { + return &m_histograms[iterator->second]; + } + + return nullptr; + } } // namespace ImGui::LYImGuiUtils #endif // IMGUI_ENABLED