- Wire org portal credit-line requests/responses through SQF bridge and UI events - Sync `creditLines` in org payloads and refresh portal state after org sync - Add store payment sources (cash, bank, org funds, credit line) and expose selection in cart UI - Scaffold server-side store addon initialization/config files
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
if (isNil QGVAR(OrgClass)) then { call FUNC(initOrgClass); };
|
|
if (isNil QGVAR(OrgUIBridge)) then { call FUNC(initOrgUIBridge); };
|
|
|
|
[QGVAR(initOrg), {
|
|
GVAR(OrgClass) call ["init", []];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseInitOrg), {
|
|
params [["_data", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(OrgClass) call ["sync", [_data, true]];
|
|
GVAR(OrgUIBridge) call ["refreshPortal", []];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseSyncOrg), {
|
|
params [["_data", createHashMap, [createHashMap]], ["_jip", false, [false]]];
|
|
|
|
GVAR(OrgClass) call ["sync", [_data, _jip]];
|
|
GVAR(OrgUIBridge) call ["refreshPortal", []];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseCreateOrg), {
|
|
params [["_payload", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(OrgUIBridge) call ["handleCreateResponse", [_payload]];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseDisbandOrg), {
|
|
params [["_payload", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(OrgUIBridge) call ["handleDisbandResponse", [_payload]];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseLeaveOrg), {
|
|
params [["_payload", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(OrgUIBridge) call ["handleLeaveResponse", [_payload]];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseCreditLine), {
|
|
params [["_payload", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(OrgUIBridge) call ["handleCreditLineResponse", [_payload]];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[{
|
|
EGVAR(actor,ActorClass) get "isLoaded";
|
|
}, {
|
|
[QGVAR(initOrg), []] call CFUNC(localEvent);
|
|
}] call CFUNC(waitUntilAndExecute);
|