Improve fillLeftPanel weapon tab filling

This commit is contained in:
Josuan Albin 2017-11-08 17:50:48 +01:00
parent d5642e1e32
commit 4ee7b172d3

View File

@ -39,26 +39,9 @@ switch true do {
private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"]; private _addEmpty = _ctrlPanel lbadd format [" <%1>",localize "str_empty"];
_ctrlPanel lbsetvalue [_addEmpty, -1]; _ctrlPanel lbsetvalue [_addEmpty, -1];
// Filling {
switch (_ctrlIDC) do { ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
case IDC_buttonPrimaryWeapon : { } foreach ((GVAR(virtualItems) select 0) select ([IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find _ctrlIDC));
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} foreach ((GVAR(virtualItems) select 0) select 0);
};
case IDC_buttonHandgun : {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} foreach ((GVAR(virtualItems) select 0) select 2);
};
case IDC_buttonSecondaryWeapon : {
{
["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem);
} foreach ((GVAR(virtualItems) select 0) select 1);
};
};
}; };
case (_ctrlIDC in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) : { case (_ctrlIDC in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]) : {