API ReferenceGE ExtensionsuivehicleSelector
Vehicle Selector – Details Interaction
Coordinates vehicle details display with spawn/replace button actions.
Coordinates vehicle details display with spawn/replace button actions.
Overview
ui_vehicleSelector_detailsInteraction bridges the vehicle specifications panel with the vehicle operations module. It assembles detail data (specs + action buttons) for the selected vehicle and manages custom button callbacks for challenge/freeroam modes.
Extension path: lua/ge/extensions/ui/vehicleSelector/detailsInteraction.lua
Dependencies: ui_vehicleSelector_vehicleOperations, ui_vehicleSelector_vehicleSpecifications
Exports (M)
| Function | Signature | Description |
|---|---|---|
getDetails | (itemDetails) → table | Returns specs + button info for a vehicle. |
getManagementDetails | () → table | Returns management buttons + current vehicle info. |
executeButton | (...) | Delegates to vehicleOperations.executeButton. |
executeDoubleClick | (...) | Delegates to vehicleOperations.executeDoubleClick. |
setManagementButtonsEnabled | (...) | Toggles management buttons. |
setDetailsButtonForFreeroam | (...) | Sets freeroam button mode. |
setCustomDetailsButtons | (buttons) | Sets custom callback buttons (challenge mode). |
setExitCallback | (callback) | Sets callback for when selector exits. |
exploreFolder | (path) | Opens native file explorer at path. |
goToMod | (modId) | Navigates UI to mod details page. |
Fields
| Field | Default | Description |
|---|---|---|
M.managementButtonsEnabled | true | Whether management buttons are shown. |
M.customDetailsButtons | {} | Custom button definitions for challenge mode. |
M.exitCallback | nop | Called when the vehicle selector is closed. |
M.dependencies | Table of extension dependencies. |
Internals
getDetails Flow
- Calls
vehicleSpecifications.getDetails(itemDetails)for specs. - If
customDetailsButtonshas entries, builds buttons from those callbacks (with default paint pre-fill from model/config). - Otherwise, calls
vehicleOperations.makeSpawningButtons(details.configDetails)for standard spawn/replace buttons. - Attaches
buttonInfoto the details table.
How It Works
- When a vehicle tile is selected, the UI calls
getDetails({model, config}). - The module assembles specifications from
vehicleSpecificationsand action buttons fromvehicleOperations. - In freeroam mode, standard spawn/replace buttons are used.
- In challenge mode,
customDetailsButtonsare used instead (each with a custom callback receiving model, config, additionalData).
Lua Examples
-- Get details for a specific vehicle
local details = extensions.ui_vehicleSelector_detailsInteraction.getDetails({
model = "pickup", config = "vehicles/pickup/base.pc"
})
-- Set custom buttons for a challenge selector
extensions.ui_vehicleSelector_detailsInteraction.setCustomDetailsButtons({
{ callback = function(model, config, data) print("Selected:", model) end,
meta = { label = "Select", icon = "car" } }
})Additional Exports
The following exports are available but not yet documented in detail:
M.executeButtonM.executeDoubleClickM.exploreFolderM.getDetailsM.getManagementDetailsM.goToModM.setCustomDetailsButtonsM.setDetailsButtonForFreeroamM.setExitCallbackM.setManagementButtonsEnabled