Crawl Editor Presets
Class-based preset and component management for the Crawl Editor. Handles save/load/delete of trails, boundaries, and pathnode presets, plus component-level persistence via `gameplay_crawl_saveSystem`
Class-based preset and component management for the Crawl Editor. Handles save/load/delete of trails, boundaries, and pathnode presets, plus component-level persistence via gameplay_crawl_saveSystem.
Constructor
local Presets = require('editor/crawlEditor/presets')
local presetMgr = Presets()Preset Categories
| Constant | Value | Description |
|---|---|---|
PRESET_CATEGORIES.TRAILS | "trails" | Complete trail presets |
PRESET_CATEGORIES.BOUNDARIES | "boundaries" | Zone boundary presets |
PRESET_CATEGORIES.PATHNODES | "pathnodes" | Path node presets |
Key Methods
| Method | Signature | Description |
|---|---|---|
C:loadPresets() | Loads presets from JSON file | |
C:savePresets() | → bool, string | Saves all presets to JSON |
C:saveBoundaryPreset(name, boundary) | → bool, string | Serialize and store a boundary preset |
C:savePathnodePreset(name, path) | → bool, string | Serialize and store a pathnode preset |
C:saveTrailPreset(name, trail) | → bool, string | Serialize and store a trail preset |
C:loadBoundaryPreset(name) | → boundary, string | Deserialize a boundary preset |
C:loadPathnodePreset(name) | → path, string | Deserialize a pathnode preset |
C:loadTrailPreset(name) | → trail, string | Deserialize a trail preset |
C:deleteBoundaryPreset(name) | → bool, string | Remove a boundary preset |
C:deletePathnodePreset(name) | → bool, string | Remove a pathnode preset |
C:deleteTrailPreset(name) | → bool, string | Remove a trail preset |
C:getBoundaryPresets() | → table | List all boundary presets |
C:getPathnodePresets() | → table | List all pathnode presets |
C:getTrailPresets() | → table | List all trail presets |
C:exportPreset(category, name, filepath) | → bool, string | Export single preset to file |
C:importPreset(filepath, category) | → bool, string | Import preset from file |
Component Methods (Level-Based)
| Method | Description |
|---|---|
C:getAllTrailComponents() | Lists trail components in current level |
C:getAllBoundaryComponents() | Lists boundary components in current level |
C:getAllPathnodeComponents() | Lists pathnode components in current level |
C:saveTrailComponent(name, trail) | Saves trail via save system |
C:saveBoundaryComponent(name, boundary) | Saves boundary via save system |
C:savePathnodeComponent(name, path) | Saves pathnode via save system |
UI Methods
| Method | Description |
|---|---|
C:drawMenu(crawlData, trails, waypoints) | Renders component load/save menus |
C:drawDialogs() | Renders save-name input dialogs and component manager |
Notes
- Presets file stored at
/levels/<level>/crawls/presets.json - Components use
gameplay_crawl_saveSystemfor level-scoped persistence - Validates preset data before save/load with category-specific validators
- Boundary deserialization uses
gameplay/sites/zone
All Class Methods
| Method | Signature | Description |
|---|---|---|
C:init() | Initialize presets state, load from file | |
C:loadPresets() | Load presets from JSON file | |
C:savePresets() | → bool, string | Save all presets to JSON |
C:saveBoundaryPreset(name, boundary) | → bool, string | Serialize and store boundary preset |
C:savePathnodePreset(name, path) | → bool, string | Serialize and store pathnode preset |
C:saveTrailPreset(name, trail) | → bool, string | Serialize and store trail preset |
C:loadBoundaryPreset(name) | → boundary/nil, string/nil | Deserialize boundary preset |
C:loadPathnodePreset(name) | → path/nil, string/nil | Deserialize pathnode preset |
C:loadTrailPreset(name) | → trail/nil, string/nil | Deserialize trail preset |
C:deleteBoundaryPreset(name) | → bool, string/nil | Remove boundary preset |
C:deletePathnodePreset(name) | → bool, string/nil | Remove pathnode preset |
C:deleteTrailPreset(name) | → bool, string/nil | Remove trail preset |
C:getBoundaryPresets() | → table | List all boundary presets |
C:getPathnodePresets() | → table | List all pathnode presets |
C:getTrailPresets() | → table | List all trail presets |
C:getAllTrailComponents() | → table | List trail components in current level |
C:getAllBoundaryComponents() | → table | List boundary components in current level |
C:getAllPathnodeComponents() | → table | List pathnode components in current level |
C:loadTrailComponent(id) | → table | Load trail component by ID |
C:loadBoundaryComponent(id) | → table | Load boundary component by ID |
C:loadPathnodeComponent(id) | → table | Load pathnode component by ID |
C:saveTrailComponent(name, trail) | → bool, string/nil | Save trail via save system |
C:saveBoundaryComponent(name, boundary) | → bool, string/nil | Save boundary via save system |
C:savePathnodeComponent(name, path) | → bool, string/nil | Save pathnode via save system |
C:deleteTrailComponent(id) | → result | Delete trail component |
C:deleteBoundaryComponent(id) | → result | Delete boundary component |
C:deletePathnodeComponent(id) | → result | Delete pathnode component |
C:exportPreset(category, name, filepath) | → bool, string/nil | Export preset to file |
C:importPreset(filepath, category) | → bool, string/nil | Import preset from file |
C:getShowSaveBoundaryDialog() | → bool | Get boundary save dialog visibility |
C:setShowSaveBoundaryDialog(show) | Set boundary save dialog visibility | |
C:getShowSavePathnodeDialog() | → bool | Get pathnode save dialog visibility |
C:setShowSavePathnodeDialog(show) | Set pathnode save dialog visibility | |
C:getShowSaveTrailDialog() | → bool | Get trail save dialog visibility |
C:setShowSaveTrailDialog(show) | Set trail save dialog visibility | |
C:getShowPresetManager() | → bool | Get preset manager visibility |
C:setShowPresetManager(show) | Set preset manager visibility | |
C:getShowPresetManagerPtr() | → ImBoolPtr | Get preset manager ImGui bool pointer |
C:getBoundaryPresetName() | → ImArrayChar | Get boundary preset name buffer |
C:getPathnodePresetName() | → ImArrayChar | Get pathnode preset name buffer |
C:getTrailPresetName() | → ImArrayChar | Get trail preset name buffer |
C:drawMenu(crawlData, trails, waypoints) | Render component load/save menus | |
C:drawDialogs() | Render save-name dialogs and component manager |
See Also
- Crawl Editor - Boundaries - Related reference
- Crawl Editor Input - Related reference
- Crawl Editor Mission Port Tool - Related reference
- World Editor Guide - Guide
Crawl Editor Paths
Class-based path and pathnode editor for the Crawl Editor. Manages path creation, node selection, gizmo manipulation, and the ImGui detail panel.
Crawl Editor Starting Positions
Class-based starting position editor for the Crawl Editor. Manages area transform (position, rotation, radius), icon position, and placement with Ctrl-drag rotation.