Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus"];
- private ["_vehicle", "_displayNameVehicle","_exit"];
- private ["_canDrag"];
- // _this==[_target, _menuNameOrParams]
- _target = _this select 0;
- _params = _this select 1;
- _menuName = "";
- _menuRsc = "popup";
- if (typeName _params == typeName []) then {
- if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
- _menuName = _params select 0;
- _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
- } else {
- _menuName = _params;
- };
- _pickedup = _target getVariable "sam_suav_pickedup";
- if (isnil ("_pickedup")) then {_target setVariable ["sam_suav_pickedup",0, false];};
- _upfalse = (_target getVariable "sam_suav_pickedup") == 0;
- _uptrue = (_target getVariable "sam_suav_pickedup") != 0;
- _battery = "Laserbatteries" in (magazines player);
- _camera = ("sam_falken_ti_camera" in (magazines player)) and ((typeOf _target) == "sam_falken_ccd") or ("sam_falken_ccd_camera" in (magazines player)) and ((typeOf _target) == "sam_falken_ti");
- _array = _target getVariable "sam_suav";
- _batterystatus = (_array select 0) != 0;
- _recovertrue = (_array select 1) != 0;
- _connected = !(isNull (_array select 2));
- _backpack = [player] call ACE_fnc_FindRuck;
- //----------------------------------------------------------------------------------------
- _menus = [
- [
- ["main", "", _menuRsc],
- [
- ["Pick up",
- {null execVM 'test_move.sqf'},
- "", "", "", -1, 1, _upfalse],
- ["Drop",
- {null execVM 'test_drop.sqf'},
- "", "", "", -1, 1, _uptrue],
- ["Launch",
- {null execVM 'test_launch.sqf'},
- "", "", "", -1, 1, _uptrue && _batterystatus && !_recovertrue && _connected],
- ["Change Battery",
- {null execVM 'test_battery.sqf'},
- "", "", "", -1, 1, _battery && _upfalse],
- ["Change Camera",
- {null execVM 'test_camera.sqf'},
- "", "", "", -1, 1, _camera && _upfalse],
- ["Recover",
- {null execVM 'test_reset.sqf'},
- "", "", "", -1, 1, _recovertrue && _upfalse],
- ["Put in backpack",
- {null execVM 'test_pack.sqf'},
- "", "", "", -1, 1, !_recovertrue && _upfalse && _backpack == "ACE_Backpack_US"]
- ]
- ]
- ];
- //-----------------------------------------------------------------------------
- _menuDef = [];
- {
- if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
- } forEach _menus;
- if (count _menuDef == 0) then {
- hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this} else {""}, __FILE__];
- diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
- };
- _menuDef // return value
Add Comment
Please, Sign In to add comment