2015-01-11 16:42:31 +00:00
/*
2015-02-03 02:04:50 +00:00
* Author: bux578
* Open the select menu with the "personal" items of a frisked unit. It only shows "handgunWeapon", "uniformItems", "vestItems", "backpackItems" and "assignedItems" because every other item is visible on the character
*
* Arguments:
* 0: player unit <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
2015-02-06 23:03:56 +00:00
* [player, bob] call ACE_captives_fnc_doFristPerson;
2015-02-03 02:04:50 +00:00
*
* Public: No
*/
#include "script_component.hpp"
2015-01-11 16:42:31 +00:00
2015-02-03 02:04:50 +00:00
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
2015-01-11 16:42:31 +00:00
2015-08-04 23:15:20 +00:00
params ["_player", "_unit"];
2015-01-11 16:42:31 +00:00
_weapon = currentWeapon _player;
if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
2015-02-04 05:56:51 +00:00
[_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation);
2015-01-11 16:42:31 +00:00
};
_listedItemClasses = [];
2015-05-28 19:59:04 +00:00
_actions = [localize LSTRING(FriskMenuHeader), ""] call ACE_Interaction_fnc_prepareSelectMenu;
2015-01-11 16:42:31 +00:00
_allGear = [];
if ((handgunWeapon _unit) != "") then {
2015-02-04 05:56:51 +00:00
_allGear pushBack (handgunWeapon _unit);
2015-01-11 16:42:31 +00:00
};
if (count (uniformItems _unit) > 0) then {
2015-02-04 05:56:51 +00:00
_allGear = _allGear + (uniformItems _unit);
2015-01-11 16:42:31 +00:00
};
if (count (vestItems _unit) > 0) then {
2015-02-04 05:56:51 +00:00
_allGear = _allGear + (vestItems _unit);
2015-01-11 16:42:31 +00:00
};
if (count (backpackItems _unit) > 0) then {
2015-02-04 05:56:51 +00:00
_allGear = _allGear + (backpackItems _unit);
2015-01-11 16:42:31 +00:00
};
if (count (assignedItems _unit) > 0) then {
2015-02-04 05:56:51 +00:00
_allGear = _allGear + (assignedItems _unit);
2015-01-11 16:42:31 +00:00
};
// Handgun
// Uniform Items
// Vest Items
// Backpack Items
// Assigned Items
{
2015-02-04 05:56:51 +00:00
if (!(_x in _listedItemClasses)) then {
private "_item";
_item = configFile >> "CfgMagazines" >> _x;
if (isNil "_item" || str _item == "") then { //str _item ?
_item = configFile >> "CfgWeapons" >> _x;
};
_actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call ACE_Interaction_fnc_addSelectableItem;
_listedItemClasses pushBack _x;
2015-01-11 16:42:31 +00:00
};
} forEach (_allGear);
2015-02-03 02:04:50 +00:00
[_actions, {call ACE_Interaction_fnc_hideMenu;}, {call ACE_Interaction_fnc_hideMenu;}] call ACE_Interaction_fnc_openSelectMenu;
2015-01-11 16:42:31 +00:00
// don't need an "Ok" Button
ctrlShow [8860, false];