Cache dogtag actions (#6625)

This commit is contained in:
mharis001 2018-10-07 23:23:49 -04:00 committed by PabstMirror
parent 98bf92f406
commit 9aa34ab462

View File

@ -17,17 +17,22 @@
params ["_player"];
private _cfgWeapons = configFile >> "CfgWeapons";
private _actions = [];
private _fnc_getActions = {
private _actions = [];
private _cfgWeapons = configFile >> "CfgWeapons";
{
private _config = _cfgWeapons >> _x;
if (getNumber (_config >> QGVAR(tagID)) > 0) then {
private _displayName = getText (_config >> "displayName");
private _picture = getText (_config >> "picture");
private _action = [_x, _displayName, _picture, {_this call FUNC(checkDogtagItem)}, {true}, {}, _x] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _player];
};
} forEach (_player call EFUNC(common,uniqueItems));
{
private _config = _cfgWeapons >> _x;
if (getNumber (_config >> QGVAR(tagID)) > 0) then {
private _displayName = getText (_config >> "displayName");
private _picture = getText (_config >> "picture");
_actions
private _action = [_x, _displayName, _picture, FUNC(checkDogtagItem), {true}, {}, _x] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _player];
};
} forEach (_player call EFUNC(common,uniqueItems));
_actions
};
[[], _fnc_getActions, _player, QGVAR(actionsCache), 9999, "cba_events_loadoutEvent"] call EFUNC(common,cachedCall);