Skip to content

Replace external ImGui entt entity editor with in-engine editor panels - #195

Merged
BenjaFriend merged 1 commit into
mainfrom
editor-component-changes
Aug 17, 2026
Merged

Replace external ImGui entt entity editor with in-engine editor panels#195
BenjaFriend merged 1 commit into
mainfrom
editor-component-changes

Conversation

@BenjaFriend

Copy link
Copy Markdown
Member

Summary

  • Breaks BaseEditor::DrawWorldOutline/component editor out into two re-usable, FlingEditorPanel-derived classes in the Editor module: WorldOutlinePanel (entity list, Add Entity, delete, selection) and EntityEditorPanel (component list, Add/Remove Component, entity rename field).
  • Both are now driven by the engine's own ComponentTypeRegistry (new create/destroy/drawEditorWidget hooks + SetEditorWidget) instead of the vendored imgui_entt_entity_editor library's separate registration scheme.
  • Removes the now-unused external/imgui_entt_entity_editor submodule and its CMake include path.
  • Fixes two crashes found while actually exercising the new UI:
    • ComponentTypeInfo::name pointers dangled after std::vector<std::string> reallocation (ComponentTypeRegistry::AddType); switched the backing storage to std::deque for pointer stability.
    • Selecting a material via the Entity Editor called registry.replace<MeshRenderer>() after already updating the material in place, which constructed a fresh MeshRenderer with a null uniform buffer (only on_construct, not on_replace, reallocates it) and crashed the next render pass. Removed the redundant replace() call.

Test plan

  • cmake -B build && cmake --build build --parallel — clean build, no warnings
  • ./build/FlingTests/bin/FlingTests — 172 assertions / 17 cases pass
  • python3 scripts/check_comment_style.py — passes
  • Manual pass in the Sandbox editor: add/rename/delete entities, add/remove components, pick a model and material on a MeshRenderer

🤖 Generated with Claude Code

World Outline and Entity Editor are now first-party, re-usable
FlingEditorPanel-derived classes in the Editor module, backed by the
existing ComponentTypeRegistry (create/destroy/drawEditorWidget hooks)
instead of the vendored library's own registration scheme. Adds an
entity rename field, an Add Entity button, and drops the now-unused
imgui_entt_entity_editor submodule. Also fixes two crashes surfaced by
actually exercising this UI: a dangling ComponentTypeInfo::name pointer
from std::vector reallocation, and a null MeshRenderer uniform buffer
from an unnecessary registry.replace() call in the material picker.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@BenjaFriend
BenjaFriend merged commit 1466db1 into main Aug 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant