Editor Inspector
Object property inspector for the world editor. Displays and edits fields of selected scene objects, supports multiple simultaneous selections, locked inspector instances, custom type handlers, and sp
Object property inspector for the world editor. Displays and edits fields of selected scene objects, supports multiple simultaneous selections, locked inspector instances, custom type handlers, and specialized editors (Ground Cover UV, transform groups).
Module Overview
| Aspect | Detail |
|---|---|
| File | extensions/editor/inspector.lua |
| Returns | M table |
| Requires | editor/api/guiInstancer, editor/api/valueInspector, editor/api/objectHistoryActions |
| Window | inspector (prefix for multiple instances) |
Public Functions (via M / editor)
| Function | Description |
|---|---|
M.onEditorGui | Renders all inspector window instances each frame |
M.onEditorRegisterApi | Registers inspector API functions on the editor object |
M.onEditorAfterOpenLevel | Refreshes inspector state after loading a level |
M.onExtensionLoaded | Extension load hook |
M.onEditorInitialized | Registers inspector windows, preferences, type handlers |
M.onEditorActivated | Initializes inspector state on editor activation |
M.onEditorDeactivated | Cleans up inspector state on editor deactivation |
M.onEditorLoadGuiInstancerState | Restores GUI instancer state |
M.onEditorSaveGuiInstancerState | Saves GUI instancer state |
M.onEditorObjectSelectionChanged | Refreshes inspector when selection changes |
Key Features
| Feature | Description |
|---|---|
| Multi-object editing | Shows shared fields across multiple selected objects; highlights differing values in orange |
| Locked inspectors | Pin an inspector to specific objects (yellow header indicator) |
| Custom type handlers | Register per-class inspection UI via editor.registerInspectorTypeHandler(type, guiFn) |
| Field modifiers | Register field override UI via editor.registerInspectorFieldModifier(class, field, guiFn) |
| Group collapsing | Field groups can be collapsed/expanded, state persisted |
| Ground Cover UV Editor | Visual drag-handle UV editor for GroundCover objects |
| Transform header menu | Quick-access menu for position, rotation, scale operations |
Inspector Type Handlers
-- Register custom inspector for a selection type
editor.registerInspectorTypeHandler("level_settings", function(inspectorInstance)
imgui.Text("Level Settings")
end)
-- Unregister
editor.unregisterInspectorTypeHandler("level_settings")Inspector Field Modifiers
-- Override rendering of a specific field on a class
editor.registerInspectorFieldModifier("TerrainBlock", "heightMap", function(objectIds, fieldInfo)
-- Custom UI for heightMap field
end)Internal State
| Variable | Description |
|---|---|
inspectorWindowNamePrefix | "inspector" - base name for inspector windows |
maxGroupCount | 500 - maximum field groups per inspector |
lockedInspectorColor | Yellow (1, 0.8, 0, 1) - header tint for locked inspectors |
differentValuesColor | Red-orange (1, 0.2, 0, 1) - indicates different values across multi-selection |
collapseGroups | Persisted collapse state for field groups |
Functions
onEditorRegisterApi()
Callback for editor register api event.
onEditorAfterOpenLevel()
Callback for editor after open level event.
Returns: self
onExtensionLoaded()
Callback for extension loaded event.
onEditorDeactivated()
Callback for editor deactivated event.
onEditorLoadGuiInstancerState(state)
Callback for editor load gui instancer state event.
state(any)
onEditorSaveGuiInstancerState(state)
Callback for editor save gui instancer state event.
state(any)
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Editor ImGui C Demo
Wraps the built-in ImGui Demo Window as an editor debug tool, accessible via the editor's Debug menu.
Editor Layout Manager
Manages saving, loading, and deleting of editor window layout presets. Handles both named layout snapshots and the current working layout. Wraps ImGui INI persistence and editor window state JSON file