API ReferenceGE ExtensionsuiliveryEditor
Livery Editor – Resources
Loads and categorises decal textures from the dynamic decals texture registry for the UI resource browser.
Loads and categorises decal textures from the dynamic decals texture registry for the UI resource browser.
Overview
ui_liveryEditor_resources reads tagged texture files from editor_api_dynamicDecals_textures, organises them into categories, and provides query functions for the UI's decal picker.
Extension path: lua/ge/extensions/ui/liveryEditor/resources.lua
Dependencies
editor_api_dynamicDecals_textures
Exports (M)
| Function | Signature | Description |
|---|---|---|
setup | () | Initialises the textures API and parses all tagged textures into categories. |
requestData | () | Triggers liveryEditor_resources_data with the full texture list. |
getTextureCategories | () → categories[] | Returns all categories sorted alphabetically. |
getTexturesByCategory | (category) → category | Returns a single category object by value/name. |
getDecalTextures | () → textures[] | Returns the full categorised texture list. |
getCategories | () → categories | Returns raw categories (may be nil). |
Data Fields
| Field | Type | Description |
|---|---|---|
M.textures | table | Cached texture data (initialized as empty {}). |
Data Fields
| Field | Description |
|---|---|
M.dependencies | {"editor_api_dynamicDecals_textures"} - texture management API. |
Internals
Texture Category Format
{
value = "flames", -- tag name / category id
label = "flames", -- display label
items = {
{
name = "flame01.png",
label = "flame01.png",
value = "flame01.png",
preview = "/art/dynamicDecals/flames/flame01.png"
},
...
}
}Setup Flow
- Calls
texturesApi.setup()to initialise the texture file scanner - Gets all tag-to-file mappings via
texturesApi.getTagsWithRefs() - Parses into the categorised format above
- Scans for untagged textures via
texturesApi.getTextureFiles()+readSidecarFile() - Untagged textures go into an "Others" category
Stub Hooks
dynamicDecals_onTextureFileAdded and dynamicDecals_onTextureFileDeleted are defined but empty - reserved for future hot-reload support.
How It Works
- On
setup(), all decal texture files are scanned and grouped by their sidecar tags - Textures without tags are collected into an "Others" bucket
- The UI calls
requestData()orgetTextureCategories()to populate the decal picker - Categories are sorted alphabetically for consistent display
Example Usage
local resources = extensions.ui_liveryEditor_resources
-- After setup, get all categories
local categories = resources.getTextureCategories()
for _, cat in ipairs(categories) do
print(cat.label, #cat.items .. " textures")
end
-- Get textures in a specific category
local flames = resources.getTexturesByCategory("flames")Additional Exports
The following exports are available but not yet documented in detail:
M.dynamicDecals_onTextureFileAddedM.dynamicDecals_onTextureFileDeletedM.getCategoriesM.getDecalTexturesM.getTextureCategoriesM.getTexturesByCategoryM.requestDataM.setup