- replace placeholder garage interaction with real UI open flow - add catalog/session/UI bridge services for hydrate, sync, store, and retrieve actions - migrate garage web UI bundle to new app shell/runtime structure - align org/store function naming with shared init and UI bridge patterns
66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
if (isNil QGVAR(GarageCatalogService)) then { call FUNC(initCatalogService); };
|
|
if (isNil QGVAR(GarageClass)) then { call FUNC(initClass); };
|
|
if (isNil QGVAR(GarageSessionService)) then { call FUNC(initSessionService); };
|
|
if (isNil QGVAR(GarageUIBridge)) then { call FUNC(initUIBridge); };
|
|
if (isNil QGVAR(VGClass)) then { call FUNC(initVGClass); };
|
|
|
|
[QGVAR(initGarage), {
|
|
GVAR(GarageClass) call ["init", []];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseInitGarage), {
|
|
params [["_data", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(GarageClass) call ["sync", [_data]];
|
|
if !(isNil QGVAR(GarageUIBridge)) then {
|
|
GVAR(GarageUIBridge) call ["refreshGarage", []];
|
|
};
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseSyncGarage), {
|
|
params [["_data", createHashMap, [createHashMap, []]]];
|
|
|
|
GVAR(GarageClass) call ["sync", [_data]];
|
|
if !(isNil QGVAR(GarageUIBridge)) then {
|
|
GVAR(GarageUIBridge) call ["refreshGarage", []];
|
|
};
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseGarageAction), {
|
|
params [["_payload", createHashMap, [createHashMap]]];
|
|
|
|
if !(isNil QGVAR(GarageUIBridge)) then {
|
|
GVAR(GarageUIBridge) call ["handleActionResponse", [_payload]];
|
|
};
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(initVG), {
|
|
GVAR(VGClass) call ["init", []];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseInitVG), {
|
|
params [["_data", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(VGClass) call ["sync", [_data]];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseSyncVG), {
|
|
params [["_data", createHashMap, [createHashMap, []]]];
|
|
|
|
GVAR(VGClass) call ["sync", [_data]];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[{
|
|
EGVAR(bank,BankClass) get "isLoaded";
|
|
}, {
|
|
[QGVAR(initGarage), []] call CFUNC(localEvent);
|
|
}] call CFUNC(waitUntilAndExecute);
|
|
|
|
[{
|
|
GVAR(GarageClass) get "isLoaded";
|
|
}, {
|
|
[QGVAR(initVG), []] call CFUNC(localEvent);
|
|
}] call CFUNC(waitUntilAndExecute);
|