Merge remote-tracking branch 'origin/selfInteractionMenu' into explosiveInteraction

This commit is contained in:
Garth L-H de Wet 2015-02-20 00:46:56 +02:00
commit 477d8c9dec
25 changed files with 709 additions and 537 deletions

View File

@ -1,6 +1,10 @@
#define MACRO_ATTACHTOVEHICLE \ #define MACRO_ATTACHTOVEHICLE \
class ACE_Actions { \ class ACE_Actions { \
class ACE_MainActions { \
selection = ""; \
distance = 5; \
condition = "true"; \
class GVAR(AttachVehicle) { \ class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \ displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
@ -21,6 +25,7 @@
icon = PATHTOF(UI\detach_ca.paa); \ icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \ distance = 4; \
}; \ }; \
}; \
}; };
class CfgVehicles { class CfgVehicles {

View File

@ -2,6 +2,11 @@ class CfgVehicles {
class Man; class Man;
class CAManBase: Man { class CAManBase: Man {
class ACE_Actions { class ACE_Actions {
class ACE_RightHandActions {
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 { class ACE_ApplyHandcuffs {
displayName = "$STR_ACE_Captives_SetCaptive"; displayName = "$STR_ACE_Captives_SetCaptive";
distance = 4; distance = 4;
@ -24,6 +29,8 @@ class CfgVehicles {
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "R"; hotkey = "R";
}; };
};
class ACE_MainActions {
class ACE_EscortCaptive { class ACE_EscortCaptive {
displayName = "$STR_ACE_Captives_EscortCaptive"; displayName = "$STR_ACE_Captives_EscortCaptive";
distance = 4; distance = 4;
@ -68,6 +75,7 @@ class CfgVehicles {
hotkey = "F"; hotkey = "F";
}; };
}; };
};
class ACE_SelfActions { class ACE_SelfActions {
class ACE_StopEscortingSelf { class ACE_StopEscortingSelf {
@ -100,6 +108,8 @@ class CfgVehicles {
#define MACRO_LOADUNLOADCAPTIVE \ #define MACRO_LOADUNLOADCAPTIVE \
class ACE_Actions { \ class ACE_Actions { \
class ACE_MainActions { \
selection = ""; \
class ACE_LoadCaptive { \ class ACE_LoadCaptive { \
displayName = "$STR_ACE_Captives_LoadCaptive"; \ displayName = "$STR_ACE_Captives_LoadCaptive"; \
distance = 4; \ distance = 4; \
@ -119,6 +129,7 @@ class CfgVehicles {
priority = 1.2; \ priority = 1.2; \
hotkey = "C"; \ hotkey = "C"; \
}; \ }; \
}; \
}; };
class LandVehicle; class LandVehicle;

View File

@ -13,7 +13,7 @@ class Extended_PostInit_EventHandlers {
class Extended_InitPost_EventHandlers { class Extended_InitPost_EventHandlers {
class All { class All {
class GVAR(compileMenu) { class GVAR(compileMenu) {
init = QUOTE(_this call FUNC(compileMenu)); init = QUOTE(_this call FUNC(compileMenu);_this call FUNC(compileMenuSelfAction));
}; };
}; };
}; };

View File

@ -15,13 +15,27 @@ _fnc = {
["ACE3", ["ACE3",
"Interact Key", "Interact Key",
{_this call FUNC(keyDown)}, {_this call FUNC(keyDown)},
[15, [false, false, false]], [219, [false, false, false]],
false, false,
"keydown"] call cba_fnc_registerKeybind; "keydown"] call cba_fnc_registerKeybind;
["ACE3", ["ACE3",
"Interact Key", "Interact Key",
{_this call FUNC(keyUp)}, {_this call FUNC(keyUp)},
[15, [false, false, false]], [219, [false, false, false]],
false,
"keyUp"] call cba_fnc_registerKeybind;
["ACE3",
"Self Actions Key",
{_this call FUNC(keyDownSelfAction)},
[219, [false, true, false]],
false,
"keydown"] call cba_fnc_registerKeybind;
["ACE3",
"Self Actions Key",
{_this call FUNC(keyUpSelfAction)},
[219, [false, true, false]],
false, false,
"keyUp"] call cba_fnc_registerKeybind; "keyUp"] call cba_fnc_registerKeybind;

View File

@ -2,22 +2,25 @@
ADDON = false; ADDON = false;
PREP(setToRender); PREP(addAction);
PREP(compileMenu);
PREP(compileMenuSelfAction);
PREP(keyDown);
PREP(keyDownSelfAction);
PREP(keyUp);
PREP(keyUpSelfAction);
PREP(probe);
PREP(removeAction);
PREP(render); PREP(render);
PREP(renderIcon); PREP(renderIcon);
PREP(renderMenu); PREP(renderMenu);
PREP(probe);
PREP(rotateVectLineGetMap);
PREP(rotateVectLine); PREP(rotateVectLine);
PREP(keyDown); PREP(rotateVectLineGetMap);
PREP(keyUp);
PREP(compileMenu);
PREP(addAction);
PREP(removeAction);
GVAR(toRender) = []; GVAR(toRender) = [];
GVAR(keyDown) = false; GVAR(keyDown) = false;
GVAR(keyDownSelfAction) = false;
GVAR(keyDownTime) = 0; GVAR(keyDownTime) = 0;
GVAR(lastTime) = diag_tickTime; GVAR(lastTime) = diag_tickTime;

View File

@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {""}; author[] = {"NouberNou", "CAA-Picard"};
authorUrl = ""; authorUrl = "";
VERSION_CONFIG; VERSION_CONFIG;
}; };

View File

@ -1,19 +1,20 @@
/* /*
* Author: commy2 * Author: commy2
*
* Add an ACE action to an object. Note: This function is NOT global. * Add an ACE action to an object. Note: This function is NOT global.
* *
* Argument: * Argument:
* 0: Object the action should be assigned to (Object) * 0: Object the action should be assigned to <OBJECT>
* 1: Name of the action shown in the menu (String) * 1: Name of the action shown in the menu <STRING>
* 2: Icon (String) * 2: Icon <STRING>
* 3: Position (Position or Selection Name) * 3: Position (Position or Selection Name) <POSITION> or <STRING>
* 4: Statement (Code) * 4: Statement <CODE>
* 5: Condition (Code) * 5: Condition <CODE>
* 6: Distance (Number) * 6: Distance <NUMBER>
* *
* Return value: * Return value:
* The entry array, which can be used to remove the entry, or add children entries. * The entry array, which can be used to remove the entry, or add children entries <ARRAY>.
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -37,7 +37,7 @@ _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";
_recurseFnc = { _recurseFnc = {
private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_condition", "_showDisabled", private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled",
"_enableInside", "_children", "_entry", "_actionsCfg"]; "_enableInside", "_children", "_entry", "_actionsCfg"];
_actions = []; _actions = [];
_actionsCfg = _this select 0; _actionsCfg = _this select 0;
@ -48,7 +48,10 @@ _recurseFnc = {
_distance = getNumber (_entryCfg >> "distance"); _distance = getNumber (_entryCfg >> "distance");
_icon = getText (_entryCfg >> "icon"); _icon = getText (_entryCfg >> "icon");
_statement = compile (getText (_entryCfg >> "statement")); _statement = compile (getText (_entryCfg >> "statement"));
_selection = getText (_entryCfg >> "selection");
if (_selection == "") then {
_selection = [0,0,0];
};
_condition = getText (_entryCfg >> "condition"); _condition = getText (_entryCfg >> "condition");
if (_condition == "") then {_condition = "true"}; if (_condition == "") then {_condition = "true"};
@ -59,24 +62,18 @@ _recurseFnc = {
_enableInside = getNumber (_entryCfg >> "enableInside"); _enableInside = getNumber (_entryCfg >> "enableInside");
_condition = compile _condition; _condition = compile _condition;
// diag_log text format["_condition: %1", _condition]; _children = [_entryCfg] call _recurseFnc;
_children = [];
if(isArray (_entryCfg >> "subMenu")) then {
_subMenuDef = getArray (_entryCfg >> "subMenu");
_childMenuName = _subMenuDef select 0;
_childMenuCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions" >> _childMenuName;
_children = [_childMenuCfg] call _recurseFnc;
};
_entry = [ _entry = [
_displayName, _displayName,
_icon, _icon,
[0,0,0], _selection,
_statement, _statement,
_condition, _condition,
_distance, _distance,
_children, _children,
GVAR(uidCounter) GVAR(uidCounter)
]; ];
diag_log _entry;
GVAR(uidCounter) = GVAR(uidCounter) + 1; GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry; _actions pushBack _entry;
}; };
@ -85,9 +82,20 @@ _recurseFnc = {
}; };
_actions = [_actionsCfg] call _recurseFnc; _actions = [_actionsCfg] call _recurseFnc;
//diag_log _actions;
// Backward-compat, filter only base actions that have a selection
private ["_newActions","_oldActions","_selection"];
_filteredActions = [];
{
_selection = _x select 2;
if (typeName _selection == "STRING") then {
_filteredActions pushBack _x;
};
} forEach _actions;
/*
_actions = [[ _actions = [[
"TEST!", "Interactions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
"Spine3", "Spine3",
{ true }, { true },
@ -98,5 +106,5 @@ _actions = [[
] ]
]; ];
GVAR(uidCounter) = GVAR(uidCounter) + 1; GVAR(uidCounter) = GVAR(uidCounter) + 1;
*/
_object setVariable [QUOTE(GVAR(actionData)), _actions]; _object setVariable [QUOTE(GVAR(actionData)), _filteredActions];

View File

@ -0,0 +1,99 @@
//fnc_compileMenuSelfAction.sqf
#include "script_component.hpp";
// diag_log text format["COMPILE ACTIONS: %1", _this];
_object = _this select 0;
_objectType = typeOf _object;
/*
displayName = "$STR_ACE_Hearing_Earbuds_On";
condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarBuds' in items _player} );
statement = QUOTE( [_player] call FUNC(putInEarPlugs) );
showDisabled = 0;
priority = 2.5;
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
hotkey = "E";
enableInside = 1;
*/
/*
[
[
"Launch",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
[0,0,0],
{ (_this select 0) setVelocity [0,0,10]; },
{ true },
1,
[]
]
]
*/
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
_recurseFnc = {
private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_condition", "_showDisabled",
"_enableInside", "_children", "_entry", "_actionsCfg"];
_actions = [];
_actionsCfg = _this select 0;
for "_i" from 0 to (count _actionsCfg)-1 do {
_entryCfg = _actionsCfg select _i;
if(isClass _entryCfg) then {
_displayName = getText (_entryCfg >> "displayName");
_icon = getText (_entryCfg >> "icon");
_statement = compile (getText (_entryCfg >> "statement"));
_condition = getText (_entryCfg >> "condition");
if (_condition == "") then {_condition = "true"};
// 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");
_condition = compile _condition;
// diag_log text format["_condition: %1", _condition];
_children = [];
if(isArray (_entryCfg >> "subMenu")) then {
_subMenuDef = getArray (_entryCfg >> "subMenu");
_childMenuName = _subMenuDef select 0;
_childMenuCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions" >> _childMenuName;
_children = [_childMenuCfg] call _recurseFnc;
};
_entry = [
_displayName,
_icon,
[0,0,0],
_statement,
_condition,
10, //distace
_children,
GVAR(uidCounter)
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
};
};
_actions
};
_actions = [_actionsCfg] call _recurseFnc;
_actions = [[
"Self Actions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
"Spine3",
{ true },
{ true },
10,
_actions,
GVAR(uidCounter)
]
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_object setVariable [QUOTE(GVAR(selfActionData)), _actions];

View File

@ -0,0 +1,11 @@
//fnc_keyDownSelfAction.sqf
#include "script_component.hpp"
if(!GVAR(keyDownSelfAction)) then {
GVAR(keyDownSelfAction) = true;
GVAR(keyDown) = false;
GVAR(keyDownTime) = diag_tickTime;
GVAR(selfMenuOffset) = [sin getDir ACE_player, cos getDir ACE_player, 0] vectorMultiply 2;
};
true

View File

@ -1,4 +1,4 @@
//fnc_keyUp.sqf //fnc_keyUpSelfAction.sqf
#include "script_component.hpp" #include "script_component.hpp"
GVAR(keyDown) = false; GVAR(keyDown) = false;

View File

@ -0,0 +1,15 @@
//fnc_keyUp.sqf
#include "script_component.hpp"
GVAR(keyDownSelfAction) = false;
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
_player = ACE_Player;
_target = GVAR(selectedTarget);
[GVAR(selectedTarget), player] call GVAR(selectedAction);
};
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
GVAR(vecLineMap) = [];
true

View File

@ -18,6 +18,7 @@ if(!GVAR(keyDown)) then {
_target = _actionObject; _target = _actionObject;
_player = ACE_player; _player = ACE_player;
_active = [_target, ACE_player] call (_actionItem select 4); _active = [_target, ACE_player] call (_actionItem select 4);
systemChat format ["%1 %2 is active %3", _actionObject, _actionItem select 0, _active];
// player sideChat format["_active: %1 %2", _actionItem select 0, _active]; // player sideChat format["_active: %1 %2", _actionItem select 0, _active];
if(_active) then { if(_active) then {
_renderItem = +_actionItem; _renderItem = +_actionItem;

View File

@ -6,7 +6,7 @@ _foundTarget = false;
_cursorPos1 = positionCameraToWorld [0, 0, 0]; _cursorPos1 = positionCameraToWorld [0, 0, 0];
_cursorPos2 = positionCameraToWorld [0, 0, 2]; _cursorPos2 = positionCameraToWorld [0, 0, 2];
GVAR(currentOptions) = []; GVAR(currentOptions) = [];
if((count GVAR(toRender)) > 0 && GVAR(keyDown)) then { if((count GVAR(toRender)) > 0 && (GVAR(keyDown) || GVAR(keyDownSelfAction))) then {
if((count GVAR(vecLineMap)) == 0 || ((count GVAR(menuDepthPath)) > 0 && (getPosASL player) distance GVAR(lastPos) > 0.01)) then { if((count GVAR(vecLineMap)) == 0 || ((count GVAR(menuDepthPath)) > 0 && (getPosASL player) distance GVAR(lastPos) > 0.01)) then {
GVAR(lastPos) = getPosASL player; GVAR(lastPos) = getPosASL player;
_cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY; _cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY;
@ -18,19 +18,28 @@ if((count GVAR(toRender)) > 0 && GVAR(keyDown)) then {
GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap); GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap);
}; };
if (GVAR(keyDown)) then {
// Render all nearby interaction menus
{ {
if(!(_forEachIndex in GVAR(filter))) then { if(!(_forEachIndex in GVAR(filter))) then {
GVAR(renderDepth) = 0; GVAR(renderDepth) = 0;
_renderTargets = _x; _renderTargets = _x;
{ {
[_renderTargets select 0, _x, 0] call FUNC(renderMenu); [_renderTargets select 0, _x, 0, [180, 360]] call FUNC(renderMenu);
} forEach (_renderTargets select 1); } forEach (_renderTargets select 1);
}; };
} forEach GVAR(toRender); } forEach GVAR(toRender);
} else {
// Render only the self action menu
_actions = (ACE_player getVariable QGVAR(selfActionData)) select 0;
_pos = (ACE_player modelToWorld (ACE_player selectionPosition "spine3")) vectorAdd GVAR(selfMenuOffset) vectorAdd [0,0,0.25];
[ACE_player, _actions, 0, [180, 360], _pos] call FUNC(renderMenu);
};
// player sideChat format["c: %1", count GVAR(toRender)]; // player sideChat format["c: %1", count GVAR(toRender)];
}; };
if(GVAR(keyDown)) then { if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
_cursorScreenPos = worldToScreen _cursorPos2; _cursorScreenPos = worldToScreen _cursorPos2;
_closestDistance = 1000000; _closestDistance = 1000000;

View File

@ -6,6 +6,7 @@ _text = _this select 0;
_color = _this select 1; _color = _this select 1;
_pos = _this select 2; _pos = _this select 2;
_icon = _this select 6; _icon = _this select 6;
//systemChat format ["Drawing icon %1", _text];
_sPos = worldToScreen _pos; _sPos = worldToScreen _pos;
// _sPos = _pos; // _sPos = _pos;
if(count _sPos > 0) then { if(count _sPos > 0) then {
@ -18,12 +19,10 @@ if(count _sPos > 0) then {
if(_icon == "") then { if(_icon == "") then {
_icon = DEFAULT_ICON; _icon = DEFAULT_ICON;
}; };
_text = "<img image='" + _icon + "' />" + _text; _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 ctrlSetStructuredText (parseText _text);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.011*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.025*SafeZoneW]; _ctrl ctrlSetPosition [(_sPos select 0)-(0.2*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.035*SafeZoneW];
_ctrl ctrlSetForegroundColor _color; //_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
_opacity = _color select 3;
_control ctrlSetTextColor _color;
// _ctrl ctrlSetBackgroundColor [1,0,0,1]; // _ctrl ctrlSetBackgroundColor [1,0,0,1];
_ctrl ctrlCommit 0; _ctrl ctrlCommit 0;
}; };

View File

@ -1,15 +1,18 @@
//fnc_renderMenu.sqf //fnc_renderMenu.sqf
#include "script_component.hpp" #include "script_component.hpp"
private ["_object", "_actionData", "_distance", "_index", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"]; private ["_object", "_actionData", "_distance", "_uid", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"];
_object = _this select 0; _object = _this select 0;
_actionData = _this select 1; _actionData = _this select 1;
_distance = _actionData select 5; _uid = _actionData select 7;//_this select 2;
_index = _this select 2; _angles = _this select 3;
if((count _this) > 3) then { _distance = _actionData select 5;
_pos = _this select 3; EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan);
if((count _this) > 4) then {
_pos = _this select 4;
} else { } else {
if(typeName (_actionData select 2) == "ARRAY") then { if(typeName (_actionData select 2) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 2); _pos = _object modelToWorld (_actionData select 2);
@ -20,44 +23,66 @@ if((count _this) > 3) then {
_cursorScreenPos = (positionCameraToWorld [0, 0, 0]); _cursorScreenPos = (positionCameraToWorld [0, 0, 0]);
if(_cursorScreenPos distance _pos <= _distance) then { if(_cursorScreenPos distance _pos <= _distance) then {
_path = []; _path = [];
if((count _this) > 4) then { if((count _this) > 5) then {
_path = +(_this select 4); _path = +(_this select 5);
}; };
_menuDepth = (count GVAR(menuDepthPath)); _menuDepth = (count GVAR(menuDepthPath));
_opacity = 1; // ARGB Color (First Hex Pair is transparancy)
if(_menuDepth > 0 && _index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then { _color = "#FFFFFFFF";
_opacity = ((GVAR(renderDepth)/_menuDepth)) max 0.25; if(_menuDepth > 0 && _uid != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then {
_color = format ["#%1FFFFFF", [255 * (((GVAR(renderDepth)/_menuDepth)) max 0.25)] call EFUNC(common,toHex)];
}; };
_path set[(count _path), _index]; _path set[(count _path), _uid];
// player sideChat format["r: %1", _actionData select 2]; [_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
[_actionData select 0, [1,1,1,_opacity], _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]]; GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]];
_currentRenderDepth = -1; _currentRenderDepth = -1;
_currentRenderDepth = GVAR(renderDepth); _currentRenderDepth = GVAR(renderDepth);
GVAR(renderDepth) = GVAR(renderDepth) + 1; GVAR(renderDepth) = GVAR(renderDepth) + 1;
if(_index == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then { if(_uid == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then {
_radialOffset = 0; // Count how many actions are active
private "_numActions";
_numActions = 0;
{
this = _object;
_target = _object;
_player = ACE_player;
_active = [_object, ACE_player] call (_x select 4);
if(_active) then {
_numActions = _numActions + 1;
};
} forEach (_actionData select 6);
systemChat format ["Menu %1, _numActions: %2", _actionData select 0, _numActions];
private "_angleSpan";
_angleSpan = _maxAngleSpan min (55 * (_numActions - 1));
private "_angle";
_angle = _centerAngle - _angleSpan / 2;
{ {
// if(_index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then {
this = _object; this = _object;
_target = _object; _target = _object;
_player = ACE_player; _player = ACE_player;
_active = [_object, ACE_player] call (_x select 4); _active = [_object, ACE_player] call (_x select 4);
// diag_log text format["_active: %1: %2", (_x select 0), _active]; // diag_log text format["_active: %1: %2", (_x select 0), _active];
if(_active) then { if(_active) then {
_offset = [GVAR(vecLineMap), (270*(GVAR(renderDepth)%2))-(_radialOffset*45)] call FUNC(rotateVectLine); //systemChat format ["_angle: %1", _angle];
_mod = 0.1*_distance; _offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine);
_mod = 0.15 max (0.15 * (_cursorScreenPos distance _pos)); //0.5;//0.1*_distance;
_newPos = [ _newPos = [
(_pos select 0) + ((_offset select 0)*_mod), (_pos select 0) + ((_offset select 0)*_mod),
(_pos select 1) + ((_offset select 1)*_mod), (_pos select 1) + ((_offset select 1)*_mod),
(_pos select 2) + ((_offset select 2)*_mod) (_pos select 2) + ((_offset select 2)*_mod)
]; ];
// drawLine3D [_pos, _newPos, [1,0,0,1]]; // drawLine3D [_pos, _newPos, [1,0,0,0.5]];
[_object, _x, _forEachIndex, _newPos, _path] call FUNC(renderMenu); [_object, _x, _forEachIndex, [_angle, 150], _newPos, _path] call FUNC(renderMenu);
_radialOffset = _radialOffset + 1;
if (_angle == 360) then {
_angle = _angle + _angleSpan / _numActions;
} else {
_angle = _angle + _angleSpan / ((_numActions-1) max 1);
};
}; };
// };
} forEach (_actionData select 6); } forEach (_actionData select 6);
}; };
GVAR(renderDepth) = GVAR(renderDepth) - 1; GVAR(renderDepth) = GVAR(renderDepth) - 1;

View File

@ -1,6 +0,0 @@
//fnc_setToRender.sqf
#include "script_component.hpp"
// No idea what this function was for, it was autogenerated out of my WIP file...
private ["_options"];
_object = _this select 0;
_options = _this select 1;

View File

@ -30,6 +30,14 @@ class CfgVehicles {
class Man; class Man;
class CAManBase: Man { class CAManBase: Man {
class ACE_Actions { class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
distance = 4;
condition = QUOTE(true);
statement = "";
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
selection = "spine3";
class ACE_TeamManagement { class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement"; displayName = "$STR_ACE_Interaction_TeamManagement";
distance = 4; distance = 4;
@ -38,7 +46,6 @@ class CfgVehicles {
showDisabled = 0; showDisabled = 0;
priority = 3.2; priority = 3.2;
icon = PATHTOF(UI\team\team_management_ca.paa); icon = PATHTOF(UI\team\team_management_ca.paa);
subMenu[] = {"ACE_TeamManagement", 0};
hotkey = "M"; hotkey = "M";
enableInside = 1; enableInside = 1;
@ -100,16 +107,6 @@ class CfgVehicles {
}; };
}; };
class ACE_TapShoulder {
displayName = "$STR_ACE_Interaction_TapShoulder";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_2(_player, _target)] call DFUNC(tapShoulder));
showDisabled = 1;
priority = 2.8;
hotkey = "Q";
enableInside = 1;
};
class ACE_JoinGroup { class ACE_JoinGroup {
displayName = "$STR_ACE_Interaction_JoinGroup"; displayName = "$STR_ACE_Interaction_JoinGroup";
distance = 4; distance = 4;
@ -149,6 +146,19 @@ class CfgVehicles {
}; };
}; };
class ACE_TapShoulder {
displayName = "$STR_ACE_Interaction_TapShoulder";
selection = "rightshoulder";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_2(_player, _target)] call DFUNC(tapShoulder));
showDisabled = 0;
priority = 2.8;
hotkey = "Q";
enableInside = 1;
};
};
class ACE_SelfActions { class ACE_SelfActions {
class ACE_TeamManagement { class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement"; displayName = "$STR_ACE_Interaction_TeamManagement";

View File

@ -16,78 +16,6 @@ GVAR(isOpeningDoor) = false;
// Add keybinds // Add keybinds
["ACE3",
localize "STR_ACE_Interaction_InteractionMenu",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), "ACE_Interaction_isNotSwimming"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(isNull (findDisplay 1713999)) exitWith {false};
// Statement
call FUNC(onButtonDown);
true
},
[219, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_InteractionMenu",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), "ACE_Interaction_isNotSwimming"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!isNull (findDisplay 1713999) && {QGVAR(AutoCloseMenu)}) exitWith {false};
// Statement
if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)};
true
},
[219, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_InteractionMenuSelf",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), QEGVAR(captives,isNotSurrendering), "ACE_Interaction_isNotSwimming", "ACE_Common_notOnMap"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(isNull (findDisplay 1713999)) exitWith {false};
// Statement
call FUNC(onButtonDownSelf);
true
},
[219, [false, true, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_InteractionMenuSelf",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), QEGVAR(captives,isNotSurrendering), "ACE_Interaction_isNotSwimming"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!isNull (findDisplay 1713999) && {QGVAR(AutoCloseMenu)}) exitWith {false};
// Statement
if (GVAR(MenuType) mod 2 == 1) then {call FUNC(onButtonUp)};
true
},
[219, [false, true, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3", ["ACE3",
localize "STR_ACE_Interaction_OpenDoor", localize "STR_ACE_Interaction_OpenDoor",
{ {

View File

@ -2,6 +2,9 @@
<!-- Edited with tabler - 2014-12-20 --> <!-- Edited with tabler - 2014-12-20 -->
<Project name="ACE"> <Project name="ACE">
<Package name="Interaction"> <Package name="Interaction">
<Key ID="STR_ACE_Interaction_MainAction">
<English>Interactions &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_InteractionMenu"> <Key ID="STR_ACE_Interaction_InteractionMenu">
<English>Interaction Menu</English> <English>Interaction Menu</English>
<German>Interaktionsmenü</German> <German>Interaktionsmenü</German>

View File

@ -2,6 +2,7 @@ class CfgVehicles {
class Helicopter_Base_F; class Helicopter_Base_F;
class UAV_01_base_F: Helicopter_Base_F { class UAV_01_base_F: Helicopter_Base_F {
class ACE_Actions { class ACE_Actions {
class ACE_MainActions {
class GVAR(RefuelUAV) { class GVAR(RefuelUAV) {
displayName = "$STR_ACE_logistics_uavbattery_Recharge"; displayName = "$STR_ACE_logistics_uavbattery_Recharge";
distance = 4; distance = 4;
@ -13,6 +14,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
// Misc box content // Misc box content
class Box_NATO_Support_F; class Box_NATO_Support_F;

View File

@ -85,6 +85,7 @@ class CfgVehicles {
}; };
class ACE_Actions { class ACE_Actions {
class ACE_MainActions {
class ACE_CopyMap { class ACE_CopyMap {
displayName = "$STR_ACE_Map_CopyMap"; displayName = "$STR_ACE_Map_CopyMap";
condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target}));
@ -94,6 +95,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
class NATO_Box_Base; class NATO_Box_Base;
class EAST_Box_Base; class EAST_Box_Base;

View File

@ -78,6 +78,10 @@ class CfgVehicles {
init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint)); init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint));
}; };
class ACE_Actions : ACE_Actions { class ACE_Actions : ACE_Actions {
class ACE_MainActions {
distance = 5;
condition = "true";
selection = "";
class ACE_Teleport { class ACE_Teleport {
displayName = "Teleport to Rallypoint"; displayName = "Teleport to Rallypoint";
distance = 4; distance = 4;
@ -88,6 +92,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
class ACE_Rallypoint_East : Flag_CSAT_F { class ACE_Rallypoint_East : Flag_CSAT_F {
author = "$STR_ACE_Common_ACETeam"; author = "$STR_ACE_Common_ACETeam";
@ -98,6 +103,10 @@ class CfgVehicles {
init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint)); init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint));
}; };
class ACE_Actions : ACE_Actions { class ACE_Actions : ACE_Actions {
class ACE_MainActions {
distance = 5;
condition = "true";
selection = "";
class ACE_Teleport { class ACE_Teleport {
displayName = "Teleport to Rallypoint"; displayName = "Teleport to Rallypoint";
distance = 4; distance = 4;
@ -108,6 +117,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
class ACE_Rallypoint_Independent : Flag_AAF_F { class ACE_Rallypoint_Independent : Flag_AAF_F {
author = "$STR_ACE_Common_ACETeam"; author = "$STR_ACE_Common_ACETeam";
@ -118,6 +128,10 @@ class CfgVehicles {
init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint)); init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint));
}; };
class ACE_Actions : ACE_Actions { class ACE_Actions : ACE_Actions {
class ACE_MainActions {
distance = 5;
condition = "true";
selection = "";
class ACE_Teleport { class ACE_Teleport {
displayName = "Teleport to Rallypoint"; displayName = "Teleport to Rallypoint";
distance = 4; distance = 4;
@ -128,6 +142,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
// moveable // moveable
class ACE_RallypointExit_West : Flag_NATO_F { class ACE_RallypointExit_West : Flag_NATO_F {
@ -139,6 +154,9 @@ class CfgVehicles {
init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint)); init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint));
}; };
class ACE_Actions : ACE_Actions { class ACE_Actions : ACE_Actions {
class ACE_MainActions {
distance = 5;
condition = "true";
class ACE_Teleport { class ACE_Teleport {
displayName = "Teleport to Base"; displayName = "Teleport to Base";
distance = 4; distance = 4;
@ -149,6 +167,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
class ACE_RallypointExit_East : Flag_CSAT_F { class ACE_RallypointExit_East : Flag_CSAT_F {
author = "$STR_ACE_Common_ACETeam"; author = "$STR_ACE_Common_ACETeam";
@ -159,6 +178,9 @@ class CfgVehicles {
init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint)); init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint));
}; };
class ACE_Actions : ACE_Actions { class ACE_Actions : ACE_Actions {
class ACE_MainActions {
distance = 5;
condition = "true";
class ACE_Teleport { class ACE_Teleport {
displayName = "Teleport to Base"; displayName = "Teleport to Base";
distance = 4; distance = 4;
@ -169,6 +191,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
class ACE_RallypointExit_Independent : Flag_AAF_F { class ACE_RallypointExit_Independent : Flag_AAF_F {
author = "$STR_ACE_Common_ACETeam"; author = "$STR_ACE_Common_ACETeam";
@ -179,6 +202,9 @@ class CfgVehicles {
init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint)); init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint));
}; };
class ACE_Actions : ACE_Actions { class ACE_Actions : ACE_Actions {
class ACE_MainActions {
distance = 5;
condition = "true";
class ACE_Teleport { class ACE_Teleport {
displayName = "Teleport to Base"; displayName = "Teleport to Base";
distance = 4; distance = 4;
@ -189,6 +215,7 @@ class CfgVehicles {
}; };
}; };
}; };
};
// team leader // team leader
class Man; class Man;

View File

@ -1,4 +1,8 @@
#define MACRO_LOCK_ACTIONS \ #define MACRO_LOCK_ACTIONS \
class ACE_MainActions { \
selection = ""; \
distance = 5; \
condition = "true"; \
class ACE_unlockVehicle { \ class ACE_unlockVehicle { \
displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ displayName = "$STR_ACE_Vehicle_Action_UnLock"; \
distance = 4; \ distance = 4; \
@ -24,6 +28,7 @@
statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \
showDisabled = 0; \ showDisabled = 0; \
priority = 0.1; \ priority = 0.1; \
}; \
}; };
class CfgVehicles { class CfgVehicles {