#include "..\script_component.hpp" /* * File: fnc_initVGStore.sqf * Author: IDSolutions * Date: 2025-12-17 * Last Update: 2026-01-10 * Public: No * * Description: * Initializes the Virtual Garage store for managing player vehicle unlocks. * Provides methods for syncing, saving, and applying virtual vehicles to BIS Garage. * * Parameter(s): * N/A * * Returns: * Something [BOOL] * * Example(s): * [parameter] call forge_x_component_fnc_myFunction */ #pragma hemtt ignore_variables ["_self"] private _typeVGarage = compileFinal createHashMapFromArray [ ["#base", EGVAR(common,BaseStore)], ["#type", "IVGarageBase"], ["init", { params [["_uid", "", [""]], ["_defaultVGarage", createHashMap, [createHashMap]]]; private _finalVGarage = createHashMap; ["owned:garage:exists", [_uid]] call EFUNC(extension,extCall) params ["_result", "_isSuccess"]; private _exists = _result == "true"; if !(_exists) then { _finalVGarage = _defaultVGarage; ["owned:garage:create", [_uid]] call EFUNC(extension,extCall); ["INFO", format ["Created new VGarage for %1", _uid], nil, nil] call EFUNC(common,log); } else { private _existingVGarage = _self call ["fetch", ["owned:garage:fetch", _uid]]; _finalVGarage = _existingVGarage; { if !(_x in _finalVGarage) then { _finalVGarage set [_x, _y]; }; } forEach _defaultVGarage; }; GVAR(VGarageRegistry) set [_uid, _finalVGarage]; private _player = [_uid] call EFUNC(common,getPlayer); [CRPC(garage,responseInitVG), [_finalVGarage], _player] call CFUNC(targetEvent); _finalVGarage }] ]; GVAR(VGarageStore) = createHashMapObject [[ ["#base", _typeVGarage], ["#type", "IVGarageStore"], ["#create", { GVAR(VGarageRegistry) = createHashMap; ["INFO", "VGarage Store Initialized!", nil, nil] call EFUNC(common,log); }] ]]; SETMVAR(FORGE_VGarageStore,GVAR(VGarageStore)); GVAR(VGarageStore)