API ReferenceGE ExtensionsuiliveryEditor
Livery Editor – History
Thin wrapper around the dynamic decals API undo/redo system that notifies the UI on history changes.
Thin wrapper around the dynamic decals API undo/redo system that notifies the UI on history changes.
Overview
ui_liveryEditor_history exposes undo and redo operations and listens for layer mutations (add, delete, update, move) to push history state to the UI via guihooks.
Extension path: lua/ge/extensions/ui/liveryEditor/history.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
undo | () | Undoes the last operation via api.undo(). |
redo | () | Redoes the last undone operation via api.redo(). |
Hook Listeners
These are called by the dynamic decals API - do not call directly.
| Hook | Trigger |
|---|---|
dynamicDecals_onLayerAdded(layerUid) | A layer was added |
dynamicDecals_onLayerDeleted(layerUid) | A layer was deleted |
dynamicDecals_onLayerUpdated(layerUid) | A layer property changed |
dynamicDecals_moveLayer(from, fromParentUid, to, toParentUid) | A layer was reordered |
All four hooks trigger guihooks.trigger("LiveryEditor_onHistoryUpdated", api.getHistory()).
How It Works
- User performs an action (add/delete/move/update layer)
- The dynamic decals API fires one of the
dynamicDecals_*hooks - This module catches the hook and pushes the full history object to the UI
- The UI updates its undo/redo button states accordingly
Example Usage
-- Undo last action
extensions.ui_liveryEditor_history.undo()
-- Redo
extensions.ui_liveryEditor_history.redo()Additional Exports
The following exports are available but not yet documented in detail:
M.dynamicDecals_moveLayerM.dynamicDecals_onLayerAddedM.dynamicDecals_onLayerDeletedM.dynamicDecals_onLayerUpdatedM.redoM.undo