From eb60910aab10ddccfae9b139014f392a65222c6d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 9 Apr 2015 21:58:45 -0500 Subject: [PATCH 01/22] Flashbangs: eyePos LOS check, 3d eye direction --- .../functions/fnc_flashbangExplosionEH.sqf | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 3868994bee..29c3aedbe5 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -19,13 +19,15 @@ private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", " PARAMS_1(_grenade); -_affected = _grenade nearEntities ["CAManBase", 50]; +_affected = _grenade nearEntities ["CAManBase", 20]; { if ((local _x) && {alive _x}) then { _strength = 1 - ((_x distance _grenade) min 15) / 15; + TRACE_3("FlashBangEffect Start",_x,(_x distance _grenade),_strength); + if (_x != ACE_player) then { //must be AI _x disableAI "MOVE"; @@ -48,30 +50,31 @@ _affected = _grenade nearEntities ["CAManBase", 50]; //Do effects for player // is there line of sight to the grenade? _posGrenade = getPosASL _grenade; + _eyePos = eyePos ACE_player; //PositionASL _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground - if (lineIntersects [_posGrenade, getPosASL _x, _grenade, _x]) then { + + //Check for line of sight: + if (lineIntersects [_posGrenade, _eyePos, _grenade, _x]) then { _strength = _strength / 10; }; - // beeeeeeeeeeeeeeeeeeeeeeeeeeeeep - if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") and _strength > 0) then { + //Add ace_hearing ear ringing sound effect + if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then { [_x, 0.5 + (_strength / 2)] call EFUNC(hearing,earRinging); }; // account for people looking away by slightly // reducing the effect for visual effects. - _posUnit = getPos _x; - _posGrenade = getPos _grenade; - _angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1)); - _angleGrenade = (_angleGrenade + 360) % 360; + _eyeDir = (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); + _dirToUnitVector = _eyePos vectorFromTo _posGrenade; + _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); - _angleView = (eyeDirection ACE_player select 0) atan2 (eyeDirection ACE_player select 1); - _angleView = (_angleView + 360) % 360; + //From 0-45deg, full effect + if (_angleDiff > 45) then { + _strength = _strength - _strength * ((_angleDiff - 45) / 120); + }; - _angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180); - _angleDiff = ((_angleDiff - 45) max 0); - - _strength = _strength - _strength * (_angleDiff / 135); + TRACE_1("Final strength for player %1",_strength); // create flash to illuminate environment _light = "#lightpoint" createVehicleLocal (getPos _grenade); From 170985295d7d70badb5f29b94af5649b2e456d35 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 9 Apr 2015 22:00:03 -0500 Subject: [PATCH 02/22] Flashbangs: Medical Pain --- addons/grenades/functions/fnc_flashbangExplosionEH.sqf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 29c3aedbe5..cbc9b647ea 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -76,6 +76,15 @@ _affected = _grenade nearEntities ["CAManBase", 20]; TRACE_1("Final strength for player %1",_strength); + + //Add ace_medical pain effect: + if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0}) then { + private "_curPain"; + _curPain = ACE_player getVariable [QEGVAR(medical,pain), 0]; + _curPain = (_curPain + (_strength / 2)) min 1; + ACE_player setVariable [QEGVAR(medical,pain), _curPain]; + }; + // create flash to illuminate environment _light = "#lightpoint" createVehicleLocal (getPos _grenade); _light setLightBrightness 200; From 3be70556abfa3ccf92f015cf876fd5bc1dcfdc0a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 11 Apr 2015 21:21:33 -0500 Subject: [PATCH 03/22] Medical: adjustPainLevels from outside functions --- addons/medical/XEH_preInit.sqf | 1 + .../medical/functions/fnc_adjustPainLevel.sqf | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 addons/medical/functions/fnc_adjustPainLevel.sqf diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index c18a116e31..24ebe65024 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -17,6 +17,7 @@ PREP(addToLog); PREP(addToTriageCard); PREP(addUnconsciousCondition); PREP(addUnloadPatientActions); +PREP(adjustPainLevel); PREP(canAccessMedicalEquipment); PREP(canTreat); PREP(canTreatCached); diff --git a/addons/medical/functions/fnc_adjustPainLevel.sqf b/addons/medical/functions/fnc_adjustPainLevel.sqf new file mode 100644 index 0000000000..7e6ce2d5f1 --- /dev/null +++ b/addons/medical/functions/fnc_adjustPainLevel.sqf @@ -0,0 +1,40 @@ +/* + * Author: PabstMirror + * Interface to allow external modules to safely adjust pain levels. + * + * Arguments: + * 0: The patient + * 1: Added ammount of pain (can be negative) + * + * Return Value: + * The new pain level + * + * Example: + * [guy, 0.5] call ace_medical_fnc_adjustPainLevel + * + * Public: Yes + */ +#include "script_component.hpp" + +private ["_pain"]; + +PARAMS_2(_unit,_addedPain); + +//Only run on local units: +if (!local _unit) exitWith {ERROR("unit is not local");}; + +//Ignore if medical system disabled: +if (GVAR(level) == 0) exitWith {}; + +_pain = _unit getVariable [QGVAR(pain), 0]; + +_pain = _pain + _addedPain; +if (GVAR(level) == 1) then {_pain = _pain min 1;}; //for basic, cap at 1 +_pain = _pain max 0; + +_unit setVariable [QGVAR(pain), _pain]; + +//Start up the vital watching (if not already running) +[_unit] call FUNC(addToInjuredCollection); + +_pain From 8fc3b535079411ddc375b788449381ccb938a33b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 11 Apr 2015 21:22:34 -0500 Subject: [PATCH 04/22] Use new medical func --- addons/grenades/functions/fnc_flashbangExplosionEH.sqf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index cbc9b647ea..ecba6f6233 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -79,10 +79,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //Add ace_medical pain effect: if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0}) then { - private "_curPain"; - _curPain = ACE_player getVariable [QEGVAR(medical,pain), 0]; - _curPain = (_curPain + (_strength / 2)) min 1; - ACE_player setVariable [QEGVAR(medical,pain), _curPain]; + [ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel); }; // create flash to illuminate environment From c3c815db8dc5a59f188a377b4a876bf1da75f918 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 11 Apr 2015 21:42:57 -0500 Subject: [PATCH 05/22] Better LOS check --- .../functions/fnc_flashbangExplosionEH.sqf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index ecba6f6233..8954d6c5cc 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light"]; +private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount"]; PARAMS_1(_grenade); @@ -53,8 +53,15 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _eyePos = eyePos ACE_player; //PositionASL _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground - //Check for line of sight: - if (lineIntersects [_posGrenade, _eyePos, _grenade, _x]) then { + _losCount = 0; + //Check for line of sight (check 4 points in case grenade is stuck in an object or underground) + { + if (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) then { + _losCount = _losCount + 1; + }; + } forEach [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; + TRACE_1("Line of sight count (out of 4)",_losCount); + if (_losCount == 0) then { _strength = _strength / 10; }; @@ -74,7 +81,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _strength = _strength - _strength * ((_angleDiff - 45) / 120); }; - TRACE_1("Final strength for player %1",_strength); + TRACE_1("Final strength for player",_strength); //Add ace_medical pain effect: From 18cd0e7f39eef3ebabb350b4f5b8315ac061d613 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 11 Apr 2015 21:48:12 -0500 Subject: [PATCH 06/22] Use DisableAI from common --- .../functions/fnc_flashbangExplosionEH.sqf | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 8954d6c5cc..c84ee33b33 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -30,20 +30,15 @@ _affected = _grenade nearEntities ["CAManBase", 20]; if (_x != ACE_player) then { //must be AI - _x disableAI "MOVE"; - _x disableAI "ANIM"; - _x disableAI "AUTOTARGET"; - _x disableAI "TARGET"; - _x disableAI "FSM"; + [_x, true] call EFUNC(common,disableAI); _x setSkill ((skill _x) / 50); [{ PARAMS_1(_unit); - _unit enableAI "MOVE"; - _unit enableAI "ANIM"; - _unit enableAI "AUTOTARGET"; - _unit enableAI "TARGET"; - _unit enableAI "FSM"; + //Make sure we don't enable AI for unconscious units + if (!(_unit getVariable ["ace_isunconscious", false])) then { + [_unit, false] call EFUNC(common,disableAI); + }; _unit setSkill (skill _unit * 50); }, [_x], (7 * _strength), 0.1] call EFUNC(common,waitAndExecute); //0.1 precision is fine for AI } else { From 1488ba2aac5be6a0f37c50922e888e7d6e04b58c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 14 Apr 2015 19:52:30 -0500 Subject: [PATCH 07/22] #595 - Hide ace optino button if no world loaded I wanted to use a rscMapControl onDraw, but it throws an error onMouseMoving seems odd, but it works and I don't have to overload onLoad --- addons/optionsmenu/config.cpp | 26 +++++++++++++------------- addons/optionsmenu/gui/pauseMenu.hpp | 5 ++++- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 89d5768603..675e415e47 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -1,23 +1,23 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {"ACE_moduleAllowConfigExport"}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"Glowbal", "PabstMirror"}; - authorUrl = "http://github.com/Glowbal"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {"ACE_moduleAllowConfigExport"}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Glowbal", "PabstMirror"}; + authorUrl = "http://github.com/Glowbal"; + VERSION_CONFIG; + }; }; class CfgAddons { - class PreloadAddons { - class ADDON { - list[] = {QUOTE(ADDON)}; + class PreloadAddons { + class ADDON { + list[] = {QUOTE(ADDON)}; + }; }; - }; }; diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index d6a831c2aa..c4cbae9916 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -96,11 +96,14 @@ class RscDisplayInterruptEditor3D: RscStandardDisplay { }; }; class RscDisplayMain: RscStandardDisplay { + //Hide the button if there is no world (-world=empty) + //Seems odd to use onMouseMoving, but I don't want to overload onLoad + onMouseMoving = "((_this select 0) displayCtrl 80085) ctrlShow (missionName != '');"; class controls { class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase { action = "if (missionName != '') then {createDialog 'ACE_settingsMenu';};"; y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; + idc = 80085; }; }; }; - From 37de67395f1af80ddce823f6fca4ff08206357cd Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 18:18:27 -0700 Subject: [PATCH 08/22] Fixed: issue where Javelin wouldn't hit > 1500 --- addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index 4e83e046ff..dc8b9b8e9d 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -57,7 +57,8 @@ switch( (_state select 0) ) do { }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - if(_distanceShooterToTarget < 1250 || _distanceToTarget < ( ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) )) then { + TRACE_1("", ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) ); + if(_distanceShooterToTarget < 1250 || _distanceToTarget < ( ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) ) * 1.5) then { _state set[0, STAGE_TERMINAL]; }; _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; From ef6d0902386765811317bd6867388872a1b2cac8 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 18:18:38 -0700 Subject: [PATCH 09/22] Fixed: JAV_DIR was erroring. --- .../functions/fnc_attackProfile_JAV_DIR.sqf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index da01b7d900..822afd7f1b 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -43,12 +43,8 @@ switch( (_state select 0) ) do { }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - _cruisAlt = 60; - if(_distanceShooterToTarget < w) then { - _cruisAlt = 60 * (_distanceShooterToTarget/2000); - TRACE_1("_cruisAlt", _cruisAlt); - }; - + _cruisAlt = 60 * (_distanceShooterToTarget/2000); + if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { _state set[0, STAGE_TERMINAL]; } else { From ad95105508cc712beb256d32886c8fc3f2a9eeea Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 18:25:02 -0700 Subject: [PATCH 10/22] Added and enabled AMG for AI. --- addons/missileguidance/ACE_Settings.hpp | 7 ++++ addons/missileguidance/CfgEventhandlers.hpp | 8 ++++- addons/missileguidance/XEH_pre_init.sqf | 3 +- .../{fnc_fired.sqf => fnc_onFired.sqf} | 34 ++++++++++++------- .../functions/fnc_onIncomingMissile.sqf | 7 ++++ .../functions/fnc_seekerType_SALH.sqf | 12 ++++--- addons/missileguidance/stringtable.xml | 6 ++++ 7 files changed, 59 insertions(+), 18 deletions(-) rename addons/missileguidance/functions/{fnc_fired.sqf => fnc_onFired.sqf} (74%) create mode 100644 addons/missileguidance/functions/fnc_onIncomingMissile.sqf diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index 060bde199b..fdd4743546 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -6,4 +6,11 @@ class ACE_Settings { displayName = "$STR_ACE_MissileGuidance"; description = "$STR_ACE_MissileGuidance_Desc"; }; + class GVAR(enabledForAI) { + value = 1; + typeName = "BOOL"; + isClientSetable = 1; + displayName = "$STR_ACE_MissileGuidance_AI"; + description = "$STR_ACE_MissileGuidance_AI_Desc"; + }; }; \ No newline at end of file diff --git a/addons/missileguidance/CfgEventhandlers.hpp b/addons/missileguidance/CfgEventhandlers.hpp index 49f067ff46..8afeb9245e 100644 --- a/addons/missileguidance/CfgEventhandlers.hpp +++ b/addons/missileguidance/CfgEventhandlers.hpp @@ -12,6 +12,12 @@ class Extended_PostInit_EventHandlers { class Extended_FiredBIS_EventHandlers { class All { - ADDON = QUOTE(_this call FUNC(fired)); + ADDON = QUOTE(_this call FUNC(onFired)); + }; +}; + +class Extended_IncomingMissile_EventHandlers { + class All { + ADDON = QUOTE(_this call FUNC(onIncomingMissile)); }; }; \ No newline at end of file diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index 8d277bc3b0..d19b8475c9 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -7,7 +7,8 @@ PREP(changeMissileDirection); PREP(checkSeekerAngle); PREP(checkLos); -PREP(fired); +PREP(onFired); +PREP(onIncomingMissile); PREP(guidancePFH); PREP(doAttackProfile); diff --git a/addons/missileguidance/functions/fnc_fired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf similarity index 74% rename from addons/missileguidance/functions/fnc_fired.sqf rename to addons/missileguidance/functions/fnc_onFired.sqf index 8b90b2353f..dea8d256f1 100644 --- a/addons/missileguidance/functions/fnc_fired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -2,10 +2,10 @@ #include "script_component.hpp" // Bail if guidance is disabled -if(!GVAR(enabled)) exitWith { false }; - // Bail on locality of the projectile, it should be local to us -if(!local _projectile) exitWith { false }; +if(!GVAR(enabled) || {!local _projectile} ) exitWith { false }; + +if(!GVAR(enableForAI) && {!isPlayer _shooter} ) exitWith { false }; private["_config", "_enabled", "_target", "_seekerType", "_attackProfile"]; PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); @@ -20,10 +20,13 @@ _enabled = getNumber ( _config >> "enabled"); if(isNil "_enabled" || {_enabled != 1}) exitWith { false }; _target = (vehicle _shooter) getVariable [QGVAR(target), nil]; +_targetPos = (vehicle _shooter) getVariable [QGVAR(targetPosition), nil]; _seekerType = (vehicle _shooter) getVariable [QGVAR(seekerType), nil]; _attackProfile = (vehicle _shooter) getVariable [QGVAR(attackProfile), nil]; _lockMode = (vehicle _shooter) getVariable [QGVAR(lockMode), nil]; +_launchPos = getPosASL (vehicle _shooter); + TRACE_3("Begin guidance", _target, _seekerType, _attackProfile); if ( isNil "_seekerType" || { ! ( _seekerType in (getArray (_config >> "seekerTypes" ) ) ) } ) then { @@ -38,21 +41,28 @@ if ( isNil "_lockMode" || { ! ( _lockMode in (getArray (_config >> "seekerLockMo // If we didn't get a target, try to fall back on tab locking if(isNil "_target") then { - _canUseLock = getNumber (_config >> "canVanillaLock"); - if(_canUseLock > 0) then { - // @TODO: Get vanilla target - _vanillaTarget = cursorTarget; - - TRACE_1("Using Vanilla Locking", _vanillaTarget); - if(!isNil "_vanillaTarget") then { - _target = _vanillaTarget; + + if(!isPlayer _shooter) then { + // This was an AI shot, lets still guide it on the AI target + _target = _shooter getVariable[QGVAR(vanilla_target), nil]; + TRACE_1("Detected AI Shooter!", _target); + } else { + _canUseLock = getNumber (_config >> "canVanillaLock"); + if(_canUseLock > 0) then { + // @TODO: Get vanilla target + _vanillaTarget = cursorTarget; + + TRACE_1("Using Vanilla Locking", _vanillaTarget); + if(!isNil "_vanillaTarget") then { + _target = _vanillaTarget; + }; }; }; }; TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); [FUNC(guidancePFH), 0, [_this, - [ACE_player, + [_shooter, [_target, _targetPos, _launchPos], _seekerType, _attackProfile, diff --git a/addons/missileguidance/functions/fnc_onIncomingMissile.sqf b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf new file mode 100644 index 0000000000..f819a97562 --- /dev/null +++ b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf @@ -0,0 +1,7 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_3(_target,_ammo,_shooter); + +if !(local (gunner _shooter) || {local _shooter}) exitWith {}; + +_shooter setVariable [QGVAR(vanilla_target),_target, false]; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index b6ed8d65a4..07f997a041 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -8,10 +8,14 @@ _launchParams = _this select 1; _seekerParams = _launchParams select 3; _angleFov = _seekerParams select 0; -_laserResult = [(getPosASL _projectile), (velocity _projectile), _angleFov, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], ACE_DEFAULT_LASER_CODE] call EFUNC(laser,seekerFindLaserSpot); -_foundTargetPos = _laserResult select 0; -TRACE_1("Search", _laserResult); - +if(!isNil "_target") then { + // Handle AI or moving vanilla lasers + _foundTargetPos = getPosASL _target; +} else { + _laserResult = [(getPosASL _projectile), (velocity _projectile), _angleFov, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], ACE_DEFAULT_LASER_CODE] call EFUNC(laser,seekerFindLaserSpot); + _foundTargetPos = _laserResult select 0; + TRACE_1("Search", _laserResult); +}; if(!isNil "_foundTargetPos") then { //_canSeeTarget = [_projectile, _foundTargetPos, _angleFov] call FUNC(checkSeekerAngle); diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 3ee166a6ff..5c136388ba 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -12,6 +12,12 @@ Avançado Missile Guidance Részletes rakéta irányító Расширенный ракетой + + + Advanced Missile Guidance for AI + + + Enables advanced guidance on AI units. Enables advanced guidance mechanics and selection for different missiles and fire modes. From b307b4bc4bc662929df19b1e815f0c0265db62a7 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 18:38:52 -0700 Subject: [PATCH 11/22] Fixed: Flummi missed 2 isClientSettable renames. --- addons/interact_menu/config.cpp | 2 +- addons/missileguidance/ACE_Settings.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index bb1b09cc20..f87062bf6f 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -26,7 +26,7 @@ class ACE_Settings { class GVAR(UseListMenu) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Interact_Menu_UseListMenu"; }; }; diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index fdd4743546..0ecd4b8cbc 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -2,14 +2,14 @@ class ACE_Settings { class GVAR(enabled) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_MissileGuidance"; description = "$STR_ACE_MissileGuidance_Desc"; }; class GVAR(enabledForAI) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_MissileGuidance_AI"; description = "$STR_ACE_MissileGuidance_AI_Desc"; }; From ee340789602485d8cdd2ee33ddf8a4f0cbe6666b Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Tue, 14 Apr 2015 22:53:10 -0300 Subject: [PATCH 12/22] Add early visibility check to interact menu --- .../functions/fnc_renderActionPoints.sqf | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 45c0c46a61..1d941435be 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -14,19 +14,25 @@ GVAR(currentOptions) = []; -private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active"]; +private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active","_cameraPos","_cameraDir"]; _player = ACE_player; - _fnc_renderNearbyActions = { // Render all nearby interaction menus #define MAXINTERACTOBJECTS 3 + _cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); + _cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; + _numInteractObjects = 0; - _nearestObjects = nearestObjects [ACE_player, ["All"], 15]; + _nearestObjects = nearestObjects [ACE_player, ["All"], 13]; { _target = _x; + // Quick oclussion test. Exit for object more than 1 m behind the camera plane + _lambda = ((getPosASL _x) vectorDiff _cameraPos) vectorDotProduct _cameraDir; + if (_lambda < -1) exitWith {}; + _numInteractions = 0; // Prevent interacting with yourself or your own vehicle if (_target != ACE_player && {_target != vehicle ACE_player}) then { From 53ce7d0be40c52ae7b6c95065967a82a2fc36846 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Tue, 14 Apr 2015 23:12:48 -0300 Subject: [PATCH 13/22] Increase the tolerance to 2m --- addons/interact_menu/functions/fnc_renderActionPoints.sqf | 4 ++-- addons/interact_menu/script_component.hpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 1d941435be..702da00f29 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -29,9 +29,9 @@ _fnc_renderNearbyActions = { { _target = _x; - // Quick oclussion test. Exit for object more than 1 m behind the camera plane + // Quick oclussion test. Exit for object more than 2 m behind the camera plane _lambda = ((getPosASL _x) vectorDiff _cameraPos) vectorDotProduct _cameraDir; - if (_lambda < -1) exitWith {}; + if (_lambda < -2) exitWith {}; _numInteractions = 0; // Prevent interacting with yourself or your own vehicle diff --git a/addons/interact_menu/script_component.hpp b/addons/interact_menu/script_component.hpp index 958d1c802d..a086b02613 100644 --- a/addons/interact_menu/script_component.hpp +++ b/addons/interact_menu/script_component.hpp @@ -9,4 +9,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACT_MENU #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define ENABLE_PERFORMANCE_COUNTERS From 57acee0f89d0bacc658c0c5438147b7d8d174ee9 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 19:19:14 -0700 Subject: [PATCH 14/22] Changed: Cleaned up Missile guidance setting for AI, SCALAR. --- addons/missileguidance/ACE_Settings.hpp | 12 +++--------- .../missileguidance/functions/fnc_onFired.sqf | 4 ++-- .../functions/fnc_onIncomingMissile.sqf | 3 ++- addons/missileguidance/stringtable.xml | 18 ------------------ 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index 0ecd4b8cbc..d489ef15f3 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -1,16 +1,10 @@ class ACE_Settings { class GVAR(enabled) { - value = 1; - typeName = "BOOL"; + value = 2; + typeName = "SCALAR"; isClientSettable = 1; displayName = "$STR_ACE_MissileGuidance"; description = "$STR_ACE_MissileGuidance_Desc"; - }; - class GVAR(enabledForAI) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_MissileGuidance_AI"; - description = "$STR_ACE_MissileGuidance_AI_Desc"; + values[] = {"Off", "Player Only", "Player and AI"}; }; }; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index dea8d256f1..186a622417 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -3,9 +3,9 @@ // Bail if guidance is disabled // Bail on locality of the projectile, it should be local to us -if(!GVAR(enabled) || {!local _projectile} ) exitWith { false }; +if(GVAR(enabled) < 1 || {!local _projectile} ) exitWith { false }; -if(!GVAR(enableForAI) && {!isPlayer _shooter} ) exitWith { false }; +if( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith { false }; private["_config", "_enabled", "_target", "_seekerType", "_attackProfile"]; PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); diff --git a/addons/missileguidance/functions/fnc_onIncomingMissile.sqf b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf index f819a97562..33ebeb34e2 100644 --- a/addons/missileguidance/functions/fnc_onIncomingMissile.sqf +++ b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf @@ -2,6 +2,7 @@ #include "script_component.hpp" PARAMS_3(_target,_ammo,_shooter); -if !(local (gunner _shooter) || {local _shooter}) exitWith {}; +if(GVAR(enabled) < 1) exitWith {}; // bail if enabled +if !(local (gunner _shooter) || {local _shooter}) exitWith {}; // bail if not shooter _shooter setVariable [QGVAR(vanilla_target),_target, false]; \ No newline at end of file diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 5c136388ba..16c9a7ec74 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -12,24 +12,6 @@ Avançado Missile Guidance Részletes rakéta irányító Расширенный ракетой - - - Advanced Missile Guidance for AI - - - Enables advanced guidance on AI units. - - - Enables advanced guidance mechanics and selection for different missiles and fire modes. - - - Włącza zaawansowaną mechanikę i wybór dla różnych rakiet i trybów strzału. - Aktiviert die erweiterten Mechaniken für unterschiedliche Raketen und Feuermodi. - Povoluje pokročilou mechaniku řízení střel. - - - - Hydra-70 DAGR Missile From c397246534543c0ecfe4c0b206b9ea8f0268b056 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Tue, 14 Apr 2015 23:22:08 -0300 Subject: [PATCH 15/22] Fix the fov test. Issue not fixed --- .../functions/fnc_renderActionPoints.sqf | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 702da00f29..9c100ea9ad 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -29,44 +29,44 @@ _fnc_renderNearbyActions = { { _target = _x; - // Quick oclussion test. Exit for object more than 2 m behind the camera plane + // Quick oclussion test. Exit for object more than 1 m behind the camera plane _lambda = ((getPosASL _x) vectorDiff _cameraPos) vectorDotProduct _cameraDir; - if (_lambda < -2) exitWith {}; + if (_lambda > -1) then { + _numInteractions = 0; + // Prevent interacting with yourself or your own vehicle + if (_target != ACE_player && {_target != vehicle ACE_player}) then { - _numInteractions = 0; - // Prevent interacting with yourself or your own vehicle - if (_target != ACE_player && {_target != vehicle ACE_player}) then { + // Iterate through object actions, find base level actions and render them if appropiate + _actionsVarName = format [QGVAR(Act_%1), typeOf _target]; + GVAR(objectActionList) = _target getVariable [QGVAR(actions), []]; + { + // Only render them directly if they are base level actions + if (count (_x select 1) == 0) then { + // Try to render the menu + _action = _x; + if ([_target, _action] call FUNC(renderBaseMenu)) then { + _numInteractions = _numInteractions + 1; + }; + }; + } forEach GVAR(objectActionList); - // Iterate through object actions, find base level actions and render them if appropiate - _actionsVarName = format [QGVAR(Act_%1), typeOf _target]; - GVAR(objectActionList) = _target getVariable [QGVAR(actions), []]; - { - // Only render them directly if they are base level actions - if (count (_x select 1) == 0) then { - // Try to render the menu + // Iterate through base level class actions and render them if appropiate + _classActions = missionNamespace getVariable [_actionsVarName, []]; + { _action = _x; + // Try to render the menu if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; }; - }; - } forEach GVAR(objectActionList); + } forEach _classActions; - // Iterate through base level class actions and render them if appropiate - _classActions = missionNamespace getVariable [_actionsVarName, []]; - { - _action = _x; - // Try to render the menu - if ([_target, _action] call FUNC(renderBaseMenu)) then { - _numInteractions = _numInteractions + 1; + // Limit the amount of objects the player can interact with + if (_numInteractions > 0) then { + _numInteractObjects = _numInteractObjects + 1; }; - } forEach _classActions; - - // Limit the amount of objects the player can interact with - if (_numInteractions > 0) then { - _numInteractObjects = _numInteractObjects + 1; }; + if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {}; }; - if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {}; } forEach _nearestObjects; }; From 7ad9238bbf35fe7cd8d1359a739c56062e57c00c Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Tue, 14 Apr 2015 23:32:03 -0300 Subject: [PATCH 16/22] Fixes --- addons/interact_menu/functions/fnc_renderActionPoints.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 9c100ea9ad..8d4734c8f8 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -25,11 +25,11 @@ _fnc_renderNearbyActions = { _cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; _numInteractObjects = 0; - _nearestObjects = nearestObjects [ACE_player, ["All"], 13]; + _nearestObjects = nearestObjects [((getPosASL ACE_player) vectorAdd (_cameraDir vectorMultiply 5)) call EFUNC(common,ASLToPosition), ["All"], 8]; { _target = _x; - // Quick oclussion test. Exit for object more than 1 m behind the camera plane + // Quick oclussion test. Skip objects more than 1 m behind the camera plane _lambda = ((getPosASL _x) vectorDiff _cameraPos) vectorDotProduct _cameraDir; if (_lambda > -1) then { _numInteractions = 0; @@ -65,8 +65,8 @@ _fnc_renderNearbyActions = { _numInteractObjects = _numInteractObjects + 1; }; }; - if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {}; }; + if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {}; } forEach _nearestObjects; }; From d6a293c573e61f8702f404491b243da00b18a8f9 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 15 Apr 2015 05:19:03 +0200 Subject: [PATCH 17/22] disable firing if menu is opened --- addons/interaction/XEH_postInit.sqf | 3 ++ addons/interaction/XEH_preInit.sqf | 1 + .../functions/fnc_handlePlayerChanged.sqf | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 addons/interaction/functions/fnc_handlePlayerChanged.sqf diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 98b1cc1523..dc019b101f 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -74,3 +74,6 @@ GVAR(isOpeningDoor) = false; [29, [false, false, false]], false] call cba_fnc_addKeybind; ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); + +// disable firing while the interact menu is is is opened +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 6f10a4e834..f6d742f419 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -14,6 +14,7 @@ PREP(getDoor); PREP(getDoorAnimations); PREP(getDown); PREP(getSelectedButton); +PREP(handlePlayerChanged); PREP(hideMenu); PREP(hideMouseHint); PREP(isInRange); diff --git a/addons/interaction/functions/fnc_handlePlayerChanged.sqf b/addons/interaction/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..0e16d5db9e --- /dev/null +++ b/addons/interaction/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * + * Disables firing while the menu is opened. Called from playerChanged eh. + * + * Argument: + * 0: New unit to add the addAction eh (Object) + * 1: Old unit to remove the addAction eh (String) + * + * Return value: + * NOPE + */ +#include "script_component.hpp" + +private ["_newUnit", "_oldUnit"]; + +_newUnit = _this select 0; +_oldUnit = _this select 1; + +// add to new unit +private "_ehid"; +_ehid = [_newUnit, "DefaultAction", {EGVAR(interact_menu,openedMenuType) >= 0}, {systemChat "snap"}] call EFUNC(common,addActionEventHandler); + +_newUnit setVariable [QGVAR(AAEHID), _ehid]; + +// remove from old unit +_ehid = _oldUnit getVariable [QGVAR(AAEHID), -1]; + +[_oldUnit, "DefaultAction", _ehid] call EFUNC(common,removeActionEventHandler); + +_oldUnit setVariable [QGVAR(AAEHID), -1]; From c81fa61f2e4a37af15256bbf8441c2b0a5dd6bc6 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Tue, 14 Apr 2015 22:34:58 -0500 Subject: [PATCH 18/22] match to exact directory name (case-sensitive) --- extensions/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 46aa4f3446..6028771554 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -27,7 +27,7 @@ include_directories(AFTER "common") # Add extensions to build here add_subdirectory(fcs) -add_subdirectory(breakline) +add_subdirectory(breakLine) add_subdirectory(advanced_ballistics) message("Build Type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file From 428688422ec0470a0ebd55d9b365fd609b5a4285 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 14 Apr 2015 22:47:57 -0500 Subject: [PATCH 19/22] Missing stringtable for listMenu --- addons/interact_menu/stringtable.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index bd8ded64ce..fdd9a2e6b4 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -10,6 +10,9 @@ Zawsze wyświetlaj kursor dla własnej interakcji Toujours afficher le curseur pour les interactions sur soi-même + + Display interact menu as a list + Interact Key Fremdinteraktionsmenü-Taste From a9f44530c9f58cd24d1193f6172ed901d8a225f9 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Wed, 15 Apr 2015 01:20:20 -0300 Subject: [PATCH 20/22] Move the function that prevents firing while the interact_menu is open to the interact_menu pbo --- addons/interact_menu/XEH_clientInit.sqf | 3 +++ addons/interact_menu/XEH_preInit.sqf | 1 + .../functions/fnc_handlePlayerChanged.sqf | 12 ++++-------- addons/interaction/XEH_postInit.sqf | 3 --- addons/interaction/XEH_preInit.sqf | 1 - 5 files changed, 8 insertions(+), 12 deletions(-) rename addons/{interaction => interact_menu}/functions/fnc_handlePlayerChanged.sqf (74%) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index bcb2d5aa8e..ea4a971563 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -50,3 +50,6 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; GVAR(actionSelected) = false; [] call FUNC(keyUp); }] call EFUNC(common,addEventhandler); + +// disable firing while the interact menu is is is opened +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index c15f8d388d..b4a3504cdd 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -9,6 +9,7 @@ PREP(compileMenuSelfAction); PREP(collectActiveActionTree); PREP(createAction); PREP(findActionNode); +PREP(handlePlayerChanged); PREP(isSubPath); PREP(keyDown); PREP(keyUp); diff --git a/addons/interaction/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf similarity index 74% rename from addons/interaction/functions/fnc_handlePlayerChanged.sqf rename to addons/interact_menu/functions/fnc_handlePlayerChanged.sqf index 0e16d5db9e..bb5c3afb53 100644 --- a/addons/interaction/functions/fnc_handlePlayerChanged.sqf +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -1,21 +1,17 @@ /* * Author: commy2 - * * Disables firing while the menu is opened. Called from playerChanged eh. * * Argument: - * 0: New unit to add the addAction eh (Object) - * 1: Old unit to remove the addAction eh (String) + * 0: New unit to add the addAction eh + * 1: Old unit to remove the addAction eh * * Return value: - * NOPE + * None */ #include "script_component.hpp" -private ["_newUnit", "_oldUnit"]; - -_newUnit = _this select 0; -_oldUnit = _this select 1; +EXPLODE_2_PVT(_this,_newUnit,_oldUnit); // add to new unit private "_ehid"; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index dc019b101f..98b1cc1523 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -74,6 +74,3 @@ GVAR(isOpeningDoor) = false; [29, [false, false, false]], false] call cba_fnc_addKeybind; ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); - -// disable firing while the interact menu is is is opened -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index f6d742f419..6f10a4e834 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -14,7 +14,6 @@ PREP(getDoor); PREP(getDoorAnimations); PREP(getDown); PREP(getSelectedButton); -PREP(handlePlayerChanged); PREP(hideMenu); PREP(hideMouseHint); PREP(isInRange); From 5faf4b7dfa55526b2d16a2437503d949961b55c9 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Wed, 15 Apr 2015 01:27:29 -0300 Subject: [PATCH 21/22] Remove comment --- addons/interact_menu/functions/fnc_handlePlayerChanged.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf index bb5c3afb53..fe25853733 100644 --- a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -15,7 +15,7 @@ EXPLODE_2_PVT(_this,_newUnit,_oldUnit); // add to new unit private "_ehid"; -_ehid = [_newUnit, "DefaultAction", {EGVAR(interact_menu,openedMenuType) >= 0}, {systemChat "snap"}] call EFUNC(common,addActionEventHandler); +_ehid = [_newUnit, "DefaultAction", {EGVAR(interact_menu,openedMenuType) >= 0}, {}] call EFUNC(common,addActionEventHandler); _newUnit setVariable [QGVAR(AAEHID), _ehid]; From 25e8e93fd065ef4de50a8996b7008ed3d8bf95a0 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Wed, 15 Apr 2015 01:32:42 -0300 Subject: [PATCH 22/22] Add back stringtables for the list menu --- addons/interact_menu/stringtable.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index bd8ded64ce..dddf90a4de 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -10,6 +10,10 @@ Zawsze wyświetlaj kursor dla własnej interakcji Toujours afficher le curseur pour les interactions sur soi-même + + Display interaction menus as lists + Mostrar los menus de interacción como listas + Interact Key Fremdinteraktionsmenü-Taste