Lua Editor Part 2#67
Merged
Merged
Conversation
Move AssetBrowser, CameraEditor, Hierarchy, Inspector and MapEditor to be Luau based editors using the new system
Especially making the Canvas based Hierarchy window faster
Remove AssetBrowser, Hierarchy, Inspector and MapSelector from C++ based editor
There was a problem hiding this comment.
Pull request overview
Ports multiple editor UI tools from C++/ImGui to Luau-driven widgets rendered via CanvasRenderer, and introduces supporting engine-side APIs for GPU-composed UI transforms, clipping/masking, and new Lua-facing handler tables (Map/Camera/Time/Editor/Scene/Asset).
Changes:
- Replace ImGui-based editor windows (Map selector, Hierarchy, Camera Info, etc.) with Luau implementations and register them in the dev top bar.
- Add GPU-side UI transform chaining + indexed clip/mask buffers (shader + renderer + ECS/UI plumbing) to reduce CPU propagation work.
- Introduce new Lua handlers (Map/Time/Camera/Editor/Scene/Asset) and update scripts to use the new APIs.
Reviewed changes
Copilot reviewed 83 out of 83 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/Shaders/Shaders/UI/Widget.vs.slang | Adds GPU parent-chain matrix composition for 2D widgets. |
| Source/Shaders/Shaders/UI/Widget.ps.slang | Switches clipping/masking to indexed clip-rect + mask-info buffers. |
| Source/Resources/Scripts/UI/Chat.luau | Adjusts InputBox anchoring usage. |
| Source/Resources/Scripts/Types.def | Replaces global map functions with a typed Map API surface. |
| Source/Resources/Scripts/Editor/MapEditor.luau | New Luau Map editor window (list/filter/actions + context menu). |
| Source/Resources/Scripts/Editor/Hierarchy.luau | New Luau Hierarchy window using VirtualList + shared selection module. |
| Source/Resources/Scripts/Editor/DevTopBar.luau | Adds menu entries to toggle new Luau editor windows. |
| Source/Resources/Scripts/Editor/CameraEditor.luau | New Luau Camera Info window (sections + saves list + context menu). |
| Source/Resources/Scripts/API/UI/VirtualList.luau | New virtualized fixed-row list built on ScrollBox. |
| Source/Resources/Scripts/API/UI/ScrollBox.luau | Adds SetOnScroll and scrollbar-drag scrolling callbacks for virtualization. |
| Source/Resources/Scripts/API/UI/LoadingScreen.luau | Updates map-loading progress call site to Map.GetLoadingProgress(). |
| Source/Resources/Scripts/API/UI/InputBox.luau | Adds SetOnTextChanged + fires change events on edits; refactors widget structure. |
| Source/Resources/Scripts/API/UI/EditorSelection.luau | New Lua fan-out selection helper bridging to dev-only Editor handler callbacks. |
| Source/Resources/Scripts/API/UI/DragInput.luau | New numeric drag-scrub input built atop InputBox. |
| Source/Resources/Scripts/API/UI/ContextMenu.luau | New right-click context menu widget with click-outside shield. |
| Source/Resources/Scripts/API/UI/Collapsible.luau | New collapsible section widget for editor window layouts. |
| Source/Resources/Scripts/API/UI/ActionBar.luau | Adjusts spell icon handling (currently disables icons). |
| Source/Game-Lib/Game-Lib/Util/PhysicsUtil.h | Declares CastRayWorld helper. |
| Source/Game-Lib/Game-Lib/Util/PhysicsUtil.cpp | Implements CastRayWorld using Jolt NarrowPhaseQuery + optional body ignore. |
| Source/Game-Lib/Game-Lib/Scripting/UI/Widget.cpp | Avoid redundant dirtying; adds clip/mask slot reserve/release hooks. |
| Source/Game-Lib/Game-Lib/Scripting/UI/Text.cpp | Avoid redundant text refresh; limits clipper refresh to clip sources. |
| Source/Game-Lib/Game-Lib/Scripting/UI/Panel.cpp | Marks correct dirty components when size/color/alpha change. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/UIHandler.h | Removes old Time API exposure from UIHandler. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/UIHandler.cpp | Removes old Time table registration logic. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/TimeHandler.h | New dedicated Time Lua handler API. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/TimeHandler.cpp | Implements Time Lua handler + second-changed callback. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/SceneHandler.h | New Scene Lua handler API for editor tooling (entity queries + component access). |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/MapHandler.h | New Map Lua handler API (list/load/unload/progress/current-map callback). |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/MapHandler.cpp | Implements Map Lua handler, map list generation, load/unload, callback wiring. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/GlobalHandler.h | Removes legacy global map functions. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/GlobalHandler.cpp | Removes legacy global map implementations. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/EditorToolHandler.h | New Editor Lua handler API (selection, picking, gizmo, debug draw toggles). |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/EditorToolHandler.cpp | Implements Editor handler: selection routing + callback refs + gizmo state. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/CameraHandler.h | New Camera Lua handler API (transform info, saves, callbacks). |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/CameraHandler.cpp | Implements Camera handler + startup-save apply + callbacks. |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/AssetHandler.h | New Asset Lua handler API (filesystem listing + model spawn/drag-spawn). |
| Source/Game-Lib/Game-Lib/Scripting/Handlers/AssetHandler.cpp | Implements asset listing + model spawn + drag-spawn request staging. |
| Source/Game-Lib/Game-Lib/Rendering/Terrain/TerrainLoader.cpp | Adds current-map-changed Lua notification; clears editor selection on unload. |
| Source/Game-Lib/Game-Lib/Rendering/Model/ModelLoader.h | Adds API to query Jolt body id by instance id. |
| Source/Game-Lib/Game-Lib/Rendering/Model/ModelLoader.cpp | Implements GetBodyIDFromInstanceID. |
| Source/Game-Lib/Game-Lib/Rendering/GameRenderer.cpp | Reorders debug renderer update and unlocks uploads after render. |
| Source/Game-Lib/Game-Lib/Rendering/Debug/DebugRenderer.h | Adds overlay solid-triangle draw path and GPU sync helper. |
| Source/Game-Lib/Game-Lib/Rendering/Debug/DebugRenderer.cpp | Adds overlay pipeline + buffers; moves CPU->GPU sync to Update; fixes solid triangle emission. |
| Source/Game-Lib/Game-Lib/Rendering/Canvas/CanvasRenderer.h | Adds matrix/clip/mask buffer APIs + draw-data packing changes + bucket patching metadata. |
| Source/Game-Lib/Game-Lib/Gameplay/MapLoader.cpp | Clears editor selection on map unload. |
| Source/Game-Lib/Game-Lib/Editor/Viewport.h | Removes Inspector pointer plumbing. |
| Source/Game-Lib/Game-Lib/Editor/Viewport.cpp | Removes Inspector include + setter. |
| Source/Game-Lib/Game-Lib/Editor/MapSelector.h | Removes ImGui Map selector editor. |
| Source/Game-Lib/Game-Lib/Editor/MapSelector.cpp | Removes ImGui Map selector implementation. |
| Source/Game-Lib/Game-Lib/Editor/Inspector.h | Removes ImGui Inspector editor. |
| Source/Game-Lib/Game-Lib/Editor/Hierarchy.h | Removes ImGui Hierarchy editor. |
| Source/Game-Lib/Game-Lib/Editor/Hierarchy.cpp | Removes ImGui Hierarchy implementation. |
| Source/Game-Lib/Game-Lib/Editor/EditorHandler.h | Removes stored pointers/accessors for removed ImGui editors. |
| Source/Game-Lib/Game-Lib/Editor/EditorHandler.cpp | Stops creating removed ImGui editors; updates default docking layout. |
| Source/Game-Lib/Game-Lib/Editor/CameraInfo.h | Removes ImGui Camera Info editor. |
| Source/Game-Lib/Game-Lib/Editor/CameraInfo.cpp | Removes ImGui Camera Info implementation. |
| Source/Game-Lib/Game-Lib/Editor/AssetBrowser.h | Removes ImGui Asset Browser editor. |
| Source/Game-Lib/Game-Lib/Editor/ActionStack.cpp | Removes Inspector coupling on undo. |
| Source/Game-Lib/Game-Lib/ECS/Util/UIUtil.h | Adds clip ancestor + clip/mask slot management APIs. |
| Source/Game-Lib/Game-Lib/ECS/Util/UIUtil.cpp | Implements clip slot reservation/recompute; changes text refresh sizing change detection. |
| Source/Game-Lib/Game-Lib/ECS/Util/Transforms.h | Removes ImGui Inspector friend access. |
| Source/Game-Lib/Game-Lib/ECS/Util/Transform2D.h | Adds dirty-kind classification; on-demand world matrix/translation composition helpers. |
| Source/Game-Lib/Game-Lib/ECS/Util/Transform2D.cpp | Reduces descendant propagation for local pose changes; special-cases size changes. |
| Source/Game-Lib/Game-Lib/ECS/Util/Database/CameraUtil.cpp | Notifies Lua Camera handler when saves change. |
| Source/Game-Lib/Game-Lib/ECS/Systems/UpdateDayNightCycle.cpp | Routes second-changed notifications to new Time handler. |
| Source/Game-Lib/Game-Lib/ECS/Systems/UI/UpdateBoundingRects.cpp | Updates only moved rects; re-derives clip sources when ancestors move. |
| Source/Game-Lib/Game-Lib/ECS/Systems/UI/HandleInput.cpp | Refactors hover walk to compose translations top-down + clip pruning + clip-respecting hit tests. |
| Source/Game-Lib/Game-Lib/ECS/Systems/Editor/EditorTools.h | Adds new per-frame editor tools system skeleton (Lua-driven inspector support). |
| Source/Game-Lib/Game-Lib/ECS/Systems/CalculateCameraMatrices.cpp | Notifies Lua Camera handler on camera view changes. |
| Source/Game-Lib/Game-Lib/ECS/Singletons/UISingleton.h | Tracks clip-source entities for incremental re-derivation. |
| Source/Game-Lib/Game-Lib/ECS/Singletons/EditorSelection.h | New shared editor selection/gizmo state singleton. |
| Source/Game-Lib/Game-Lib/ECS/Scheduler.cpp | Registers EditorSelection + EditorTools system in ECS schedule. |
| Source/Game-Lib/Game-Lib/ECS/Components/UI/Widget.h | Adds gpuMatrixSlot for GPU transform chaining. |
| Source/Game-Lib/Game-Lib/ECS/Components/UI/Text.h | Adds GPU allocation capacities + bucket slot for incremental patching. |
| Source/Game-Lib/Game-Lib/ECS/Components/UI/Clipper.h | Adds clip/mask buffer slot indices. |
| Source/Game-Lib/Game-Lib/Application/Application.cpp | Registers new Lua handlers (Time/Camera/Map/Scene/Editor/Asset). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…fer to fail loudly
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves Hierarchy, Inspector and AssetBrowser to Luau editors with the CanvasRenderer, gets rid of their C++/ImGui counterparts. Also cleans up old C++/ImGui based MapSelector.