fix interaction menu

This commit is contained in:
commy2 2015-01-13 19:14:34 +01:00
parent 2336b51e5b
commit 270ff5535a
7 changed files with 91 additions and 89 deletions

View File

@ -39,8 +39,8 @@ class CfgFunctions {
class CfgVehicles {
class Man;
class CAManBase: Man {
class AGM_SelfActions {
class AGM_Equipment {
class ACE_SelfActions {
class ACE_Equipment {
class GVAR(Attach) {
displayName = "$STR_AGM_Attach_AttachDetach";
condition = QUOTE( [_player, ''] call FUNC(canAttach) );

View File

@ -147,11 +147,11 @@ class CfgVehicles {
class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement";
distance = 4;
condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)} );
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)});
statement = "";
showDisabled = 0;
priority = 3.2;
icon = PATHOF(UI\team\team_management_ca.paa);
icon = PATHTOF(UI\team\team_management_ca.paa);
subMenu[] = {"ACE_TeamManagement", 0};
hotkey = "M";
enableInside = 1;
@ -159,10 +159,10 @@ class CfgVehicles {
class ACE_JoinTeamRed {
displayName = "$STR_ACE_Interaction_JoinTeamRed";
distance = 4;
condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} );
statement = QUOTE( [_target, 'RED'] call FUNC(joinTeam) );
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR2(_target,'RED')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHOF(UI\team\team_red_ca.paa);
icon = PATHTOF(UI\team\team_red_ca.paa);
priority = 2.4;
hotkey = "R";
enableInside = 1;
@ -170,10 +170,10 @@ class CfgVehicles {
class ACE_JoinTeamGreen {
displayName = "$STR_ACE_Interaction_JoinTeamGreen";
distance = 4;
condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} );
statement = QUOTE( [_target, 'GREEN'] call FUNC(joinTeam) );
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHOF(UI\team\team_green_ca.paa);
icon = PATHTOF(UI\team\team_green_ca.paa);
priority = 2.3;
hotkey = "G";
enableInside = 1;
@ -181,10 +181,10 @@ class CfgVehicles {
class ACE_JoinTeamBlue {
displayName = "$STR_ACE_Interaction_JoinTeamBlue";
distance = 4;
condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} );
statement = QUOTE( [_target, 'BLUE'] call FUNC(joinTeam) );
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHOF(UI\team\team_blue_ca.paa);
icon = PATHTOF(UI\team\team_blue_ca.paa);
priority = 2.2;
hotkey = "B";
enableInside = 1;
@ -192,10 +192,10 @@ class CfgVehicles {
class ACE_JoinTeamYellow {
displayName = "$STR_ACE_Interaction_JoinTeamYellow";
distance = 4;
condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} );
statement = QUOTE( [_target, 'YELLOW'] call FUNC(joinTeam) );
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHOF(UI\team\team_yellow_ca.paa);
icon = PATHTOF(UI\team\team_yellow_ca.paa);
priority = 2.1;
hotkey = "Y";
enableInside = 1;
@ -204,10 +204,10 @@ class CfgVehicles {
class ACE_LeaveTeam {
displayName = "$STR_ACE_Interaction_LeaveTeam";
distance = 4;
condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'} );
statement = QUOTE( [_target, 'MAIN'] call FUNC(joinTeam) );
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'});
statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHOF(UI\team\team_white_ca.paa);
icon = PATHTOF(UI\team\team_white_ca.paa);
priority = 2.5;
hotkey = "N";
enableInside = 1;
@ -217,8 +217,8 @@ class CfgVehicles {
class ACE_TapShoulder {
displayName = "$STR_ACE_Interaction_TapShoulder";
distance = 4;
condition = QUOTE( [_player, _target] call FUNC(canTapShoulder) );
statement = QUOTE( [_player, _target] call FUNC(tapShoulder) );
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";
@ -227,11 +227,11 @@ class CfgVehicles {
class ACE_JoinGroup {
displayName = "$STR_ACE_Interaction_JoinGroup";
distance = 4;
condition = QUOTE( side group _player == side group _target && {group _player != group _target} );
statement = QUOTE( [_player] joinSilent group _target; );
condition = QUOTE(side group _player == side group _target && {group _player != group _target});
statement = QUOTE([_player] joinSilent group _target;);
showDisabled = 0;
priority = 2.6;
icon = PATHOF(UI\team\team_management_ca.paa);
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "J";
enableInside = 1;
};
@ -239,24 +239,24 @@ class CfgVehicles {
class ACE_GetDown {
displayName = "$STR_ACE_Interaction_GetDown";
distance = 4;
condition = QUOTE( [_target] call FUNC(canInteractWith) );
statement = QUOTE( [_target] call FUNC(getDown) );
condition = QUOTE([_target] call DFUNC(canInteractWith));
statement = QUOTE([_target] call DFUNC(getDown));
showDisabled = 0;
priority = 2.2;
};
class ACE_SendAway {
displayName = "$STR_ACE_Interaction_SendAway";
distance = 4;
condition = QUOTE( [_target] call FUNC(canInteractWith) );
statement = QUOTE( [_target] call FUNC(sendAway) );
condition = QUOTE([_target] call DFUNC(canInteractWith));
statement = QUOTE([_target] call DFUNC(sendAway));
showDisabled = 0;
priority = 2.0;
};
class ACE_Pardon {
displayName = "$STR_ACE_Interaction_Pardon";
distance = 4;
condition = QUOTE( rating _target < -2000 && {alive _target} && {side group _player == side group _target} );
statement = QUOTE( [_target, '{_this addRating -rating _this}', _target] call EFUNC(core,execRemoteFnc) );
condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target});
statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc));
showDisabled = 0;
priority = 2.5;
enableInside = 1;
@ -266,84 +266,84 @@ class CfgVehicles {
class ACE_SelfActions {
class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement";
condition = QUOTE( GVAR(EnableTeamManagement) );
condition = QUOTE(GVAR(EnableTeamManagement));
statement = "";
showDisabled = 1;
priority = 3.2;
icon = PATHOF(UI\team\team_management_ca.paa);
icon = PATHTOF(UI\team\team_management_ca.paa);
subMenu[] = {"ACE_TeamManagement", 1};
enableInside = 1;
hotkey = "M";
class ACE_JoinTeamRed {
displayName = "$STR_ACE_Interaction_JoinTeamRed";
condition = QUOTE( true );
statement = QUOTE( [_player, 'RED'] call FUNC(joinTeam) );
condition = QUOTE(true);
statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam));
showDisabled = 1;
priority = 2.4;
icon = PATHOF(UI\team\team_red_ca.paa);
icon = PATHTOF(UI\team\team_red_ca.paa);
enableInside = 1;
hotkey = "R";
};
class ACE_JoinTeamGreen {
displayName = "$STR_ACE_Interaction_JoinTeamGreen";
condition = QUOTE( true );
statement = QUOTE( [_player, 'GREEN'] call FUNC(joinTeam) );
condition = QUOTE(true);
statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam));
showDisabled = 1;
priority = 2.3;
icon = PATHOF(UI\team\team_green_ca.paa);
icon = PATHTOF(UI\team\team_green_ca.paa);
enableInside = 1;
hotkey = "G";
};
class ACE_JoinTeamBlue {
displayName = "$STR_ACE_Interaction_JoinTeamBlue";
condition = QUOTE( true );
statement = QUOTE( [_player, 'BLUE'] call FUNC(joinTeam) );
condition = QUOTE(true);
statement = QUOTE([ARR_2(_player,'BLUE')] call FUNC(joinTeam));
showDisabled = 1;
priority = 2.2;
icon = PATHOF(UI\team\team_blue_ca.paa);
icon = PATHTOF(UI\team\team_blue_ca.paa);
enableInside = 1;
hotkey = "B";
};
class ACE_JoinTeamYellow {
displayName = "$STR_ACE_Interaction_JoinTeamYellow";
condition = QUOTE( true );
statement = QUOTE( [_player, 'YELLOW'] call FUNC(joinTeam) );
condition = QUOTE(true);
statement = QUOTE([ARR_2(_player,'YELLOW')] call FUNC(joinTeam));
showDisabled = 1;
priority = 2.1;
icon = PATHOF(UI\team\team_yellow_ca.paa);
icon = PATHTOF(UI\team\team_yellow_ca.paa);
enableInside = 1;
hotkey = "Y";
};
class ACE_LeaveTeam {
displayName = "$STR_ACE_Interaction_LeaveTeam";
condition = QUOTE( assignedTeam _player != 'MAIN' );
statement = QUOTE( [_player, 'MAIN'] call FUNC(joinTeam) );
condition = QUOTE(assignedTeam _player != 'MAIN');
statement = QUOTE([ARR_2(_player,'MAIN')] call FUNC(joinTeam));
showDisabled = 1;
priority = 2.5;
icon = PATHOF(UI\team\team_white_ca.paa);
icon = PATHTOF(UI\team\team_white_ca.paa);
enableInside = 1;
hotkey = "N";
};
class ACE_BecomeLeader {
displayName = "$STR_ACE_Interaction_BecomeLeader";
condition = QUOTE( count (units group _player) > 1 && {leader group _player != _player} );
statement = QUOTE( _newGroup = createGroup side group _player; (units group _player) joinSilent _newGroup; _newGroup selectLeader _player; );
condition = QUOTE(count (units group _player) > 1 && {leader group _player != _player});
statement = QUOTE(_newGroup = createGroup side group _player; (units group _player) joinSilent _newGroup; _newGroup selectLeader _player;);
showDisabled = 1;
priority = 1.0;
icon = PATHOF(UI\team\team_white_ca.paa);
icon = PATHTOF(UI\team\team_white_ca.paa);
enableInside = 1;
hotkey = "L";
};
class ACE_LeaveGroup {
displayName = "$STR_ACE_Interaction_LeaveGroup";
condition = QUOTE( count (units group _player) > 1 );
statement = QUOTE( _oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup; );
condition = QUOTE(count (units group _player) > 1);
statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;);
showDisabled = 1;
priority = 1.2;
icon = PATHOF(UI\team\team_management_ca.paa);
icon = PATHTOF(UI\team\team_management_ca.paa);
enableInside = 1;
hotkey = "M";
};
@ -373,7 +373,7 @@ class CfgVehicles {
showDisabled = 1;
priority = 3.5;
subMenu[] = {"ACE_Gestures", 1};
icon = "ACE_Interaction\UI\gestures_ca.paa";
icon = PATHTOF(UI\gestures_ca.paa);
hotkey = "G";
/*class ACE_Gesture_Advance {
@ -385,87 +385,87 @@ class CfgVehicles {
};*/
class ACE_Gesture_Advance {
displayName = "$STR_ACE_Interaction_Gestures_Advance";
condition = "canStand _target";
statement = "_target playActionNow 'gestureAdvance';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureAdvance';);
showDisabled = 1;
priority = 1.9;
hotkey = "1";
};
class ACE_Gesture_Go {
displayName = "$STR_ACE_Interaction_Gestures_Go";
condition = "canStand _target";
statement = "_target playActionNow (['gestureGo', 'gestureGoB'] select (floor random 2));";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2););
showDisabled = 1;
priority = 1.8;
hotkey = "2";
};
class ACE_Gesture_Follow {
displayName = "$STR_ACE_Interaction_Gestures_Follow";
condition = "canStand _target";
statement = "_target playActionNow 'gestureFollow';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureFollow';);
showDisabled = 1;
priority = 1.7;
hotkey = "3";
};
/*class ACE_Gesture_Point {
displayName = "$STR_ACE_Interaction_Gestures_Point";
condition = "canStand _target";
statement = "_target playActionNow 'gesturePoint';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gesturePoint';);
showDisabled = 1;
priority = 1.6;
};*/
class ACE_Gesture_Up {
displayName = "$STR_ACE_Interaction_Gestures_Up";
condition = "canStand _target";
statement = "_target playActionNow 'gestureUp';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureUp';);
showDisabled = 1;
priority = 1.5;
hotkey = "4";
};
class ACE_Gesture_Cover {
displayName = "$STR_ACE_Interaction_Gestures_Cover";
condition = "canStand _target";
statement = "_target playActionNow 'gestureCover';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureCover';);
showDisabled = 1;
priority = 1.4;
hotkey = "5";
};
class ACE_Gesture_CeaseFire {
displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire";
condition = "canStand _target";
statement = "_target playActionNow 'gestureCeaseFire';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureCeaseFire';);
showDisabled = 1;
priority = 1.3;
hotkey = "6";
};
class ACE_Gesture_Freeze {
displayName = "$STR_ACE_Interaction_Gestures_Freeze";
condition = "canStand _target";
statement = "_target playActionNow 'gestureFreeze';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureFreeze';);
showDisabled = 1;
priority = 1.2;
hotkey = "7";
};
class ACE_Gesture_Yes {
displayName = "$STR_ACE_Interaction_Gestures_Yes";
condition = "canStand _target";
statement = "_target playActionNow (['gestureYes', 'gestureNod'] select (floor random 2));";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2););
showDisabled = 1;
priority = 1.1;
hotkey = "8";
};
class ACE_Gesture_No {
displayName = "$STR_ACE_Interaction_Gestures_No";
condition = "canStand _target";
statement = "_target playActionNow 'gestureNo';";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow 'gestureNo';);
showDisabled = 1;
priority = 1.0;
hotkey = "9";
};
class ACE_Gesture_Hi {
displayName = "$STR_ACE_Interaction_Gestures_Hi";
condition = "canStand _target";
statement = "_target playActionNow (['gestureHi', 'gestureHiB', 'gestureHiC'] select (floor random 3));";
condition = QUOTE(canStand _target);
statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3););
showDisabled = 1;
priority = 0.9;
hotkey = "0";
@ -474,7 +474,7 @@ class CfgVehicles {
class ACE_Equipment {
displayName = "$STR_ACE_Interaction_Equipment";
condition = "true";
condition = QUOTE(true);
statement = "";
showDisabled = 1;
priority = 4.5;
@ -485,11 +485,11 @@ class CfgVehicles {
class ACE_Dummy {
displayName = "";
condition = "false";
condition = QUOTE(false);
statement = "";
showDisabled = 1;
priority = -99;
icon = PATHOF(UI\blank_CO.paa);
icon = PATHTOEF(common,UI\blank_CO.paa);
enableInside = 1;
};
};
@ -557,8 +557,8 @@ class CfgWeapons {
class ACE_CableTie: ACE_ItemCore {
displayName = "$STR_ACE_Interaction_CableTie_Name";
descriptionShort = "$STR_ACE_Interaction_CableTie_Description";
model = PATHOF(ACE_cabletie.p3d);
picture = PATHOF(UI\ACE_cabletie_x_ca.paa);
model = PATHTOF(ACE_cabletie.p3d);
picture = PATHTOF(UI\ACE_cabletie_x_ca.paa);
scope = 2;
class ItemInfo: InventoryItem_Base_F {
mass = 1;

View File

@ -129,9 +129,9 @@ for "_i" from 0 to (_count - 1) do {
_cacheIndices pushBack _indexCache;
_cache = [_cacheConfigs, _cacheActions, _cacheIndices];
["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(debug,log);
["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log);
} else {
["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(debug,log);
["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log);
_cachedAction = _cacheActions select (_cacheIndices select _indexCache);

View File

@ -97,9 +97,9 @@ _cacheIndices = _cache select 2;
_cacheIndices pushBack _indexCache;
_cache = [_cacheConfigs, _cacheActions, _cacheIndices];
["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(debug,log);
["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log);
} else {
["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(debug,log);
["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log);
private ["_cachedAction", "_showDisabled"];
_cachedAction = _cacheActions select (_cacheIndices select _indexCache);

View File

@ -31,7 +31,7 @@ _player = ACE_player;
_vehicle = vehicle _player;
//_object = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
if !([_target, 5] call GVAR(isInRange)) exitWith {};
if !([_target, 5] call FUNC(isInRange)) exitWith {};
GVAR(Shortcuts) = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
@ -119,7 +119,7 @@ if (_this select 2) then {
_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
waitUntil {
if !([_target, 5] call GVAR(isInRange)) exitWith {
if !([_target, 5] call FUNC(isInRange)) exitWith {
(findDisplay 1713999) closeDisplay 1
};
@ -134,7 +134,7 @@ if (_this select 2) then {
GVAR(CurrentTooltip) = [];
_enable = (_distance == 0 || {[_target, _distance] call GVAR(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow};
_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)];

View File

@ -19,7 +19,7 @@ _subMenu = _action select 4;
// back
if (_index == -1) exitWith {
call FUNC(MainButton);
call GVAR(MainButton);
};
if (count _subMenu < 2) then {

View File

@ -182,6 +182,8 @@
#define QFUNC(var1) QUOTE(DFUNC(var1))
#define QEFUNC(var1,var2) QUOTE(DEFUNC(var1,var2))
#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2)
#ifdef DISABLE_COMPILE_CACHE
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))
#else