Begin render ContentBrowser.
Skip if no InfoBar Instance.
End render ContentBrowser.
Begin render ContentBrowser.
Skip if no InfoBar Instance.
End render ContentBrowser.
51 {
53
58
59 {
61
62 float width = ImGui::GetContentRegionAvail().x;
63 ImGui::Spacing();
64
69 {
71 return;
72 }
73
74 ImGui::PushID("ImguiInfoBar");
75
77
78 ImGui::Columns(3, 0);
79
80 ImGui::SetColumnWidth(0, 0.5f * width);
81 ImGui::NextColumn();
82
83 ImGui::SetColumnWidth(1, 0.39f * width);
84 ImGui::Text(item->GetInfo().c_str());
85 ImGui::NextColumn();
86
87 switch (item->GetType())
88 {
90 {
91 float rate = std::any_cast<float>(item->GetRate());
92 ImGui::PushStyleColor(ImGuiCol_PlotHistogram, ImVec4(0.310f, 0.49f, 0.627f, 1.0f));
93 ImGui::ProgressBar(rate);
94 ImGui::PopStyleColor();
95 break;
96 }
98 {
99 int count = std::any_cast<int>(item->GetRate());
100 std::stringstream ss;
102
103 ImGui::Text(ss.str().c_str());
104 break;
105 }
106 }
107
108 ImGui::Columns(1);
109
110 ImGui::PopID();
111 }
112
113 {
115
116 if (ImGui::BeginPopupContextWindow(0, 1))
117 {
119
120 if (ImGui::MenuItem(k.c_str()))
121 {
122 m_SelectedInfoBar = v;
123 }
124 return false;
125
126 });
127
128 ImGui::EndPopup();
129 }
130 }
131
136 }
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
scl::linked_unordered_map< std::string, std::shared_ptr< SlateInfoBar > > m_InfoBars
InfoBar instances.
std::shared_ptr< SlateInfoBar > m_SelectedInfoBar
Selected InfoBar.
void Begin(float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate.
std::string m_PanelName
This slate's name.
constexpr int count
Calculate count that meets requirement.