forge/arma/client/addons/store/functions/fnc_handleUIEvents.sqf
Jacob Schmidt 09ab290b5a Add live category hydration and paged store catalog UI
- route new `store::category::request` bridge events from UI to SQF and hydrate category items from game configs
- cache and format generated catalog entries (types, descriptions, prices, images) in the store bridge/class
- update storefront UI with category loading states, image media support, and next/previous catalog pagination
2026-03-10 22:20:38 -05:00

42 lines
1.2 KiB
Plaintext

#include "..\script_component.hpp"
/*
* File: fnc_handleUIEvents.sqf
* Author: IDSolutions
* Date: 2026-01-28
* Last Update: 2026-03-11
* Public: No
*
* Description:
* Handles the UI events.
*
* Arguments:
* 0: [CONTROL] - The control that triggered the event
* 1: [BOOL] - Whether the event is from a confirm dialog
* 2: [STRING] - The message containing the event data
*
* Return Value:
* UI events handled [BOOL]
*
* Example:
* call forge_client_store_fnc_handleUIEvents;
*/
params ["_control", "_isConfirmDialog", "_message"];
private _alert = fromJSON _message;
private _event = _alert get "event";
private _data = _alert get "data";
diag_log format ["[FORGE:Client:Store] Handling UI event: %1 with data: %2", _event, _data];
switch (_event) do {
case "store::close": { closeDialog 1; };
case "store::ready": { GVAR(StoreUIBridge) call ["handleReady", [_control]]; };
case "store::category::request": { GVAR(StoreUIBridge) call ["handleCategoryRequest", [_data]]; };
case "store::checkout::request": { GVAR(StoreUIBridge) call ["handleCheckoutRequest", [_data]]; };
default { hint format ["Unhandled UI event: %1", _event]; };
};
true;