client/addons/arsenal/functions/fnc_initArsenal.sqf
Jacob Schmidt 55f60dc71f feat: Revamp admin panel, store, and arsenal systems
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.
2025-05-03 19:33:10 -05:00

63 lines
2.2 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Function: forge_client_arsenal_fnc_initArsenal
* Author: IDSolutions
*
* [Description]
* Initializes the arsenal system with armory and garage data
*
* Arguments:
* 0: Armory data <ARRAY> - [items, weapons, magazines, backpacks]
* 1: Garage data <ARRAY> - [cars, armor, helicopters, planes, naval, static]
*
* Return Value:
* BOOLEAN - true if initialization successful, false if invalid data
*
* Example:
* [[_items, _weapons, _magazines, _backpacks], [_cars, _armor, _helis, _planes, _naval, _statics]] call forge_client_arsenal_fnc_initArsenal
*/
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 (GVAR(armory_type) == 0) then {
{
[GVAR(gear_box), _x, false, true, 1, _forEachIndex] call BFUNC(addVirtualItemCargo);
} forEach _armory_data;
} else {
{
[GVAR(gear_box), _x] call AFUNC(arsenal,addVirtualItems);
} forEach _armory_data;
};
_armory_data params [["_items", [], [[]]], ["_weapons", [], [[]]], ["_magazines", [], [[]]], ["_backpacks", [], [[]]]];
_garage_data params [["_cars", [], [[]]], ["_armor", [], [[]]], ["_helis", [], [[]]], ["_planes", [], [[]]], ["_naval", [], [[]]], ["_statics", [], [[]]]];
GVAR(armory_unlocks) = _armory_data;
GVAR(garage_unlocks) = _garage_data;
GVAR(item_unlocks) = _items;
GVAR(weapon_unlocks) = _weapons;
GVAR(magazine_unlocks) = _magazines;
GVAR(backpack_unlocks) = _backpacks;
GVAR(car_unlocks) = _cars;
GVAR(armor_unlocks) = _armor;
GVAR(heli_unlocks) = _helis;
GVAR(plane_unlocks) = _planes;
GVAR(naval_unlocks) = _naval;
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);