API ReferenceGE Extensionseditor
Forest View
Provides a list view of all forest items when the forest editor is active.
Provides a list view of all forest items when the forest editor is active.
Overview
The editor_forestView extension displays a scrollable list of all ForestItemData entries in the current forest. Each item is shown as a clickable button with its name. The view opens automatically when the "Edit Forest" edit mode is activated and closes when it is deactivated.
Exported Functions
| Function | Description |
|---|---|
M.onEditorInitialized() | Registers the forestEditorView window |
M.onEditorActivated() | Empty hook placeholder |
M.onEditorGui() | Draws the forest item list as buttons in a scrolling child region |
Note:
onEditorEditModeActivatedandonEditorEditModeDeactivatedexist in source but are commented out (not exported).populateForestItemsis local-only.
Local Functions
| Function | Description |
|---|---|
forestItemDataTreeNode(item) | Renders a single forest item as a styled button with icon and name |
forestItemSortByNameFunc(a, b) | Sorts items alphabetically by internalName |
Item Data Structure
Each entry in forestItemsInfo:
| Field | Type | Description |
|---|---|---|
key | number | Forest item key from getData():findItem() |
id | number | Scene object ID |
name | string | Display name (internalName_id_index) |
selected | boolean | Selection state |
Usage Example
-- The forest view is managed automatically by edit mode hooks.
-- When the user enters "Edit Forest" mode:
-- 1. Scene tree is closed
-- 2. Forest view window opens
-- 3. All forest items are listed alphabetically
-- Items are queried from:
local forest = scenetree.findObject("theForest")
local items = forest:getData():getItems()See Also
- Forest Editor - Full forest editing tools