2026-01-21 23:26:33 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-01-31 11:13:15 -05:00
|
|
|
// ImGuiSceneExplorer - excluded from headless and SDL2 builds (ImGui-SFML only)
|
|
|
|
|
#if !defined(MCRF_HEADLESS) && !defined(MCRF_SDL2)
|
2026-01-30 23:09:07 -05:00
|
|
|
|
2026-01-21 23:26:33 -05:00
|
|
|
#include <string>
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
class GameEngine;
|
|
|
|
|
class UIDrawable;
|
|
|
|
|
class UIEntity;
|
|
|
|
|
class UIFrame;
|
|
|
|
|
class UIGrid;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief ImGui-based scene tree explorer for debugging
|
|
|
|
|
*
|
|
|
|
|
* Displays hierarchical view of all scenes and their UI elements.
|
|
|
|
|
* Allows switching between scenes and collapsing/expanding the tree.
|
|
|
|
|
* Activated by F4 key. Mutually exclusive with the console (grave key).
|
|
|
|
|
*/
|
|
|
|
|
class ImGuiSceneExplorer {
|
|
|
|
|
public:
|
|
|
|
|
ImGuiSceneExplorer() = default;
|
|
|
|
|
|
|
|
|
|
// Core functionality
|
|
|
|
|
void render(GameEngine& engine);
|
|
|
|
|
void toggle();
|
|
|
|
|
bool isVisible() const { return visible; }
|
|
|
|
|
void setVisible(bool v) { visible = v; }
|
|
|
|
|
|
|
|
|
|
// Configuration - uses same enabled flag as console
|
|
|
|
|
static bool isEnabled();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool visible = false;
|
|
|
|
|
|
|
|
|
|
// Tree rendering helpers
|
|
|
|
|
void renderSceneNode(GameEngine& engine, const std::string& sceneName, bool isActive);
|
|
|
|
|
void renderDrawableNode(std::shared_ptr<UIDrawable> drawable, int depth = 0);
|
|
|
|
|
void renderEntityNode(std::shared_ptr<UIEntity> entity);
|
|
|
|
|
|
|
|
|
|
// Get display name for a drawable (name or type + address)
|
|
|
|
|
std::string getDisplayName(UIDrawable* drawable);
|
|
|
|
|
std::string getEntityDisplayName(UIEntity* entity);
|
|
|
|
|
|
|
|
|
|
// Get type name string
|
|
|
|
|
const char* getTypeName(UIDrawable* drawable);
|
|
|
|
|
};
|
2026-01-30 23:09:07 -05:00
|
|
|
|
|
|
|
|
#endif // MCRF_HEADLESS
|