Editor Main Menu
Manages the editor's main menu bar, notification system, window menu organization, layout management UI, and scene metrics display. Depends on `editor_layoutManager` for layout persistence.
Manages the editor's main menu bar, notification system, window menu organization, layout management UI, and scene metrics display. Depends on editor_layoutManager for layout persistence.
Module Overview
| Aspect | Detail |
|---|---|
| File | extensions/editor/mainMenu.lua |
| Returns | M table |
| Dependencies | editor_layoutManager |
| Role | Main menu bar rendering and notification queue |
Public Functions
| Function | Description |
|---|---|
M.onEditorGuiMainMenu | Renders the main menu bar, notifications, and modal dialogs |
M.onExtensionLoaded | Extension load hook |
M.onEditorActivated | Sets up menu state on editor activation |
M.onEditorInitialized | Initializes menu structures and notification system |
M.onEditorPreferenceValueChanged | Responds to preference value changes |
Notification System
| Function | Signature | Description |
|---|---|---|
showNotification | (text, icon, group, duration, doBeep) | Queues a notification with optional icon, group override, duration, and audio beep |
editor.showNotification("Rebuilt Static Collision Data")
editor.showNotification("Saved!", editor.icons.save, "save", 3, true)| Parameter | Default | Description |
|---|---|---|
text | required | Notification message |
icon | editor.icons.info | Icon from editor icon atlas |
group | "" | Group name - same-group notifications override each other |
duration | 4 seconds | Display duration |
doBeep | false | Play audio beep |
Menu Organization
| Feature | Description |
|---|---|
| Window menu items | Registered via editor.addWindowMenuItem(name, callback, options) |
| Menu groups | Items grouped under submenus (e.g., Debug, Tools) |
| Window search | Searchable window list with fuzzy matching |
| Layout management | Save/Load/Delete layout presets via popup dialogs |
Collision Rebuild
-- Rebuilds static collision data when flagged
editor.rebuildCollision() -- or force: rebuildCollision(true)
-- Sets editor.needsCollisionRebuild = false after rebuild
-- Shows notification: "Rebuilt Static Collision Data"Key Internal State
| Variable | Description |
|---|---|
notificationShowTime | 4 seconds - default notification display time |
notificationFadeTime | 1 second - fade-out duration |
forceShowNewest | true - newest notification overrides current |
windowMenuItems | Registered menu items for the Window menu |
windowMenuGroups | Grouped menu item submenus |
metrics | Scene performance metrics (object counts, draw calls) |
Module Variables
dependencies(table) -{"editor_layoutManager"}
Functions
onEditorGuiMainMenu()
Callback for editor gui main menu event.
onExtensionLoaded()
Callback for extension loaded event.
onEditorPreferenceValueChanged(path, value)
Callback for editor preference value changed event.
path(string)value(any)
Returns: self
Additional Exports
M.dependencies
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Editor Main
Core editor bootstrap module. Sets up the global `editor` object, manages extension loading, preferences, edit modes, window registration, selection system, history/undo, and the editor activate/deact
Editor Main Toolbar
Renders the editor's main toolbar with edit mode buttons, transform snapping controls (grid/rotation/scale), camera speed slider, time-of-day slider, terrain snap settings, and configurable edit mode