API ReferenceGE Extensionscareermodulesdelivery
Delivery Cargo Screen
M.dependencies = {"core_vehicleBridge"}
Dependencies
M.dependencies = {"core_vehicleBridge"}Central cargo screen UI module - formats cargo/vehicles/materials for display, handles loading/unloading, route planning, big map integration, and commit/cancel flows.
Module Info
| Field | Value |
|---|---|
| Path | extensions/career/modules/delivery/cargoScreen.lua |
| Global | career_modules_delivery_cargoScreen |
| Dependencies | core_vehicleBridge |
Public API
| Function | Signature | Description |
|---|---|---|
isCargoScreenOpen | () | Returns true if the cargo overview screen is open |
setCargoScreenTab | (tab) | Sets active tab, filters visible bigmap markers |
getCargoScreenTab | () | Returns current tab name |
formatCargoGroup | (group, playerCargoContainers, showFirstSeen) | Formats a group of identical cargo into a UI card with targets, modifiers, timers |
formatAcceptedOfferForUI | (offer) | Formats an accepted vehicle/trailer offer for player view |
abandonAcceptedOffer | (vehId) | Gives back a delivery vehicle |
requestCargoDataForUi | (facId, psPath, updateMaxTimeTimestamp) | Main data getter - builds full cargo screen data for UI |
moveCargoFromUi | (cargoId, targetLocation) | Adds a transient move for a cargo item |
applyTransientMoves | () | Applies all pending transient moves |
spawnOffer | (...) | Delegates to vehicleOfferManager.spawnOffer |
toggleOfferForSpawning | (offerId) | Toggles an offer's spawnWhenCommitingCargo flag |
moveMaterialFromUi | (materialType, cargoType, amount, targetLocation) | Loads material from facility tank into player containers |
clearTransientMovesForStorage | (materialType) | Clears transient moves for a material storage type |
enterCargoOverviewScreen | (facilityId, parkingSpotPath) | Opens cargo screen with big map |
enterMyCargo | () | Opens cargo screen without facility (my cargo view) |
exitCargoOverviewScreen | (facilityId, parkingSpotPath) | Closes cargo screen, updates weights |
commitDeliveryConfiguration | () | Commits all transient moves, starts delivery mode, spawns vehicles |
cancelDeliveryConfiguration | () | Cancels all transient moves |
setBestRoute | (onlyClosestTarget) | Calculates and sets optimal delivery route |
showRoutePreview | (route) | Shows route preview on big map |
showCargoRoutePreview | (cargoId) | Shows route for specific cargo item |
showVehicleOfferRoutePreview | (offerId) | Shows route for vehicle offer |
showLocationRoutePreview | (locationId, asProvider) | Shows route to a facility |
highlightCargoInPoi | (poiId) | Highlights cargo cards for a big map POI |
deliveryMarkerSelected | (poiId) | Handles marker click on cargo screen |
setCargoRoute | (cargoId, origin) | Sets big map nav focus to cargo destination |
setVisibleIdsForBigMap | () | Builds visible marker ID mapping |
deliveryScreenExternalButtonPressed | (id) | Handles external button clicks (progress pages) |
onCargoPickedUp | () | Recalculates route after cargo pickup |
onDeliveryRewardsPopupClosed | () | Recalculates route after delivery rewards shown |
onDeactivateBigMapCallback | () | Sets closest-first route when exiting big map |
exitDeliveryMode | () | Delegates to general.exitDeliveryMode |
showCargoContainerHelpPopup | () | Shows tutorial popup for cargo containers |
unloadCargoPopupClosed | () | Delegates to progress.unloadCargoPopupClosed |
requestDropOffData | (...) | Delegates to progress.requestDropOffData |
confirmDropOffData | (...) | Delegates to progress.confirmDropOffData |
clearTransientMoveForCargo | (...) | Delegates to parcelManager |
dropOffPopupClosed | (mode) | Triggers hooks for results or cargoSelection popup close |
onCargoGenerated | (cargo) | Notifies UI of new cargo if screen is open |
| M.onBigmapHoveredPoiIdChanged | (poiId) | - |
| M.onCareerActivated | () | - |
| M.tryLoadAll | (ids) | - |
Usage Example
-- Open cargo screen at a facility
career_modules_delivery_cargoScreen.enterCargoOverviewScreen("belasco_auto", "ps_01")
-- Move cargo to player vehicle
career_modules_delivery_cargoScreen.moveCargoFromUi(42, {type="vehicle", vehId=123, containerId=0})
-- Commit and start delivery
career_modules_delivery_cargoScreen.commitDeliveryConfiguration()See Also
career_modules_delivery_general- Delivery mode statecareer_modules_delivery_parcelManager- Cargo datacareer_modules_delivery_cargoCards- Card grouping/sortingcareer_modules_delivery_generator- Facility and generationfreeroam_bigMapMode- Big map integration
Additional Exports
Functions
| Function | Description |
|---|---|
M.abandonAcceptedOffer(vehId) | No description available |
M.applyTransientMoves() | No description available |
M.clearTransientMoveForCargo(...) | No description available |
M.confirmDropOffData(...) | No description available |
M.deliveryScreenExternalButtonPressed(id) | No description available |
M.dropOffPopupClosed(mode) | No description available |
M.exitDeliveryMode() | other/utility functions |
M.getCargoScreenTab() | No description available |
M.isCargoScreenOpen() | No description available |
M.requestDropOffData(...) | No description available |
M.setCargoScreenTab(tab) | print("cargo tab -> " .. dumps(tab)) |
M.showCargoContainerHelpPopup() | No description available |
M.spawnOffer(...) | offer spawning is handled in vehOffermanager |
M.unloadCargoPopupClosed() | No description available |
Values/Properties
| Export | Description |
|---|---|
M.cancelDeliveryConfiguration | Value: cancelDeliveryConfiguration |
M.clearTransientMovesForStorage | Value: clearTransientMovesForStorage |
M.commitDeliveryConfiguration | Value: commitDeliveryConfiguration |
M.deliveryMarkerSelected | Value: deliveryMarkerSelected |
M.enterCargoOverviewScreen | Value: enterCargoOverviewScreen |
M.enterMyCargo | Value: enterMyCargo |
M.exitCargoOverviewScreen | Value: exitCargoOverviewScreen |
M.formatAcceptedOfferForUI | Value: formatAcceptedOfferForUI |
M.formatCargoGroup | Value: formatCargoGroup |
M.highlightCargoInPoi | Value: highlightCargoInPoi |
M.moveCargoFromUi | Value: moveCargoFromUi |
M.moveMaterialFromUi | Value: moveMaterialFromUi |
M.onCargoGenerated | Value: onCargoGenerated |
M.onCargoPickedUp | Value: onCargoPickedUp |
M.onDeactivateBigMapCallback | Value: onDeactivateBigMapCallback |
M.onDeliveryRewardsPopupClosed | Value: onDeliveryRewardsPopupClosed |
M.requestCargoDataForUi | Value: requestCargoDataForUi |
M.setBestRoute | Value: setBestRoute |
M.setCargoRoute | Value: setCargoRoute |
M.setVisibleIdsForBigMap | Value: setVisibleIdsForBigMap |
M.showCargoRoutePreview | Value: showCargoRoutePreview |
M.showLocationRoutePreview | Value: showLocationRoutePreview |
M.showRoutePreview | Value: showRoutePreview |
M.showVehicleOfferRoutePreview | Value: showVehicleOfferRoutePreview |
M.toggleOfferForSpawning | Value: toggleOfferForSpawning |
Delivery Cargo Cards
Builds card UI data for the cargo screen - grouping, sorting, filtering of cargo items by type, destination, container, and task.
Delivery General
Core delivery system module - manages delivery mode lifecycle, game time, save/load, vehicle cargo containers, weight updates, POI generation, and permission checks.