ACE3/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf
Dedmen Miller e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00

119 lines
3.6 KiB
Plaintext

#include "script_component.hpp"
#include "..\defines.hpp"
/*
* Author: Alganthe
* Update the list of unique items.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
GVAR(virtualItems) set [18, []];
GVAR(virtualItems) set [19, []];
GVAR(virtualItems) set [20, []];
GVAR(virtualItems) set [21, []];
GVAR(virtualItems) set [22, [[], [], [], []]];
GVAR(virtualItems) set [23, []];
GVAR(virtualItems) set [24, []];
private _array = LIST_DEFAULTS select 2;
private _itemsCache = uiNamespace getVariable QGVAR(configItems);
private _configCfgWeapons = configFile >> "CfgWeapons";
private _configMagazines = configFile >> "CfgMagazines";
private _configVehicles = configFile >> "CfgVehicles";
private _configGlasses = configFile >> "CfgGlasses";
{
switch true do {
// Weapon mag
case (
isClass (_configMagazines >> _x) &&
{_x in (_itemsCache select 2)} &&
{!(_x in (GVAR(virtualItems) select 2))}
): {
(GVAR(virtualItems) select 19) pushBackUnique _x;
};
// Mag throw
case (
isClass (_configMagazines >> _x) &&
{_x in (_itemsCache select 15)} &&
{!(_x in (GVAR(virtualItems) select 15))}
): {
(GVAR(virtualItems) select 20) pushBackUnique _x;
};
// Mag put
case (
isClass (_configMagazines >> _x) &&
{_x in (_itemsCache select 16)} &&
{!(_x in (GVAR(virtualItems) select 16))}
): {
(GVAR(virtualItems) select 21) pushBackUnique _x;
};
// acc
case (
isClass (_configCfgWeapons >> _x) &&
{!(_x in ((GVAR(virtualItems) select 1) select 0))} &&
{_x in ((_itemsCache select 1) select 0)}
): {
((GVAR(virtualItems) select 22) select 0) pushBackUnique _x;
};
// acc
case (
isClass (_configCfgWeapons >> _x) &&
{!(_x in ((GVAR(virtualItems) select 1) select 1))} &&
{_x in ((_itemsCache select 1) select 1)}
): {
((GVAR(virtualItems) select 22) select 1) pushBackUnique _x;
};
// acc
case (
isClass (_configCfgWeapons >> _x) &&
{!(_x in ((GVAR(virtualItems) select 1) select 2))} &&
{_x in ((_itemsCache select 1) select 2)}
): {
((GVAR(virtualItems) select 22) select 2) pushBackUnique _x;
};
// acc
case (
isClass (_configCfgWeapons >> _x) &&
{!(_x in ((GVAR(virtualItems) select 1) select 3))} &&
{_x in ((_itemsCache select 1) select 3)}
): {
((GVAR(virtualItems) select 22) select 3) pushBackUnique _x;
};
// Misc
case (
isClass (_configCfgWeapons >> _x) &&
{!(_x in (GVAR(virtualItems) select 17))} &&
{!(_x in ((_itemsCache select 1) select 0))} &&
{!(_x in ((_itemsCache select 1) select 1))} &&
{!(_x in ((_itemsCache select 1) select 2))} &&
{!(_x in ((_itemsCache select 1) select 3))}
): {
(GVAR(virtualItems) select 18) pushBackUnique _x;
};
// Backpacks
case (isClass (_configVehicles >> _x)): {
(GVAR(virtualItems) select 23) pushBackUnique _x;
};
// Facewear
case (isClass (_configGlasses >> _x)): {
(GVAR(virtualItems) select 24) pushBackUnique _x;
};
};
} foreach _array;