Interaction - Add condition to zeus actions (#6665)

* Add conditions to zeus actions

* Add condition caching
This commit is contained in:
Dystopian 2018-11-11 21:26:36 +04:00 committed by PabstMirror
parent 69a67ff4e2
commit 40f371c063
3 changed files with 13 additions and 5 deletions

View File

@ -7,7 +7,7 @@ class ACE_ZeusActions {
class stance { class stance {
displayName = "$STR_A3_RscAttributeUnitPos_Title"; 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 { class prone {
displayName = "$STR_Pos_Down"; displayName = "$STR_Pos_Down";
@ -34,7 +34,7 @@ class ACE_ZeusActions {
class remoteControl { class remoteControl {
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa"; 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( \ statement = QUOTE( \
private _units = curatorSelected select 0; \ private _units = curatorSelected select 0; \
private _unit = _units param [ARR_2( \ private _unit = _units param [ARR_2( \
@ -52,7 +52,7 @@ class ACE_ZeusActions {
class GVAR(repair) { class GVAR(repair) {
displayName = "$STR_repair"; displayName = "$STR_repair";
icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; 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)); statement = QUOTE({if (_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}) then {_x setDamage 0}} forEach (curatorSelected select 0));
}; };
}; };
@ -64,6 +64,7 @@ class ACE_ZeusActions {
class behaviour { class behaviour {
displayName = "$STR_Combat_Mode"; displayName = "$STR_Combat_Mode";
condition = QUOTE(ZEUS_ACTION_CONDITION);
class careless { class careless {
displayName = "$STR_Combat_Careless"; displayName = "$STR_Combat_Careless";
@ -93,6 +94,7 @@ class ACE_ZeusActions {
class speed { class speed {
displayName = "$STR_HC_Menu_Speed"; displayName = "$STR_HC_Menu_Speed";
condition = QUOTE(ZEUS_ACTION_CONDITION);
class limited { class limited {
displayName = "$STR_Speed_Limited"; displayName = "$STR_Speed_Limited";
@ -113,6 +115,7 @@ class ACE_ZeusActions {
class formation { class formation {
displayName = "$STR_Formation"; displayName = "$STR_Formation";
condition = QUOTE(ZEUS_ACTION_CONDITION);
class wedge { class wedge {
displayName = "$STR_Wedge"; displayName = "$STR_Wedge";
@ -169,6 +172,7 @@ class ACE_ZeusActions {
class behaviour { class behaviour {
displayName = "$STR_Combat_Mode"; displayName = "$STR_Combat_Mode";
condition = QUOTE(ZEUS_ACTION_CONDITION);
class careless { class careless {
displayName = "$STR_Combat_Careless"; displayName = "$STR_Combat_Careless";
@ -198,6 +202,7 @@ class ACE_ZeusActions {
class speed { class speed {
displayName = "$STR_HC_Menu_Speed"; displayName = "$STR_HC_Menu_Speed";
condition = QUOTE(ZEUS_ACTION_CONDITION);
class limited { class limited {
displayName = "$STR_Speed_Limited"; displayName = "$STR_Speed_Limited";
@ -218,6 +223,7 @@ class ACE_ZeusActions {
class formation { class formation {
displayName = "$STR_Formation"; displayName = "$STR_Formation";
condition = QUOTE(ZEUS_ACTION_CONDITION);
class wedge { class wedge {
displayName = "$STR_Wedge"; displayName = "$STR_Wedge";

View File

@ -134,4 +134,6 @@
#define MRAD_TO_DEG(d) ((d) / 17.45329252) // Conversion factor: 9 / (50 * PI) #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 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" #include "script_debug.hpp"

View File

@ -2,8 +2,8 @@ class ACE_ZeusActions {
class ZeusUnits { class ZeusUnits {
class GVAR(rearm) { class GVAR(rearm) {
displayName = CSTRING(Rearm); displayName = CSTRING(Rearm);
icon = "\z\ace\addons\rearm\ui\icon_rearm_interact.paa"; icon = QPATHTOF(ui\icon_rearm_interact.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( \ statement = QUOTE( \
{ \ { \
if (_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}) then { \ if (_x isKindOf 'AllVehicles' && {!(_x isKindOf 'Man')}) then { \