Vehicle Editor - Part List
Sortable, searchable table listing all available (or active-only) JBeam parts for the current vehicle, with file modification timestamps and part selection.
Sortable, searchable table listing all available (or active-only) JBeam parts for the current vehicle, with file modification timestamps and part selection.
Module Exports
| Export | Type | Description |
|---|---|---|
M.menuEntry | string | "Part List" - menu label |
M.open | function | Shows the part list window |
M.onEditorGui | hook | Renders the ImGui part list table |
M.onEditorInitialized | hook | Registers the editor window |
M.onSerialize | hook | Persists selected part |
M.onDeserialized | hook | Restores selected part |
Key Internals
| Variable | Type | Purpose |
|---|---|---|
parts | table/nil | Cached part entries (rebuilt on toggle or vehicle change) |
checkboxActivePartsOnly | BoolPtr | Filter to show only active parts |
partsSearchText | ArrayChar | Search filter input |
partsViewCount | number | Number of parts matching current filter |
tableFlags | number | ImGui table flags (sortable, resizable, scrollable) |
Part Entry Structure
Each entry in parts is: {visible, partName, jbeamFilename, modTimeEpoch, modTimeStr, partData}
How It Works
- On first render or "Active" toggle, rebuilds the part list from
jbeamIO.getAvailableParts() - For each part, queries file modification time via
FS:stat() - Table has 3 columns: Name, Filename (hidden by default), Last modified (hidden by default)
- Sorting is done via ImGui table sort specs with ascending/descending support
- Text search filters by part name and filename (case-insensitive)
- Clicking a part selects it and opens Part Tree + Part Text View windows
- Double-clicking copies the part name or filename to clipboard
- Right-click context menu: "Open location in file explorer"
Lua Code Example
-- Open part list
extensions.editor_vehicleEditor_staticEditor_vePartList.open()
-- Parts are loaded from the IO context:
-- local ioCtx = vEditor.vehData.ioCtx
-- local partsList = jbeamIO.getAvailableParts(ioCtx)
-- local activePartsData = vEditor.vehData.vdata.activePartsData
-- File modification time display:
-- local stat = FS:stat(jbeamFilename)
-- timeDiffStr(stat.modtime) -> "last minute", "last hour", "last 24h: 01/15 14:30", etc.
-- Selecting a part:
-- vEditor.selectedPart = partName
-- Opens Part Tree and Part Text View windows
-- The main part auto-selects on load:
-- if part.slotType == "main" then
-- vEditor.selectedPart = partName
-- end
-- Search uses case-insensitive substring matching:
-- partName:lower():find(searchText, 1, true) or jbeamFilename:lower():find(searchText, 1, true)
-- Sorting via ImGui TableGetSortSpecs():
-- Supports ascending/descending on Name (col 2), Filename (col 3), Last Modified (col 4)
-- Selected part is highlighted with red background:
-- im.PushStyleColor2(im.Col_TableRowBg, highLightBg) -- im.ImVec4(0.5, 0, 0, 1)
-- im.PushStyleColor2(im.Col_TableRowBgAlt, highLightBg)
-- Right-click context menu:
-- Engine.Platform.exploreFolder(tostring(rightClickedPart[3]))See Also
- Vehicle Editor - JBeam Beautifier - Related reference
- Vehicle Editor - JBeam Modifier Leaking Visualizer - Related reference
- Vehicle Editor - JBeam Spellchecker - Related reference
- World Editor Guide - Guide
Vehicle Editor - JBeam Variables Checker
Validates that JBeam variable values (both defaults and vehicle configuration overrides) fall within their declared min/max ranges across all vehicle directories.
Vehicle Editor - Part Property View
Generic property inspector window for editing individual JBeam table entries (nodes, beams, etc.) selected via the Part Tree view.