
This commit introduces significant changes to the admin panel, store, and arsenal systems, focusing on improved functionality, UI enhancements, and code optimization. **Admin Panel:** - Migrated to a web-based UI for improved user experience and maintainability. - Implemented dynamic player listing with filtering and search capabilities. - Added functionality for managing player paygrades, sending messages, and transferring funds. - Integrated server-side events for handling admin actions. **Store:** - Added `handleDelivery` event handler. - Streamlined product selection and purchase processes. - Improved handling of organization funds and player balances. - Refactored code for better readability and maintainability. **Arsenal:** - Enhanced initialization process with improved data validation. - Optimized item unlocking logic. These changes aim to provide a more robust, user-friendly, and efficient experience for both administrators and players.
65 lines
1.7 KiB
Plaintext
65 lines
1.7 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Function: forge_client_admin_fnc_openAdmin
|
|
* Author: IDSolutions
|
|
*
|
|
* [Description]
|
|
* Opens the admin menu.
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Examples:
|
|
* None
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
private _productVersion = productVersion;
|
|
private _steamBranchName = _productVersion select 8;
|
|
private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call BFUNC(getCfgData);
|
|
|
|
if (_steamBranchName == "profiling") then {
|
|
private _display = (findDisplay 46) createDisplay "RscWebAdmin";
|
|
private _ctrl = _display displayCtrl 2025;
|
|
|
|
_ctrl ctrlAddEventHandler ["JSDialog", {
|
|
params ["_control", "_isConfirmDialog", "_message"];
|
|
[QGVAR(handleEvents), [_control, _isConfirmDialog, _message]] call CFUNC(localEvent);
|
|
}];
|
|
|
|
_ctrl ctrlWebBrowserAction ["LoadFile", QUOTE(PATHTOF(ui\_site\index.html))];
|
|
} else {
|
|
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 _index = _list2 lbAdd format ["%1 - $%2", (_x select 0), ((_x select 1) call EFUNC(misc,formatNumber))];
|
|
|
|
_list2 lbSetData [_index, str _x];
|
|
} forEach _payGrades;
|
|
|
|
lbSetCurSel [2023003, 0];
|
|
ctrlSetText [2023002, format ["$%1", (companyFunds call EFUNC(misc,formatNumber))]];
|
|
}; |