Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Written by beta
- //Self interaction setup
- #include "\ca\editor\Data\Scripts\dikCodes.h"
- private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus"];
- // _this==[_target, _menuNameOrParams]
- _target = _this select 0;
- _params = _this select 1;
- _menuName = "";
- _menuRsc = "buttonList";
- 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;
- };
- //-----------------------------------------------------------------------------
- _menus =
- [
- [
- ["main", "krauseSelfInteracts", _menuRsc],
- [
- [
- "Toggle Overlay on/off",
- "[] execVM 'scriptname.sqf'",
- "","","", -1, 1, (boolean condition)
- ]
- ]
- ]
- ];
- //-----------------------------------------------------------------------------
- _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