forge/arma/client/addons/bank/XEH_postInitClient.sqf
Jacob Schmidt 5c76d59baf feat: add mobile banking app and integrate into phone UI
- Implemented wallet app functionality including account management, transaction handling, and user notifications.
- Updated HomeScreen to include Wallet app icon.
- Enhanced StateManager to maintain mobile bank state.
- Created wallet-specific styles for UI consistency.
- Updated CSS and JS concatenation scripts to include wallet resources.
2026-05-19 20:58:57 -05:00

73 lines
2.4 KiB
Plaintext

#include "script_component.hpp"
if (isNil QGVAR(BankRepository)) then { call FUNC(initRepository); };
if (isNil QGVAR(BankUIBridge)) then { call FUNC(initUIBridge); };
GVAR(sendPhoneBankEvent) = {
params [["_functionName", "", [""]], ["_arguments", [], [[]]]];
private _display = uiNamespace getVariable ["RscPhone", displayNull];
if (isNull _display || { _functionName isEqualTo "" }) exitWith { false };
private _control = _display displayCtrl 1001;
if (isNull _control) exitWith { false };
private _serializedArguments = _arguments apply { toJSON _x };
private _script = format [
"window.%1 && window.%1(%2)",
_functionName,
_serializedArguments joinString ", "
];
_control ctrlWebBrowserAction ["ExecJS", _script];
true
};
[QGVAR(initBank), {
GVAR(BankRepository) call ["init", []];
}] call CFUNC(addEventHandler);
[QGVAR(responseInitBank), {
params [["_data", createHashMap, [createHashMap]]];
GVAR(BankRepository) call ["markLoaded", []];
if !(isNil QGVAR(BankUIBridge)) then {
GVAR(BankUIBridge) call ["handleAccountSyncResponse", [_data]];
};
["updateMobileBankAccount", [_data]] call GVAR(sendPhoneBankEvent);
}] call CFUNC(addEventHandler);
[QGVAR(responseSyncBank), {
params [["_data", createHashMap, [createHashMap]], ["_jip", false, [false]]];
GVAR(BankRepository) call ["markLoaded", []];
if !(isNil QGVAR(BankUIBridge)) then {
GVAR(BankUIBridge) call ["handleAccountSyncResponse", [_data]];
};
["updateMobileBankAccount", [_data]] call GVAR(sendPhoneBankEvent);
}] call CFUNC(addEventHandler);
[QGVAR(responseHydrateBank), {
params [["_data", createHashMap, [createHashMap]]];
if !(isNil QGVAR(BankUIBridge)) then {
GVAR(BankUIBridge) call ["handleHydrateResponse", [_data, "bank::hydrate"]];
};
["updateMobileBank", [_data]] call GVAR(sendPhoneBankEvent);
}] call CFUNC(addEventHandler);
[QGVAR(responseBankNotice), {
params [["_type", "error", [""]], ["_message", "", [""]]];
if !(isNil QGVAR(BankUIBridge)) then {
GVAR(BankUIBridge) call ["handleNoticeResponse", [_type, _message]];
};
["showMobileBankNotice", [_type, _message]] call GVAR(sendPhoneBankEvent);
}] call CFUNC(addEventHandler);
[{
EGVAR(actor,ActorRepository) get "isLoaded";
}, {
[QGVAR(initBank), []] call CFUNC(localEvent);
}] call CFUNC(waitUntilAndExecute);