24auto should_use_prefab_inspection(entt::meta_any& selected) ->
bool
26 if(selected.type() != entt::resolve<entt::handle>())
31 auto entity = selected.cast<entt::handle>();
45auto inspect_object_with_prefab_check(
rtti::context& ctx, entt::meta_any&
object) ->
void
47 auto& override_ctx = ctx.get_cached<prefab_override_context>();
48 auto& inspector_ctx = ctx.get_cached<inspector_context>();
50 if(should_use_prefab_inspection(
object))
52 auto entity =
object.cast<entt::handle>();
54 if(override_ctx.begin_prefab_inspection(
entity))
60 override_ctx.end_prefab_inspection();
66 if(
object.
type() == entt::resolve<entt::handle>())
68 auto entity =
object.cast<entt::handle>();
101 auto& selected = em.get_active_selection();
103 if(ImGui::BeginMenuBar())
105 ImGui::PushStyleColor(ImGuiCol_Header, ImGui::GetStyleColorVec4(ImGuiCol_TabSelected));
106 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImGui::GetStyleColorVec4(ImGuiCol_TabSelected));
107 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImGui::GetStyleColorVec4(ImGuiCol_TabSelectedOverline));
109 bool locked = !!locked_object_;
117 locked_object_ = selected;
125 ImGui::SetItemTooltipEx(
"%s",
"Lock/Unlock Inspector");
132 ImGui::SetItemTooltipEx(
"%s",
"Debug View");
134 ImGui::PopStyleColor(3);
144 em.push_undo_stack_enabled(
true);
146 auto selections_count = int(em.get_selections().size());
150 inspect_object_with_prefab_check(ctx, locked_object_);
152 else if(em.get_selections().size() > 1)
154 ImGui::Text(
"%d Items Selected.", selections_count);
158 inspect_object_with_prefab_check(ctx, selected);
166 em.pop_undo_stack_enabled();
static auto get_entity_name(entt::handle entity) -> std::string
Gets the entity name from tag component.
void init(rtti::context &ctx)
void draw_ui(rtti::context &ctx) override
inspector_panel(imgui_panels *parent, const char *name)
void deinit(rtti::context &ctx)
#define ICON_MDI_LOCK_OPEN_VARIANT
auto make_entity_proxy(entt::meta_any &var, const std::string &name) -> meta_any_proxy
Like make_proxy, but for entt::handle roots resolved by id_component UUID each access.
void pop_debug_view()
Pops debug view mode (decreases debug view counter)
void push_debug_view()
Pushes debug view mode (increases debug view counter)
auto inspect_var(rtti::context &ctx, entt::meta_any &var, const meta_any_proxy &var_proxy, const var_info &info, const entt::meta_custom &custom) -> inspect_result
Main entry point for inspecting any variable with automatic type resolution.
auto add(Args &&... args) -> T &
Registry for managing type-specific inspector instances.
Global context for tracking prefab override changes during inspection.