#include "..\script_component.hpp" /* * Author: IDSolutions * Initialize notification class * * Arguments: * N/A * * Return Value: * N/A * * Examples: * [] call forge_client_notifications_fnc_initNotificationClass * * Public: Yes */ #pragma hemtt ignore_variables ["_self"] GVAR(NotificationClass) = createHashMapObject [[ ["#type", "INotificationClass"], ["#create", { private _display = uiNamespace getVariable ["RscNotifications", nil]; private _control = _display displayCtrl 1004; _self set ["control", _control]; _self set ["isLoaded", false]; }], ["init", { private _params = ["success", "System Ready", "Notification system handshake complete!", 3000]; _self call ["create", _params]; _self set ["isLoaded", true]; systemChat format ["Notifications loaded for %1", (name player)]; diag_log "[FORGE:Client:Notifications] Notification Class Initialized!"; }], ["create", { params [["_type", "", ["info"]], ["_title", "", [""]], ["_content", "", [""]], ["_duration", 4000]]; private _control = _self get "control"; private _message = createHashMap; _message set ["type", _type]; _message set ["title", _title]; _message set ["message", _content]; _message set ["duration", _duration]; _control ctrlWebBrowserAction ["ExecJS", format ["window.dispatchEvent(new CustomEvent('forge:notify', { detail: %1 }))", (toJSON _message)]]; }] ]]; SETVAR(player,FORGE_NotificationClass,GVAR(NotificationClass)); GVAR(NotificationClass)