client/addons/garage/functions/fnc_fetchGarage.sqf
2025-01-04 19:26:35 -06:00

22 lines
877 B
Plaintext

#include "..\script_component.hpp"
private _display = findDisplay IDD_GARAGEDIALOG;
private _garageList = _display displayCtrl IDC_GARAGEVEHICLELIST;
// private _storedVehicles = player getVariable ["FORGE_Garage", []];
private _storedVehicles = GETVAR(player,FORGE_Garage,[]);
lbClear _garageList;
{
// _x params ["_vehType", "_className", "_vehData"];
_x params ["_vehType", "_className"];
private _index = -1;
private _displayName = getText (configFile >> "CfgVehicles" >> _className >> "displayName");
private _picture = getText (configFile >> "CfgVehicles" >> _className >> "picture");
_index = _garageList lbAdd _displayName;
// _garageList lbSetData [_index, str [_vehType, _className, _vehData]];
_garageList lbSetData [_index, str [_vehType, _className]];
_garageList lbSetPicture [_index, _picture];
} forEach _storedVehicles;