From d7d43ce3b1c922b647f9eaa4cd0fe53f8b2911bb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 29 Apr 2015 01:26:13 -0500 Subject: [PATCH] #828 - Private Variables for Interact Menu --- addons/interact_menu/XEH_clientInit.sqf | 2 +- addons/interact_menu/functions/fnc_compileMenu.sqf | 3 +-- addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf | 4 ++-- addons/interact_menu/functions/fnc_createAction.sqf | 1 + addons/interact_menu/functions/fnc_findActionNode.sqf | 2 +- addons/interact_menu/functions/fnc_removeActionFromClass.sqf | 2 +- addons/interact_menu/functions/fnc_render.sqf | 2 +- addons/interact_menu/functions/fnc_renderActionPoints.sqf | 2 +- addons/interact_menu/functions/fnc_renderBaseMenu.sqf | 2 +- addons/interact_menu/functions/fnc_renderIcon.sqf | 2 +- addons/interact_menu/functions/fnc_renderMenu.sqf | 2 +- addons/interact_menu/functions/fnc_renderSelector.sqf | 3 ++- addons/interact_menu/functions/fnc_setupTextColors.sqf | 2 +- addons/interact_menu/functions/fnc_splitPath.sqf | 2 +- addons/interact_menu/script_component.hpp | 2 ++ 15 files changed, 18 insertions(+), 15 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index faabf773f4..5714b77e16 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -8,7 +8,7 @@ GVAR(ParsedTextCached) = []; //Setup text/shadow color matrix [] call FUNC(setupTextColors); ["SettingChanged", { - PARAMS_2(_name,_value); + PARAMS_1(_name); if ((_name == QGVAR(colorTextMax)) || {_name == QGVAR(colorTextMin)} || {_name == QGVAR(colorShadowMax)} || {_name == QGVAR(colorShadowMin)}) then { [] call FUNC(setupTextColors); }; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index bd2023a90d..f5296ec9cf 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -26,8 +26,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { - private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; + private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction", "_i"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 0258b3dc8a..e4c449ce80 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -14,7 +14,7 @@ EXPLODE_1_PVT(_this,_target); -private ["_objectType","_actionsVarName"]; +private ["_objectType","_actionsVarName", "_canCollapse", "_children", "_enableInside", "_entry", "_entryCfg", "_i", "_insertChildren", "_modifierFunction", "_runOnHover"]; _objectType = _target; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; @@ -26,7 +26,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { - private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", + private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index fb3f05b7b5..a7d939722e 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -28,6 +28,7 @@ EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition); +// IGNORE_PRIVATE_WARNING(_target); private ["_insertChildren","_customParams","_position","_distance","_params", "_modifierFunction"]; _insertChildren = if (count _this > 5) then { diff --git a/addons/interact_menu/functions/fnc_findActionNode.sqf b/addons/interact_menu/functions/fnc_findActionNode.sqf index 4027b7a852..b8639754d2 100644 --- a/addons/interact_menu/functions/fnc_findActionNode.sqf +++ b/addons/interact_menu/functions/fnc_findActionNode.sqf @@ -19,7 +19,7 @@ EXPLODE_2_PVT(_this,_actionTreeList,_parentPath); -private ["_parentNode", "_foundParentNode", "_fnc_findFolder"]; +private ["_parentNode", "_foundParentNode", "_fnc_findFolder", "_actionTree"]; // Hack to make this work on the root node too if (count _parentPath == 0) exitWith { diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 898228d6d8..c407273258 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -19,7 +19,7 @@ EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); -private ["_res","_varName","_actionTrees"]; +private ["_res","_varName","_actionTrees", "_actionIndex", "_parentLevel", "_parentNode"]; _res = _fullPath call FUNC(splitPath); EXPLODE_2_PVT(_res,_parentPath,_actionName); diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 01a550eb91..06c155ac54 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -14,7 +14,7 @@ BEGIN_COUNTER(fnc_render); -private ["_cursorPos1", "_cursorPos2", "_cursorVec", "_p1", "_p2", "_p", "_v", "_cp", "_forEachIndex", "_renderTargets", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_pos", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i"]; +private ["_cursorPos1", "_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"]; _foundTarget = false; _cursorPos1 = positionCameraToWorld [0, 0, 0]; _cursorPos2 = positionCameraToWorld [0, 0, 2]; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 78d5418e5a..8e6cb7d390 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -14,7 +14,7 @@ GVAR(currentOptions) = []; -private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active","_cameraPos","_cameraDir"]; +private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos"]; _player = ACE_player; _fnc_renderNearbyActions = { diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index a5214ddcbe..8df24f9e55 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -16,7 +16,7 @@ BEGIN_COUNTER(fnc_renderBaseMenu) -private ["_distance","_pos","_weaponDir","_ref","_cameraPos","_sPos","_activeActionTree"]; +private ["_distance","_pos","_weaponDir","_ref","_sPos","_activeActionTree", "_line"]; EXPLODE_2_PVT(_this,_object,_baseActionNode); EXPLODE_1_PVT(_baseActionNode,_actionData); diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index ec56c5a653..642464028d 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" #define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa) -private ["_ctrl", "_pos"]; +private ["_ctrl", "_pos", "_displayNum"]; PARAMS_6(_text,_icon,_sPos,_textColor,_shadowColor,_iconColor); //systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1]; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index e80e9d41ab..a050374786 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; +private ["_menuInSelectedPath", "_path", "_menuDepth", "_x", "_offset", "_newPos", "_forEachIndex", "_player", "_pos", "_shadowColor", "_target", "_textColor"]; EXPLODE_4_PVT(_this,_parentPath,_action,_sPos,_angles); EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index ca2f06d63f..569fa79198 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -15,12 +15,13 @@ EXPLODE_2_PVT(_this,_sPos,_icon); +private ["_displayNum", "_ctrl", "_pos"]; + if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); }; -private ["_ctrl", "_pos"]; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); GVAR(iconCount) = GVAR(iconCount) + 1; diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index 5df9c589da..58f9995985 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -private ["_mixColor", "_rowT", "_rowS", "_menuDepth", "_pathCount", "_menuInSelectedPath", "_color", "_path"]; +private ["_mixColor", "_rowT", "_rowS", "_menuDepth", "_pathCount"]; //Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text _mixColor = { diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf index 935e947b30..790ae83466 100644 --- a/addons/interact_menu/functions/fnc_splitPath.sqf +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -private ["_parentPath","_actionName"]; +private ["_parentPath","_actionName", "_i"]; _parentPath = []; for [{_i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do { _parentPath pushBack (_this select _i); diff --git a/addons/interact_menu/script_component.hpp b/addons/interact_menu/script_component.hpp index a086b02613..3117065ca2 100644 --- a/addons/interact_menu/script_component.hpp +++ b/addons/interact_menu/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT interact_menu #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_INTERACT_MENU #define DEBUG_MODE_FULL #endif