Compare commits
No commits in common. "fd247922df4783b2678440be0345b68166c87e22" and "71438fe39381ddb57d2a9760422919b209c1b29c" have entirely different histories.
fd247922df
...
71438fe393
@ -1,7 +1,5 @@
|
||||
PREP(adminRefresh);
|
||||
PREP(handleEvents);
|
||||
PREP(handleTransfer);
|
||||
PREP(initAdmin);
|
||||
PREP(openAdmin);
|
||||
PREP(sendMessage);
|
||||
PREP(updatePaygrade);
|
||||
PREP(updatePaygrade);
|
||||
@ -2,12 +2,7 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
*
|
||||
* [Description]
|
||||
* Refreshes the admin interface player list and resets input fields.
|
||||
* This function populates the player list with names and paygrades,
|
||||
* storing player UIDs as data for each entry. Only shows players
|
||||
* on the same side as the admin.
|
||||
* Refreshes the admin interface
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Dummy <ANY> - Optional parameter, not used (for compatibility with event handlers)
|
||||
@ -19,10 +14,9 @@
|
||||
* [] call forge_client_admin_fnc_adminRefresh;
|
||||
* ["dummy"] call forge_client_admin_fnc_adminRefresh;
|
||||
*
|
||||
* Public: No - Called from admin dialog controls
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
|
||||
private _dialog = findDisplay 202303;
|
||||
private _list = _dialog displayCtrl 2023001;
|
||||
|
||||
@ -40,4 +34,4 @@ lbClear _list;
|
||||
|
||||
lbSetCurSel [2023001, 0];
|
||||
ctrlSetText [2023005, ""];
|
||||
ctrlSetText [2023006, ""];
|
||||
ctrlSetText [2023006, ""];
|
||||
@ -1,62 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: forge_client_admin_fnc_handleEvents
|
||||
* Author: IDSolutions
|
||||
*
|
||||
* [Description]
|
||||
* Handles events from the admin interface.
|
||||
* This function listens for events from the admin interface
|
||||
* and processes them accordingly.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event <STRING> - The event to handle
|
||||
* 1: Data <ANY> - The data associated with the event
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Examples:
|
||||
* ["EVENT_NAME", "DATA"] call forge_client_admin_fnc_handleEvents;
|
||||
*
|
||||
* Public: No - Called from admin dialog controls
|
||||
*/
|
||||
|
||||
params ["_control", "_isConfirmDialog", "_message"];
|
||||
|
||||
diag_log format ["[FORGE: Admin] Received event: %1", _message];
|
||||
|
||||
private _messageParts = _message splitString ":";
|
||||
private _event = _messageParts select 0;
|
||||
private _data = _messageParts select 1;
|
||||
|
||||
switch (_event) do {
|
||||
case "REQUEST_PLAYER_DATA": {
|
||||
private _playerData = createHashMap;
|
||||
private _playerList = [];
|
||||
|
||||
{
|
||||
private _player = _x;
|
||||
private _uid = getPlayerUID _player;
|
||||
private _name = name _player;
|
||||
private _paygrade = GETVAR(_player,FORGE_PayGrade,QUOTE(E1));
|
||||
private _funds = GETVAR(_player,FORGE_BankBalance,0);
|
||||
|
||||
private _playerInfo = createHashMapFromArray [
|
||||
["uid", _uid],
|
||||
["name", _name],
|
||||
["paygrade", _paygrade],
|
||||
["funds", _funds],
|
||||
["side", str (side _player)]
|
||||
];
|
||||
|
||||
_playerList pushBack _playerInfo;
|
||||
} forEach allPlayers;
|
||||
|
||||
_playerData set ["players", _playerList];
|
||||
_control ctrlWebBrowserAction ["ExecJS", format ["handlePlayerDataRequest(%1)", (toJSON _playerList)]];
|
||||
};
|
||||
default {
|
||||
diag_log format ["[FORGE: Admin] Unknown event: %1", _event];
|
||||
};
|
||||
};
|
||||
@ -1,16 +1,8 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: forge_client_admin_fnc_handleTransfer
|
||||
* Author: IDSolutions
|
||||
*
|
||||
* [Description]
|
||||
* Handles fund transfers through the admin interface.
|
||||
* This function retrieves the selected player's UID and amount
|
||||
* from the admin dialog, then sends it to the server-side admin store.
|
||||
* Supports multiple transfer types: advance (to single player),
|
||||
* deduct (from single player), advanceAll (to all players),
|
||||
* and payday (distribute based on paygrade).
|
||||
* Handles fund transfers
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Condition <STRING> - The type of transfer to perform ("advance", "deduct", "advanceAll", "payday")
|
||||
@ -33,8 +25,8 @@ private _index = lbCurSel _list;
|
||||
private _uid = _list lbData _index;
|
||||
private _amount = round (parseNumber (ctrlText 2023005));
|
||||
|
||||
if (_condition in ["advance", "deduct"] && ((isNil "_uid") || { _uid isEqualTo "" })) exitWith { hint "You did not select a player!"; };
|
||||
if ({_condition in ["advance", "deduct"]} && ((isNil "_uid") || { _uid isEqualTo "" })) exitWith { hint "You did not select a player!"; };
|
||||
|
||||
[_condition, _amount, _uid] remoteExec ["forge_server_admin_fnc_handleTransfer", 2];
|
||||
["forge_server_admin_handleEvents", ["ADMIN::TRANSFER", [_condition, _amount, _uid]]] call CFUNC(serverEvent);
|
||||
|
||||
ctrlSetText [2023005, ""];
|
||||
ctrlSetText [2023005, ""];
|
||||
@ -16,26 +16,8 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
disableSerialization;
|
||||
createDialog "RscAdmin";
|
||||
|
||||
private _dialog = findDisplay 202303;
|
||||
private _list = _dialog displayCtrl 2023001;
|
||||
private _list2 = _dialog displayCtrl 2023003;
|
||||
|
||||
{
|
||||
if (str (side _x) == str (playerSide) && isPlayer _x) then {
|
||||
private _name = name (_x);
|
||||
private _uid = getPlayerUID _x;
|
||||
private _payGrade = GETVAR(_x,FORGE_PayGrade,QUOTE(E1));
|
||||
private _index = _list lbAdd format["%1 - %2", _name, _payGrade];
|
||||
|
||||
_list lbSetData [_index, _uid];
|
||||
};
|
||||
} count (allPlayers);
|
||||
|
||||
lbSetCurSel [2023001, 0];
|
||||
|
||||
private _productVersion = productVersion;
|
||||
private _steamBranchName = _productVersion select 8;
|
||||
private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call BFUNC(getCfgData);
|
||||
|
||||
if (_steamBranchName == "profiling") then {
|
||||
@ -77,4 +59,4 @@ if (_steamBranchName == "profiling") then {
|
||||
|
||||
lbSetCurSel [2023003, 0];
|
||||
ctrlSetText [2023002, format ["$%1", (companyFunds call EFUNC(misc,formatNumber))]];
|
||||
};
|
||||
};
|
||||
@ -1,13 +1,8 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: forge_client_admin_fnc_sendMessage
|
||||
* Author: IDSolutions
|
||||
*
|
||||
* [Description]
|
||||
* Sends a message to a selected player through the admin interface.
|
||||
* This function retrieves the selected player's UID and message content
|
||||
* from the admin dialog, then sends it to the server-side admin store.
|
||||
* Sends a message to a selected player
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
@ -30,8 +25,6 @@ private _message = ctrlText _control;
|
||||
|
||||
if ((isNil "_uid") || {_uid isEqualTo ""}) exitWith { hintSilent "You did not select a player!"; };
|
||||
|
||||
[_uid, _message] remoteExec ["forge_server_admin_fnc_sendMessage", 2];
|
||||
["forge_server_admin_handleEvents", ["ADMIN::SEND::MESSAGE", [_uid, _message]]] call CFUNC(serverEvent);
|
||||
|
||||
hintSilent format ["Message sent to UID %1: %2", _uid, _message];
|
||||
|
||||
["dummy"] call FUNC(adminRefresh);
|
||||
["dummy"] call FUNC(adminRefresh);
|
||||
@ -1,13 +1,8 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: forge_client_admin_fnc_updatePaygrade
|
||||
* Author: IDSolutions
|
||||
*
|
||||
* [Description]
|
||||
* Updates a player's paygrade in the server's admin store.
|
||||
* This function retrieves the selected player's UID and the target paygrade
|
||||
* from the admin dialog, then sends it to the server-side admin store.
|
||||
* Updates a player's paygrade
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
@ -26,12 +21,12 @@ private _list = _dialog displayCtrl 2023001;
|
||||
private _list2 = _dialog displayCtrl 2023003;
|
||||
private _targetIndex = lbCurSel _list;
|
||||
private _rankIndex = lbCurSel _list2;
|
||||
private _targetUID = _list lbData _targetIndex;
|
||||
private _uid = _list lbData _targetIndex;
|
||||
private _rankData = call compile format ["%1", (_list2 lbData _rankIndex)];
|
||||
private _paygrade = _rankData select 0;
|
||||
|
||||
if ((isNil "_targetUID") || {_targetUID isEqualTo ""}) exitWith { hintSilent "You did not select a player!" };
|
||||
if ((isNil "_uid") || {_uid isEqualTo ""}) exitWith { hintSilent "You did not select a player!" };
|
||||
|
||||
[_targetUID, _paygrade] remoteExec ["forge_server_admin_fnc_updatePaygrade", 2];
|
||||
["forge_server_admin_handleEvents", ["ADMIN::UPDATE::PAYGRADE", [_uid, _paygrade]]] call CFUNC(serverEvent);
|
||||
|
||||
["dummy"] call FUNC(adminRefresh);
|
||||
["dummy"] call FUNC(adminRefresh);
|
||||
@ -2,8 +2,6 @@
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
*
|
||||
* [Description]
|
||||
* Initializes the arsenal system with armory and garage data
|
||||
*
|
||||
* Arguments:
|
||||
@ -19,11 +17,8 @@
|
||||
|
||||
params [["_armory_data", [], [[]]], ["_garage_data", [], [[]]]];
|
||||
|
||||
private _defaultArmory = [[],[],[],[]];
|
||||
private _defaultGarage = [[],[],[],[],[],[]];
|
||||
|
||||
if (!(_armory_data isEqualTypeArray _defaultArmory) || (count _armory_data != 4)) then { _armory_data = _defaultArmory; };
|
||||
if (!(_garage_data isEqualTypeArray _defaultGarage) || (count _garage_data != 6)) then { _garage_data = _defaultGarage; };
|
||||
if (!(_armory_data isEqualTypeArray GVAR(default_armory)) || (count _armory_data != 4)) then { _armory_data = GVAR(default_armory); };
|
||||
if (!(_garage_data isEqualTypeArray GVAR(default_garage)) || (count _garage_data != 6)) then { _garage_data = GVAR(default_garage); };
|
||||
if (GVAR(armory_type) == 0) then {
|
||||
{
|
||||
[GVAR(gear_box), _x, false, true, 1, _forEachIndex] call BFUNC(addVirtualItemCargo);
|
||||
@ -54,9 +49,4 @@ GVAR(static_unlocks) = _statics;
|
||||
|
||||
{
|
||||
[_x] call FUNC(addVirtualVehicles);
|
||||
} forEach GVAR(garage_unlocks);
|
||||
|
||||
private _armoryCount = count (_armory_data select { count _x > 0 });
|
||||
private _garageCount = count (_garage_data select { count _x > 0 });
|
||||
|
||||
TRACE_2("Arsenal System Initialized",_armoryCount,_garageCount);
|
||||
} forEach GVAR(garage_unlocks);
|
||||
@ -1,11 +1,10 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: forge_store_fnc_handleDelivery
|
||||
* Description:
|
||||
* Author: IDSolutions
|
||||
* Handles the delivery timer and locker updates for purchased items
|
||||
*
|
||||
* Parameters:
|
||||
* Arguments:
|
||||
* 0: New Locker Contents <ARRAY>
|
||||
*
|
||||
* Returns:
|
||||
@ -13,37 +12,36 @@
|
||||
*
|
||||
* Example:
|
||||
* [_newLocker] spawn forge_store_fnc_handleDelivery
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params [["_newLocker", [], [[]]]];
|
||||
|
||||
if (_newLocker isEqualTo []) exitWith {
|
||||
["Error: Empty locker contents", "error", 5] call FUNC(notify);
|
||||
};
|
||||
|
||||
private _deliveryTime = ["DT", 0] call BIS_fnc_getParamValue;
|
||||
|
||||
if (_newLocker isEqualTo []) exitWith {};
|
||||
if (_deliveryTime > 0) then {
|
||||
[
|
||||
format [
|
||||
"<t align='left'>Order Processing</t><br/><t size='0.8' align='left'>Estimated delivery: %1</t>",
|
||||
"<t align='left'>Order Processing</t><br/><t size='0.8' align='left'>Estimated delivery: %1</t>",
|
||||
[_deliveryTime, "MM:SS"] call BIS_fnc_secondsToString
|
||||
],
|
||||
"info",
|
||||
3,
|
||||
"left"
|
||||
] call FUNC(notify);
|
||||
"right"
|
||||
] call EFUNC(misc,notify);
|
||||
|
||||
sleep (_deliveryTime / 2);
|
||||
uiSleep (_deliveryTime / 2);
|
||||
|
||||
[
|
||||
"<t align='left'>Package in transit</t>",
|
||||
"warning",
|
||||
2,
|
||||
"left"
|
||||
] call FUNC(notify);
|
||||
|
||||
sleep (_deliveryTime / 2);
|
||||
] call EFUNC(misc,notify);
|
||||
|
||||
uiSleep (_deliveryTime / 2);
|
||||
|
||||
SETPVAR(player,FORGE_Locker,_newLocker);
|
||||
|
||||
@ -52,18 +50,18 @@ if (_deliveryTime > 0) then {
|
||||
"success",
|
||||
5,
|
||||
"left"
|
||||
] call FUNC(notify);
|
||||
|
||||
if (hasInterface) then {
|
||||
playSound "FD_Finish_F";
|
||||
};
|
||||
] call EFUNC(misc,notify);
|
||||
|
||||
if (hasInterface) then { playSound "FD_Finish_F"; };
|
||||
} else {
|
||||
SETPVAR(player,FORGE_Locker,_newLocker);
|
||||
|
||||
|
||||
[
|
||||
"<t align='left'>Order Complete!</t><br/><t size='0.8' align='left'>Items added to locker</t>",
|
||||
"success",
|
||||
3,
|
||||
5,
|
||||
"left"
|
||||
] call FUNC(notify);
|
||||
};
|
||||
] call EFUNC(misc,notify);
|
||||
|
||||
if (hasInterface) then { playSound "FD_Finish_F"; };
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user