ImGui: Added FindContainerByName() helper (#7313)
Added a helper function to find a container by name in the histogram container. Signed-off-by: Benjamin Jillich <jillich@amazon.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user