Livery Editor – Layers / Decal
Provides per-layer decal operations - querying actions, adding decals, and reading formatted layer data for the cursor/decal UI.
Provides per-layer decal operations - querying actions, adding decals, and reading formatted layer data for the cursor/decal UI.
Overview
ui_liveryEditor_layers_decal manages individual decal layer interactions. It defines the available actions for a decal layer, provides a centred-add helper, and formats layer data for the cursor UI display.
Extension path: lua/ge/extensions/ui/liveryEditor/layers/decal.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
setLayer | (layerUid) | Sets the active layer UID for subsequent operations. |
addLayer | (params) → layer | Resets cursor, sets colour/texture from params, stamps a decal. |
addLayerCentered | (params) → layer | Adds a layer at centre (0.5, 0.5) regardless of mouse mode, then resets cursor. |
updateLayer | (params) | Stub - not yet implemented. |
getLayerActions | (layerUid) → actions[] | Returns the available context menu actions for the given decal layer. |
Internals
Action Menu
The available actions for a single decal layer:
| Label | Value | Notes |
|---|---|---|
| Reproject | requestReproject | Lazy-load, no drawer |
| Transform | transform | |
| Materials | materials | |
| Mirror | requestMirror | Lazy-load, no drawer |
| Order | order | |
| Highlight | highlight | Toggle switch |
| Enable | enabled | Shows current state |
| Duplicate | duplicate | |
| Delete | delete |
Add Layer Flow
M.addLayer = function(params)
resetCursor() -- centre, white, default scale
api.setDecalColor(color)
api.setDecalTexturePath("color", params.texturePath)
return api.addDecal()
endaddLayerCentered temporarily switches to cursor mode (non-mouse) to ensure the decal is placed at (0.5, 0.5), then resets and hides the cursor.
How It Works
setLayer(uid)sets the active layer for the modulegetLayerActions(uid)builds an actions array; the "enabled" action includes the current stateaddLayerresets the cursor to defaults, applies params, and stamps viaapi.addDecal()addLayerCenteredforces cursor mode to guarantee centre placement
Example Usage
local decalLayer = extensions.ui_liveryEditor_layers_decal
-- Add a new decal at centre
local layer = decalLayer.addLayerCentered({
texturePath = "/art/decals/stripe.png",
color = {1, 1, 1, 1}
})
-- Get actions for context menu
local actions = decalLayer.getLayerActions(layer.uid)Additional Exports
The following exports are available but not yet documented in detail:
M.addLayerCenteredM.getLayerActionsM.layerUidM.setLayerM.updateLayer
Livery Editor – Layers / Cursor
Manages the decal placement cursor - position, scale, skew, rotation, colour, material properties, and mirror settings.
Livery Editor – Layers / Decals
Operates on existing decal layers - transform (scale, skew, rotate), material properties (colour, metallic, roughness), and data formatting.