client/addons/arsenal/functions/fnc_updateUnlocks.sqf
Jacob Schmidt d474b3676a
All checks were successful
Build / Build (push) Successful in 28s
Refactor: Standardize function descriptions and variable handling
This commit refactors several client-side functions to improve code consistency and readability.

- Standardizes function descriptions by removing redundant "Function: forge_client..." prefixes and "[Description]" sections, focusing on concise descriptions of the function's purpose.
- Updates variable handling in arsenal functions to use GVAR and EGVARS for default values, improving consistency and reducing code duplication.
- Removes the bank init function as it is no longer needed.
- Adds a done variable to the preinit file.
2025-05-25 11:30:26 -05:00

44 lines
1.1 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Updates the arsenal system variables when unlocks change
*
* Arguments:
* 0: Type <STRING> ("armory" or "garage")
* 1: Data <ARRAY> (Array of unlocks)
*
* Return Value:
* None
*
* Examples:
* ["armory", _armory_unlocks] call forge_client_arsenal_fnc_updateUnlocks
*
* Public: Yes
*/
params [["_type", "", [""]], ["_data", [], [[]]]];
switch (_type) do {
case "armory": {
_data params ["_items", "_weapons", "_magazines", "_backpacks"];
GVAR(armory_unlocks) = _data;
GVAR(item_unlocks) = _items;
GVAR(weapon_unlocks) = _weapons;
GVAR(magazine_unlocks) = _magazines;
GVAR(backpack_unlocks) = _backpacks;
};
case "garage": {
_data params ["_cars", "_armor", "_helis", "_planes", "_naval", "_static"];
GVAR(garage_unlocks) = _data;
GVAR(car_unlocks) = _cars;
GVAR(armor_unlocks) = _armor;
GVAR(heli_unlocks) = _helis;
GVAR(plane_unlocks) = _planes;
GVAR(naval_unlocks) = _naval;
GVAR(static_unlocks) = _static;
};
};