Merge pull request #166 from KoffeinFlummi/ace_interactionCleanup

ACE_Interaction cleanup and improvements to ACE_Interact_Menu
This commit is contained in:
Nicolás Badano 2015-03-03 01:53:33 -03:00
commit 39be8ffbe7
54 changed files with 521 additions and 1779 deletions

View File

@ -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))); \

View File

@ -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);

View File

@ -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";

View File

@ -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);

View File

@ -0,0 +1,21 @@
/*
* Author: CAA-Picard
* Converts ASL to Arma "Position"
*
* Arguments:
* 0: position x <Number>
* 1: position y <Number>
* 2: position z <Number>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (surfaceIsWater _this) then {
_this
} else {
ASLtoATL _this
};

View File

@ -0,0 +1,21 @@
/*
* Author: CAA-Picard
* Converts Arma "Position" to ASL
*
* Arguments:
* 0: position x <Number>
* 1: position y <Number>
* 2: position z <Number>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (surfaceIsWater _this) then {
_this
} else {
ATLtoASL _this
};

View File

@ -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 {

View File

@ -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);

View File

@ -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);
};

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,72 @@
/*
* Author: CAA-Picard
* Collect a entire tree of active actions
*
* Argument:
* 0: Object <OBJECT>
* 1: Original action tree <ARRAY>
*
* Return value:
* Active children <ARRAY>
*
* 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]

View File

@ -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]
]
]
*/

View File

@ -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];

View File

@ -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

View File

@ -22,5 +22,4 @@ if(GVAR(actionSelected)) then {
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
GVAR(vecLineMap) = [];
true

View File

@ -26,5 +26,4 @@ if(GVAR(actionSelected)) then {
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
GVAR(vecLineMap) = [];
true

View File

@ -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;

View File

@ -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);

View File

@ -0,0 +1,71 @@
/*
* Author: NouberNou and CAA-Picard
* Render the interaction menu for a base action
*
* Argument:
* 0: Object <OBJECT>
* 1: Action data <ARRAY>
* 2: 3D position <ARRAY> (Optional)
*
* Return value:
* Was the menu rendered <BOOL>
*
* 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

View File

@ -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 ["<img image='%1' color='%2' align='center'/><br/><t color ='%3' size='0.75' align='center'>%4</t>", _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;
};

View File

@ -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 <OBJECT>
* 1: Action data <ARRAY>
* 2: Was the condition already checked? <BOOL>
* 2: 3D position <ARRAY>
* 3: Angle range available for rendering <ARRAY>
* 4: 3D position <ARRAY> (Optional)
*
* Return value:
* Was the menu rendered <BOOL>
* 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);

View File

@ -1,52 +0,0 @@
/*
* Author: NouberNou
* Rotate a vector line (?)
*
* Argument:
* 0: Map <ARRAY>
* 1: Theta <ARRAY>
*
* Return value:
* 0: ?? <ARRAY>
*
* 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;

View File

@ -1,52 +0,0 @@
/*
* Author: NouberNou
* ?
*
* Argument:
* 0: p0 <ARRAY>
* 1: p1 <ARRAY>
* 2: p2 <ARRAY>
*
* Return value:
* Map <ARRAY>
*
* 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]

View File

@ -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);
};

View File

@ -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 {};
};
};
};

View File

@ -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;

View File

@ -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;

View File

@ -19,24 +19,6 @@ class CfgPatches {
#include <Menu_Config.hpp>
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";

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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

View File

@ -1,5 +0,0 @@
// by commy2
#include "script_component.hpp"
GVAR(CurrentTooltip) pushBack (_this select 0);

View File

@ -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}

View File

@ -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

View File

@ -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)
};
};
};

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -1,7 +0,0 @@
// by commy2
#include "script_component.hpp"
private "_target";
_target = [cursorTarget, GVAR(Target)] select (_this == "Default");
[0, _target, ""] call FUNC(showMenu);

View File

@ -1,4 +0,0 @@
// by commy2
#include "script_component.hpp"
[1, ACE_player, ""] call FUNC(showMenu);

View File

@ -1,4 +0,0 @@
// by commy2
#include "script_component.hpp"
[2, GVAR(Target), _this select 0] call FUNC(showMenu);

View File

@ -1,4 +0,0 @@
// by commy2
#include "script_component.hpp"
[3, ACE_player, _this select 0] call FUNC(showMenu);

View File

@ -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

View File

@ -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];

View File

@ -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];

View File

@ -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);

View File

@ -5,6 +5,24 @@
<Key ID="STR_ACE_Interaction_MainAction">
<English>Interactions &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_Head">
<English>Head &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_ArmLeft">
<English>Left Arm &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_ArmRight">
<English>Right Arm &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_LegLeft">
<English>Left Leg &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_LegRight">
<English>Right Leg &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_Weapon">
<English>Weapon &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_InteractionMenu">
<English>Interaction Menu</English>
<German>Interaktionsmenü</German>
@ -569,18 +587,6 @@
<Italian>Perdona</Italian>
<Hungarian>Megbocsátás</Hungarian>
</Key>
<Key ID="STR_ACE_Interaction_FlowMenu">
<English>Flow Menu</English>
<German>Mausradmenü</German>
<Polish>Flow Menu</Polish>
<Spanish>Menú desplegable</Spanish>
<French>Menu Déroulant</French>
<Czech>Flow Menu</Czech>
<Russian>Выпадающее меню</Russian>
<Portuguese>Flow Menu</Portuguese>
<Italian>Menù a Scorrimento</Italian>
<Hungarian>Legördülő menü</Hungarian>
</Key>
<Key ID="STR_ACE_Interaction_ScrollHint">
<English>Scroll</English>
<German>Scrollen</German>
@ -616,25 +622,6 @@
<Polish>Poza zasięgiem</Polish>
<Czech>Mimo dosah</Czech>
</Key>
<Key ID="STR_ACE_Interaction_AutoCloseMenu">
<English>Close Menu on Key Release</English>
<German>Menü nach Loslassen schließen</German>
<Polish>Zamknij menu automatycznie</Polish>
<French>Fermer le menu en relâchant la touche</French>
<Spanish>Cerrar menú al soltar la tecla</Spanish>
<Hungarian>Menü bezárása a billentyű elengedésekor</Hungarian>
<Russian>Закрывать меню при отжатии клавиши</Russian>
<Czech>Menu interakce (Na držení)</Czech>
</Key>
<Key ID="STR_ACE_Interaction_AutoCenterCursor">
<English>Auto Center Cursor</English>
<German>Mauszeiger automatisch zentrieren</German>
<Spanish>Auto-centrar cursor</Spanish>
<Polish>Automatycznie centruj kursor </Polish>
<Czech>Vycentrování kurzoru</Czech>
<Hungarian>Egér auto-centrírozása</Hungarian>
<Russian>Автоцентрирование курсора</Russian>
</Key>
<Key ID="STR_ACE_Interaction_Equipment">
<English>Equipment &gt;&gt;</English>
<German>Ausrüstung &gt;&gt;</German>

View File

@ -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);

View File

@ -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 {

View File

@ -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;
};
};
};
};

View File

@ -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;

View File

@ -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; \