
All checks were successful
Build / Build (push) Successful in 28s
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.
101 lines
4.1 KiB
Plaintext
101 lines
4.1 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Fetches the locker
|
|
*
|
|
* Arguments:
|
|
* N/A
|
|
*
|
|
* Return Value:
|
|
* N/A
|
|
*
|
|
* Examples:
|
|
* [] call forge_client_locker_fnc_fetchLocker;
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
private _display = findDisplay IDD_LOCKERDIALOG;
|
|
private _itemList = _display displayCtrl IDC_LOCKEREQUIPMENTLIST;
|
|
private _locker = GETVAR(player,FORGE_Locker,[]);
|
|
|
|
{
|
|
_x params ["_itemType", "_item"];
|
|
private _index = -1;
|
|
|
|
switch (_itemType) do {
|
|
case "backpack": {
|
|
private _displayName = getText (configFile >> "CfgVehicles" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgVehicles" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "facewear": {
|
|
private _displayName = getText (configFile >> "CfgGlasses" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgGlasses" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "headgear": {
|
|
private _displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgWeapons" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "hmd": {
|
|
private _display = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgWeapons" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "item": {
|
|
private _displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgWeapons" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "magazine": {
|
|
private _displayName = format["%1 (%2/%3)", getText (configFile >> "CfgMagazines" >> (_item select 0) >> "displayName"), (_item select 1), (_item select 2)];
|
|
private _picture = getText (configFile >> "CfgMagazines" >> (_item select 0) >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "uniform": {
|
|
private _displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgWeapons" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "vest": {
|
|
private _displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgWeapons" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
case "weapon": {
|
|
private _displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
|
|
private _picture = getText (configFile >> "CfgWeapons" >> _item >> "picture");
|
|
|
|
_index = _itemList lbAdd _displayName;
|
|
_itemList lbSetData [_index, str [_itemType, _item]];
|
|
_itemList lbSetPicture [_index, _picture];
|
|
};
|
|
};
|
|
} forEach _locker; |