New logging system

This commit is contained in:
2021-09-26 12:21:57 +02:00
parent a53db1e7b4
commit 40a1723544
29 changed files with 590 additions and 132 deletions

View File

@@ -3,7 +3,7 @@
#include <imgui.h>
Imgui::EntityWindow::EntityWindow(const std::vector<ModelEntity *> &entities) : Window("Entities"), m_entites(entities)
Imgui::EntityWindow::EntityWindow(const std::vector<ModelEntity *> entities) : Window("Entities"), m_entites(entities)
{}
void Imgui::EntityWindow::addWidgets()
@@ -11,21 +11,28 @@ void Imgui::EntityWindow::addWidgets()
ImGui::Text("Treelist");
for (const auto &entity : m_entites) {
// addChildWidget(*entity);
addChildWidget(*entity);
}
}
void Imgui::EntityWindow::addChildWidget(const ModelEntity &entity)
{
if (entity.getChildren().empty()) {
ImGui::Indent();
ImGui::Text(entity.getUniqueName().c_str());
ImGui::SameLine();
ImGui::SmallButton("Edit");
ImGui::Unindent();
} else {
if (ImGui::TreeNode(entity.getUniqueName().c_str())) {
bool expanded = ImGui::TreeNode(entity.getUniqueName().c_str());
ImGui::SameLine();
ImGui::SmallButton("Edit");
if (expanded) {
for (const auto &child : entity.getChildren()) {
addChildWidget(*(const ModelEntity *)child);
}
ImGui::TreePop();
ImGui::Separator();
}
}
}