diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index b681c0f7f7..047549dfba 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -2,9 +2,6 @@ #define MACRO_ATTACHTOVEHICLE \ class ACE_Actions { \ class ACE_MainActions { \ - selection = ""; \ - distance = 5; \ - condition = "true"; \ class GVAR(AttachVehicle) { \ displayName = "$STR_ACE_Attach_AttachDetach"; \ condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ diff --git a/addons/attach/functions/fnc_openAttachUI.sqf b/addons/attach/functions/fnc_openAttachUI.sqf index 5533956bb6..1b95be9b84 100644 --- a/addons/attach/functions/fnc_openAttachUI.sqf +++ b/addons/attach/functions/fnc_openAttachUI.sqf @@ -62,6 +62,5 @@ _attachables = items _unit; }, { call EFUNC(interaction,hideMenu); - if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)}; } ] call EFUNC(interaction,openSelectMenu); diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 3e4147eee1..b6f9edd576 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -2,34 +2,26 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_Actions { - class ACE_RightHandActions { + + class ACE_ApplyHandcuffs { + displayName = "$STR_ACE_Captives_SetCaptive"; selection = "righthand"; - displayName = "Right hand"; - distance = 5; - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)) || ([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs))); - class ACE_ApplyHandcuffs { - displayName = "$STR_ACE_Captives_SetCaptive"; - distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); - exceptions[] = {}; - showDisabled = 0; - priority = 2.4; - icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); - hotkey = "C"; - }; - class ACE_RemoveHandcuffs { - displayName = "$STR_ACE_Captives_ReleaseCaptive"; - distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); - exceptions[] = {}; - showDisabled = 0; - priority = 2.4; - icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); - hotkey = "R"; - }; + distance = 2; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); + exceptions[] = {}; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); }; + class ACE_RemoveHandcuffs { + displayName = "$STR_ACE_Captives_ReleaseCaptive"; + selection = "righthand"; + distance = 2; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); + exceptions[] = {}; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); + }; + class ACE_MainActions { class ACE_EscortCaptive { displayName = "$STR_ACE_Captives_EscortCaptive"; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 62fbd7404f..97c9b9c906 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -15,6 +15,7 @@ PREP(addSetting); PREP(adminKick); PREP(ambientBrightness); PREP(applyForceWalkStatus); +PREP(ASLToPosition); PREP(beingCarried); PREP(binarizeNumber); PREP(blurScreen); @@ -135,6 +136,7 @@ PREP(onLoadRscDisplayChannel); PREP(owned); PREP(player); PREP(playerSide); +PREP(positionToASL); PREP(progressBar); PREP(queueAnimation); PREP(readSettingFromModule); diff --git a/addons/common/functions/fnc_ASLToPosition.sqf b/addons/common/functions/fnc_ASLToPosition.sqf new file mode 100644 index 0000000000..41e532d39b --- /dev/null +++ b/addons/common/functions/fnc_ASLToPosition.sqf @@ -0,0 +1,21 @@ +/* + * Author: CAA-Picard + * Converts ASL to Arma "Position" + * + * Arguments: + * 0: position x + * 1: position y + * 2: position z + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +if (surfaceIsWater _this) then { + _this +} else { + ASLtoATL _this +}; diff --git a/addons/common/functions/fnc_positionToASL.sqf b/addons/common/functions/fnc_positionToASL.sqf new file mode 100644 index 0000000000..916184eb33 --- /dev/null +++ b/addons/common/functions/fnc_positionToASL.sqf @@ -0,0 +1,21 @@ +/* + * Author: CAA-Picard + * Converts Arma "Position" to ASL + * + * Arguments: + * 0: position x + * 1: position y + * 2: position z + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +if (surfaceIsWater _this) then { + _this +} else { + ATLtoASL _this +}; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 983bc0972a..a1f0aa5944 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -16,7 +16,6 @@ class CfgVehicles { showDisabled = 1; priority = 4; icon = PATHTOF(UI\Explosives_Menu_ca.paa); - subMenu[] = {"ACE_Explosives", 1}; hotkey = "X"; //Sub-menu items class ACE_Detonate { diff --git a/addons/explosives/functions/fnc_openPlaceUI.sqf b/addons/explosives/functions/fnc_openPlaceUI.sqf index 5ad79381b1..6eb2d478bf 100644 --- a/addons/explosives/functions/fnc_openPlaceUI.sqf +++ b/addons/explosives/functions/fnc_openPlaceUI.sqf @@ -51,8 +51,5 @@ _actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosive }, { call EFUNC(interaction,hideMenu); - if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then { - "ACE_Explosives" call EFUNC(interaction,openMenuSelf); - }; } ] call EFUNC(interaction,openSelectMenu); diff --git a/addons/explosives/functions/fnc_openTransmitterUI.sqf b/addons/explosives/functions/fnc_openTransmitterUI.sqf index b87673c214..f90636474e 100644 --- a/addons/explosives/functions/fnc_openTransmitterUI.sqf +++ b/addons/explosives/functions/fnc_openTransmitterUI.sqf @@ -43,9 +43,6 @@ if (count _detonators == 0) then { }, { call EFUNC(interaction,hideMenu); - if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then { - "ACE_Explosives" call EFUNC(interaction,openMenuSelf); - }; } ] call EFUNC(interaction,openSelectMenu); }; diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 72e8e7249e..d3ea2451b9 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -5,6 +5,7 @@ ADDON = false; PREP(addAction); PREP(compileMenu); PREP(compileMenuSelfAction); +PREP(collectActiveActionTree); PREP(keyDown); PREP(keyDownSelfAction); PREP(keyUp); @@ -12,10 +13,8 @@ PREP(keyUpSelfAction); PREP(removeAction); PREP(render); PREP(renderIcon); +PREP(renderBaseMenu); PREP(renderMenu); -PREP(rotateVectLine); -PREP(rotateVectLineGetMap); -PREP(updateVecLineMap); GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; @@ -29,7 +28,6 @@ GVAR(actionSelected) = false; GVAR(selectedTarget) = objNull; GVAR(menuDepthPath) = []; -GVAR(vecLineMap) = []; GVAR(lastPos) = [0,0,0]; GVAR(currentOptions) = []; @@ -42,6 +40,4 @@ GVAR(startHoverTime) = diag_tickTime; GVAR(iconCtrls) = []; GVAR(iconCount) = 0; -GVAR(uidCounter) = 0; - ADDON = true; diff --git a/addons/interact_menu/functions/fnc_addAction.sqf b/addons/interact_menu/functions/fnc_addAction.sqf index 1a288bd85e..136205766e 100644 --- a/addons/interact_menu/functions/fnc_addAction.sqf +++ b/addons/interact_menu/functions/fnc_addAction.sqf @@ -36,17 +36,18 @@ if((count _actions) == 0) then { private "_entry"; _entry = [ - _displayName, - _icon, - _position, - _statement, - _condition, - _distance, - [], - GVAR(uidCounter), - + _fullPath + [ + _displayName, + _icon, + _position, + _statement, + _condition, + _distance, + [false,false,false], + + _fullPath + ], + [] ]; -GVAR(uidCounter) = GVAR(uidCounter) + 1; _actions pushBack _entry; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf new file mode 100644 index 0000000000..42f762de3f --- /dev/null +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -0,0 +1,72 @@ +/* + * Author: CAA-Picard + * Collect a entire tree of active actions + * + * Argument: + * 0: Object + * 1: Original action tree + * + * Return value: + * Active children + * + * Public: No + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_object,_origAction); +EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); + +private ["_resultingAction","_target","_player","_activeChildren","_action","_actionData","_x"]; + +_target = _object; +_player = ACE_player; + +// Return nothing if the action itself is not active +if !([_target, ACE_player] call (_origActionData select 4)) exitWith { + [] +}; + +_activeChildren = []; + +// Collect children class actions +{ + _action = [_object, _x] call FUNC(collectActiveActionTree); + if ((count _action) > 0) then { + _activeChildren pushBack _action; + }; +} forEach _origActionChildren; + +// Collect children object actions +{ + _action = _x; + _actionData = _action select 0; + + // Check if the action is children of the original action + if ((count (_actionData select 7)) == (count (_origActionData select 7) + 1)) then { + + // Compare parent path to see if it's a suitable child + private "_isChild"; + _isChild = true; + { + if !(_x isEqualTo ((_actionData select 7) select _forEachIndex)) exitWith { + _isChild = false; + }; + } forEach (_origActionData select 7); + + if (_isChild) then { + _action = [_object, _action] call FUNC(collectActiveActionTree); + if ((count _action) > 0) then { + _activeChildren pushBack _action; + }; + }; + }; +} forEach GVAR(objectActions); + + +// If the original action has no statement, and no children, don't display it +if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) exitWith { + // @todo: Account for showDisabled? + [] +}; + +[_origActionData, _activeChildren] diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index cd9f8f51c7..c2ebac5034 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -45,8 +45,9 @@ _recurseFnc = { // Add canInteract (including exceptions) and canInteractWith to condition _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; - _showDisabled = getNumber (_entryCfg >> "showDisabled"); - _enableInside = getNumber (_entryCfg >> "enableInside"); + _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; + _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; + _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; _fullPath = (+ _parentPath); _fullPath pushBack (configName _entryCfg); @@ -55,18 +56,18 @@ _recurseFnc = { _children = [_entryCfg, _fullPath] call _recurseFnc; _entry = [ - _displayName, - _icon, - _selection, - _statement, - _condition, - _distance, - _children, - GVAR(uidCounter), - _fullPath + [ + _displayName, + _icon, + _selection, + _statement, + _condition, + _distance, + [_showDisabled,_enableInside,_canCollapse], + _fullPath + ], + _children ]; - - GVAR(uidCounter) = GVAR(uidCounter) + 1; _actions pushBack _entry; }; }; @@ -81,15 +82,17 @@ missionNamespace setVariable [_actionsVarName, [_actionsCfg, []] call _recurseFn /* [ [ - "My Action", - "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", - [0,0,0], - { (_this select 0) setVelocity [0,0,10]; }, - { true }, - 1, - [], - uid, - ["ACE_MainActions","TeamManagement","MyAction"] + [ + "My Action", + "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", + [0,0,0], + { (_this select 0) setVelocity [0,0,10]; }, + { true }, + 1, + [false,false,false] + ["ACE_MainActions","TeamManagement","MyAction"] + ], + [children actions] ] ] */ diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index d4096d123f..0dd82e5178 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -42,8 +42,9 @@ _recurseFnc = { // Add canInteract (including exceptions) and canInteractWith to condition _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; - _showDisabled = getNumber (_entryCfg >> "showDisabled"); - _enableInside = getNumber (_entryCfg >> "enableInside"); + _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; + _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; + _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; _fullPath = (+ _parentPath); _fullPath pushBack (configName _entryCfg); @@ -52,18 +53,18 @@ _recurseFnc = { _children = [_entryCfg, _fullPath] call _recurseFnc; _entry = [ - _displayName, - _icon, - [0,0,0], - _statement, - _condition, - 10, //distace - _children, - GVAR(uidCounter), - _fullPath + [ + _displayName, + _icon, + [0,0,0], + _statement, + _condition, + 10, //distace + [_showDisabled,_enableInside,_canCollapse], + _fullPath + ], + _children ]; - - GVAR(uidCounter) = GVAR(uidCounter) + 1; _actions pushBack _entry; }; }; @@ -74,18 +75,20 @@ private "_actionsCfg"; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; // Create a master action to base on self action -_actions = [[ - "Self Actions", - "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", - "Spine3", - { true }, - { true }, - 10, - [_actionsCfg, ["ACE_SelfActions"]] call _recurseFnc, - GVAR(uidCounter), - ["ACE_SelfActions"] -] +_actions = [ + [ + [ + "Self Actions", + "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", + "Spine3", + { true }, + { true }, + 10, + [false,true,false], + ["ACE_SelfActions"] + ], + [_actionsCfg, ["ACE_SelfActions"]] call _recurseFnc + ] ]; -GVAR(uidCounter) = GVAR(uidCounter) + 1; missionNamespace setVariable [_actionsVarName, _actions]; diff --git a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf index 151a7f3b04..0f58a246d2 100644 --- a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf @@ -32,7 +32,8 @@ if(!GVAR(keyDownSelfAction)) then { setMousePosition [0.5, 0.5]; }; - GVAR(selfMenuOffset) = (positionCameraToWorld [0, 0, 2]) vectorDiff (positionCameraToWorld [0, 0, 0]); - //systemChat format ["GVAR(selfMenuOffset) %1",GVAR(selfMenuOffset)]; + + GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff + ((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)); }; true diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index ee98a86f7a..b2b5f35547 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -22,5 +22,4 @@ if(GVAR(actionSelected)) then { GVAR(expanded) = false; GVAR(lastPath) = []; GVAR(menuDepthPath) = []; -GVAR(vecLineMap) = []; true diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf index 1842587984..0f784e640b 100644 --- a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf @@ -26,5 +26,4 @@ if(GVAR(actionSelected)) then { GVAR(expanded) = false; GVAR(lastPath) = []; GVAR(menuDepthPath) = []; -GVAR(vecLineMap) = []; true diff --git a/addons/interact_menu/functions/fnc_removeAction.sqf b/addons/interact_menu/functions/fnc_removeAction.sqf index 2d66b64627..3c6988971d 100644 --- a/addons/interact_menu/functions/fnc_removeAction.sqf +++ b/addons/interact_menu/functions/fnc_removeAction.sqf @@ -24,7 +24,7 @@ _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; _actions = _object getVariable [_varName, []]; { - if ((_x select 8) isEqualTo _fullPath) exitWith { + if (((_x select 0) select 7) isEqualTo _fullPath) exitWith { _actions deleteAt _forEachIndex; }; } forEach _actions; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index c4cb9ad32f..f5723f0c5d 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -22,10 +22,9 @@ GVAR(selfMenuScale) = (((worldToScreen (positionCameraToWorld [1,0,2])) select 0 //systemChat format ["selfMenuScale: %1", GVAR(selfMenuScale)]; GVAR(currentOptions) = []; -private ["_actionsVarName","_classActions","_objectActions","_target","_player","_actionItem","_active"]; +private ["_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active"]; _player = ACE_player; if (GVAR(keyDown)) then { - [] call FUNC(updateVecLineMap); // Render all nearby interaction menus #define MAXINTERACTOBJECTS 3 @@ -44,11 +43,11 @@ if (GVAR(keyDown)) then { _actionsVarName = format [QGVAR(Act_%1), typeOf _target]; GVAR(objectActions) = _target getVariable [QGVAR(actions), []]; { - _actionItem = _x; + _action = _x; // Only render them directly if they are base level actions - if (count (_actionItem select 8) == 1) then { + if (count ((_action select 0) select 7) == 1) then { // Try to render the menu - if ([_target, _actionItem, false, [180, 360]] call FUNC(renderMenu)) then { + if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; }; }; @@ -57,9 +56,9 @@ if (GVAR(keyDown)) then { // Iterate through base level class actions and render them if appropiate _classActions = missionNamespace getVariable [_actionsVarName, []]; { - _actionItem = _x; + _action = _x; // Try to render the menu - if ([_target, _actionItem, false, [180, 360]] call FUNC(renderMenu)) then { + if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; }; } forEach _classActions; @@ -76,8 +75,6 @@ if (GVAR(keyDown)) then { } else { if (GVAR(keyDownSelfAction)) then { - [] call FUNC(updateVecLineMap); - // Render only the self action menu _target = vehicle ACE_player; @@ -86,14 +83,10 @@ if (GVAR(keyDown)) then { GVAR(objectActions) = _target getVariable [QGVAR(selfActions), []]; /* { - _actionItem = _x; + _action = _x; // Only render them directly if they are base level actions - if (count (_actionItem select 8) == 1) then { - _active = [_target, ACE_player] call (_actionItem select 4); - - if (_active) then { - [_target, _actionItem, 0, [180, 360]] call FUNC(renderMenu); - }; + if (count (_action select 7) == 1) then { + [_target, _action, 0, [180, 360]] call FUNC(renderMenu); }; } forEach GVAR(objectActions); */ @@ -102,14 +95,10 @@ if (GVAR(keyDown)) then { _actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target]; _classActions = missionNamespace getVariable [_actionsVarName, []]; { - _actionItem = _x; - _active = [_target, ACE_player] call (_actionItem select 4); + _action = _x; - if (_active) then { - //_pos = (ACE_player modelToWorld (ACE_player selectionPosition "spine3")) vectorAdd GVAR(selfMenuOffset) vectorAdd [0,0,0.25]; - _pos = _cursorPos1 vectorAdd GVAR(selfMenuOffset); - [_target, _actionItem, true, [180, 360], _pos] call FUNC(renderMenu); - }; + _pos = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition); + [_target, _action, _pos] call FUNC(renderBaseMenu); } forEach _classActions; }; }; @@ -154,9 +143,10 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { _foundTarget = true; GVAR(actionSelected) = true; GVAR(selectedTarget) = (_closest select 0) select 0; - GVAR(selectedAction) = ((_closest select 0) select 1) select 3; + GVAR(selectedAction) = (((_closest select 0) select 1) select 0) select 3; _misMatch = false; _hoverPath = (_closest select 2); + if((count GVAR(lastPath)) != (count _hoverPath)) then { _misMatch = true; } else { @@ -183,9 +173,6 @@ if(!_foundTarget && GVAR(actionSelected)) then { GVAR(actionSelected) = false; GVAR(expanded) = false; GVAR(lastPath) = []; - if(!GVAR(keyDown)) then { - GVAR(vecLineMap) = []; - }; }; for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do { ctrlDelete (GVAR(iconCtrls) select _i); diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf new file mode 100644 index 0000000000..7ff430fa08 --- /dev/null +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -0,0 +1,71 @@ +/* + * Author: NouberNou and CAA-Picard + * Render the interaction menu for a base action + * + * Argument: + * 0: Object + * 1: Action data + * 2: 3D position (Optional) + * + * Return value: + * Was the menu rendered + * + * Public: No + */ +#include "script_component.hpp" + +private ["_distance","_pos","_weaponDir","_ref","_cameraPos","_sPos","_activeActionTree"]; + +EXPLODE_2_PVT(_this,_object,_baseAction); +EXPLODE_1_PVT(_baseAction,_actionData); + +_distance = _actionData select 5; + +// Obtain a 3D position for the action +if((count _this) > 2) then { + _pos = _this select 2; +} else { + if(typeName (_actionData select 2) == "ARRAY") then { + _pos = _object modelToWorld (_actionData select 2); + } else { + if ((_actionData select 2) == "weapon") then { + // Craft a suitable position for weapon interaction + _weaponDir = _object weaponDirection currentWeapon _object; + _ref = _weaponDir call EFUNC(common,createOrthonormalReference); + _pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); + } else { + _pos = _object modelToWorld (_object selectionPosition (_actionData select 2)); + }; + }; + // Compensate for movement during the frame to get rid of jittering + _pos = _pos vectorAdd ((visiblePositionASL _object) vectorDiff (getPosASL _object)); +}; + +_cameraToActionVec = (_pos call EFUNC(common,positionToASL)) vectorDiff ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)); +GVAR(refSystem) = _cameraToActionVec call EFUNC(common,createOrthonormalReference); + +// For non-self actions, exit if the action is too far away +if (GVAR(keyDown) && + {(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; + +// Exit if the action is behind you +_sPos = worldToScreen _pos; +if(count _sPos == 0) exitWith {false}; + +// Exit if the action is off screen +if ((_sPos select 0) < safeZoneXAbs || (_sPos select 0) > safeZoneXAbs + safeZoneWAbs) exitWith {false}; +if ((_sPos select 1) < safeZoneY || (_sPos select 1) > safeZoneY + safeZoneH) exitWith {false}; + + +// Collect active tree +// @todo: cache activeActionTree? +_activeActionTree = ([_object, _baseAction] call FUNC(collectActiveActionTree)); + +// Check if there's something left for rendering +if (count _activeActionTree == 0) exitWith {false}; + +//EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren); + +[_object, _activeActionTree, _pos, [180,360]] call FUNC(renderMenu); + +true diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index d3f94a2d86..9d845eab3f 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -40,11 +40,10 @@ if(count _sPos > 0) then { if(_icon == "") then { _icon = DEFAULT_ICON; }; - //systemChat format ["Ctrl: %1, %2,%3", _text,_sPos select 0, _sPos select 1]; _text = format ["
%4", _icon, _color, _color, _text]; _ctrl ctrlSetStructuredText (parseText _text); _ctrl ctrlSetPosition [(_sPos select 0)-(0.2*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.035*SafeZoneW]; //_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; - // _ctrl ctrlSetBackgroundColor [1,0,0,1]; + //_ctrl ctrlSetBackgroundColor [1,0,0,1]; _ctrl ctrlCommit 0; }; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index f90b084a29..ad604b9fa5 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -1,63 +1,32 @@ /* * Author: NouberNou and CAA-Picard - * Render a interaction menu and it's children recursively + * Render an interaction menu and it's children recursively * * Argument: * 0: Object * 1: Action data - * 2: Was the condition already checked? + * 2: 3D position * 3: Angle range available for rendering - * 4: 3D position (Optional) * * Return value: - * Was the menu rendered + * None * * Public: No */ #include "script_component.hpp" -private ["_distance", "_uid", "_pos", "_cameraPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"]; +private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; -EXPLODE_4_PVT(_this,_object,_actionData,_wasConditionChecked,_angles); +EXPLODE_4_PVT(_this,_object,_action,_pos,_angles); +EXPLODE_2_PVT(_action,_actionData,_activeChildren); EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); -_uid = _actionData select 7; -_distance = _actionData select 5; - -// Obtain a 3D position for the action -if((count _this) > 4) then { - _pos = _this select 4; -} else { - if(typeName (_actionData select 2) == "ARRAY") then { - _pos = _object modelToWorld (_actionData select 2); - } else { - _pos = _object modelToWorld (_object selectionPosition (_actionData select 2)); - }; -}; - -// For non-self actions, exit if the action is too far away -_cameraPos = positionCameraToWorld [0, 0, 0]; -if (GVAR(keyDown) && {_cameraPos distance _pos >= _distance}) exitWith {false}; - -// Exit if the action is behind you -_sPos = worldToScreen _pos; -if(count _sPos == 0) exitWith {false}; - -// Exit if the action is off screen -if ((_sPos select 0) < safeZoneXAbs || (_sPos select 0) > safeZoneXAbs + safeZoneWAbs) exitWith {false}; -if ((_sPos select 1) < safeZoneY || (_sPos select 1) > safeZoneY + safeZoneH) exitWith {false}; - -// If the condition was not checked, check it and exit if needed -if (!_wasConditionChecked && {!([_target, ACE_player] call (_actionItem select 4))}) exitWith {false}; - _menuDepth = (count GVAR(menuDepthPath)) - 1; // Store path to action -_path = [_object]; -_path = _path + (_actionData select 8); +_path = [_object] + (_actionData select 7); // Check if the menu is on the selected path -private "_menuInSelectedPath"; _menuInSelectedPath = true; { if (_forEachIndex >= (count GVAR(menuDepthPath))) exitWith { @@ -71,8 +40,12 @@ _menuInSelectedPath = true; // Render icon // ARGB Color (First Hex Pair is transparancy) _color = "#FFFFFFFF"; -if(_menuDepth > 0 && !_menuInSelectedPath) then { - _color = format ["#%1FFFFFF", [255 * ((((count _path) - 2)/_menuDepth) max 0.25)] call EFUNC(common,toHex)]; +if(!_menuInSelectedPath) then { //_menuDepth > 0 && + if (_menuDepth > 0) then { + _color = format ["#%1FFFFFF", [255 * ((((count _path) - 2)/_menuDepth) max 0.25)] call EFUNC(common,toHex)]; + } else { + _color = format ["#%1FFFFFF", [255 * 0.75] call EFUNC(common,toHex)]; + }; }; [_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon); @@ -82,45 +55,6 @@ GVAR(currentOptions) pushBack [_this, _pos, _path]; // Exit without rendering children if it isn't if !(_menuInSelectedPath) exitWith {true}; -// Collect all active children actions -private "_activeChildren"; -_activeChildren = []; -// Collect children class actions -{ - _target = _object; - _player = ACE_player; - _active = [_object, ACE_player] call (_x select 4); - if(_active) then { - _activeChildren pushBack _x; - }; -} forEach (_actionData select 6); - -// Collect children object actions -{ - _actionItem = _x; - - // Check if the action is children of the selected menu - if ((count (_actionItem select 8)) == (count _path)) then { - // Compare parent path to see if it's a suitable child - private "_isChild"; - _isChild = true; - for "_i" from 0 to (count (_actionItem select 8)) - 2 do { - if !(((_actionItem select 8) select _i) isEqualTo (_path select (_i + 1))) exitWith { - _isChild = false; - }; - }; - if (_isChild) exitWith { - _target = _object; - _player = ACE_player; - _active = [_target, ACE_player] call (_actionItem select 4); - - if (_active) then { - _activeChildren pushBack _actionItem; - }; - }; - }; -} forEach GVAR(objectActions); - private ["_angleSpan","_angle"]; _angleSpan = _maxAngleSpan min (55 * ((count _activeChildren) - 1)); if (_angleSpan >= 305) then { @@ -128,18 +62,19 @@ if (_angleSpan >= 305) then { }; _angle = _centerAngle - _angleSpan / 2; - { _target = _object; _player = ACE_player; - _offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine); - _mod = (0.15 max (0.15 * (_cameraPos distance _pos))) / GVAR(selfMenuScale); - _newPos = _pos vectorAdd (_offset vectorMultiply _mod); + _mod = (0.15 max (0.15 * ((positionCameraToWorld [0, 0, 0]) distance _pos))) / GVAR(selfMenuScale); - // drawLine3D [_pos, _newPos, [1,0,0,0.5]]; + _offset = ((GVAR(refSystem) select 1) vectorMultiply (-_mod * cos _angle)) vectorAdd + ((GVAR(refSystem) select 2) vectorMultiply (-_mod * sin _angle)); + _newPos = ((_pos call EFUNC(common,positionToASL)) vectorAdd _offset) call EFUNC(common,ASLToPosition); - [_object, _x, true, [_angle, 140], _newPos] call FUNC(renderMenu); + //drawLine3D [_pos, _newPos, [1,0,0,0.5]]; + + [_object, _x, _newPos, [_angle, 140]] call FUNC(renderMenu); if (_angleSpan == 360) then { _angle = _angle + _angleSpan / (count _activeChildren); diff --git a/addons/interact_menu/functions/fnc_rotateVectLine.sqf b/addons/interact_menu/functions/fnc_rotateVectLine.sqf deleted file mode 100644 index 4639a50903..0000000000 --- a/addons/interact_menu/functions/fnc_rotateVectLine.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Author: NouberNou - * Rotate a vector line (?) - * - * Argument: - * 0: Map - * 1: Theta - * - * Return value: - * 0: ?? - * - * Public: No - */ -#include "script_component.hpp" - -private ["_theta", "_p", "_map", "_p1", "_p2", "_q1", "_q2", "_u", "_d"]; -_map = _this select 0; -_theta = _this select 1; - -_p = _map select 0; -_p1 = _map select 1; -_p2 = _map select 2; - -_q1 = +(_map select 3); -_q2 = +(_map select 4); -_u = _map select 5; -_d = _map select 6; - -/* Step 4 */ -_q2 set[0, (_q1 select 0) * cos(_theta) - (_q1 select 1) * sin(_theta)]; -_q2 set[1, (_q1 select 0) * sin(_theta) + (_q1 select 1) * cos(_theta)]; -_q2 set[2, (_q1 select 2)]; - -/* Inverse of step 3 */ -_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)]; -_q1 set[1, (_q2 select 1)]; -_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d]; - -/* Inverse of step 2 */ -if (_d != 0) then { - _q2 set[0, (_q1 select 0)]; - _q2 set[1, (_q1 select 1) * (_u select 2) / _d + (_q1 select 2) * (_u select 1) / _d]; - _q2 set[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d]; -} else { - _q2 = _q1; -}; - -/* Inverse of step 1 */ -_q1 set[0, (_q2 select 0) + (_p1 select 0)]; -_q1 set[1, (_q2 select 1) + (_p1 select 1)]; -_q1 set[2, (_q2 select 2) + (_p1 select 2)]; -_q1; diff --git a/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf b/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf deleted file mode 100644 index e695f3fa8e..0000000000 --- a/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Author: NouberNou - * ? - * - * Argument: - * 0: p0 - * 1: p1 - * 2: p2 - * - * Return value: - * Map - * - * Public: No - */ -#include "script_component.hpp" - -private ["_p", "_p1", "_p2", "_q1", "_q2", "_u", "_d"]; - -_p = _this select 0; -_p1 = _this select 1; -_p2 = _this select 2; - -_q1 = []; -_q2 = []; -_u = []; - -/* Step 1 */ -_q1 set[0, (_p select 0) - (_p1 select 0)]; -_q1 set[1, (_p select 1) - (_p1 select 1)]; -_q1 set[2, (_p select 2) - (_p1 select 2)]; - -_u set[0, (_p2 select 0) - (_p1 select 0)]; -_u set[1, (_p2 select 1) - (_p1 select 1)]; -_u set[2, (_p2 select 2) - (_p1 select 2)]; -_u = _u call BIS_fnc_unitVector; -_d = sqrt((_u select 1)*(_u select 1) + (_u select 2)*(_u select 2)); - -/* Step 2 */ -if (_d != 0) then { - _q2 set[0, (_q1 select 0)]; - _q2 set[1, (_q1 select 1) * (_u select 2) / _d - (_q1 select 2) * (_u select 1) / _d]; - _q2 set[2, (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d]; -} else { - _q2 = _q1; -}; - -/* Step 3 */ -_q1 set[0, (_q2 select 0) * _d - (_q2 select 2) * (_u select 0)]; -_q1 set[1, (_q2 select 1)]; -_q1 set[2, (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d]; - -[_p, _p1, _p2, _q1, _q2, _u, _d] diff --git a/addons/interact_menu/functions/fnc_updateVecLineMap.sqf b/addons/interact_menu/functions/fnc_updateVecLineMap.sqf deleted file mode 100644 index c5027ffc60..0000000000 --- a/addons/interact_menu/functions/fnc_updateVecLineMap.sqf +++ /dev/null @@ -1,13 +0,0 @@ -#include "script_component.hpp"; - -if((count GVAR(vecLineMap)) == 0 || ((count GVAR(menuDepthPath)) > 0 && (getPosASL player) distance GVAR(lastPos) > 0.01)) then { - GVAR(lastPos) = getPosASL player; - _cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY; - _p1 = [0,0,0]; - _p2 = +_cursorVec; - _p = (_cursorVec call CBA_fnc_vect2polar); - _v = [(_p select 0), (_p select 1), (_p select 2)+90] call CBA_fnc_polar2vect; - _cp = [_cursorVec, _v] call BIS_fnc_crossProduct; - - GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap); -}; \ No newline at end of file diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 10fde54769..c4f44bdcff 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -122,7 +122,7 @@ class CfgVehicles { class ACE_GetDown { displayName = "$STR_ACE_Interaction_GetDown"; distance = 5; - condition = QUOTE([_target] call DFUNC(canInteractWith)); + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); statement = QUOTE([_target] call DFUNC(getDown)); showDisabled = 0; priority = 2.2; @@ -130,7 +130,7 @@ class CfgVehicles { class ACE_SendAway { displayName = "$STR_ACE_Interaction_SendAway"; distance = 5; - condition = QUOTE([_target] call DFUNC(canInteractWith)); + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); statement = QUOTE([_target] call DFUNC(sendAway)); showDisabled = 0; priority = 2.0; @@ -145,6 +145,48 @@ class CfgVehicles { enableInside = 1; }; }; + class ACE_Head { + displayName = "$STR_ACE_Interaction_Head"; + selection = "pilot"; + distance = 2.0; + condition = ""; + statement = ""; + }; + class ACE_ArmLeft { + displayName = "$STR_ACE_Interaction_ArmLeft"; + selection = "LeftForeArm"; + distance = 2.0; + condition = ""; + statement = ""; + }; + class ACE_ArmRight { + displayName = "$STR_ACE_Interaction_ArmRight"; + selection = "RightForeArm"; + distance = 2.0; + condition = ""; + statement = ""; + }; + class ACE_LegLeft { + displayName = "$STR_ACE_Interaction_LegLeft"; + selection = "LKnee"; + distance = 2.0; + condition = ""; + statement = ""; + }; + class ACE_LegRight { + displayName = "$STR_ACE_Interaction_LegRight"; + selection = "RKnee"; + distance = 2.0; + condition = ""; + statement = ""; + }; + class ACE_Weapon { + displayName = "$STR_ACE_Interaction_Weapon"; + selection = "weapon"; + distance = 2.0; + condition = ""; + statement = ""; + }; class ACE_TapShoulderRight { displayName = "$STR_ACE_Interaction_TapShoulder"; @@ -152,10 +194,6 @@ class CfgVehicles { distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); - showDisabled = 0; - priority = 2.8; - hotkey = "Q"; - enableInside = 1; }; class ACE_TapShoulderLeft { displayName = "$STR_ACE_Interaction_TapShoulder"; @@ -163,10 +201,6 @@ class CfgVehicles { distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); - showDisabled = 0; - priority = 2.8; - hotkey = "Q"; - enableInside = 1; }; }; @@ -178,7 +212,6 @@ class CfgVehicles { showDisabled = 1; priority = 3.2; icon = PATHTOF(UI\team\team_management_ca.paa); - subMenu[] = {"ACE_TeamManagement", 1}; enableInside = 1; hotkey = "M"; @@ -256,30 +289,12 @@ class CfgVehicles { }; }; - /* DANCE ANIMATION DOESN'T WORK :( - class ACE_Dance { - displayName = "$STR_ACE_Interaction_Dance"; - condition = "isClass (configFile >> 'CfgPatches' >> 'ACE_Movement') and !ACE_Dancing"; - statement = "ACE_Dancing = true; [-2, {_this switchMove 'TestDance';}, player] call CBA_fnc_globalExecute;"; - showDisabled = 0; - priority = -1.2; - }; - class ACE_StopDancing { - displayName = "$STR_ACE_Interaction_StopDancing"; - condition = "ACE_Dancing"; - statement = "ACE_Dancing = false; [-2, {_this switchMove '';}, player] call CBA_fnc_globalExecute;"; - showDisabled = 0; - priority = -1.2; - }; - */ - class ACE_Gestures { displayName = "$STR_ACE_Interaction_Gestures"; condition = "canStand _target"; statement = ""; showDisabled = 1; priority = 3.5; - subMenu[] = {"ACE_Gestures", 1}; icon = PATHTOF(UI\gestures_ca.paa); hotkey = "G"; @@ -386,67 +401,105 @@ class CfgVehicles { showDisabled = 1; priority = 4.5; icon = ""; // @todo - subMenu[] = {"ACE_Equipment", 1}; enableInside = 1; hotkey = "E"; - - class ACE_Dummy { - displayName = ""; - condition = QUOTE(false); - statement = ""; - showDisabled = 1; - priority = -99; - icon = PATHTOEF(common,UI\blank_CO.paa); - enableInside = 1; - }; }; }; }; class LandVehicle; class Car: LandVehicle { - class ACE_Actions {}; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + }; + }; class ACE_SelfActions {}; }; class Tank: LandVehicle { - class ACE_Actions {}; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + }; + }; class ACE_SelfActions {}; }; class Air; class Helicopter: Air { - class ACE_Actions {}; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + }; + }; class ACE_SelfActions {}; }; class Plane: Air { - class ACE_Actions {}; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + }; + }; class ACE_SelfActions {}; }; class Ship; class Ship_F: Ship { class ACE_Actions { - class ACE_Push { - displayName = "$STR_ACE_Interaction_Push"; - distance = 4; - condition = QUOTE(getMass _target < 1000 && {alive _target}); - statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push);); - showDisabled = 0; - priority = -1; + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + + class ACE_Push { + displayName = "$STR_ACE_Interaction_Push"; + distance = 6; + condition = QUOTE(getMass _target < 1000 && {alive _target}); + statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push);); + showDisabled = 0; + priority = -1; + }; }; }; class ACE_SelfActions {}; }; class StaticWeapon: LandVehicle { - class ACE_Actions {}; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + }; + }; class ACE_SelfActions {}; }; class StaticMortar; class Mortar_01_base_F: StaticMortar { - class ACE_Actions {}; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + }; + }; class ACE_SelfActions {}; }; -}; \ No newline at end of file +}; diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp index ccd0f7d414..38f12066e0 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/Menu_Config.hpp @@ -43,370 +43,6 @@ class ACE_Interaction_Button_Base { soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; }; -#define ICON_BORDER 0.05 - -// Old command rose -class ACE_Interaction_Dialog { - idd = 1713999; - enableSimulation = 1; - movingEnable = 0; - onLoad = "_dlgInteractionDialog = _this select 0; for '_a' from 10 to 19 do {(_dlgInteractionDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['ACE_Interaction_Dialog', _dlgInteractionDialog];"; - objects[] = {}; - class controls { - class Interaction_BackgroundMain: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = 2; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY"; - w = "1.8 / 16 * safezoneW"; - h = "0.55 / 9 * safezoneH"; - }; - - class Interaction_ButtonMain: ACE_Interaction_Button_Base { - action = "-1 call ACE_Interaction_fnc_onClick;"; - style = 2; - tooltip = ""; - text = "Interaction Menu"; - idc = 3; - sizeEx = "0.6 / 40 / (getResolution select 5)"; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; - x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY"; - w = "1.8 / 16 * safezoneW"; - h = "0.55 / 9 * safezoneH"; - }; - - class Interaction_Background0: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = 40; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background1: Interaction_Background0 { - idc = 41; - x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background2: Interaction_Background0 { - idc = 42; - x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background3: Interaction_Background0 { - idc = 43; - x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background4: Interaction_Background0 { - idc = 44; - x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background5: Interaction_Background0 { - idc = 45; - x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background6: Interaction_Background0 { - idc = 46; - x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background7: Interaction_Background0 { - idc = 47; - x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background8: Interaction_Background0 { - idc = 48; - x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Background9: Interaction_Background0 { - idc = 49; - x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - - class Interaction_Icon0: ACE_Interaction_Button_Base { - tooltip = ""; - text = ""; - idc = 20; - type = 0; - style = 48; - colorBackground[] = {0,0,0,0}; - x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 - 2.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon1: Interaction_Icon0 { - idc = 21; - x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon2: Interaction_Icon0 { - idc = 22; - x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon3: Interaction_Icon0 { - idc = 23; - x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon4: Interaction_Icon0 { - idc = 24; - x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon5 : Interaction_Icon0 { - idc = 25; - x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 + 2.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon6: Interaction_Icon0 { - idc = 26; - x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon7: Interaction_Icon0 { - idc = 27; - x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon8: Interaction_Icon0 { - idc = 28; - x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - class Interaction_Icon9: Interaction_Icon0 { - idc = 29; - x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX; - y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY; - w = (0.3-ICON_BORDER) / 16 * safezoneW; - h = (0.3-ICON_BORDER) / 9 * safezoneH; - }; - - class Interaction_Shortcut0: ACE_Interaction_Button_Base { - tooltip = ""; - text = ""; - idc = 30; - style = 2; - colorBackground[] = {0,0,0,0}; - x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut1: Interaction_Shortcut0 { - idc = 31; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut2: Interaction_Shortcut0 { - idc = 32; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut3: Interaction_Shortcut0 { - idc = 33; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut4: Interaction_Shortcut0 { - idc = 34; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut5 : Interaction_Shortcut0 { - idc = 35; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut6: Interaction_Shortcut0 { - idc = 36; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut7: Interaction_Shortcut0 { - idc = 37; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut8: Interaction_Shortcut0 { - idc = 38; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Shortcut9: Interaction_Shortcut0 { - idc = 39; - type = 0; - x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; - w = "0.3 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - - class Interaction_Button0: ACE_Interaction_Button_Base { - action = "0 call ACE_Interaction_fnc_onClick;"; - style = 2; - tooltip = ""; - text = ""; - idc = 10; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; - x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button1: Interaction_Button0 { - action = "1 call ACE_Interaction_fnc_onClick;"; - idc = 11; - x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button2: Interaction_Button0 { - action = "2 call ACE_Interaction_fnc_onClick;"; - idc = 12; - x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button3: Interaction_Button0 { - action = "3 call ACE_Interaction_fnc_onClick;"; - idc = 13; - x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button4: Interaction_Button0 { - action = "4 call ACE_Interaction_fnc_onClick;"; - idc = 14; - x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button5: Interaction_Button0 { - action = "5 call ACE_Interaction_fnc_onClick;"; - idc = 15; - x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button6: Interaction_Button0 { - action = "6 call ACE_Interaction_fnc_onClick;"; - idc = 16; - x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button7: Interaction_Button0 { - action = "7 call ACE_Interaction_fnc_onClick;"; - idc = 17; - x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button8: Interaction_Button0 { - action = "8 call ACE_Interaction_fnc_onClick;"; - idc = 18; - x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - class Interaction_Button9: Interaction_Button0 { - action = "9 call ACE_Interaction_fnc_onClick;"; - idc = 19; - x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; - y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; - }; - }; -}; - class RscListbox; class IGUIBack; class RscText; @@ -518,75 +154,6 @@ class RscInteractionText: RscText{ h = 1.5 * GUI_GRID_H; }; class RscTitles { - class ACE_FlowMenu { - idd = 9920; - enableSimulation = 1; - movingEnable = 0; - fadeIn=0.5; - fadeOut=0.5; - duration = 10e10; - onLoad = "uiNamespace setVariable ['ACE_Flow_Display', _this select 0];"; - - class controls { - class RearIcon: RscInteractionIcon{ - idc = 999; - text = PATHTOF(UI\CenterIcon_ca.paa); - x = 17.9 * GUI_GRID_W; - y = 10 * GUI_GRID_H; - w = 3.7 * GUI_GRID_H; - h = 5.75 * GUI_GRID_H; - }; - class TopIcon: RscInteractionIcon{ - idc = 1200; - h = 1 * GUI_GRID_H; - y = 9 * GUI_GRID_H; - }; - class FirstIcon: RscInteractionIcon{ - idc = 1201; - y = 10.25 * GUI_GRID_H; - h = 1.5 * GUI_GRID_H; - }; - class SelectedItemIcon: RscInteractionIcon{ - idc = 1202; - y = 12 * GUI_GRID_H; - }; - class ThirdIcon: RscInteractionIcon{ - idc = 1203; - y = 14.25 * GUI_GRID_H; - h = 1.5 * GUI_GRID_H; - }; - class BottomIcon: TopIcon{ - idc = 1204; - y = 16 * GUI_GRID_H; - }; - class ItemName: RscText{ - idc = 1000; - style = 0x01; - x = 5.25 * GUI_GRID_W; - y = 12.15 * GUI_GRID_H; - w = 13 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; - colorBackground[] = {0.3, 0.3, 0.3, 0.8}; - }; - class BackIcon: RscInteractionIcon{ - idc = 1210; - text = PATHTOF(UI\backArrow_ca.paa); - x = 18.25 * GUI_GRID_W; - y = 12.69 * GUI_GRID_H; - w = 0.5 * GUI_GRID_W; - h = 0.5 * GUI_GRID_H; - }; - class ItemDetails: RscStructuredText{ - idc = 1100; - style = 0x0c; - x = 23.5 * GUI_GRID_W; - y = 11 * GUI_GRID_H; - w = 13 * GUI_GRID_W; - h = 3.9 * GUI_GRID_H; - colorBackground[] = {0, 0, 0, 0.4}; - }; - }; - }; class GVAR(InteractionHelper) { idd = 9930; enableSimulation = 1; diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index bcb8103ea2..6efa72778e 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -2,49 +2,30 @@ ADDON = false; -PREP(addInteraction); -PREP(addInteractionSelf); PREP(addSelectableItem); -PREP(addToTooltip); PREP(applyButtons); -PREP(canInteractWith); +PREP(canInteractWithCivilian); PREP(canTapShoulder); -PREP(getActions); -PREP(getActions2); PREP(getDoor); PREP(getDoorAnimations); PREP(getDown); PREP(getSelectedButton); PREP(hideMenu); PREP(hideMouseHint); -PREP(initialiseInteraction); PREP(isInRange); PREP(joinTeam); -PREP(menuKeyInput); PREP(moduleInteraction); PREP(moveDown); -PREP(onButtonDown); -PREP(onButtonDownSelf); -PREP(onButtonUp); -PREP(onClick); PREP(onSelectMenuDblClick); PREP(openDoor); -PREP(openMenu); PREP(openMenuSelectUI); -PREP(openMenuSelf); PREP(openSelectMenu); -PREP(openSubMenu); -PREP(openSubMenuSelf); PREP(prepareSelectMenu); PREP(push); -PREP(removeInteraction); -PREP(removeInteractionSelf); PREP(removeTag); PREP(sendAway); -PREP(showMenu); PREP(showMouseHint); PREP(sortOptionsByPriority); PREP(tapShoulder); -PREP(updateTooltipPosition); ADDON = true; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 90db08e9e2..c9cfd2c0b4 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -19,24 +19,6 @@ class CfgPatches { #include class ACE_Settings { - class GVAR(FlowMenu) { - value = 0; - typeName = "BOOL"; - isClientSetable = 1; - displayName = "$STR_ACE_Interaction_FlowMenu"; - }; - class GVAR(AutoCloseMenu) { - value = 0; - typeName = "BOOL"; - isClientSetable = 1; - displayName = "$STR_ACE_Interaction_AutoCloseMenu"; - }; - class GVAR(AutoCenterCursor) { - value = 1; - typeName = "BOOL"; - isClientSetable = 1; - displayName = "$STR_ACE_Interaction_AutoCenterCursor"; - }; class GVAR(EnableTeamManagement) { value = 1; typeName = "BOOL"; diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_AddSelectableItem.sqf index 1e3065d234..966c4fe043 100644 --- a/addons/interaction/functions/fnc_AddSelectableItem.sqf +++ b/addons/interaction/functions/fnc_AddSelectableItem.sqf @@ -29,13 +29,8 @@ if (_picture == "" || _picture == "PictureThing") then { _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); }; -if ((profileNamespace getVariable [QGVAR(FlowMenu), false])) then { - //[_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey] - _container pushBack [_displayName, nil, {true},0,[], _picture, "", {true}, [], 4, "", _data]; -}else{ - _index = lbAdd [_container, _displayName]; - lbSetData [_container, _index, str _data]; - lbSetPicture [_container, _index, _picture]; -}; +_index = lbAdd [_container, _displayName]; +lbSetData [_container, _index, str _data]; +lbSetPicture [_container, _index, _picture]; _container diff --git a/addons/interaction/functions/fnc_GetActions.sqf b/addons/interaction/functions/fnc_GetActions.sqf deleted file mode 100644 index 67386331c1..0000000000 --- a/addons/interaction/functions/fnc_GetActions.sqf +++ /dev/null @@ -1,154 +0,0 @@ -/* - Author: - commy2 - Garth de Wet (LH) - - Description: - - Parameters: - 0: OBJECT - target - 1: ARRAY - Parents of the target object - 2: ARRAY - Actions - 3: ARRAY - Patches - 4: CONFIG - Parent config (ConfigFile >> "CfgVehicles"/MissionConfigFile >> "CfgVehicles") - 5: BOOL - Is mission config file? - 6: STRING - Classname ("ACE_Actions"/"ACE_SelfActions") - 7: STRING - Sub-class - - Returns: - Nothing - - Example: - [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_Actions"] call ACE_Interaction_fnc_GetActions; - - [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_SelfActions"] call ACE_Interaction_fnc_GetActions; -*/ -#include "script_component.hpp" - -#define DEFAULT_ICON QUOTE(PATHTOF(UI\dot_ca.paa)) -private ["_target", "_parents", "_actions", "_patches", "_baseConfig", "_actionType", "_i","_index", "_missionConfig", "_stdConfig"]; -_target = _this select 0; -_parents = _this select 1; -_actions = _this select 2; -_patches = _this select 3; -_baseConfig = _this select 4; -_missionConfig = _this select 5; -_actionType = _this select 6; -_subClass = _this select 7; - -_stdConfig = (configFile >> "CfgVehicles" >> typeOf _target >> _actionType); -if (_subClass != "") then { - _stdConfig = _stdConfig >> _subClass; -}; - -_count = count _parents; -for "_i" from 0 to (_count - 1) do { - _config = _baseConfig >> _parents select _i >> _actionType; - if (_subClass != "") then { - _config = _config >> _subClass; - }; - - _count = count _config; - if (_count > 0) then { - for "_index" from 0 to (_count - 1) do { - private ["_action", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority", "_tooltip", "_hotkey", - "_subMenu", "_conditionShow", "_exceptions", "_icon", "_actionToCache", "_cacheActions", "_cache", "_indexCache", "_configName"]; - _action = if (_missionConfig) then {_config select _index} else {_stdConfig >> configName (_config select _index)}; - _cache = missionNamespace getVariable [QGVAR(MenuCache), [[], [], []]]; - - if (count _action > 0) then { - _configName = configName _action; - - _cacheConfigs = _cache select 0; - _cacheActions = _cache select 1; - _cacheIndices = _cache select 2; - - _indexCache = _cacheConfigs find _action; - if (_indexCache == -1) then { - _displayName = getText (_action >> "displayName"); - _distance = getNumber (_action >> "distance"); - _priority = getNumber (_action >> "priority"); - _subMenu = getArray (_action >> "subMenu"); - _tooltip = getText (_action >> "tooltip"); - _hotkey = getText (_action >> "hotkey"); - _enableInside = getNumber (_action >> "enableInside"); - - // Condition - _condition = getText (_action >> "condition"); - if (_condition == "") then {_condition = "true"}; - - _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, GVAR(Target))] call EFUNC(common,canInteractWith)} ), getArray (_action >> "exceptions")]; - if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; - - _condition = compile _condition; - - // Condition to show the action - _conditionShow = getText (_action >> "conditionShow"); - _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call _conditionShow; - }; - - // Exceptions to the general conditions that have to be true - _exceptions = getArray (_action >> "exceptions"); - - // statement - _statement = getText (_action >> "statement"); - _statement = compile _statement; - - if (profileNamespace getVariable [QGVAR(FlowMenu), false]) then { - _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { - compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1]; - } else { - compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement")); - }; - }; - - // icon - _icon = getText (_action >> "Icon"); - if (_icon == "") then { - _icon = DEFAULT_ICON; - }; - - _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; - - if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call _condition}} && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then { - _actions pushBack _actionToCache; - _patches pushBack _configName; - }; - - _indexCache = _cacheActions find _actionToCache; - if (_indexCache == -1) then { - _indexCache = count _cacheActions; - _cacheActions pushBack _actionToCache; - }; - - _cacheConfigs pushBack _action; - _cacheIndices pushBack _indexCache; - - _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; - ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log); - } else { - ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log); - - _cachedAction = _cacheActions select (_cacheIndices select _indexCache); - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call (_cachedAction select 7); - }; - - if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call (_cachedAction select 2)}} && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then { - _actions pushBack _cachedAction; - _patches pushBack _configName; - }; - }; - }; - - GVAR(MenuCache) = _cache; - }; - }; -}; -[_actions, _patches] diff --git a/addons/interaction/functions/fnc_addInteraction.sqf b/addons/interaction/functions/fnc_addInteraction.sqf deleted file mode 100644 index 5e8889891d..0000000000 --- a/addons/interaction/functions/fnc_addInteraction.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Author: commy2 - * - * Add an ACE action to an object. Note: This function is global. - * - * Argument: - * 0: Object the action should be assigned to (Object) - * 1: Name of the action shown in the menu (String) - * 2: Distance the player can be away from the object (Number) - * 3: Condition (Code or String) - * 4: Statement (Code or String) - * 5: Show the action even if the conditon is not met (Bool or Number) - * 6: Priority (Number, optional default: 0) - * - * Return value: - * ID of the action (used to remove it later). - */ - -#include "script_component.hpp" - -private ["_object", "_displayName", "_distance", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_object = _this select 0; -_displayName = _this select 1; -_distance = _this select 2; -_condition = _this select 3; -_statement = _this select 4; -_showDisabled = _this select 5; -_priority = _this select 6; - -if (typeName _condition == "STRING") then { - _condition = compile _condition; -}; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -if (typeName _showDisabled == "SCALAR") then { - _showDisabled = _showDisabled > 0; -}; - -if (isNil "_priority") then { - _priority = 0; -}; - -_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack [_displayName, _distance, _condition, _statement, _showDisabled, _priority]; - -_object setVariable [QGVAR(Interactions), [_id, _actionIDs, _actions], true]; -_id diff --git a/addons/interaction/functions/fnc_addInteractionSelf.sqf b/addons/interaction/functions/fnc_addInteractionSelf.sqf deleted file mode 100644 index 48773fcb99..0000000000 --- a/addons/interaction/functions/fnc_addInteractionSelf.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: commy2 - * - * Add an ACE self action to the player. Execute this on the local machine of the player. - * - * Argument: - * 0: Name of the action shown in the menu (String) - * 1: Condition (Code or String) - * 2: Statement (Code or String) - * 3: Show the action even if the conditon is not met (Bool or Number) - * 4: Priority (Number, optional default: 0) - * - * Return value: - * ID of the action (used to remove it later). - */ - -#include "script_component.hpp" - -private ["_displayName", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; - - -_displayName = _this select 0; - -_condition = _this select 1; -_statement = _this select 2; -_showDisabled = _this select 3; -_priority = _this select 4; - -if (typeName _condition == "STRING") then { - _condition = compile _condition; -}; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -if (typeName _showDisabled == "SCALAR") then { - _showDisabled = _showDisabled > 0; -}; - -if (isNil "_priority") then { - _priority = 0; -}; - -_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack [_displayName, _condition, _statement, _showDisabled, _priority]; - -ACE_player setVariable [QGVAR(InteractionsSelf), [_id, _actionIDs, _actions], false]; -_id diff --git a/addons/interaction/functions/fnc_addToTooltip.sqf b/addons/interaction/functions/fnc_addToTooltip.sqf deleted file mode 100644 index 9f5595a9bc..0000000000 --- a/addons/interaction/functions/fnc_addToTooltip.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// by commy2 - -#include "script_component.hpp" - -GVAR(CurrentTooltip) pushBack (_this select 0); diff --git a/addons/interaction/functions/fnc_canInteractWith.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf similarity index 61% rename from addons/interaction/functions/fnc_canInteractWith.sqf rename to addons/interaction/functions/fnc_canInteractWithCivilian.sqf index 5a47782546..6408d66aa8 100644 --- a/addons/interaction/functions/fnc_canInteractWith.sqf +++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf @@ -2,13 +2,10 @@ #include "script_component.hpp" -private ["_unit", "_isCivilian"]; - -_unit = _this select 0; -_isCivilian = _this select 1; +EXPLODE_2_PVT(_this,_unit,_isCivilian); if (isNil "_isCivilian") then {_isCivilian = true}; alive _unit && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian -//&& {count (weapons _unit) == 0} +//&& {count (weapons _unit) == 0} \ No newline at end of file diff --git a/addons/interaction/functions/fnc_getActions2.sqf b/addons/interaction/functions/fnc_getActions2.sqf deleted file mode 100644 index 0de4f7a534..0000000000 --- a/addons/interaction/functions/fnc_getActions2.sqf +++ /dev/null @@ -1,121 +0,0 @@ -// commy2 -#include "script_component.hpp" - -private ["_object", "_config", "_type", "_actions", "_configs"]; - -_object = _this select 0; -_config = _this select 1; // configFile, missionConfigFile -_type = _this select 2; // "ACE_CfgInteractions", "ACE_CfgInteractionsSelf" -_actions = _this select 3; // []; - -_configs = "_object isKindOf configName _x" configClasses (_config >> _type); - -// cache -private ["_cache", "_cacheConfigs", "_cacheActions", "_cacheIndices"]; - -_cache = uiNamespace getVariable [QGVAR(MenuCache), [[], [], []]]; -_cacheConfigs = _cache select 0; -_cacheActions = _cache select 1; -_cacheIndices = _cache select 2; - -// get interactions -{ - private "_configActions"; - - _configActions = "true" configClasses (_config >> _type >> configName _x); - { - private ["_action", "_configName", "_indexCache"]; - - _action = _x; - _configName = configName _action; - - _indexCache = _cacheConfigs find _action; - if (_indexCache == -1) then { - private ["_displayName", "_distance", "_priority", "_subMenu", "_tooltip", "_hotkey", "_enableInside", "_condition", "_conditionShow", "_showDisabled", "_exceptions", "_statement", "_icon"]; - - _displayName = getText (_action >> "displayName"); - _distance = getNumber (_action >> "distance"); - _priority = getNumber (_action >> "priority"); - _subMenu = getArray (_action >> "subMenu"); - _tooltip = getText (_action >> "tooltip"); - _hotkey = getText (_action >> "hotkey"); - _enableInside = getNumber (_action >> "enableInside"); - - // Condition - _condition = getText (_action >> "condition"); - if (_condition == "") then {_condition = "true"}; - - _condition = _condition + format [QUOTE(&& {%1 call EFUNC(common,canInteract)} && {[ARR_2(ACE_player, GVAR(Target))] call FUNC(canInteractWith)}), getArray (_action >> "exceptions")]; - if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; - - _condition = compile _condition; - - // Condition to show the action - _conditionShow = getText (_action >> "conditionShow"); - _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call _conditionShow; - }; - - // Exceptions to the general conditions that have to be true - _exceptions = getArray (_action >> "exceptions"); - - // statement - _statement = getText (_action >> "statement"); - _statement = compile _statement; - - if (GVAR(FlowMenu)) then { - _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { - compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1]; - } else { - compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement")); - }; - }; - - // icon - _icon = getText (_action >> "Icon"); - if (_icon == "") then { - _icon = DEFAULT_ICON; - }; - - private "_actionToCache"; - _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; - - if ((_showDisabled || {[_object, _player] call _condition}) && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then { - _actions pushBack _actionToCache; - }; - - _indexCache = _cacheActions find _actionToCache; - if (_indexCache == -1) then { - _indexCache = count _cacheActions; - _cacheActions pushBack _actionToCache; - }; - - _cacheConfigs pushBack _action; - _cacheIndices pushBack _indexCache; - - _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; - ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log); - } else { - ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log); - - private ["_cachedAction", "_showDisabled"]; - _cachedAction = _cacheActions select (_cacheIndices select _indexCache); - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call (_cachedAction select 7); - }; - - if ((_showDisabled || {[_object, _player] call (_cachedAction select 2)}) && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then { - _actions pushBack _cachedAction; - }; - }; - } forEach _configActions; //Actions of this CfgVehicles class -} forEach _configs; //CfgVehicles class - -uiNamespace setVariable [QGVAR(MenuCache), _cache]; - -_actions diff --git a/addons/interaction/functions/fnc_initialiseInteraction.sqf b/addons/interaction/functions/fnc_initialiseInteraction.sqf deleted file mode 100644 index 4d88eb4ea1..0000000000 --- a/addons/interaction/functions/fnc_initialiseInteraction.sqf +++ /dev/null @@ -1,167 +0,0 @@ -/* - Author: - commy2 - Garth de Wet (LH) - - Description: - Initialises the interaction click handlers. - - Parameters: - 0 : CODE - code to call when right clicking/center button - 1 : BOOLEAN - Submenu - 2 : BOOLEAN - Flow Menu - 3 : BOOLEAN - Self interaction - 4 : OBJECT - Target - - Returns: - Nothing - - Example: - [{"Default" call FUNC(openMenu);}, true, (profileNamespace getVariable [QGVAR(FlowMenu), false]), GVAR(Target)] call FUNC(initialiseInteraction); -*/ -#include "script_component.hpp" - -private ["_subMenu", "_selfMenu", "_target"]; -GVAR(MainButton) = _this select 0; -_subMenu = _this select 1; -_selfMenu = _this select 3; -_target = _this select 4; - -_player = ACE_player; -_vehicle = vehicle _player; -//_object = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); - -if !([_target, 5] call FUNC(isInRange)) exitWith {}; - -GVAR(Shortcuts) = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; - -// Flow menu -if (_this select 2) then { - (QGVAR(FlowMenu) call BIS_fnc_rscLayer) cutRsc [QGVAR(FlowMenu), "PLAIN",0.5, false]; - ACE_Interaction_SelectedButton = 0; - (findDisplay 1713999) closeDisplay 1; - if (_player getVariable ["ACE_AcceptAction", -1] == -1) then { - [{if(isNil {GVAR(MainButton)} || {!(profileNamespace getVariable [QGVAR(FlowMenu), false])})exitWith{false};(-(_this select 0) / 1.2) call FUNC(MoveDown);true}] call EFUNC(common,addScrollWheelEventHandler); - - _player setVariable ["ACE_AcceptAction", [_player, "DefaultAction", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {_action = GVAR(Buttons) select ACE_Interaction_SelectedButton;_target = GVAR(Target);_player = ACE_player;_vehicle = vehicle _player;if ([_target, _player] call (_action select 2)) then {call FUNC(hideMenu);if(count _action == 12) then{(_action select 11) call (_action select 1);}else{[_target, _player] call (_action select 1);};};}] call EFUNC(common,addActionEventHandler)]; - _player setVariable ["ACE_AcceptAction", [_player, "menuBack", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {call GVAR(MainButton);}] call EFUNC(common,addActionEventHandler)]; - }; - 0 call FUNC(moveDown); - [localize "STR_ACE_Interaction_MakeSelection", if (_subMenu)then{localize "STR_ACE_Interaction_Back"}else{""}, localize "STR_ACE_Interaction_ScrollHint"] call FUNC(showMouseHint); - ((uiNamespace getVariable QGVAR(Flow_Display)) displayCtrl (1210)) ctrlShow _subMenu; -}else{ // Rose - if (!isNull(uiNamespace getVariable QGVAR(Flow_Display))) then { - (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; - call FUNC(hideMouseHint); - }; - if (!_subMenu || {isNull (findDisplay 1713999)}) then { - (findDisplay 1713999) closeDisplay 1; - - (findDisplay 46) createDisplay QGVAR(Dialog); - // Add eventhandlers - /*(findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))]; - (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))];*/ - - (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call FUNC(menuKeyInput))]; - }; - disableSerialization; - _dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog); - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; - if (GVAR(AutoCenterCursor)) then {setMousePosition [0.5, 0.5]}; - if !(_subMenu) then { - _ctrlInteractionDialog ctrlSetText ([_target] call EFUNC(common,getName)); - } else { - _ctrlInteractionDialog ctrlSetText localize "STR_ACE_Interaction_Back"; - }; - - _buttons = GVAR(Buttons); - _count = count _buttons; - - for "_i" from 0 to 9 do { - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _i); - _ctrlInteractionDialog ctrlShow true; - - _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _i); - _ctrlInteractionDialogShortcut = _dlgInteractionDialog displayCtrl (30 + _i); - //_ctrlInteractionDialogBackground = _dlgInteractionDialog displayCtrl (40 + _i); - if (_i < _count) then { - _action = _buttons select _i; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable ([_target, _player] call (_action select 2)); - _ctrlInteractionDialog ctrlSetTooltip (_action select 6); - - _ctrlInteractionDialogIcon ctrlSetText (_action select 5); - _ctrlInteractionDialogShortcut ctrlSetText (_action select 10); - //_ctrlInteractionDialogBackground ctrlShow true; - - GVAR(Shortcuts) set [_i, [_action select 10] call EFUNC(common,letterToCode)]; - } else { - _ctrlInteractionDialog ctrlSetText ""; - _ctrlInteractionDialog ctrlEnable false; - _ctrlInteractionDialog ctrlSetTooltip ""; - - _ctrlInteractionDialogIcon ctrlSetText ""; - _ctrlInteractionDialogShortcut ctrlSetText ""; - //_ctrlInteractionDialogBackground ctrlShow false; - }; - }; - - // Update Buttons - terminate (missionNamespace getVariable [QGVAR(updateMenuHandle), scriptNull]); - - GVAR(updateMenuHandle) = 0 spawn { - disableSerialization; - _dlgMenu = uiNamespace getVariable [QGVAR(Dialog), displayNull]; - _ctrlTooltip = _dlgMenu displayCtrl 40; - - _player = ACE_player; - _vehicle = vehicle _player; - _target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); - - waitUntil { - if !([_target, 5] call FUNC(isInRange)) exitWith { - (findDisplay 1713999) closeDisplay 1 - }; - - GVAR(Tooltips) = [[], [], [], [], [], [], [], [], [], []]; - { - _ctrlText = _dlgMenu displayCtrl (10 + _forEachIndex); - _ctrlIcon = _dlgMenu displayCtrl (20 + _forEachIndex); - - _condition = _x select 2; - _conditionShow = _x select 7; - _distance = _x select 9; - - GVAR(CurrentTooltip) = []; - - _enable = (_distance == 0 || {[_target, _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}; - if (isNil "_enable") then {_enable = false}; - - GVAR(Tooltips) set [_forEachIndex, GVAR(CurrentTooltip)]; - - // apply conditional tooltips - /*if (_forEachIndex == call ACE_Interaction_fnc_getSelectedButton) then { - _tooltip = _x select 6; - - _showTooltip = _tooltip != ""; - - _tooltip = text _tooltip; - - { - _showTooltip = true; - _tooltip = composeText [_tooltip, lineBreak, _x]; - } forEach (GVAR(Tooltips) select _forEachIndex); - - _ctrlTooltip ctrlSetStructuredText _tooltip; - _ctrlTooltip ctrlShow _showTooltip; - };*/ - - _ctrlText ctrlEnable _enable; - _ctrlIcon ctrlEnable _enable; - } forEach GVAR(Buttons); - - sleep 0.5; - isNull (findDisplay 1713999) - }; - }; -}; diff --git a/addons/interaction/functions/fnc_menuKeyInput.sqf b/addons/interaction/functions/fnc_menuKeyInput.sqf deleted file mode 100644 index 2390d6be14..0000000000 --- a/addons/interaction/functions/fnc_menuKeyInput.sqf +++ /dev/null @@ -1,17 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private "_key"; - -_key = _this select 1; - -if (_key in [28, 57, 156, 200, 208, 203, 205, 201, 209]) exitWith {true}; - -_index = GVAR(Shortcuts) find _key; - -if (_index != -1 && {ctrlEnabled (findDisplay 1713999 displayCtrl (_index + 10))}) exitWith { - _index call FUNC(onClick); - true -}; - -false diff --git a/addons/interaction/functions/fnc_onButtonDown.sqf b/addons/interaction/functions/fnc_onButtonDown.sqf deleted file mode 100644 index 63f62ed4a0..0000000000 --- a/addons/interaction/functions/fnc_onButtonDown.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -if (dialog) exitWith { - closeDialog 0; -}; - -if (isNull (findDisplay 1713999)) then { - if (ACE_player == vehicle ACE_player) then {"" call FUNC(openMenu)} else {[ACE_player, vehicle ACE_player] call FUNC(openMenuSelectUI)}; - setMousePosition [0.5, 0.5]; -} else { - (findDisplay 1713999) closeDisplay 1; -}; - -// Raise custom event. @todo: remove -[_player, "interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,callCustomEventHandlers); -// Raise ACE localEvent -["interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,localEvent); diff --git a/addons/interaction/functions/fnc_onButtonDownSelf.sqf b/addons/interaction/functions/fnc_onButtonDownSelf.sqf deleted file mode 100644 index 7b9abb926e..0000000000 --- a/addons/interaction/functions/fnc_onButtonDownSelf.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -if (dialog) exitWith { - closeDialog 0; -}; - -if (isNull (findDisplay 1713999)) then { - "" call FUNC(openMenuSelf); - setMousePosition [0.5, 0.5]; -} else { - (findDisplay 1713999) closeDisplay 1; -}; - -// Raise custom event. @todo: remove -[_player, "interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,callCustomEventHandlers); -// Raise ACE localEvent -["interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,localEvent); diff --git a/addons/interaction/functions/fnc_openMenu.sqf b/addons/interaction/functions/fnc_openMenu.sqf deleted file mode 100644 index 7785f2e4a4..0000000000 --- a/addons/interaction/functions/fnc_openMenu.sqf +++ /dev/null @@ -1,7 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private "_target"; -_target = [cursorTarget, GVAR(Target)] select (_this == "Default"); - -[0, _target, ""] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_openMenuSelf.sqf b/addons/interaction/functions/fnc_openMenuSelf.sqf deleted file mode 100644 index 9ce84f7287..0000000000 --- a/addons/interaction/functions/fnc_openMenuSelf.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -[1, ACE_player, ""] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_openSubMenu.sqf b/addons/interaction/functions/fnc_openSubMenu.sqf deleted file mode 100644 index cda4e76537..0000000000 --- a/addons/interaction/functions/fnc_openSubMenu.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -[2, GVAR(Target), _this select 0] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_openSubMenuSelf.sqf b/addons/interaction/functions/fnc_openSubMenuSelf.sqf deleted file mode 100644 index e207603ebb..0000000000 --- a/addons/interaction/functions/fnc_openSubMenuSelf.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -[3, ACE_player, _this select 0] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index 43c9eccdf1..acff7fa5e2 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -18,18 +18,15 @@ private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; closeDialog 0; -if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) exitWith { - _header = _this select 0; - _buttonText = _this select 1; - if (isNil "_buttonText" or {_buttonText == ""}) then { - _buttonText = localize "STR_ACE_Interaction_MakeSelection"; - }; - createDialog "RscACE_SelectAnItem"; - ctrlSetText [8860, _buttonText]; - ctrlSetText [8870, _header]; - - lbClear 8866; - - 8866 +_header = _this select 0; +_buttonText = _this select 1; +if (isNil "_buttonText" or {_buttonText == ""}) then { + _buttonText = localize "STR_ACE_Interaction_MakeSelection"; }; -[] +createDialog "RscACE_SelectAnItem"; +ctrlSetText [8860, _buttonText]; +ctrlSetText [8870, _header]; + +lbClear 8866; + +8866 diff --git a/addons/interaction/functions/fnc_removeInteraction.sqf b/addons/interaction/functions/fnc_removeInteraction.sqf deleted file mode 100644 index 141773da73..0000000000 --- a/addons/interaction/functions/fnc_removeInteraction.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: commy2 - * - * Remove an ACE action from an object. Note: This function is global. - * - * Argument: - * 0: Object (Object) - * 1: ID of the action (Number) - * - * Return value: - * None. - */ -#include "script_component.hpp" - -private ["_object", "_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; - -_object = _this select 0; -_id = _this select 1; - -_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]]; - -_currentID = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []]; -_actions = _actions - [[]]; - -_object setVariable [QGVAR(Interactions), [_currentID, _actionIDs, _actions], true]; diff --git a/addons/interaction/functions/fnc_removeInteractionSelf.sqf b/addons/interaction/functions/fnc_removeInteractionSelf.sqf deleted file mode 100644 index fce0f6a5a0..0000000000 --- a/addons/interaction/functions/fnc_removeInteractionSelf.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: commy2 - * - * Remove an ACE self action from the player. - * - * Argument: - * 0: ID of the action (Number) - * - * Return value: - * None. - */ -#include "script_component.hpp" - -private ["_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; - - -_id = _this select 0; - -_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]]; - -_currentID = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []]; -_actions = _actions - [[]]; - -ACE_player setVariable [QGVAR(InteractionsSelf), [_currentID, _actionIDs, _actions], false]; diff --git a/addons/interaction/functions/fnc_showMenu.sqf b/addons/interaction/functions/fnc_showMenu.sqf deleted file mode 100644 index b567a22ea4..0000000000 --- a/addons/interaction/functions/fnc_showMenu.sqf +++ /dev/null @@ -1,118 +0,0 @@ -/* - Author: - commy2 - Garth de Wet (LH) - aeroson - - Description: - - Parameters: - 0: NUMBER - Menu type (0 - interaction, 1 - self-interaction, 2 - sub-interaction, 3 - sub-self-interaction) - 1: OBJECT - Target object - 2: STRING - Sub-Menu ClassName - - Returns: - Nothing - - Example: - [0, GVAR(Target)] call FUNC(showMenu); - [1, player] call FUNC(showMenu); - [2, GVAR(Target), "ACE_Explosives"] call FUNC(showMenu); - [3, player, "ACE_Explosives"] call FUNC(showMenu); -*/ -#include "script_component.hpp" - -private ["_player", "_vehicle", "_mainButtonAction", "_object", "_index", "_actions", "_result", "_menuType"]; -#define DEFAULT_ICON QUOTE(PATHOF(UI\dot_ca.paa)) -#define DEFAULT_DISTANCE 4 // seems to be 4 -_player = ACE_player; -_vehicle = vehicle _player; - -GVAR(MenuType) = _this select 0; // 0 Interaction, 1 Self Interaction - -_mainButtonAction = [ - {call FUNC(hideMenu)}, - {call FUNC(hideMenu)}, - {"Default" call FUNC(openMenu)}, - {"Default" call FUNC(openMenuSelf)} -] select GVAR(MenuType); - -_menuType = GVAR(MenuType) % 2; -uiNamespace setVariable [QGVAR(CursorPosition), [controlNull, 0.5, 0.5, -1]]; - -GVAR(Target) = _this select 1; -_object = GVAR(Target); - -if (_menuType == 0 && {(isNull (_object) || {!([_object, 4] call FUNC(isInRange))})}) exitWith {}; -if !([_player, _object] call EFUNC(common,canInteractWith)) exitWith {}; - -// add actions or self actions of GVAR(Target) -_parents = [configFile >> "CfgVehicles" >> typeOf _object, true] call BIS_fnc_returnParents; -_result = [_object, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions); -_actions = ([_object, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0); - -// add self actions of vehicle _player -if (_menuType == 1 && {_player != _vehicle}) then { - _parents = [configFile >> "CfgVehicles" >> typeOf _vehicle, true] call BIS_fnc_returnParents; - _result = [_vehicle, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions); - _actions = _actions + (([_vehicle, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0)); -}; - -// custom defined actions, stored in variable instead of cfg like above -if (GVAR(MenuType) < 2) then { - - private ["_customActions", "_customAction", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority"]; - - // add interactions or self interactions of GVAR(Target) - _customActions = (_object getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2; - - // add self interactions of vehicle _player - if (_menuType == 1 && {_player != _vehicle}) then { - _customActions = _customActions + ((_vehicle getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2); - }; - - if(_menuType==0) then { - - private ["_distance"]; - - for "_index" from 0 to (count _customActions - 1) do { - - _customAction = _customActions select _index; - _displayName = _customAction select 0; - _distance = _customAction select 1; - _condition = _customAction select 2; - _statement = _customAction select 3; - _showDisabled = _customAction select 4; - _priority = _customAction select 5; - - if ((_showDisabled || {[_object, _player] call _condition}) && {[_object, _distance] call FUNC(isInRange) || {_distance == 0}}) then { - _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], _distance, ""]; - }; - }; - - } else { // self interactions do not have distance - - for "_index" from 0 to (count _customActions - 1) do { - - _customAction = _customActions select _index; - _displayName = _customAction select 0; - _condition = _customAction select 1; - _statement = _customAction select 2; - _showDisabled = _customAction select 3; - _priority = _customAction select 4; - - if (_showDisabled || {[_object, _player] call _condition}) then { - _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], DEFAULT_DISTANCE, ""]; - }; - }; - - }; - - -}; - -if (count _actions == 0) exitWith {}; - -_actions call FUNC(sortOptionsByPriority); -GVAR(Buttons) = _actions; -[_mainButtonAction, (_this select 2) != "", (profileNamespace getVariable [QGVAR(FlowMenu), false]), _menuType == 1, _object] call FUNC(initialiseInteraction); diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 960d136c0f..76898cd227 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -5,6 +5,24 @@ Interactions >> + + Head >> + + + Left Arm >> + + + Right Arm >> + + + Left Leg >> + + + Right Leg >> + + + Weapon >> + Interaction Menu Interaktionsmenü @@ -569,18 +587,6 @@ Perdona Megbocsátás - - Flow Menu - Mausradmenü - Flow Menu - Menú desplegable - Menu Déroulant - Flow Menu - Выпадающее меню - Flow Menu - Menù a Scorrimento - Legördülő menü - Scroll Scrollen @@ -616,25 +622,6 @@ Poza zasięgiem Mimo dosah - - Close Menu on Key Release - Menü nach Loslassen schließen - Zamknij menu automatycznie - Fermer le menu en relâchant la touche - Cerrar menú al soltar la tecla - Menü bezárása a billentyű elengedésekor - Закрывать меню при отжатии клавиши - Menu interakce (Na držení) - - - Auto Center Cursor - Mauszeiger automatisch zentrieren - Auto-centrar cursor - Automatycznie centruj kursor - Vycentrování kurzoru - Egér auto-centrírozása - Автоцентрирование курсора - Equipment >> Ausrüstung >> diff --git a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf index e96e84e9a1..fc183faa5b 100644 --- a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf +++ b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf @@ -54,6 +54,5 @@ _actions, { [_this] call FUNC(startRepackingMagazine); }, { call EFUNC(interaction,hideMenu); //ToDo: Self Interaction Integration - if !(profileNamespace getVariable [QGVAR(AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)}; } ] call EFUNC(interaction,openSelectMenu); diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index eafc85cdf1..4452c10b23 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -15,7 +15,6 @@ class CfgVehicles { exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; showDisabled = 0; priority = 100; - subMenu[] = {"ACE_MapTools", 1}; enableInside = 1; class ACE_MapToolsHide { diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 190d131f07..7dd4397ff1 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -60,46 +60,77 @@ class CfgVehicles { }; class ACE_Actions { - class Bandage_Head { - displayName = "Bandage Head"; - selection = "pilot"; - distance = 2.0; - //condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage Head')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = "B"; - enableInside = 1; + class ACE_Head { + class Bandage_Head { + displayName = "Bandage Head"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage Head')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + }; }; - class Bandage_Torso: Bandage_Head { - displayName = "Bandage Torso"; - selection = "Spine3"; - //condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreat)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); + class ACE_MainActions { + class Bandage_Torso { + displayName = "Bandage Torso"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreat)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + }; }; - class Bandage_LeftArm: Bandage_Head { - displayName = "Bandage Right Arm"; - selection = "LeftForeArm"; - //condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); + class ACE_ArmLeft { + class Bandage_LeftArm { + displayName = "Bandage Right Arm"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + }; }; - class Bandage_RightArm: Bandage_Head { - displayName = "Bandage Right Arm"; - selection = "RightForeArm"; - //condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); + class ACE_ArmRight { + class Bandage_RightArm { + displayName = "Bandage Right Arm"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + }; }; - class Bandage_LeftLeg: Bandage_Head { - displayName = "Bandage Left Leg"; - selection = "lknee"; - //condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreat)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); + class ACE_LegLeft { + class Bandage_LeftLeg { + displayName = "Bandage Left Leg"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreat)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + }; }; - class Bandage_RightLeg: Bandage_Head { - displayName = "Bandage Right Leg"; - selection = "rknee"; - //condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); + class ACE_LegRight { + class Bandage_RightLeg { + displayName = "Bandage Right Leg"; + distance = 2.0; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); + showDisabled = 1; + priority = 2; + hotkey = "B"; + enableInside = 1; + }; }; }; }; diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index cbf35b0baf..2a5d96ff95 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -157,6 +157,7 @@ class CfgVehicles { class ACE_MainActions { distance = 5; condition = "true"; + selection = ""; class ACE_Teleport { displayName = "Teleport to Base"; distance = 4; @@ -181,6 +182,7 @@ class CfgVehicles { class ACE_MainActions { distance = 5; condition = "true"; + selection = ""; class ACE_Teleport { displayName = "Teleport to Base"; distance = 4; @@ -205,6 +207,7 @@ class CfgVehicles { class ACE_MainActions { distance = 5; condition = "true"; + selection = ""; class ACE_Teleport { displayName = "Teleport to Base"; distance = 4; diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 2ffb4eee44..5be796c126 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -1,8 +1,5 @@ #define MACRO_LOCK_ACTIONS \ class ACE_MainActions { \ - selection = ""; \ - distance = 5; \ - condition = "true"; \ class ACE_unlockVehicle { \ displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ distance = 4; \