RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility
Livery Editor - CameraLivery Editor - ControlsLivery Editor - Edit ModeLivery Editor – Editor (Core)Livery Editor – HistoryLivery Editor – Layer ActionLivery Editor – Layer EditLivery Editor – LayersLivery Editor – ResourcesLivery Editor – SelectionLivery Editor – ToolsLivery Editor – User DataLivery Editor – Utils

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionsuiliveryEditor

Livery Editor – Selection

Manages the layer selection state - single/multi-select, available actions, highlight toggling, and UI notifications.

Manages the layer selection state - single/multi-select, available actions, highlight toggling, and UI notifications.


Overview

ui_liveryEditor_selection tracks which layers are currently selected, computes available actions based on selection type and count, and notifies the UI of changes. It also provides duplicate and reapply workflows.

Extension path: lua/ge/extensions/ui/liveryEditor/selection.lua


Exports (M)

FunctionSignatureDescription
select(layerIds, highlight)Sets the selection to one or more layer UIDs. Optionally highlights.
clearSelection()Clears all selected layers and disables highlighting.
toggleSelection(layerUid)Adds/removes a layer from the multi-selection.
addToSelection(layerUid)Adds a layer UID to the selection.
removeFromSelection(layerUid) → boolRemoves a UID; returns true if found.
getSelectedLayers() → uid[]Returns the array of selected UIDs.
getFirstSelectedLayer() → uidReturns the first selected UID.
getSelectedLayersData() → layer[]Returns UI-formatted layer objects with highlight flags.
isLayerSelected(layerUid) → boolChecks if a UID is in the selection.
getAvailableActions() → actions[]Returns context-appropriate actions for the current selection.
toggleHighlightSelectedLayer()Toggles API highlighting on the first selected layer.
duplicateSelectedLayer()Duplicates the first selected layer.
reapplySelectedLayer()Enters reapply mode - hides layer, shows cursor with its properties.
cancelReapplySelectedLayer()Cancels reapply mode and restores the layer.
setup()Clears selection and notifies UI.
notifyUiListeners()Pushes selection state, actions, and data to UI.
requestInitialData()Alias for notifyUiListeners.

Data Fields

FieldDescription
M.selectedLayersTable of currently selected layer UIDs.

Internals

Multi-Selection Action Rules

SelectionAvailable Actions
Single decalFull action set from ui_liveryEditor_layers_decal
Single fillFull action set from ui_liveryEditor_layers_fill
Single linkedSetFull action set from ui_liveryEditor_layers_group
Multiple decalsgroup, material, duplicate, mirror, visibility, delete
Multiple fillsduplicate, visibility, delete
Mixed typesvisibility only

UI Events Triggered

On any selection change, these guihooks fire:

  • liveryEditor_selection_actionsUpdated
  • liveryEditor_selection_selectedChanged
  • LiveryEditor_SelectedLayersChanged
  • LiverEditorLayerActionsUpdated
  • LiveryEditor_SelectedLayersDataUpdated

Hook Listener Exports

ExportDescription
liveryEditor_OnLayerAdded(layer) - If duplicate was active, selects the new layer.
dynamicDecals_onLayerDeleted(layerUid) - Removes deleted layer from selection.
liveryEditor_onLayersUpdated(layerUid) - Re-sends selected layer data if the updated layer is selected.

How It Works

  1. UI calls select(uid, true) when user clicks a layer - sets selection and highlights
  2. Shift-click calls toggleSelection(uid) for multi-select
  3. getAvailableActions() computes which operations are valid for the current mix
  4. Action buttons in the UI are enabled/disabled based on the returned actions
  5. Duplicate and reapply use flags (duplicateLayerActive, reapplyLayerActive) to handle async callbacks

Example Usage

local sel = extensions.ui_liveryEditor_selection

-- Select a layer with highlighting
sel.select(layerUid, true)

-- Check available actions
local actions = sel.getAvailableActions()

-- Multi-select
sel.addToSelection(anotherUid)

-- Clear
sel.clearSelection()

Additional Exports

The following exports are available but not yet documented in detail:

  • M.addToSelection
  • M.cancelReapplySelectedLayer
  • M.clearSelection
  • M.duplicateLayerActive
  • M.duplicateSelectedLayer
  • M.dynamicDecals_onLayerDeleted
  • M.getAvailableActions
  • M.getFirstSelectedLayer
  • M.getSelectedLayers
  • M.getSelectedLayersData
  • M.isLayerSelected
  • M.liveryEditor_OnLayerAdded
  • M.liveryEditor_onLayersUpdated
  • M.notifyUiListeners
  • M.reapplyLayerActive
  • M.reapplySelectedLayer
  • M.removeFromSelection
  • M.requestInitialData
  • M.select
  • M.setup
  • M.toggleHighlightSelectedLayer
  • M.toggleSelection

Livery Editor – Resources

Loads and categorises decal textures from the dynamic decals texture registry for the UI resource browser.

Livery Editor – Tools

Central tool manager - switches active tools, manages action maps, and dispatches operations to cursor or layer targets.

On this page

OverviewExports (M)Data FieldsInternalsMulti-Selection Action RulesUI Events TriggeredHook Listener ExportsHow It WorksExample UsageAdditional Exports