Skip to content

Commit

Permalink
Interaction - Add condition to zeus actions (#6665)
Browse files Browse the repository at this point in the history
* Add conditions to zeus actions

* Add condition caching
  • Loading branch information
Dystopian authored and PabstMirror committed Nov 11, 2018
1 parent 69a67ff commit 40f371c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions addons/interaction/ACE_ZeusActions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ACE_ZeusActions {

class stance {
displayName = "$STR_A3_RscAttributeUnitPos_Title";
condition = QUOTE(-1 < (curatorSelected select 0) findIf {_x isKindOf 'CAManBase'});
condition = QUOTE(ZEUS_ACTION_CONDITION && {-1 < (curatorSelected select 0) findIf {_x isKindOf 'CAManBase'}});

class prone {
displayName = "$STR_Pos_Down";
Expand All @@ -34,7 +34,7 @@ class ACE_ZeusActions {
class remoteControl {
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa";
condition = QUOTE(-1 < (curatorSelected select 0) findIf {_x isKindOf 'CAManBase'});
condition = QUOTE(ZEUS_ACTION_CONDITION && {-1 < (curatorSelected select 0) findIf {_x isKindOf 'CAManBase'}});
statement = QUOTE( \
private _units = curatorSelected select 0; \
private _unit = _units param [ARR_2( \
Expand All @@ -52,7 +52,7 @@ class ACE_ZeusActions {
class GVAR(repair) {
displayName = "$STR_repair";
icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa";
condition = QUOTE(-1 < (curatorSelected select 0) findIf {_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}});
condition = QUOTE(ZEUS_ACTION_CONDITION && {-1 < (curatorSelected select 0) findIf {_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}}});
statement = QUOTE({if (_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}) then {_x setDamage 0}} forEach (curatorSelected select 0));
};
};
Expand All @@ -64,6 +64,7 @@ class ACE_ZeusActions {

class behaviour {
displayName = "$STR_Combat_Mode";
condition = QUOTE(ZEUS_ACTION_CONDITION);

class careless {
displayName = "$STR_Combat_Careless";
Expand Down Expand Up @@ -93,6 +94,7 @@ class ACE_ZeusActions {

class speed {
displayName = "$STR_HC_Menu_Speed";
condition = QUOTE(ZEUS_ACTION_CONDITION);

class limited {
displayName = "$STR_Speed_Limited";
Expand All @@ -113,6 +115,7 @@ class ACE_ZeusActions {

class formation {
displayName = "$STR_Formation";
condition = QUOTE(ZEUS_ACTION_CONDITION);

class wedge {
displayName = "$STR_Wedge";
Expand Down Expand Up @@ -169,6 +172,7 @@ class ACE_ZeusActions {

class behaviour {
displayName = "$STR_Combat_Mode";
condition = QUOTE(ZEUS_ACTION_CONDITION);

class careless {
displayName = "$STR_Combat_Careless";
Expand Down Expand Up @@ -198,6 +202,7 @@ class ACE_ZeusActions {

class speed {
displayName = "$STR_HC_Menu_Speed";
condition = QUOTE(ZEUS_ACTION_CONDITION);

class limited {
displayName = "$STR_Speed_Limited";
Expand All @@ -218,6 +223,7 @@ class ACE_ZeusActions {

class formation {
displayName = "$STR_Formation";
condition = QUOTE(ZEUS_ACTION_CONDITION);

class wedge {
displayName = "$STR_Wedge";
Expand Down
2 changes: 2 additions & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,6 @@
#define MRAD_TO_DEG(d) ((d) / 17.45329252) // Conversion factor: 9 / (50 * PI)
#define MOA_TO_RAD(d) ((d) * 0.00029088) // Conversion factor: PI / 10800

#define ZEUS_ACTION_CONDITION ([_target, {QUOTE(QUOTE(ADDON)) in curatorAddons _this}, missionNamespace, QUOTE(QGVAR(zeusCheck)), 1E11, 'ace_interactMenuClosed'] call EFUNC(common,cachedCall))

#include "script_debug.hpp"
4 changes: 2 additions & 2 deletions addons/rearm/ACE_ZeusActions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class ACE_ZeusActions {
class ZeusUnits {
class GVAR(rearm) {
displayName = CSTRING(Rearm);
icon = "\z\ace\addons\rearm\ui\icon_rearm_interact.paa";
condition = QUOTE(-1 < (curatorSelected select 0) findIf {_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}});
icon = QPATHTOF(ui\icon_rearm_interact.paa);
condition = QUOTE(ZEUS_ACTION_CONDITION && {-1 < (curatorSelected select 0) findIf {_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}}});
statement = QUOTE( \
{ \
if (_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}) then { \
Expand Down

0 comments on commit 40f371c

Please sign in to comment.