diff --git a/.editorconfig b/.editorconfig
index f6f23b8d1b..0deca3d2ab 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,7 +1,7 @@
root = true
[*]
-end_of_line = lf
+end_of_line = crlf
insert_final_newline = true
charset = utf-8
indent_style = space
diff --git a/README.md b/README.md
index ddece2a48d..83950e8236 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,23 @@
-
-
-
-
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
Requires the latest version of CBA A3 | BIF thread
-**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM**, **CSE** and **RHS** to improve the realism and authenticity of Arma 3.
+**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project).
@@ -32,7 +34,7 @@ More information on the purpose of the different components of ACE and which one
* Realistic ballistics including wind and humidity
* Backblast simulation
* Weapon resting and bipod deployment
-* A fire control system for armored vehicles and helicopters
+* A fire control system for armored vehicles and helicopters
***and more...***
For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki).
diff --git a/TO_MERGE/agm/Optics/agm_optics_pip.p3d b/TO_MERGE/agm/Optics/agm_optics_pip.p3d
new file mode 100644
index 0000000000..d331ce4acd
Binary files /dev/null and b/TO_MERGE/agm/Optics/agm_optics_pip.p3d differ
diff --git a/TO_MERGE/agm/Optics/clientInit.sqf b/TO_MERGE/agm/Optics/clientInit.sqf
new file mode 100644
index 0000000000..7dca46fdc4
--- /dev/null
+++ b/TO_MERGE/agm/Optics/clientInit.sqf
@@ -0,0 +1,25 @@
+// TMR: Optics initialization and functions
+// (C) 2013 Ryan Schultz. See LICENSE.
+
+// Request a resource layer from the game engine.
+AGM_Optics_scopeRSC = ["AGM_Optics_Scope"] call BIS_fnc_rscLayer;
+
+// Set global variables
+AGM_Optics_inScope = false; // Is the scope up?
+AGM_Optics_currentOptic = ""; // What optic is attached right now?
+
+0 = 0 spawn {
+ waituntil {!isNull (findDisplay 46)};
+
+ [] call AGM_Optics_fnc_initScope;
+
+ // PiP technique by BadBenson
+ AGM_Optics_Camera = "camera" camCreate (positioncameratoworld [0,0,0]);
+ AGM_Optics_Camera camSetFov 0.7;
+ AGM_Optics_Camera camSetTarget player;
+ AGM_Optics_Camera camCommit 1;
+ "agm_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
+ AGM_Optics_Camera cameraEffect ["INTERNAL", "BACK","agm_optics_rendertarget0"];
+
+ waitUntil {[] call AGM_Optics_fnc_mainLoop; False};
+};
diff --git a/TO_MERGE/agm/Optics/config.cpp b/TO_MERGE/agm/Optics/config.cpp
new file mode 100644
index 0000000000..429c57cbe2
--- /dev/null
+++ b/TO_MERGE/agm/Optics/config.cpp
@@ -0,0 +1,454 @@
+class CfgPatches {
+ class AGM_Optics {
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = 0.60;
+ requiredAddons[] = {AGM_Core};
+ version = 0.1;
+ author[] = {"Taosenai"};
+ authorUrl = "http://www.ryanschultz.org/tmr/";
+ };
+};
+
+class CfgFunctions {
+ class AGM_Optics {
+ class AGM_Optics {
+ file = "AGM_Optics\functions";
+ class firedEH;
+ class hideScope;
+ class initScope;
+ class mainLoop;
+ };
+ };
+};
+
+class Extended_PostInit_EventHandlers {
+ class AGM_Optics {
+ clientInit = "call compile preProcessFileLineNumbers '\AGM_Optics\clientInit.sqf'";
+ };
+};
+
+class Extended_FiredBIS_EventHandlers {
+ class CAManBase {
+ class AGM_Optics {
+ clientFiredBIS = "_this call AGM_Optics_fnc_firedEH;";
+ };
+ };
+};
+
+class CfgOpticsEffect {
+ class AGM_OpticsRadBlur1 {
+ type = "radialblur";
+ params[] = {0.015, 0, 0.14, 0.2};
+ priority = 950;
+ };
+};
+
+
+class CfgWeapons {
+ class ItemCore;
+ class InventoryItem_Base_F;
+ class InventoryMuzzleItem_Base_F;
+ class InventoryOpticsItem_Base_F;
+
+ class optic_Hamr : ItemCore {
+ displayName = "HAMR 4x";
+ descriptionShort = "High Accuracy Multi-Range Optic Magnification: 4x Reticle: CM-RW 6.5mm";
+ scope = 2;
+ weaponInfoType = "AGM_RscWeapon";
+
+ AGM_Optics_enhanced = 1;
+ AGM_Optics_reticle = "\AGM_Optics\data\hamr\hamr-reticle65_ca.paa";
+ AGM_Optics_reticleIllum = "\AGM_Optics\data\hamr\hamr-reticle65Illum_ca.paa";
+ AGM_Optics_body = "\AGM_Optics\data\hamr\hamr-body_ca.paa";
+ AGM_Optics_bodyNight = "\AGM_Optics\data\hamr\hamr-bodyNight_ca.paa";
+
+ model = "\A3\weapons_f\acc\acco_hamr_F";
+
+ class ItemInfo : InventoryOpticsItem_Base_F {
+ mass = 4;
+ optics = 1;
+ optictype = 1;
+ rmbhint = "HAMR";
+ modeloptics = "\AGM_Optics\agm_optics_pip.p3d";
+
+ class OpticsModes {
+ class Hamr2Collimator {
+ AGM_Optics_enhanced = 0;
+ opticsID = 1;
+ useModelOptics = 0;
+ opticsppeffects[] = {};
+ opticsFlare = 0;
+ opticsDisablePeripherialVision = 0;
+ opticsZoomMin = 0.375;
+ opticsZoomMax = 1;
+ opticsZoomInit = 0.75;
+ memoryPointCamera = "eye";
+ visionMode[] = {};
+ distanceZoomMin = 300;
+ distanceZoomMax = 300;
+ };
+
+ class Hamr2Scope {
+ cameradir = "";
+ distanceZoomMin = 300;
+ distanceZoomMax = 300;
+ memorypointcamera = "opticView";
+ opticsdisableperipherialvision = 0;
+ opticsdisplayname = "IHAMR";
+ opticsflare = 1;
+ opticsid = 2;
+ opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur1", "AGM_OpticsRadBlur1"};
+ opticszoominit = 0.0872664626;
+ opticszoommax = 0.0872664626;
+ opticszoommin = 0.0872664626;
+ discretefov[] = {0.0872664626};
+ discreteinitindex = 0;
+ usemodeloptics = 1;
+ modeloptics = "\AGM_Optics\agm_optics_pip.p3d";
+ visionmode[] = {"Normal", "NVG"};
+ };
+ };
+ };
+ };
+
+ class optic_Arco : ItemCore {
+ descriptionshort = "Advanced Rifle Combat Optic Magnification: 4x Reticle: SpecterDR 6.5mm";
+ displayname = "ARCO 4x";
+ picture = "\A3\weapons_F\Data\UI\gear_acco_Arco_CA.paa";
+ scope = 2;
+ weaponInfoType = "AGM_RscWeapon";
+
+ model = "\A3\weapons_f\acc\acco_Arco_F";
+
+ AGM_Optics_enhanced = 1;
+ AGM_Optics_reticle = "\AGM_Optics\data\arco\arco-reticle65_ca.paa";
+ AGM_Optics_reticleIllum = "\AGM_Optics\data\arco\arco-reticle65Illum_ca.paa";
+ AGM_Optics_body = "\AGM_Optics\data\arco\arco-body_ca.paa";
+ AGM_Optics_bodyNight = "\AGM_Optics\data\arco\arco-bodyNight_ca.paa";
+
+ class ItemInfo: InventoryOpticsItem_Base_F {
+ mass = 4;
+ optics = 1;
+ optictype = 1;
+ rmbhint = "ARCO";
+
+ class OpticsModes {
+ class ARCO2collimator {
+ AGM_Optics_enhanced = 0;
+ cameradir = "";
+ distancezoommax = 300;
+ distancezoommin = 300;
+ memorypointcamera = "eye";
+ opticsdisableperipherialvision = 0;
+ opticsdisplayname = "CQB";
+ opticsflare = 0;
+ opticsid = 1;
+ opticsppeffects[] = {};
+ opticszoominit = 0.75;
+ opticszoommax = 1.1;
+ opticszoommin = 0.375;
+ usemodeloptics = 0;
+ visionmode[] = {};
+ };
+ class ARCO2scope: ARCO2collimator {
+ cameradir = "";
+ distanceZoomMin = 300;
+ distanceZoomMax = 300;
+ memorypointcamera = "opticView";
+ opticsdisableperipherialvision = 0;
+ opticsdisplayname = "ARCO";
+ opticsflare = 1;
+ opticsid = 2;
+ opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur1", "AGM_OpticsRadBlur1"};
+ opticszoominit = 0.0872664626; // 0.0872664626 rad = 5 degrees
+ opticszoommax = 0.0872664626; // SpecterDR 4x is 6 degrees
+ opticszoommin = 0.0872664626; // Scope graphic in game covers 1 degree
+ discretefov[] = {0.0872664626};
+ discreteinitindex = 0;
+ usemodeloptics = 1;
+ modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
+ visionmode[] = {"Normal"};
+ };
+ };
+ };
+ };
+
+ class optic_MRCO : ItemCore {
+ displayName = "MRCO 1x/4x";
+ descriptionShort = "Medium Range Combat Optic Magnification: 1x/4x Reticle: Pitbull Gen II 5.56mm";
+ scope = 2;
+ weaponInfoType = "AGM_RscWeapon";
+
+ AGM_Optics_enhanced = 1;
+ AGM_Optics_reticle = "\AGM_Optics\data\mrco\mrco-reticle556_ca.paa";
+ AGM_Optics_reticleIllum = "\AGM_Optics\data\mrco\mrco-reticle556Illum_ca.paa";
+ AGM_Optics_body = "\AGM_Optics\data\mrco\mrco-body_ca.paa";
+ AGM_Optics_bodyNight = "\AGM_Optics\data\mrco\mrco-bodyNight_ca.paa";
+
+ class ItemInfo : InventoryOpticsItem_Base_F {
+ opticType = 1;
+ mass = 4;
+ optics = 1;
+ modelOptics = "\A3\Weapons_f_beta\acc\reticle_MRCO_F";
+
+ class OpticsModes {
+ class MRCOcq {
+ AGM_Optics_enhanced = 0;
+ opticsID = 1;
+ useModelOptics = 0;
+ opticsPPEffects[] = {};
+ opticsFlare = 0;
+ opticsDisablePeripherialVision = 0;
+ opticsZoomMin = 0.375;
+ opticsZoomMax = 1;
+ opticsZoomInit = 0.75;
+ memoryPointCamera = "eye";
+ visionMode[] = {};
+ distanceZoomMin = 100;
+ distanceZoomMax = 100;
+ };
+
+ class MRCOscope {
+ cameradir = "";
+ distanceZoomMin = 300;
+ distanceZoomMax = 300;
+ memorypointcamera = "eye";
+ opticsdisableperipherialvision = 0;
+ opticsdisplayname = "MRCO";
+ opticsflare = 1;
+ opticsid = 2;
+ opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur2", "AGM_OpticsRadBlur1"};
+ opticszoominit = 0.0872664626;
+ opticszoommax = 0.0872664626;
+ opticszoommin = 0.0872664626;
+ discretefov[] = {0.0872664626};
+ discreteinitindex = 0;
+ usemodeloptics = 1;
+ modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
+ visionmode[] = {"Normal"};
+ };
+ };
+ };
+ };
+
+ class optic_Nightstalker : ItemCore {
+ class ItemInfo: InventoryOpticsItem_Base_F {
+ class OpticsModes {
+ class NCTALKEP {};
+ class Iron : NCTALKEP {
+ opticsppeffects[] = {}; // Fix Arma 3 bug
+ };
+ };
+ };
+ };
+
+ class optic_SOS: ItemCore {
+ class ItemInfo: InventoryOpticsItem_Base_F {
+ modelOptics = "\AGM_Optics\agm_optics_pip.p3d";
+ class OpticsModes {
+ class Snip {
+ visionMode[] = {"Normal","TI","NVG"};
+ thermalMode[] = {5,6};
+ opticsPPEffects[] = {"OpticsCHAbera1","radblur"};
+ modelOptics[] = {"\AGM_Optics\agm_optics_pip.p3d","\AGM_Optics\agm_optics_pip.p3d"};
+ };
+ };
+
+ };
+ };
+
+ class optic_DMS : ItemCore {
+ class ItemInfo: InventoryOpticsItem_Base_F {
+ class OpticsModes {
+ class Snip {};
+ class Iron : Snip {
+ opticsppeffects[] = {}; // Fix Arma 3 bug
+ };
+ };
+ };
+ };
+
+ class optic_LRPS : ItemCore {
+ descriptionshort = "Nightforce NXS Riflescope Magnification: 5.5-22x";
+ displayname = "NXS 5.5-22x";
+ weaponinfotype = "AGM_RscWeapon";
+
+ AGM_Optics_enhanced = 1;
+ AGM_Optics_reticle = "\AGM_Optics\data\sos\sos-reticleMLR_ca.paa";
+ AGM_Optics_reticleIllum = "\AGM_Optics\data\sos\sos-reticleMLRIllum_ca.paa";
+ AGM_Optics_body = "\AGM_Optics\data\sos\sos-body_ca.paa";
+ AGM_Optics_bodyNight = "\AGM_Optics\data\sos\sos-bodyNight_ca.paa";
+
+ class ItemInfo: InventoryOpticsItem_Base_F {
+ modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
+ weaponinfotype = "RscWeaponRangeZeroingFOV";
+ opticType = 2; // Sniper optics
+
+ class OpticsModes {
+ // Based on Nightforce NXS 5.5-22 scope
+ class Snip {
+ cameradir = "";
+ discretedistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300};
+ discretedistanceinitindex = 0;
+ discreteinitindex = 0;
+ distancezoommax = 2300;
+ distancezoommin = 100;
+ memorypointcamera = "opticView";
+ modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
+ opticsdisableperipherialvision = 1;
+ opticsdisplayname = "SOS";
+ opticsflare = 1;
+ opticsid = 1;
+ opticsppeffects[] = {"OpticsCHAbera1", "OpticsBlur1", "AGM_OpticsRadBlur1"};
+ // How to determine opticszoom
+ // First do the basic math based on the listed FOV of the scope to
+ // get a baseline FOV
+ // 0.1 meter at 100 meters = 1 mrad
+ //
+ // 5.5x FOV -- 5.3 m at 100 m = 53 mrad
+ // = 0.053 rad = 3.037 deg FOV
+
+ // 22x FOV -- 1.4 m at 100m = 14 mrad
+ // = 0.014 rad = 0.802 deg
+
+ // The FOV you give the engine is based on a rather larger scope outline, so we
+ // have to do this extra work ourselves.
+
+ // At 1680x1050
+ // The width of a TMR optic viewfield is 864px
+ // The engine viewport width (which is what the below FOV is based on) is 980
+ // (864/980) = (FOV to give engine / true FOV of optic)
+ // 864/980 * 0.053 = 0.04673
+ // 864/980 * 0.014 = 0.01234
+
+ // Measured experimentally, these values seem quite right.
+ // Certainly they're close enough after you account for pixel density, etc.
+
+ opticszoominit = 0.01234;
+ opticszoommax = 0.04673;
+ opticszoommin = 0.01234;
+ discretefov[] = {};
+ usemodeloptics = 1;
+ visionmode[] = {"Normal"};
+ };
+ };
+ };
+ };
+
+ class optic_Yorris : ItemCore {
+ descriptionshort = "Burris FastFire II Red Dot Sight Magnification: 1x";
+ displayname = "FastFire II";
+ };
+
+ class optic_MRD : ItemCore {
+ descriptionshort = "Eotech MRDS Red Dot Sight Magnification: 1x";
+ displayname = "MRDS";
+ };
+
+ class optic_Holosight : ItemCore {
+ descriptionshort = "Eotech XPS3 Holographic Sight Magnification: 1x";
+ displayname = "XPS3 Holo";
+ };
+};
+
+class RscOpticsText;
+class RscOpticsValue;
+class RscInGameUI {
+ class RscUnitInfo;
+ class RscWeaponZeroing;
+ class AGM_RscWeapon : RscWeaponZeroing {
+ idd = -1;
+ controls[] = {"CA_Zeroing", "CA_FOVMode"};
+
+ onLoad ="with uiNameSpace do { AGM_OpticsIGUI = _this select 0 }";
+
+ class CA_FOVMode : RscOpticsValue {
+ idc = 154;
+ style = 2;
+ colorText[] = {0, 0, 0, 0};
+ x = 0;
+ y = 0;
+ w = 0;
+ h = 0;
+ };
+ };
+};
+
+class RscTitles {
+ class AGM_Optics_Scope {
+ idd = -1;
+ onLoad = "with uiNameSpace do { AGM_Optics_Scope = _this select 0 };";
+ onUnload = "";
+ movingEnable = 1;
+ duration = 10000;
+ controls[] = {"Reticle", "ReticleNight", "BodyNight", "Body"};
+
+ class Reticle {
+ colorBackground[] = {0,0,0, 0};
+ colorText[] = {1,1,1, 1};
+ fade = 0;
+ font = "PuristaMedium";
+ h = SafeZoneH;
+ idc = 1;
+ lineSpacing = 1.0;
+ movingEnable = 1;
+ size = 0;
+ sizeEx = 1;
+ style = 48;
+ text = "";
+ type = 0;
+ w = SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1));
+ x = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1)))/2);
+ y = SafeZoneY;
+ };
+
+ class ReticleNight : Reticle {
+ idc = 2;
+ text = "";
+ };
+
+ class Body : Reticle {
+ idc = 6;
+ text = "";
+ x = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1))));
+ y = SafeZoneY - (SafeZoneH/2);
+ w = SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1)) * 2;
+ h = SafeZoneH * 2;
+ };
+
+ class BodyNight : Body {
+ idc = 5;
+ text = "";
+ };
+ };
+};
+
+class PreloadTextures {
+ class CfgWeapons {
+ class optic_hamr {
+ AGM_Optics_body= "*";
+ AGM_Optics_bodyNight = "*";
+ AGM_Optics_reticle = "*";
+ AGM_Optics_reticleIllum = "*";
+ };
+ class optic_arco {
+ AGM_Optics_body= "*";
+ AGM_Optics_bodyNight = "*";
+ AGM_Optics_reticle = "*";
+ AGM_Optics_reticleIllum = "*";
+ };
+ class optic_mrco {
+ AGM_Optics_body= "*";
+ AGM_Optics_bodyNight = "*";
+ AGM_Optics_reticle = "*";
+ AGM_Optics_reticleIllum = "*";
+ };
+ class optic_LRPS {
+ AGM_Optics_body= "*";
+ AGM_Optics_bodyNight = "*";
+ AGM_Optics_reticle = "*";
+ AGM_Optics_reticleIllum = "*";
+ };
+ };
+};
diff --git a/TO_MERGE/agm/Optics/data/arco/arco-bodyNight_ca.paa b/TO_MERGE/agm/Optics/data/arco/arco-bodyNight_ca.paa
new file mode 100644
index 0000000000..9b186b56f4
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/arco/arco-bodyNight_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/arco/arco-body_ca.paa b/TO_MERGE/agm/Optics/data/arco/arco-body_ca.paa
new file mode 100644
index 0000000000..193b14a92c
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/arco/arco-body_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/arco/arco-reticle65Illum_ca.paa b/TO_MERGE/agm/Optics/data/arco/arco-reticle65Illum_ca.paa
new file mode 100644
index 0000000000..d193051e81
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/arco/arco-reticle65Illum_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/arco/arco-reticle65_ca.paa b/TO_MERGE/agm/Optics/data/arco/arco-reticle65_ca.paa
new file mode 100644
index 0000000000..671417fd4b
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/arco/arco-reticle65_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/black.rvmat b/TO_MERGE/agm/Optics/data/black.rvmat
new file mode 100644
index 0000000000..431d76689f
--- /dev/null
+++ b/TO_MERGE/agm/Optics/data/black.rvmat
@@ -0,0 +1,8 @@
+ambient[]={0,0,0,0.89999998};
+diffuse[]={0,0,0,0.89999998};
+forcedDiffuse[]={0,0,0,1};
+emmisive[]={0,0,0,1};
+specular[]={0,0,0,0};
+specularPower=1;
+PixelShaderID="Normal";
+VertexShaderID="Basic";
diff --git a/TO_MERGE/agm/Optics/data/em.rvmat b/TO_MERGE/agm/Optics/data/em.rvmat
new file mode 100644
index 0000000000..a491df4b9a
--- /dev/null
+++ b/TO_MERGE/agm/Optics/data/em.rvmat
@@ -0,0 +1,20 @@
+ambient[]={1,1,1,1};
+diffuse[]={1,1,1,1};
+forcedDiffuse[]={0,0,0,0};
+emmisive[]={1,1,1,1};
+specular[]={1,0.99956858,1,1};
+specularPower=1;
+PixelShaderID="Normal";
+VertexShaderID="Basic";
+class Stage1
+{
+ texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
+ uvSource="tex";
+ class uvTransform
+ {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
diff --git a/TO_MERGE/agm/Optics/data/hamr/hamr-bodyNight_ca.paa b/TO_MERGE/agm/Optics/data/hamr/hamr-bodyNight_ca.paa
new file mode 100644
index 0000000000..422b13f7f1
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/hamr/hamr-bodyNight_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/hamr/hamr-body_ca.paa b/TO_MERGE/agm/Optics/data/hamr/hamr-body_ca.paa
new file mode 100644
index 0000000000..6b55916c5f
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/hamr/hamr-body_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/hamr/hamr-reticle65Illum_ca.paa b/TO_MERGE/agm/Optics/data/hamr/hamr-reticle65Illum_ca.paa
new file mode 100644
index 0000000000..7af73234fc
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/hamr/hamr-reticle65Illum_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/hamr/hamr-reticle65_ca.paa b/TO_MERGE/agm/Optics/data/hamr/hamr-reticle65_ca.paa
new file mode 100644
index 0000000000..2cbf329c89
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/hamr/hamr-reticle65_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/mrco/mrco-bodyNight_ca.paa b/TO_MERGE/agm/Optics/data/mrco/mrco-bodyNight_ca.paa
new file mode 100644
index 0000000000..381fdd3e97
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/mrco/mrco-bodyNight_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/mrco/mrco-body_ca.paa b/TO_MERGE/agm/Optics/data/mrco/mrco-body_ca.paa
new file mode 100644
index 0000000000..bfcaa9828f
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/mrco/mrco-body_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/mrco/mrco-reticle556Illum_ca.paa b/TO_MERGE/agm/Optics/data/mrco/mrco-reticle556Illum_ca.paa
new file mode 100644
index 0000000000..5bf836d593
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/mrco/mrco-reticle556Illum_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/mrco/mrco-reticle556_ca.paa b/TO_MERGE/agm/Optics/data/mrco/mrco-reticle556_ca.paa
new file mode 100644
index 0000000000..e7b8599f83
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/mrco/mrco-reticle556_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/scopeblack-100_ca.paa b/TO_MERGE/agm/Optics/data/scopeblack-100_ca.paa
new file mode 100644
index 0000000000..d0232dc0cc
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/scopeblack-100_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/scopeblack-70_ca.paa b/TO_MERGE/agm/Optics/data/scopeblack-70_ca.paa
new file mode 100644
index 0000000000..62b06d7f84
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/scopeblack-70_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/scopeblack-80_ca.paa b/TO_MERGE/agm/Optics/data/scopeblack-80_ca.paa
new file mode 100644
index 0000000000..f74e3e41f1
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/scopeblack-80_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/scopeblack-90_ca.paa b/TO_MERGE/agm/Optics/data/scopeblack-90_ca.paa
new file mode 100644
index 0000000000..2240dcc5fe
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/scopeblack-90_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/sos/sos-bodyNight_ca.paa b/TO_MERGE/agm/Optics/data/sos/sos-bodyNight_ca.paa
new file mode 100644
index 0000000000..22f008b17a
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/sos/sos-bodyNight_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/sos/sos-body_ca.paa b/TO_MERGE/agm/Optics/data/sos/sos-body_ca.paa
new file mode 100644
index 0000000000..37c6d47d63
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/sos/sos-body_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/sos/sos-reticleMLRIllum_ca.paa b/TO_MERGE/agm/Optics/data/sos/sos-reticleMLRIllum_ca.paa
new file mode 100644
index 0000000000..65d0afb2e2
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/sos/sos-reticleMLRIllum_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/sos/sos-reticleMLR_ca.paa b/TO_MERGE/agm/Optics/data/sos/sos-reticleMLR_ca.paa
new file mode 100644
index 0000000000..48bc7f4e00
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/sos/sos-reticleMLR_ca.paa differ
diff --git a/TO_MERGE/agm/Optics/data/tmr_optics_reticle100.p3d b/TO_MERGE/agm/Optics/data/tmr_optics_reticle100.p3d
new file mode 100644
index 0000000000..365c9d5555
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/tmr_optics_reticle100.p3d differ
diff --git a/TO_MERGE/agm/Optics/data/tmr_optics_reticle70.p3d b/TO_MERGE/agm/Optics/data/tmr_optics_reticle70.p3d
new file mode 100644
index 0000000000..cbb0181a17
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/tmr_optics_reticle70.p3d differ
diff --git a/TO_MERGE/agm/Optics/data/tmr_optics_reticle80.p3d b/TO_MERGE/agm/Optics/data/tmr_optics_reticle80.p3d
new file mode 100644
index 0000000000..cbb0181a17
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/tmr_optics_reticle80.p3d differ
diff --git a/TO_MERGE/agm/Optics/data/tmr_optics_reticle90.p3d b/TO_MERGE/agm/Optics/data/tmr_optics_reticle90.p3d
new file mode 100644
index 0000000000..c2f1ae5ceb
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/tmr_optics_reticle90.p3d differ
diff --git a/TO_MERGE/agm/Optics/data/tmr_reticle_clear.p3d b/TO_MERGE/agm/Optics/data/tmr_reticle_clear.p3d
new file mode 100644
index 0000000000..89a29d7d8c
Binary files /dev/null and b/TO_MERGE/agm/Optics/data/tmr_reticle_clear.p3d differ
diff --git a/TO_MERGE/agm/Optics/functions/fn_firedEH.sqf b/TO_MERGE/agm/Optics/functions/fn_firedEH.sqf
new file mode 100644
index 0000000000..1030fceefd
--- /dev/null
+++ b/TO_MERGE/agm/Optics/functions/fn_firedEH.sqf
@@ -0,0 +1,149 @@
+/*
+ * Original Author: Taosenai
+ * Adapted By: KoffeinFlummi
+ *
+ * Animates the scope when firing.
+ *
+ * Arguments:
+ * 0: Unit
+ * 1: Weapon
+ * 2: Muzzle
+ * 3: Mode
+ * 4: Ammo
+ * 5: Magazine
+ * 6: Projectile
+ *
+ * Return Value:
+ * None
+ */
+
+if (_this select 0 != AGM_player) exitwith {}; // Sanity check
+
+0 = _this spawn {
+ disableSerialization;
+
+ _weaponType = _this select 1;
+ _config = configFile >> "CfgWeapons" >> _weaponType;
+ _scope = uiNameSpace getVariable "AGM_Optics_Scope";
+
+ // @todo
+ _recoilMulti = getNumber (_config >> "tmr_smallarms_recoil_shakeMultiplier"); // Will be 0 if undefined
+
+ if (_recoilMulti == 0) then {
+ _recoilMulti = 1;
+ };
+ if (_recoilMulti > 2.6) then {
+ _recoilMulti = 2.6; // Don't get too high
+ };
+
+ // Reduce the reticle movement as the player drops into lower, supported stances.
+ _detectStance = (player selectionPosition "Neck" select 2);
+ if (_detectStance < 1.3) then {
+ _recoilMulti = _recoilMulti - 0.10;
+ };
+ if (_detectStance < 0.7) then {
+ _recoilMulti = _recoilMulti - 0.20;
+ };
+
+ // Reduce reticle movement if the player is rested (tmr_autorest).
+ if (player getVariable ["tmr_autorest_rested", false]) then {
+ _recoilMulti = _recoilMulti - 0.20;
+ };
+
+ // Reduce reticle movement if the player is deployed (tmr_autorest).
+ if (player getVariable ["tmr_autorest_deployed", false]) then {
+ _recoilMulti = _recoilMulti - 0.30;
+ };
+ _recoilMulti = 1;
+ // @endtodo
+
+
+ // Constants which determine how the scope recoils
+ _recoilScope = 0.03 * _recoilMulti + random 0.0015;
+ _recoilRing = 0.03 * _recoilMulti + random 0.0015;
+
+ _randomScopeShiftX = 0.005 * _recoilMulti - random 0.011;
+
+ _randomReticleShiftX = 0.0036 * _recoilMulti + random 0.0045; // Always tend up and right;
+ _randomReticleShiftY = -0.0046 * _recoilMulti - random 0.0055;
+
+ /////////
+ // Center everything
+
+ // getResolution select 4 should return the aspect ratio, but it's totally wrong
+ // for triple head displays. We'll compute it manually.
+ _aspectRatio = (getResolution select 0) / (getResolution select 1);
+
+ _reticleX = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / _aspectRatio)/2);
+ _reticleY = SafeZoneY;
+ _reticleW = SafeZoneWAbs / _aspectRatio;
+ _reticleH = SafeZoneH;
+
+ // Reticle
+ (_scope displayCtrl 1) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
+ // Reticle night (illum)
+ (_scope displayCtrl 2) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
+
+ _bodyX = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / _aspectRatio));
+ _bodyY = SafeZoneY - (SafeZoneH/2);
+ _bodyW = SafeZoneWAbs / _aspectRatio * 2;
+ _bodyH = SafeZoneH * 2;
+
+ // Body night
+ (_scope displayCtrl 5) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
+ // Body
+ (_scope displayCtrl 6) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
+
+ _centerDelay = 0.01;
+ (_scope displayCtrl 1) ctrlCommit _centerDelay;
+ (_scope displayCtrl 2) ctrlCommit _centerDelay;
+ (_scope displayCtrl 5) ctrlCommit _centerDelay;
+ (_scope displayCtrl 6) ctrlCommit _centerDelay;
+
+ /////////
+ // Create and commit recoil effect
+
+ // Move reticle
+
+ (_scope displayCtrl 1) ctrlSetPosition [_reticleX - (_recoilScope/2) + _randomReticleShiftX, _reticleY - (_recoilScope/2) + _randomReticleShiftY, _reticleW + _recoilScope, _reticleH + _recoilScope];
+ (_scope displayCtrl 2) ctrlSetPosition [_reticleX - (_recoilScope/2) + _randomReticleShiftX, _reticleY - (_recoilScope/2) + _randomReticleShiftY, _reticleW + _recoilScope, _reticleH + _recoilScope];
+
+ // Move body
+
+ (_scope displayCtrl 5) ctrlSetPosition [_bodyX - (_recoilScope/2) + _randomScopeShiftX, _bodyY - (_recoilScope/2), _bodyW + _recoilScope, _bodyH + _recoilScope];
+ (_scope displayCtrl 6) ctrlSetPosition [_bodyX - (_recoilScope/2) + _randomScopeShiftX, _bodyY - (_recoilScope/2), _bodyW + _recoilScope, _bodyH + _recoilScope];
+
+ _recoilDelay = 0.036;
+ _fa = false;
+ _cwm = currentWeaponMode player;
+ if (_cwm == "FullAuto" || _cwm == "manual" || _cwm == "Burst") then {
+ _recoilDelay = getNumber (_config >> _cwm >> "reloadTime")/2.2;
+ _fa = true;
+ };
+ (_scope displayCtrl 1) ctrlCommit _recoilDelay;
+ (_scope displayCtrl 2) ctrlCommit _recoilDelay;
+ (_scope displayCtrl 5) ctrlCommit _recoilDelay;
+ (_scope displayCtrl 6) ctrlCommit _recoilDelay;
+
+ //////////////
+
+ waituntil {sleep 0.01; ctrlCommitted (_scope displayCtrl 6)};
+
+ //////////////
+
+ //////
+ // Bring them all back
+ (_scope displayCtrl 1) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
+ (_scope displayCtrl 2) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
+ (_scope displayCtrl 5) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
+ (_scope displayCtrl 6) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
+
+ _recenterDelay = 0.09;
+ if (_fa) then {
+ _recenterDelay = getNumber (_config >> _cwm >> "reloadTime")/2.2;
+ };
+ (_scope displayCtrl 1) ctrlCommit _recenterDelay;
+ (_scope displayCtrl 2) ctrlCommit _recenterDelay;
+ (_scope displayCtrl 5) ctrlCommit _recenterDelay;
+ (_scope displayCtrl 6) ctrlCommit _recenterDelay;
+};
diff --git a/TO_MERGE/agm/Optics/functions/fn_hideScope.sqf b/TO_MERGE/agm/Optics/functions/fn_hideScope.sqf
new file mode 100644
index 0000000000..8b048f1bd7
--- /dev/null
+++ b/TO_MERGE/agm/Optics/functions/fn_hideScope.sqf
@@ -0,0 +1,19 @@
+/*
+ * Original Author: Taosenai
+ * Adapted By: KoffeinFlummi
+ *
+ * Hides the scope.
+ *
+ */
+
+private ["_scope"];
+
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlSetTextColor [1,1,1,0];
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlSetTextColor [1,1,1,0];
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlSetTextColor [1,1,1,0];
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlSetTextColor [1,1,1,0];
+
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlCommit 0;
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlCommit 0;
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlCommit 0;
+((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlCommit 0;
diff --git a/TO_MERGE/agm/Optics/functions/fn_initScope.sqf b/TO_MERGE/agm/Optics/functions/fn_initScope.sqf
new file mode 100644
index 0000000000..f2e078ebbe
--- /dev/null
+++ b/TO_MERGE/agm/Optics/functions/fn_initScope.sqf
@@ -0,0 +1,25 @@
+/*
+ * Original Author: Taosenai
+ * Adapted By: KoffeinFlummi
+ *
+ * Initializes the scope resources.
+ *
+ */
+
+private ["_display"];
+
+// Make sure we only cutRsc when the resource isn't already available
+if (isNil {uiNameSpace getVariable "AGM_Optics_Scope"} or {isNull (uiNameSpace getVariable "AGM_Optics_Scope")}) exitWith {
+ AGM_Optics_scopeRSC cutRsc ["AGM_Optics_Scope","PLAIN",0];
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlSetTextColor [1,1,1,0];
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlSetTextColor [1,1,1,0];
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlSetTextColor [1,1,1,0];
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlSetTextColor [1,1,1,0];
+
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlCommit 0;
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlCommit 0;
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlCommit 0;
+ ((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlCommit 0;
+ True
+};
+False
diff --git a/TO_MERGE/agm/Optics/functions/fn_mainLoop.sqf b/TO_MERGE/agm/Optics/functions/fn_mainLoop.sqf
new file mode 100644
index 0000000000..e73b56db37
--- /dev/null
+++ b/TO_MERGE/agm/Optics/functions/fn_mainLoop.sqf
@@ -0,0 +1,94 @@
+/*
+ * Original Author: Taosenai
+ * Adapted By: KoffeinFlummi
+ *
+ * Monitors the RscInGameUI and displays the overlays when needed.
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ */
+
+if !(cameraOn == AGM_player && {alive AGM_player} && {!visibleMap} && {ctrlShown ((uinamespace getVariable "AGM_OpticsIGUI") displayCtrl 154)}) exitWith {
+ // Failed the state check, hide the scope if it's up
+ if (AGM_Optics_inScope) then {
+ // Hide the scope
+ AGM_Optics_inScope = false;
+ AGM_Optics_inScope_FOV = ([] call cba_fnc_getFOV) select 0;
+
+ [] call AGM_Optics_fnc_hideScope;
+ };
+};
+
+AGM_Optics_Camera setposATL (positioncameratoworld [0,0,0.4]);
+AGM_Optics_Camera camPrepareTarget (positioncameratoworld [0,0,50]);
+AGM_Optics_Camera camCommitPrepared 0;
+
+if (cameraView == "Gunner") then {
+ AGM_Optics_Camera camsetFOV 0.7;
+ AGM_Optics_Camera camcommit 0;
+} else {
+ AGM_Optics_Camera camsetFOV 0.01;
+ AGM_Optics_Camera camcommit 0;
+};
+
+private ["_optic", "_scope"];
+
+disableSerialization;
+
+// Get the name of the attached optic
+_optic = (primaryWeaponItems AGM_player) select 2;
+_scope = uiNameSpace getVariable "AGM_Optics_Scope";
+
+// Init the scope (if needed)
+[] call AGM_Optics_fnc_initScope;
+
+// Check if the optic has changed since we last drew it
+_doUpdateAllLayers = false;
+if (AGM_Optics_currentOptic != _optic) then {
+ AGM_Optics_currentOptic = _optic;
+ _doUpdateAllLayers = true;
+};
+
+// Check if Splendid Camera, unit switch, etc. has blanked out our displays for no good reason (grrr)
+if (ctrlText (_scope displayCtrl 1) == "") then {
+ _doUpdateAllLayers = true;
+};
+
+// Draw the correct layers (don't show them)
+if (_doUpdateAllLayers) then {
+ (_scope displayCtrl 1) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_reticle");
+ (_scope displayCtrl 2) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_reticleIllum");
+ (_scope displayCtrl 5) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_bodyNight");
+ (_scope displayCtrl 6) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_body");
+};
+
+// Stop processing if already in the scope view and FOV hasn't changed
+if (AGM_Optics_inScope) exitwith {};
+
+// Mark that we're in enhanced scope view
+AGM_Optics_inScope = true;
+
+// Calculate lighting
+_lighting = sunOrMoon; // 1 is day, 0 is night
+
+_nightOpacity = 1;
+_dayOpacity = (0 max moonIntensity * (1 - (0 max overcast)))/5;
+
+if (_lighting == 1) then {
+ _nightOpacity = 0;
+ _dayOpacity = 1;
+};
+
+// Apply lighting and make layers visible
+(_scope displayCtrl 1) ctrlSetTextColor [1,1,1,1];
+(_scope displayCtrl 2) ctrlSetTextColor [1,1,1,_nightOpacity];
+(_scope displayCtrl 5) ctrlSetTextColor [1,1,1,_nightOpacity];
+(_scope displayCtrl 6) ctrlSetTextColor [1,1,1,_dayOpacity];
+
+(_scope displayCtrl 1) ctrlCommit 0;
+(_scope displayCtrl 2) ctrlCommit 0;
+(_scope displayCtrl 5) ctrlCommit 0;
+(_scope displayCtrl 6) ctrlCommit 0;
diff --git a/addons/parachute/Gurtgeschirr.p3d b/TO_MERGE/agm/Parachute/Gurtgeschirr.p3d
similarity index 100%
rename from addons/parachute/Gurtgeschirr.p3d
rename to TO_MERGE/agm/Parachute/Gurtgeschirr.p3d
diff --git a/addons/parachute/T10Schirm.p3d b/TO_MERGE/agm/Parachute/T10Schirm.p3d
similarity index 100%
rename from addons/parachute/T10Schirm.p3d
rename to TO_MERGE/agm/Parachute/T10Schirm.p3d
diff --git a/addons/wep_dragon/$PBOPREFIX$ b/TO_MERGE/wep_dragon/$PBOPREFIX$
similarity index 100%
rename from addons/wep_dragon/$PBOPREFIX$
rename to TO_MERGE/wep_dragon/$PBOPREFIX$
diff --git a/addons/wep_dragon/CfgAmmo.hpp b/TO_MERGE/wep_dragon/CfgAmmo.hpp
similarity index 97%
rename from addons/wep_dragon/CfgAmmo.hpp
rename to TO_MERGE/wep_dragon/CfgAmmo.hpp
index 62769fec2b..3798470615 100644
--- a/addons/wep_dragon/CfgAmmo.hpp
+++ b/TO_MERGE/wep_dragon/CfgAmmo.hpp
@@ -1,77 +1,77 @@
-class CfgAmmo {
- class MissileBase;
- class ShellBase;
-
- class ace_m47_dragon_serviceCharge : ShellBase {
- hit = 1;
- indirectHit = 2;
- indirectHitRange = 1;
- typicalSpeed = 100;
- explosive = 1;
- cost = 300;
- model = "\ca\weapons\empty";
- airFriction = 0;
- timeToLive = 1;
- explosionTime = 0.001;
- soundFly[] = {"",1,1};
- soundEngine[] = {"",1,4};
- CraterEffects = "";
- explosionEffects = "ace_m47_serviceExplosion";
- hitarmor[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitbuilding[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitconcrete[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitdefault[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitfoliage[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitglass[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitglassarmored[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitgroundhard[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitgroundsoft[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitiron[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitman[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitmetal[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitmetalplate[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitplastic[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitrubber[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- hitwood[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
- sounddefault1[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject", 56.2341, 1, 1800};
- sounddefault2[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject", 56.2341, 1, 1800};
- sounddefault3[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject", 56.2341, 1, 1800};
- soundHit[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject",56.23413,1,1800};
- };
-
- class M_47_AT_EP1: MissileBase {
- ace_towsmoke = 0; // no trail
- six_tracerenable = 0; // can't find it?
- ace_guidance_type = "dragon";
- soundFly[] = {"",0,1,0};
- soundEngine[] = {"",0,1,0};
- };
-
- class ace_missile_dragon : M_47_AT_EP1 {
- model = QUOTE(PATHTOF(models\dragon.p3d));
- maxSpeed = 120;
- thrust = 0;
- initTime = 0;
- thrustTime = 0;
- sideAirFriction = 0.025;
- explosionEffects = "";
- CraterEffects = "";
- hitarmor[] = {"soundhit", 1};
- hitbuilding[] = {"soundhit", 1};
- hitconcrete[] = {"soundhit", 1};
- hitdefault[] = {"soundhit", 1};
- hitfoliage[] = {"soundhit", 1};
- hitglass[] = {"soundhit", 1};
- hitglassarmored[] = {"soundhit", 1};
- hitgroundhard[] = {"soundhit", 1};
- hitgroundsoft[] = {"soundhit", 1};
- hitiron[] = {"soundhit", 1};
- hitman[] = {"soundhit", 1};
- hitmetal[] = {"soundhit", 1};
- hitmetalplate[] = {"soundhit", 1};
- hitplastic[] = {"soundhit", 1};
- hitrubber[] = {"soundhit", 1};
- hitwood[] = {"soundhit", 1};
- soundhit[] = {"", 0, 1};
- };
+class CfgAmmo {
+ class MissileBase;
+ class ShellBase;
+
+ class ace_m47_dragon_serviceCharge : ShellBase {
+ hit = 1;
+ indirectHit = 2;
+ indirectHitRange = 1;
+ typicalSpeed = 100;
+ explosive = 1;
+ cost = 300;
+ model = "\ca\weapons\empty";
+ airFriction = 0;
+ timeToLive = 1;
+ explosionTime = 0.001;
+ soundFly[] = {"",1,1};
+ soundEngine[] = {"",1,4};
+ CraterEffects = "";
+ explosionEffects = "ace_m47_serviceExplosion";
+ hitarmor[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitbuilding[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitconcrete[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitdefault[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitfoliage[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitglass[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitglassarmored[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitgroundhard[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitgroundsoft[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitiron[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitman[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitmetal[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitmetalplate[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitplastic[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitrubber[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ hitwood[] = {"soundDefault1", 0.33, "soundDefault2", 0.33, "soundDefault3", 0.33};
+ sounddefault1[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject", 56.2341, 1, 1800};
+ sounddefault2[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject", 56.2341, 1, 1800};
+ sounddefault3[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject", 56.2341, 1, 1800};
+ soundHit[] = {"\x\ace\addons\arty_ammunition\Sounds\base_eject",56.23413,1,1800};
+ };
+
+ class M_47_AT_EP1: MissileBase {
+ ace_towsmoke = 0; // no trail
+ six_tracerenable = 0; // can't find it?
+ ace_guidance_type = "dragon";
+ soundFly[] = {"",0,1,0};
+ soundEngine[] = {"",0,1,0};
+ };
+
+ class ace_missile_dragon : M_47_AT_EP1 {
+ model = QUOTE(PATHTOF(models\dragon.p3d));
+ maxSpeed = 120;
+ thrust = 0;
+ initTime = 0;
+ thrustTime = 0;
+ sideAirFriction = 0.025;
+ explosionEffects = "";
+ CraterEffects = "";
+ hitarmor[] = {"soundhit", 1};
+ hitbuilding[] = {"soundhit", 1};
+ hitconcrete[] = {"soundhit", 1};
+ hitdefault[] = {"soundhit", 1};
+ hitfoliage[] = {"soundhit", 1};
+ hitglass[] = {"soundhit", 1};
+ hitglassarmored[] = {"soundhit", 1};
+ hitgroundhard[] = {"soundhit", 1};
+ hitgroundsoft[] = {"soundhit", 1};
+ hitiron[] = {"soundhit", 1};
+ hitman[] = {"soundhit", 1};
+ hitmetal[] = {"soundhit", 1};
+ hitmetalplate[] = {"soundhit", 1};
+ hitplastic[] = {"soundhit", 1};
+ hitrubber[] = {"soundhit", 1};
+ hitwood[] = {"soundhit", 1};
+ soundhit[] = {"", 0, 1};
+ };
};
\ No newline at end of file
diff --git a/addons/wep_dragon/CfgEventhandlers.hpp b/TO_MERGE/wep_dragon/CfgEventhandlers.hpp
similarity index 94%
rename from addons/wep_dragon/CfgEventhandlers.hpp
rename to TO_MERGE/wep_dragon/CfgEventhandlers.hpp
index d22d71eb89..9aea97ee1a 100644
--- a/addons/wep_dragon/CfgEventhandlers.hpp
+++ b/TO_MERGE/wep_dragon/CfgEventhandlers.hpp
@@ -1,11 +1,11 @@
-class Extended_PreInit_EventHandlers {
- class ADDON {
- init = QUOTE(call COMPILE_FILE(XEH_pre_init));
- };
-};
-
-class Extended_PostInit_EventHandlers {
- class ADDON {
- init = QUOTE(call COMPILE_FILE(XEH_post_init));
- };
+class Extended_PreInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_pre_init));
+ };
+};
+
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_post_init));
+ };
};
\ No newline at end of file
diff --git a/addons/wep_dragon/CfgMagazines.hpp b/TO_MERGE/wep_dragon/CfgMagazines.hpp
similarity index 94%
rename from addons/wep_dragon/CfgMagazines.hpp
rename to TO_MERGE/wep_dragon/CfgMagazines.hpp
index 8b00f7b2fb..712e0eb4c6 100644
--- a/addons/wep_dragon/CfgMagazines.hpp
+++ b/TO_MERGE/wep_dragon/CfgMagazines.hpp
@@ -1,7 +1,7 @@
-class CfgMagazines {
- class CA_LauncherMagazine;
-
- class Dragon_EP1: CA_LauncherMagazine {
- model = QUOTE(PATHTOF(models\ace_m47_magazine.p3d));
- };
+class CfgMagazines {
+ class CA_LauncherMagazine;
+
+ class Dragon_EP1: CA_LauncherMagazine {
+ model = QUOTE(PATHTOF(models\ace_m47_magazine.p3d));
+ };
};
\ No newline at end of file
diff --git a/addons/wep_dragon/CfgVehicles.hpp b/TO_MERGE/wep_dragon/CfgVehicles.hpp
similarity index 95%
rename from addons/wep_dragon/CfgVehicles.hpp
rename to TO_MERGE/wep_dragon/CfgVehicles.hpp
index 1d7d3841a7..65081083f6 100644
--- a/addons/wep_dragon/CfgVehicles.hpp
+++ b/TO_MERGE/wep_dragon/CfgVehicles.hpp
@@ -1,64 +1,64 @@
-class CfgVehicles {
- class LandVehicle;
-
- class StaticWeapon : LandVehicle {
- class Turrets;
- };
-
- class StaticATWeapon : StaticWeapon {
- class Turrets: Turrets {
- class MainTurret;
- };
- };
-
- class ACE_M47_Static_Base : StaticATWeapon {
- class Turrets: Turrets {
- class MainTurret : MainTurret {
- class ViewOptics;
- };
- };
- };
-
- class ACE_M47_Static: ACE_M47_Static_Base {
- scope = 1; // Hide it for now
- model = QUOTE(PATHTOF(models\ace_m47_static.p3d));
- displayName = "M47 Dragon";
- class Turrets: Turrets {
- class MainTurret: MainTurret {
- gunnerAction = "LowKORD_Gunner";
- GVAR(tracker) = "TOWLauncherSingle";
- gunnerOpticsModel = "\ca\Weapons_e\optics_m47";
- weapons[] = {"ACE_M47StaticLauncher"};
- magazines[] = {};
- class ViewOptics : ViewOptics {
- initFov = DRAGON_FOV;
- minFov = DRAGON_FOV;
- maxFov = DRAGON_FOV;
- };
- };
- };
- class AnimationSources {
- class rest_rotate {
- source="user";
- animPeriod=0.00001;
- initPhase=-0.35;
- maxValue="3.60";
- minValue="-3.60";
- };
- class optic_hide {
- source="user";
- animPeriod=0.0001;
- initPhase=1;
- maxValue="1";
- minValue="0";
- };
- class missile_hide {
- source="user";
- animPeriod=0.0001;
- initPhase=0;
- maxValue="1";
- minValue="0";
- };
- };
- };
+class CfgVehicles {
+ class LandVehicle;
+
+ class StaticWeapon : LandVehicle {
+ class Turrets;
+ };
+
+ class StaticATWeapon : StaticWeapon {
+ class Turrets: Turrets {
+ class MainTurret;
+ };
+ };
+
+ class ACE_M47_Static_Base : StaticATWeapon {
+ class Turrets: Turrets {
+ class MainTurret : MainTurret {
+ class ViewOptics;
+ };
+ };
+ };
+
+ class ACE_M47_Static: ACE_M47_Static_Base {
+ scope = 1; // Hide it for now
+ model = QUOTE(PATHTOF(models\ace_m47_static.p3d));
+ displayName = "M47 Dragon";
+ class Turrets: Turrets {
+ class MainTurret: MainTurret {
+ gunnerAction = "LowKORD_Gunner";
+ GVAR(tracker) = "TOWLauncherSingle";
+ gunnerOpticsModel = "\ca\Weapons_e\optics_m47";
+ weapons[] = {"ACE_M47StaticLauncher"};
+ magazines[] = {};
+ class ViewOptics : ViewOptics {
+ initFov = DRAGON_FOV;
+ minFov = DRAGON_FOV;
+ maxFov = DRAGON_FOV;
+ };
+ };
+ };
+ class AnimationSources {
+ class rest_rotate {
+ source="user";
+ animPeriod=0.00001;
+ initPhase=-0.35;
+ maxValue="3.60";
+ minValue="-3.60";
+ };
+ class optic_hide {
+ source="user";
+ animPeriod=0.0001;
+ initPhase=1;
+ maxValue="1";
+ minValue="0";
+ };
+ class missile_hide {
+ source="user";
+ animPeriod=0.0001;
+ initPhase=0;
+ maxValue="1";
+ minValue="0";
+ };
+ };
+ };
};
\ No newline at end of file
diff --git a/addons/wep_dragon/CfgWeapons.hpp b/TO_MERGE/wep_dragon/CfgWeapons.hpp
similarity index 96%
rename from addons/wep_dragon/CfgWeapons.hpp
rename to TO_MERGE/wep_dragon/CfgWeapons.hpp
index b873219e04..8f16f0d564 100644
--- a/addons/wep_dragon/CfgWeapons.hpp
+++ b/TO_MERGE/wep_dragon/CfgWeapons.hpp
@@ -1,45 +1,45 @@
-class CfgWeapons {
- class Weapon_Bag_Base;
- class B_AT_01_weapon_F: Weapon_Bag_Base {
- };
- class ACE_M47StaticLauncher: B_AT_01_weapon_F {
- displayName = "M47 Dragon";
- canLock = 0;
- handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons_E\Data\Anim\M47.rtm"};
- sound[] = {"Ca\Sounds_E\Weapons_E\M47\M47_1",3.1622777,1,1200};
- drySound[] = {"Ca\Sounds_E\Weapons_E\M47\dry",0.0001,1,10};
- reloadMagazineSound[] = {"Ca\Sounds_E\Weapons_E\M47\rocket_reload",1.0,1,30};
- soundFly[] = {"",3.1622777,1,500};
- initSpeed = 20;
- magazines[] = {"Dragon_EP1"};
- reloadTime = 0;
- magazineReloadTime = 0;
- };
-
- class Launcher;
- class M47Launcher_EP1: Launcher {
- displayName = "M47 Dragon";
- canlock = 0;
- model = QUOTE(PATHTOF(models\ace_m47_magazine.p3d));
- picture = QUOTE(PATHTOF(textures\m47_dragon_item_ca.paa));
- };
- class ACE_M47_Daysight: M47Launcher_EP1 {
- displayName = $STR_DN_ACE_DRAGONSUP36; // Stay next to tubes in gear dialogs
- model = QUOTE(PATHTOF(models\ace_m47_optic.p3d));
- picture = QUOTE(PATHTOF(textures\m47_daysight_item_ca.paa));
- optics = 1;
- weaponInfoType = "RscWeaponEmpty";
- modelOptics = "\ca\Weapons_e\optics_m47";
- reloadaction = "";
- showSwitchAction = 1;
- useAsBinocular = 1;
- uipicture = "";
- descriptionshort = "SU-36/P Daysight";
- ace_disposable = 0;
- magazines[] = {};
- type = 4096;
- opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
- opticsZoomMin = 0.015;
- opticsZoomMax = 0.015;
- };
+class CfgWeapons {
+ class Weapon_Bag_Base;
+ class B_AT_01_weapon_F: Weapon_Bag_Base {
+ };
+ class ACE_M47StaticLauncher: B_AT_01_weapon_F {
+ displayName = "M47 Dragon";
+ canLock = 0;
+ handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons_E\Data\Anim\M47.rtm"};
+ sound[] = {"Ca\Sounds_E\Weapons_E\M47\M47_1",3.1622777,1,1200};
+ drySound[] = {"Ca\Sounds_E\Weapons_E\M47\dry",0.0001,1,10};
+ reloadMagazineSound[] = {"Ca\Sounds_E\Weapons_E\M47\rocket_reload",1.0,1,30};
+ soundFly[] = {"",3.1622777,1,500};
+ initSpeed = 20;
+ magazines[] = {"Dragon_EP1"};
+ reloadTime = 0;
+ magazineReloadTime = 0;
+ };
+
+ class Launcher;
+ class M47Launcher_EP1: Launcher {
+ displayName = "M47 Dragon";
+ canlock = 0;
+ model = QUOTE(PATHTOF(models\ace_m47_magazine.p3d));
+ picture = QUOTE(PATHTOF(textures\m47_dragon_item_ca.paa));
+ };
+ class ACE_M47_Daysight: M47Launcher_EP1 {
+ displayName = $STR_DN_ACE_DRAGONSUP36; // Stay next to tubes in gear dialogs
+ model = QUOTE(PATHTOF(models\ace_m47_optic.p3d));
+ picture = QUOTE(PATHTOF(textures\m47_daysight_item_ca.paa));
+ optics = 1;
+ weaponInfoType = "RscWeaponEmpty";
+ modelOptics = "\ca\Weapons_e\optics_m47";
+ reloadaction = "";
+ showSwitchAction = 1;
+ useAsBinocular = 1;
+ uipicture = "";
+ descriptionshort = "SU-36/P Daysight";
+ ace_disposable = 0;
+ magazines[] = {};
+ type = 4096;
+ opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
+ opticsZoomMin = 0.015;
+ opticsZoomMax = 0.015;
+ };
};
\ No newline at end of file
diff --git a/addons/wep_dragon/README.md b/TO_MERGE/wep_dragon/README.md
similarity index 100%
rename from addons/wep_dragon/README.md
rename to TO_MERGE/wep_dragon/README.md
diff --git a/addons/wep_dragon/XEH_post_init.sqf b/TO_MERGE/wep_dragon/XEH_post_init.sqf
similarity index 94%
rename from addons/wep_dragon/XEH_post_init.sqf
rename to TO_MERGE/wep_dragon/XEH_post_init.sqf
index 6904ee6c47..a4e4806591 100644
--- a/addons/wep_dragon/XEH_post_init.sqf
+++ b/TO_MERGE/wep_dragon/XEH_post_init.sqf
@@ -1,3 +1,3 @@
-#include "script_component.hpp"
-NO_DEDICATED;
-
+#include "script_component.hpp"
+NO_DEDICATED;
+
diff --git a/addons/wep_dragon/XEH_pre_init.sqf b/TO_MERGE/wep_dragon/XEH_pre_init.sqf
similarity index 94%
rename from addons/wep_dragon/XEH_pre_init.sqf
rename to TO_MERGE/wep_dragon/XEH_pre_init.sqf
index dc30361926..6eccf9d1dd 100644
--- a/addons/wep_dragon/XEH_pre_init.sqf
+++ b/TO_MERGE/wep_dragon/XEH_pre_init.sqf
@@ -1,2 +1,2 @@
-#include "script_component.hpp"
-
+#include "script_component.hpp"
+
diff --git a/addons/wep_dragon/config.cpp b/TO_MERGE/wep_dragon/config.cpp
similarity index 90%
rename from addons/wep_dragon/config.cpp
rename to TO_MERGE/wep_dragon/config.cpp
index f654e815c9..00ea7d4a6c 100644
--- a/addons/wep_dragon/config.cpp
+++ b/TO_MERGE/wep_dragon/config.cpp
@@ -1,17 +1,17 @@
-#include "script_component.hpp"
-
-class CfgPatches {
- class ADDON {
- units[] = { "ACE_M47_Static" };
- weapons[] = { "ACE_M47StaticLauncher", "M47Launcher_EP1", "ACE_M47_Daysight" };
- requiredVersion = REQUIRED_VERSION;
- requiredAddons[] = { "ace_main", "ace_common" };
- VERSION_CONFIG;
- };
-};
-
-#include "CfgEventhandlers.hpp"
-#include "CfgVehicles.hpp"
-#include "CfgWeapons.hpp"
-#include "CfgAmmo.hpp"
+#include "script_component.hpp"
+
+class CfgPatches {
+ class ADDON {
+ units[] = { "ACE_M47_Static" };
+ weapons[] = { "ACE_M47StaticLauncher", "M47Launcher_EP1", "ACE_M47_Daysight" };
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = { "ace_main", "ace_common" };
+ VERSION_CONFIG;
+ };
+};
+
+#include "CfgEventhandlers.hpp"
+#include "CfgVehicles.hpp"
+#include "CfgWeapons.hpp"
+#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
\ No newline at end of file
diff --git a/addons/wep_dragon/functions/fnc_dragon_fired.sqf b/TO_MERGE/wep_dragon/functions/fnc_dragon_fired.sqf
similarity index 97%
rename from addons/wep_dragon/functions/fnc_dragon_fired.sqf
rename to TO_MERGE/wep_dragon/functions/fnc_dragon_fired.sqf
index ff97232aea..1038e64a23 100644
--- a/addons/wep_dragon/functions/fnc_dragon_fired.sqf
+++ b/TO_MERGE/wep_dragon/functions/fnc_dragon_fired.sqf
@@ -1,135 +1,135 @@
-//fnc_fired.sqf
-#include "script_component.hpp"
-#define DRAGON_VELOCITY 100
-#define SERVICE_INTERVAL 0.3
-#define DRAGON_SERVICE_COUNT 60
-#define DRAGON_TRIM 1
-#define TRACKINTERVAL 0.025
-
-if ((_this select 0) == player || {(gunner (_this select 0)) == player}) then {
- if ((typeOf (_this select 6)) == "M_47_AT_EP1") then {
- _missile = (_this select 6);
- _vel = velocity _missile;
- _ppos = getPosASL _missile;
- _missile setPosATL [_ppos select 0, _ppos select 1, 5000];
- _unitVec = _vel call ACE_fnc_unitVector;
- _spawnPos = [(_ppos select 0) + (_unitVec select 0), (_ppos select 1) + (_unitVec select 1), (_ppos select 2) + (_unitVec select 2)];
- _shell = "ace_missile_dragon" createVehicle _spawnPos;
- _this set[6, _shell];
- _shell setPosASL _spawnPos;
-
- _newVel = [_unitVec, DRAGON_VELOCITY*1.25] call ACE_fnc_vectorMultiply;
- _shell setVelocity _newVel;
- _shell setVectorDir _unitVec;
- _gunner = _this select 0;
- //setAccTime 0.2;
-
- [
- {
- _unitVec = (velocity _shell) call ACE_fnc_unitVector;
- _polar = _unitVec call CBA_fnc_vect2polar;
- _spos = getPosATL _shell;
- _ppos = getPosASL _shell;
- _screenPos = if (_spos select 2 > _ppos select 2) then {worldToScreen _ppos} else {worldToScreen _spos};
-
- if (count _screenPos > 0 && {alive _gunner}) then {
- _x = (((_screenPos select 0) - 0.5) max -1) min 1;
- _y = (((_screenPos select 1) - 0.45) max -1) min 1;
- _m = ((_shell distance _gunner)*0.009);
-
- //player sideChat format["x: %1, y: %2 m: %3 di: %4 spd: %5", _x*_m, _y*_m*-1, _m, (_shell distance _gunner), (speed _shell)];
-
- _yDeg = 2.1;
- _xDeg = 1.6;
- _difEl = _yDeg*(_y*_m);
- _difEl = ((_difEl min _yDeg) max (_yDeg*-1));
- if(_difEl < 0) then {
- _difEl = _difEl / 2;
- };
- _dir = _xDeg*(_x*_m)*-1;
- _dir = ((_dir min _xDeg) max (_xDeg*-1));
- _difDir = (_polar select 1) + _dir;
- if (_difDir < 0) then {_difDir = _difDir + 360};
- if (_difDir > 360) then {_difDir = _difDir - 360};
- //drop ["\Ca\Data\Cl_basic","","Billboard",1,5,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,0.25]],[0],0.0,2.0,"","",""];
- _firedAdjust = false;
- _shellVelocity = velocity _shell;
- _speed = (3.6*sqrt((_shellVelocity select 0)^2 + (_shellVelocity select 1)^2 + (_shellVelocity select 2)^2))*0.278;
- //hint format["speed: %1\ndistance: %2\ntime: %3", _speed, (_gunner distance _shell), diag_tickTime-_startTime];
- if (diag_tickTime >= _timerCorrect && {_chargeCount > 0}) then {
- if ((abs _dir) >= _xDeg/2) then {
- _firedAdjust = true;
- _difDir = (_polar select 1) + (_dir*0.25);
- if (_difDir < 0) then {_difDir = _difDir + 360};
- if (_difDir > 360) then {_difDir = _difDir - 360};
- //player sideChat "CORRECT!";
- _timerCorrect = diag_tickTime+(SERVICE_INTERVAL*2);
- _newVel = [DRAGON_VELOCITY, (_difDir), (_polar select 2)+(_difEl*0.25)+DRAGON_TRIM] call CBA_fnc_polar2vect;
- _shell setVelocity _newVel;
- _shell setVectorDir (_newVel call ACE_fnc_unitVector);
- "ace_m47_dragon_serviceCharge" createVehicle (getPos _shell);
- _chargeCount = _chargeCount - 1;
- };
- };
-
- if (!_firedAdjust && {diag_tickTime >= _timer} && {_chargeCount > 0}) then {
- _timer = diag_tickTime+SERVICE_INTERVAL;
-
- _newVel = [DRAGON_VELOCITY, _difDir, (_polar select 2)+(_difEl)+DRAGON_TRIM] call CBA_fnc_polar2vect;
- //_newVel = [(velocity _shell), _newVel] call ACE_fnc_vectorAdd;
- // if(_difEl > 0) then {
- // drop ["\Ca\Data\Cl_basic","","Billboard",1,5,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""];
- // } else {
- // drop ["\Ca\Data\Cl_basic","","Billboard",1,5,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,0,1,1]],[0],0.0,2.0,"","",""];
- // };
- _shell setVelocity _newVel;
- _shell setVectorDir (_newVel call ACE_fnc_unitVector);
-
- // charge FX
- _shellCharge = "ace_m47_dragon_serviceCharge" createVehicle _ppos;
- _shellCharge setPosASL _ppos;
- _chargeCount = _chargeCount - 1;
- };
- };
- _missile setPosATL [_ppos select 0, _ppos select 1, 5000];
- _prevTime = diag_tickTime;
- },
- [_shell,_gunner,_unitVec,_missile],
- 0.0, // delay
- {
- //init
- _shell = _this select 0;
- _gunner = _this select 1;
- _chargeCount = DRAGON_SERVICE_COUNT;
- _timer = diag_tickTime+SERVICE_INTERVAL;
- _timerCorrect = _timer;
- _originalVec = _this select 2;
- _originalPolar = _originalVec call CBA_fnc_vect2polar;
- _targetPolar = +_originalPolar;
- _startTime = diag_tickTime;
- _lastX = 1000;
- _lastY = 1000;
- // Return original missile at explosion
- _missile = _this select 3;
- // start from beginning
- _prevTime = diag_tickTime - TRACKINTERVAL;
- },
- {
- // exit
- if !(isNull _missile) then {
- _missile setVelocity _newVel;
- _missile setVectorDir (_newVel call ACE_fnc_unitVector);
- _missile setPosASL _ppos;
- };
- },
- {
- diag_tickTime - _prevTime > TRACKINTERVAL
- },
- {!alive _shell},
- [
- "_shell", "_gunner", "_chargeCount", "_timer", "_originalVec", "_originalPolar", "_timerCorrect", "_startTime", "_lastX", "_lastY",
- "_missile", "_ppos", "_newVel", "_prevTime"
- ]
- ] call cba_common_fnc_addPerFrameHandlerLogic;
- };
+//fnc_fired.sqf
+#include "script_component.hpp"
+#define DRAGON_VELOCITY 100
+#define SERVICE_INTERVAL 0.3
+#define DRAGON_SERVICE_COUNT 60
+#define DRAGON_TRIM 1
+#define TRACKINTERVAL 0.025
+
+if ((_this select 0) == player || {(gunner (_this select 0)) == player}) then {
+ if ((typeOf (_this select 6)) == "M_47_AT_EP1") then {
+ _missile = (_this select 6);
+ _vel = velocity _missile;
+ _ppos = getPosASL _missile;
+ _missile setPosATL [_ppos select 0, _ppos select 1, 5000];
+ _unitVec = _vel call ACE_fnc_unitVector;
+ _spawnPos = [(_ppos select 0) + (_unitVec select 0), (_ppos select 1) + (_unitVec select 1), (_ppos select 2) + (_unitVec select 2)];
+ _shell = "ace_missile_dragon" createVehicle _spawnPos;
+ _this set[6, _shell];
+ _shell setPosASL _spawnPos;
+
+ _newVel = [_unitVec, DRAGON_VELOCITY*1.25] call ACE_fnc_vectorMultiply;
+ _shell setVelocity _newVel;
+ _shell setVectorDir _unitVec;
+ _gunner = _this select 0;
+ //setAccTime 0.2;
+
+ [
+ {
+ _unitVec = (velocity _shell) call ACE_fnc_unitVector;
+ _polar = _unitVec call CBA_fnc_vect2polar;
+ _spos = getPosATL _shell;
+ _ppos = getPosASL _shell;
+ _screenPos = if (_spos select 2 > _ppos select 2) then {worldToScreen _ppos} else {worldToScreen _spos};
+
+ if (count _screenPos > 0 && {alive _gunner}) then {
+ _x = (((_screenPos select 0) - 0.5) max -1) min 1;
+ _y = (((_screenPos select 1) - 0.45) max -1) min 1;
+ _m = ((_shell distance _gunner)*0.009);
+
+ //player sideChat format["x: %1, y: %2 m: %3 di: %4 spd: %5", _x*_m, _y*_m*-1, _m, (_shell distance _gunner), (speed _shell)];
+
+ _yDeg = 2.1;
+ _xDeg = 1.6;
+ _difEl = _yDeg*(_y*_m);
+ _difEl = ((_difEl min _yDeg) max (_yDeg*-1));
+ if(_difEl < 0) then {
+ _difEl = _difEl / 2;
+ };
+ _dir = _xDeg*(_x*_m)*-1;
+ _dir = ((_dir min _xDeg) max (_xDeg*-1));
+ _difDir = (_polar select 1) + _dir;
+ if (_difDir < 0) then {_difDir = _difDir + 360};
+ if (_difDir > 360) then {_difDir = _difDir - 360};
+ //drop ["\Ca\Data\Cl_basic","","Billboard",1,5,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,0.25]],[0],0.0,2.0,"","",""];
+ _firedAdjust = false;
+ _shellVelocity = velocity _shell;
+ _speed = (3.6*sqrt((_shellVelocity select 0)^2 + (_shellVelocity select 1)^2 + (_shellVelocity select 2)^2))*0.278;
+ //hint format["speed: %1\ndistance: %2\ntime: %3", _speed, (_gunner distance _shell), diag_tickTime-_startTime];
+ if (diag_tickTime >= _timerCorrect && {_chargeCount > 0}) then {
+ if ((abs _dir) >= _xDeg/2) then {
+ _firedAdjust = true;
+ _difDir = (_polar select 1) + (_dir*0.25);
+ if (_difDir < 0) then {_difDir = _difDir + 360};
+ if (_difDir > 360) then {_difDir = _difDir - 360};
+ //player sideChat "CORRECT!";
+ _timerCorrect = diag_tickTime+(SERVICE_INTERVAL*2);
+ _newVel = [DRAGON_VELOCITY, (_difDir), (_polar select 2)+(_difEl*0.25)+DRAGON_TRIM] call CBA_fnc_polar2vect;
+ _shell setVelocity _newVel;
+ _shell setVectorDir (_newVel call ACE_fnc_unitVector);
+ "ace_m47_dragon_serviceCharge" createVehicle (getPos _shell);
+ _chargeCount = _chargeCount - 1;
+ };
+ };
+
+ if (!_firedAdjust && {diag_tickTime >= _timer} && {_chargeCount > 0}) then {
+ _timer = diag_tickTime+SERVICE_INTERVAL;
+
+ _newVel = [DRAGON_VELOCITY, _difDir, (_polar select 2)+(_difEl)+DRAGON_TRIM] call CBA_fnc_polar2vect;
+ //_newVel = [(velocity _shell), _newVel] call ACE_fnc_vectorAdd;
+ // if(_difEl > 0) then {
+ // drop ["\Ca\Data\Cl_basic","","Billboard",1,5,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""];
+ // } else {
+ // drop ["\Ca\Data\Cl_basic","","Billboard",1,5,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,0,1,1]],[0],0.0,2.0,"","",""];
+ // };
+ _shell setVelocity _newVel;
+ _shell setVectorDir (_newVel call ACE_fnc_unitVector);
+
+ // charge FX
+ _shellCharge = "ace_m47_dragon_serviceCharge" createVehicle _ppos;
+ _shellCharge setPosASL _ppos;
+ _chargeCount = _chargeCount - 1;
+ };
+ };
+ _missile setPosATL [_ppos select 0, _ppos select 1, 5000];
+ _prevTime = diag_tickTime;
+ },
+ [_shell,_gunner,_unitVec,_missile],
+ 0.0, // delay
+ {
+ //init
+ _shell = _this select 0;
+ _gunner = _this select 1;
+ _chargeCount = DRAGON_SERVICE_COUNT;
+ _timer = diag_tickTime+SERVICE_INTERVAL;
+ _timerCorrect = _timer;
+ _originalVec = _this select 2;
+ _originalPolar = _originalVec call CBA_fnc_vect2polar;
+ _targetPolar = +_originalPolar;
+ _startTime = diag_tickTime;
+ _lastX = 1000;
+ _lastY = 1000;
+ // Return original missile at explosion
+ _missile = _this select 3;
+ // start from beginning
+ _prevTime = diag_tickTime - TRACKINTERVAL;
+ },
+ {
+ // exit
+ if !(isNull _missile) then {
+ _missile setVelocity _newVel;
+ _missile setVectorDir (_newVel call ACE_fnc_unitVector);
+ _missile setPosASL _ppos;
+ };
+ },
+ {
+ diag_tickTime - _prevTime > TRACKINTERVAL
+ },
+ {!alive _shell},
+ [
+ "_shell", "_gunner", "_chargeCount", "_timer", "_originalVec", "_originalPolar", "_timerCorrect", "_startTime", "_lastX", "_lastY",
+ "_missile", "_ppos", "_newVel", "_prevTime"
+ ]
+ ] call cba_common_fnc_addPerFrameHandlerLogic;
+ };
};
\ No newline at end of file
diff --git a/addons/wep_dragon/functions/script_component.hpp b/TO_MERGE/wep_dragon/functions/script_component.hpp
similarity index 100%
rename from addons/wep_dragon/functions/script_component.hpp
rename to TO_MERGE/wep_dragon/functions/script_component.hpp
diff --git a/addons/wep_dragon/license.txt b/TO_MERGE/wep_dragon/license.txt
similarity index 99%
rename from addons/wep_dragon/license.txt
rename to TO_MERGE/wep_dragon/license.txt
index ff5ec3e450..7113bf4340 100644
--- a/addons/wep_dragon/license.txt
+++ b/TO_MERGE/wep_dragon/license.txt
@@ -1,79 +1,79 @@
-License (short)
-===============
-
-You are free:
-- to Share — to copy, distribute and transmit the work
-
-Under the following conditions:
-- Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
-- Noncommercial — You may not use this work for commercial purposes.
-- No Derivative Works — You may not alter, transform, or build upon this work.
-
-With the understanding that:
-
-Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
-
-Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
-
-Other Rights — In no way are any of the following rights affected by the license:
- - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
- - The author's moral rights;
- - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
-
-Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
-
-
-Full license text
-=================
-
-THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
-
-BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
-
-1. Definitions
-
-"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
-"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
-"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
-"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
-"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
-"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
-"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
-"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
-"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
-2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
-
-3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
-
-to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
-to Distribute and Publicly Perform the Work including as incorporated in Collections.
-The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
-
-4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
-
-You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
-You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
-If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
-For the avoidance of doubt:
-
-Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
-Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
-Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
-Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
-5. Representations, Warranties and Disclaimer
-
-UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
-
-6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. Termination
-
-This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
-Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
-8. Miscellaneous
-
-Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
-If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
-This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
-The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+License (short)
+===============
+
+You are free:
+- to Share — to copy, distribute and transmit the work
+
+Under the following conditions:
+- Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
+- Noncommercial — You may not use this work for commercial purposes.
+- No Derivative Works — You may not alter, transform, or build upon this work.
+
+With the understanding that:
+
+Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
+
+Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
+
+Other Rights — In no way are any of the following rights affected by the license:
+ - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
+ - The author's moral rights;
+ - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
+
+Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
+
+
+Full license text
+=================
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+to Distribute and Publicly Perform the Work including as incorporated in Collections.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
diff --git a/addons/wep_dragon/model.cfg b/TO_MERGE/wep_dragon/model.cfg
similarity index 95%
rename from addons/wep_dragon/model.cfg
rename to TO_MERGE/wep_dragon/model.cfg
index 6aeaf2e95e..7c113bf821 100644
--- a/addons/wep_dragon/model.cfg
+++ b/TO_MERGE/wep_dragon/model.cfg
@@ -1,96 +1,96 @@
-class CfgSkeletons {
- class Default {
- isDiscrete = 1;
- skeletonInherit = "";
- skeletonBones[] = {};
- };
-
- class ace_m47_static_skeleton: Default {
- skeletonInherit = "Default";
- skeletonBones[] = {
- "bipod","",
- "grav_box","bipod",
- "launcher","grav_box",
- "optic","launcher",
- "missile","launcher"
- };
- };
-};
-
-class CfgModels {
- class Default {
- sectionsInherit = "";
- sections[] = {};
- };
-
- class ace_m47_static: Default {
- sectionsInherit = "Default";
- sections[] = {};
- skeletonName = "ace_m47_static_skeleton";
- class Animations {
- class MainGun {
- type="rotation";
- selection="launcher";
- sourceAddress = "clamp";
- source="MainGun";
- axis="elevate_axis";
- animPeriod=0.01;
- initPhase=0;
- maxValue="rad 360";
- minValue="rad -360";
- angle1="rad 360";
- angle0="rad -360";
- };
- class MainTurret {
- type="rotation";
- source="MainTurret";
- selection="bipod";
- sourceAddress = "loop";
- axis="rotate_axis";
- animPeriod=0.005;
- minValue="rad -360";
- maxValue="rad +360";
- angle0="rad -360";
- angle1="rad +360";
- };
- class rest_rotate {
- type="rotation";
- selection="grav_box";
- sourceAddress = "clamp";
- source="user";
- axis="elevate_axis";
- animPeriod=0.00001;
- initPhase=-0.35;
- maxValue="3.60";
- minValue="-3.60";
- angle1="rad -360";
- angle0="rad 360";
- };
- class optic_hide
- {
- type = "hide";
- source = "user";
- selection = "optic";
- animPeriod = 0.0001;
- minValue = 0;
- maxValue = 1;
- minPhase = 0;
- maxPhase = 1;
- hideValue = 0.99;
- initPhase = 1;
- };
- class missile_hide
- {
- type = "hide";
- source = "user";
- selection = "missile";
- animPeriod = 0.0001;
- minValue = 0;
- maxValue = 1;
- minPhase = 0;
- maxPhase = 1;
- hideValue = 0.99;
- };
- };
- };
-};
+class CfgSkeletons {
+ class Default {
+ isDiscrete = 1;
+ skeletonInherit = "";
+ skeletonBones[] = {};
+ };
+
+ class ace_m47_static_skeleton: Default {
+ skeletonInherit = "Default";
+ skeletonBones[] = {
+ "bipod","",
+ "grav_box","bipod",
+ "launcher","grav_box",
+ "optic","launcher",
+ "missile","launcher"
+ };
+ };
+};
+
+class CfgModels {
+ class Default {
+ sectionsInherit = "";
+ sections[] = {};
+ };
+
+ class ace_m47_static: Default {
+ sectionsInherit = "Default";
+ sections[] = {};
+ skeletonName = "ace_m47_static_skeleton";
+ class Animations {
+ class MainGun {
+ type="rotation";
+ selection="launcher";
+ sourceAddress = "clamp";
+ source="MainGun";
+ axis="elevate_axis";
+ animPeriod=0.01;
+ initPhase=0;
+ maxValue="rad 360";
+ minValue="rad -360";
+ angle1="rad 360";
+ angle0="rad -360";
+ };
+ class MainTurret {
+ type="rotation";
+ source="MainTurret";
+ selection="bipod";
+ sourceAddress = "loop";
+ axis="rotate_axis";
+ animPeriod=0.005;
+ minValue="rad -360";
+ maxValue="rad +360";
+ angle0="rad -360";
+ angle1="rad +360";
+ };
+ class rest_rotate {
+ type="rotation";
+ selection="grav_box";
+ sourceAddress = "clamp";
+ source="user";
+ axis="elevate_axis";
+ animPeriod=0.00001;
+ initPhase=-0.35;
+ maxValue="3.60";
+ minValue="-3.60";
+ angle1="rad -360";
+ angle0="rad 360";
+ };
+ class optic_hide
+ {
+ type = "hide";
+ source = "user";
+ selection = "optic";
+ animPeriod = 0.0001;
+ minValue = 0;
+ maxValue = 1;
+ minPhase = 0;
+ maxPhase = 1;
+ hideValue = 0.99;
+ initPhase = 1;
+ };
+ class missile_hide
+ {
+ type = "hide";
+ source = "user";
+ selection = "missile";
+ animPeriod = 0.0001;
+ minValue = 0;
+ maxValue = 1;
+ minPhase = 0;
+ maxPhase = 1;
+ hideValue = 0.99;
+ };
+ };
+ };
+};
diff --git a/addons/wep_dragon/models/ace_m47_magazine.p3d b/TO_MERGE/wep_dragon/models/ace_m47_magazine.p3d
similarity index 100%
rename from addons/wep_dragon/models/ace_m47_magazine.p3d
rename to TO_MERGE/wep_dragon/models/ace_m47_magazine.p3d
diff --git a/addons/wep_dragon/models/ace_m47_optic.p3d b/TO_MERGE/wep_dragon/models/ace_m47_optic.p3d
similarity index 100%
rename from addons/wep_dragon/models/ace_m47_optic.p3d
rename to TO_MERGE/wep_dragon/models/ace_m47_optic.p3d
diff --git a/addons/wep_dragon/models/ace_m47_static.p3d b/TO_MERGE/wep_dragon/models/ace_m47_static.p3d
similarity index 100%
rename from addons/wep_dragon/models/ace_m47_static.p3d
rename to TO_MERGE/wep_dragon/models/ace_m47_static.p3d
diff --git a/addons/wep_dragon/models/dragon.p3d b/TO_MERGE/wep_dragon/models/dragon.p3d
similarity index 100%
rename from addons/wep_dragon/models/dragon.p3d
rename to TO_MERGE/wep_dragon/models/dragon.p3d
diff --git a/addons/wep_dragon/script_component.hpp b/TO_MERGE/wep_dragon/script_component.hpp
similarity index 95%
rename from addons/wep_dragon/script_component.hpp
rename to TO_MERGE/wep_dragon/script_component.hpp
index 1898fac04c..e593c3d367 100644
--- a/addons/wep_dragon/script_component.hpp
+++ b/TO_MERGE/wep_dragon/script_component.hpp
@@ -1,12 +1,12 @@
-#define COMPONENT wep_dragon
-#include "\z\ace\Addons\main\script_mod.hpp"
-
-#ifdef DEBUG_ENABLED_WEP_DRAGON
- #define DEBUG_MODE_FULL
-#endif
-
-#ifdef DEBUG_SETTINGS_WEP_DRAGON
- #define DEBUG_SETTINGS DEBUG_SETTINGS_WEP_DRAGON
-#endif
-
-#include "\z\ace\Addons\main\script_macros.hpp"
+#define COMPONENT wep_dragon
+#include "\z\ace\Addons\main\script_mod.hpp"
+
+#ifdef DEBUG_ENABLED_WEP_DRAGON
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_SETTINGS_WEP_DRAGON
+ #define DEBUG_SETTINGS DEBUG_SETTINGS_WEP_DRAGON
+#endif
+
+#include "\z\ace\Addons\main\script_macros.hpp"
diff --git a/addons/wep_dragon/textures/dragon_text.paa b/TO_MERGE/wep_dragon/textures/dragon_text.paa
similarity index 100%
rename from addons/wep_dragon/textures/dragon_text.paa
rename to TO_MERGE/wep_dragon/textures/dragon_text.paa
diff --git a/addons/wep_dragon/textures/m47_daysight_item_ca.paa b/TO_MERGE/wep_dragon/textures/m47_daysight_item_ca.paa
similarity index 100%
rename from addons/wep_dragon/textures/m47_daysight_item_ca.paa
rename to TO_MERGE/wep_dragon/textures/m47_daysight_item_ca.paa
diff --git a/addons/wep_dragon/textures/m47_dragon_item_ca.paa b/TO_MERGE/wep_dragon/textures/m47_dragon_item_ca.paa
similarity index 100%
rename from addons/wep_dragon/textures/m47_dragon_item_ca.paa
rename to TO_MERGE/wep_dragon/textures/m47_dragon_item_ca.paa
diff --git a/ace_fcs.dll b/ace_fcs.dll
index 9907d9e1a0..7c222dc1d7 100644
Binary files a/ace_fcs.dll and b/ace_fcs.dll differ
diff --git a/addons/aircraft/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp
index 5f419506c0..e9fb90e61e 100644
--- a/addons/aircraft/CfgVehicles.hpp
+++ b/addons/aircraft/CfgVehicles.hpp
@@ -217,9 +217,8 @@ class CfgVehicles {
};*/
};
- class I_Heli_Transport_02_F: Heli_Transport_02_base_F {};
-
- class I_Heli_light_03_base_F: Helicopter_Base_F {
+ class Heli_light_03_base_F: Helicopter_Base_F {};
+ class I_Heli_light_03_base_F: Heli_light_03_base_F {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@@ -242,15 +241,15 @@ class CfgVehicles {
};
};
- class I_Heli_light_03_F: I_Heli_light_03_base_F {
+ class I_Heli_light_03_F: Heli_light_03_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
- class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {};
+ class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {};
- class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {};
+ class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {};
class Plane_CAS_01_base_F: Plane_Base_F {
lockDetectionSystem = 12;
@@ -303,7 +302,8 @@ class CfgVehicles {
};*/
};
- class B_Heli_Transport_03_base_F: Helicopter_Base_H {
+ class Heli_Transport_03_base_F: Helicopter_Base_H {};
+ class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@@ -317,7 +317,7 @@ class CfgVehicles {
};
};
- class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {
+ class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F {
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp
index b681c0f7f7..15eca2fb62 100644
--- a/addons/attach/CfgVehicles.hpp
+++ b/addons/attach/CfgVehicles.hpp
@@ -2,14 +2,11 @@
#define MACRO_ATTACHTOVEHICLE \
class ACE_Actions { \
class ACE_MainActions { \
- selection = ""; \
- distance = 5; \
- condition = "true"; \
class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
- exceptions[] = {"ACE_Drag_isNotDragging"}; \
+ exceptions[] = {"isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
@@ -19,7 +16,7 @@
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
- exceptions[] = {"ACE_Drag_isNotDragging"}; \
+ exceptions[] = {"isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \
@@ -60,7 +57,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
- exceptions[] = {"ACE_Drag_isNotDragging"};
+ exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
@@ -70,7 +67,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
- exceptions[] = {"ACE_Drag_isNotDragging"};
+ exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\detach_ca.paa);
diff --git a/addons/attach/config.cpp b/addons/attach/config.cpp
index dd7e1add3b..e8983cefde 100644
--- a/addons/attach/config.cpp
+++ b/addons/attach/config.cpp
@@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
- author[] = {"KoffeinFlummi","eRazeri","CAA-Picard"};
+ author[] = {"KoffeinFlummi","eRazeri","esteldunedain"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf
index 3aa06bacc2..655cac598b 100644
--- a/addons/attach/functions/fnc_attach.sqf
+++ b/addons/attach/functions/fnc_attach.sqf
@@ -1,5 +1,5 @@
/*
- * Author: eRazeri and CAA-Picard
+ * Author: eRazeri and esteldunedain
* Attach an item to the unit
*
* Arguments:
diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf
index 8fb9e3cc9c..7b0d82dec1 100644
--- a/addons/attach/functions/fnc_detach.sqf
+++ b/addons/attach/functions/fnc_detach.sqf
@@ -1,5 +1,5 @@
/*
- * Author: eRazeri and CAA-Picard
+ * Author: eRazeri and esteldunedain
* Detach an item from a unit
*
* Arguments:
diff --git a/addons/attach/functions/fnc_openAttachUI.sqf b/addons/attach/functions/fnc_openAttachUI.sqf
index 5533956bb6..1b95be9b84 100644
--- a/addons/attach/functions/fnc_openAttachUI.sqf
+++ b/addons/attach/functions/fnc_openAttachUI.sqf
@@ -62,6 +62,5 @@ _attachables = items _unit;
},
{
call EFUNC(interaction,hideMenu);
- if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
] call EFUNC(interaction,openSelectMenu);
diff --git a/addons/backpacks/$PBOPREFIX$ b/addons/backpacks/$PBOPREFIX$
new file mode 100644
index 0000000000..99e61f20d4
--- /dev/null
+++ b/addons/backpacks/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\backpacks
\ No newline at end of file
diff --git a/addons/lockbackpacks/CfgEventHandlers.hpp b/addons/backpacks/CfgEventHandlers.hpp
similarity index 74%
rename from addons/lockbackpacks/CfgEventHandlers.hpp
rename to addons/backpacks/CfgEventHandlers.hpp
index 9a26e6f614..1aad146690 100644
--- a/addons/lockbackpacks/CfgEventHandlers.hpp
+++ b/addons/backpacks/CfgEventHandlers.hpp
@@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers {
};
};
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_postInit));
+ };
+};
+
class Extended_InventoryOpened_EventHandlers {
class CAManBase {
class GVAR(onOpenInventory) {
diff --git a/addons/lockbackpacks/README.md b/addons/backpacks/README.md
similarity index 100%
rename from addons/lockbackpacks/README.md
rename to addons/backpacks/README.md
diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf
new file mode 100644
index 0000000000..375fcd5f89
--- /dev/null
+++ b/addons/backpacks/XEH_postInit.sqf
@@ -0,0 +1,3 @@
+#include "script_component.hpp"
+
+["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
diff --git a/addons/lockbackpacks/XEH_preInit.sqf b/addons/backpacks/XEH_preInit.sqf
similarity index 86%
rename from addons/lockbackpacks/XEH_preInit.sqf
rename to addons/backpacks/XEH_preInit.sqf
index c474ff625a..a47825d0b0 100644
--- a/addons/lockbackpacks/XEH_preInit.sqf
+++ b/addons/backpacks/XEH_preInit.sqf
@@ -2,6 +2,7 @@
ADDON = false;
+PREP(backpackOpened);
PREP(getBackpackAssignedUnit);
PREP(isBackpack);
PREP(onOpenInventory);
diff --git a/addons/lockbackpacks/config.cpp b/addons/backpacks/config.cpp
similarity index 78%
rename from addons/lockbackpacks/config.cpp
rename to addons/backpacks/config.cpp
index 0224b4b237..ddc7639921 100644
--- a/addons/lockbackpacks/config.cpp
+++ b/addons/backpacks/config.cpp
@@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
- requiredAddons[] = {"ace_common","ace_interaction"};
+ requiredAddons[] = {"ace_common"};
author[] = {"bux","commy2"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
@@ -13,4 +13,3 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
-#include "CfgVehicles.hpp"
diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf
new file mode 100644
index 0000000000..186202027f
--- /dev/null
+++ b/addons/backpacks/functions/fnc_backpackOpened.sqf
@@ -0,0 +1,51 @@
+/*
+ * Author: commy2
+ *
+ * Someone opened your backpack. Execute locally.
+ *
+ * Argument:
+ * 0: Who accessed your inventory? (Object)
+ * 1: Unit that wields the backpack (Object)
+ * 2: The backpack object (Object)
+ *
+ * Return value:
+ * None.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+_backpack = _this select 2;
+
+// do cam shake if the target is the player
+if ([_target] call EFUNC(common,isPlayer)) then {
+ addCamShake [4, 0.5, 5];
+};
+
+// play a rustling sound
+private ["_sounds", "_position"];
+
+_sounds = [
+ /*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
+ "a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
+ "a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
+ "a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
+
+ QUOTE(PATHTO_R(sounds\zip_in.wav)),
+ QUOTE(PATHTO_R(sounds\zip_out.wav))
+];
+
+_position = _target modelToWorld (_target selectionPosition "Spine3");
+_position = _position call EFUNC(common,positionToASL);
+
+playSound3D [
+ _sounds select floor random count _sounds,
+ objNull,
+ false,
+ _position,
+ 1,
+ 1,
+ 50
+];
diff --git a/addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf
similarity index 100%
rename from addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf
rename to addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf
diff --git a/addons/lockbackpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf
similarity index 100%
rename from addons/lockbackpacks/functions/fnc_isBackpack.sqf
rename to addons/backpacks/functions/fnc_isBackpack.sqf
diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf
new file mode 100644
index 0000000000..63e4aa87a3
--- /dev/null
+++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf
@@ -0,0 +1,30 @@
+/*
+ * Author: commy2
+ *
+ * Handle the open inventory event. Display message on traget client.
+ *
+ * Argument:
+ * Input from "InventoryOpened" eventhandler
+ *
+ * Return value:
+ * false. Always open the inventory dialog. (Bool)
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_backpack"];
+
+_unit = _this select 0;
+_backpack = _this select 1;
+
+// exit if the target is not a backpack
+if !([_backpack] call FUNC(isBackpack)) exitWith {};
+
+// get the unit that wears the backpack object
+private "_target";
+_target = [_backpack] call FUNC(getBackpackAssignedUnit);
+
+// raise event on target unit
+["backpackOpened", _target, [_unit, _target, _backpack]] call EFUNC(common,targetEvent);
+
+// return false to open inventory as usual
+false
diff --git a/addons/backpacks/functions/script_component.hpp b/addons/backpacks/functions/script_component.hpp
new file mode 100644
index 0000000000..b6bb78fff5
--- /dev/null
+++ b/addons/backpacks/functions/script_component.hpp
@@ -0,0 +1 @@
+#include "\z\ace\addons\backpacks\script_component.hpp"
\ No newline at end of file
diff --git a/addons/backpacks/script_component.hpp b/addons/backpacks/script_component.hpp
new file mode 100644
index 0000000000..2837367bfb
--- /dev/null
+++ b/addons/backpacks/script_component.hpp
@@ -0,0 +1,12 @@
+#define COMPONENT backpacks
+#include "\z\ace\addons\main\script_mod.hpp"
+
+#ifdef DEBUG_ENABLED_BACKPACKS
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_ENABLED_BACKPACKS
+ #define DEBUG_SETTINGS DEBUG_ENABLED_BACKPACKS
+#endif
+
+#include "\z\ace\addons\main\script_macros.hpp"
\ No newline at end of file
diff --git a/addons/backpacks/sounds/zip_in.wav b/addons/backpacks/sounds/zip_in.wav
new file mode 100644
index 0000000000..b93549310a
Binary files /dev/null and b/addons/backpacks/sounds/zip_in.wav differ
diff --git a/addons/backpacks/sounds/zip_out.wav b/addons/backpacks/sounds/zip_out.wav
new file mode 100644
index 0000000000..b671c118a3
Binary files /dev/null and b/addons/backpacks/sounds/zip_out.wav differ
diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp
index 722750f915..0ce09280a7 100644
--- a/addons/captives/CfgEventHandlers.hpp
+++ b/addons/captives/CfgEventHandlers.hpp
@@ -9,7 +9,6 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
-
//release escorted captive when entering a vehicle
class Extended_GetIn_EventHandlers {
class All {
@@ -18,7 +17,6 @@ class Extended_GetIn_EventHandlers {
};
};
};
-
//reset captive animation after leaving vehicle
class Extended_GetOut_EventHandlers {
class All {
@@ -27,7 +25,6 @@ class Extended_GetOut_EventHandlers {
};
};
};
-
//reset captivity and escorting status when getting killed
class Extended_Killed_EventHandlers {
class CAManBase {
@@ -36,7 +33,6 @@ class Extended_Killed_EventHandlers {
};
};
};
-
//mission start
class Extended_InitPost_EventHandlers {
class CAManBase {
@@ -45,4 +41,3 @@ class Extended_InitPost_EventHandlers {
};
};
};
-
diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp
index 6e67f3615b..d60fab5a33 100644
--- a/addons/captives/CfgMoves.hpp
+++ b/addons/captives/CfgMoves.hpp
@@ -72,7 +72,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
InterpolateTo[] = {"Unconscious",0.01};
};
class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
- speed = 0.333; //for gameplay reasons, slow this down
+ speed = 0.5; //for gameplay reasons, slow this down
actions = "CivilStandActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp
index 57f9644a4a..89ab74d5bb 100644
--- a/addons/captives/CfgVehicles.hpp
+++ b/addons/captives/CfgVehicles.hpp
@@ -2,34 +2,26 @@ class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_Actions {
- class ACE_RightHandActions {
+
+ class ACE_ApplyHandcuffs {
+ displayName = "$STR_ACE_Captives_SetCaptive";
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 {
- displayName = "$STR_ACE_Captives_SetCaptive";
- distance = 4;
- condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
- statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
- exceptions[] = {};
- showDisabled = 0;
- priority = 2.4;
- icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
- hotkey = "C";
- };
- class ACE_RemoveHandcuffs {
- displayName = "$STR_ACE_Captives_ReleaseCaptive";
- distance = 4;
- condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
- statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
- exceptions[] = {};
- showDisabled = 0;
- priority = 2.4;
- icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
- hotkey = "R";
- };
+ distance = 2;
+ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
+ statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
+ exceptions[] = {};
+ icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
};
+ class ACE_RemoveHandcuffs {
+ displayName = "$STR_ACE_Captives_ReleaseCaptive";
+ selection = "righthand";
+ distance = 2;
+ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
+ statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
+ exceptions[] = {};
+ icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
+ };
+
class ACE_MainActions {
class ACE_EscortCaptive {
displayName = "$STR_ACE_Captives_EscortCaptive";
@@ -47,7 +39,7 @@ class CfgVehicles {
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
- exceptions[] = {QGVAR(isNotEscorting)};
+ exceptions[] = {"isNotEscorting"};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3;
@@ -58,7 +50,7 @@ class CfgVehicles {
distance = 4;
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
- exceptions[] = {QGVAR(isNotEscorting)};
+ exceptions[] = {"isNotEscorting"};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2;
@@ -82,7 +74,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Captives_StopEscorting";
condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive));
- exceptions[] = {QGVAR(isNotEscorting)};
+ exceptions[] = {"isNotEscorting"};
showDisabled = 0;
priority = 2.3;
hotkey = "C";
@@ -90,7 +82,7 @@ class CfgVehicles {
class ACE_StartSurrenderingSelf {
displayName = "$STR_ACE_Captives_StartSurrendering";
condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender));
- statement = QUOTE([ARR_2(_player, true)] call FUNC(surrender));
+ statement = QUOTE([ARR_2(_player, true)] call FUNC(setSurrendered));
exceptions[] = {};
showDisabled = 0;
priority = 0;
@@ -98,8 +90,8 @@ class CfgVehicles {
class ACE_StopSurrenderingSelf {
displayName = "$STR_ACE_Captives_StopSurrendering";
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
- statement = QUOTE([ARR_2(_player, false)] call FUNC(surrender));
- exceptions[] = {QGVAR(isNotSurrendering)};
+ statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
+ exceptions[] = {"isNotSurrendering"};
showDisabled = 0;
priority = 0;
};
@@ -115,7 +107,7 @@ class CfgVehicles {
distance = 4; \
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
- exceptions[] = {QGVAR(isNotEscorting)}; \
+ exceptions[] = {"isNotEscorting"}; \
showDisabled = 0; \
priority = 1.2; \
hotkey = "L"; \
@@ -162,15 +154,10 @@ class CfgVehicles {
MACRO_LOADUNLOADCAPTIVE
};
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
- };
-
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
- MACRO_ADDITEM(ACE_CableTie,12)
+ MACRO_ADDITEM(ACE_CableTie,12);
};
};
@@ -191,7 +178,7 @@ class CfgVehicles {
curatorCost = 0; //???
isGlobal = 1; //run global
isTriggerActivated = 1; //Wait for triggers
- // icon = QUOTE(PATHTOF(ui\todo.paa));
+ icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
functionPriority = 0;
class Arguments {};
class ModuleDescription: ModuleDescription {
diff --git a/addons/captives/UI/Icon_Module_Make_Unit_Surrender_ca.paa b/addons/captives/UI/Icon_Module_Make_Unit_Surrender_ca.paa
new file mode 100644
index 0000000000..1f030359ec
Binary files /dev/null and b/addons/captives/UI/Icon_Module_Make_Unit_Surrender_ca.paa differ
diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf
index 9d1a242d4d..651edbcf86 100644
--- a/addons/captives/XEH_postInit.sqf
+++ b/addons/captives/XEH_postInit.sqf
@@ -1,12 +1,9 @@
#include "script_component.hpp"
-["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
-["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
-["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
-["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
//Handles when someone starts escorting and then disconnects, leaving the captive attached
//This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
+
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
PARAMS_1(_disconnectedPlayer);
@@ -21,12 +18,20 @@ if (isServer) then {
}];
};
-//TODO: Medical Integration Events???
+["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler);
+["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler);
+["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
+["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
+["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
-// [_unit, "knockedOut", {
-// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
-// }] call ACE_Core_fnc_addCustomEventhandler;
+["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
+["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
-// [_unit, "wokeUp", {
-// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
-// }] call ACE_Core_fnc_addCustomEventhandler;
+//Medical Integration Events???
+["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
+
+if (!hasInterface) exitWith {};
+
+["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
+["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
+["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);
diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf
index 75ee77e9bc..c09f81e51b 100644
--- a/addons/captives/XEH_preInit.sqf
+++ b/addons/captives/XEH_preInit.sqf
@@ -19,13 +19,13 @@ PREP(doUnloadCaptive);
PREP(handleGetIn);
PREP(handleGetOut);
PREP(handleKilled);
-PREP(handleKnockedOut);
+PREP(handleOnUnconscious);
PREP(handlePlayerChanged);
PREP(handleUnitInitPost);
-PREP(handleWokeUp);
+PREP(handleZeusDisplayChanged);
PREP(moduleSurrender);
PREP(setHandcuffed);
-PREP(surrender);
+PREP(setSurrendered);
PREP(vehicleCaptiveMoveIn);
PREP(vehicleCaptiveMoveOut);
diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp
index 27b7c4ec60..57de6ee970 100644
--- a/addons/captives/config.cpp
+++ b/addons/captives/config.cpp
@@ -16,16 +16,3 @@ class CfgPatches {
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
-
-
-class ACE_canInteractConditions {
- class GVAR(isNotEscorting) {
- condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false)));
- };
- class GVAR(isNotHandcuffed) {
- condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false)));
- };
- class GVAR(isNotSurrendering) {
- condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false)));
- };
-};
diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf
index 238087c62b..3ee687cfc1 100644
--- a/addons/captives/functions/fnc_canSurrender.sqf
+++ b/addons/captives/functions/fnc_canSurrender.sqf
@@ -18,5 +18,12 @@
PARAMS_2(_unit,_newSurrenderState);
-//TODO: any other conditions??
-(!((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _newSurrenderState))
+private "_returnValue";
+
+_returnValue = if (_newSurrenderState) then {
+ !(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
+} else {
+ (_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
+};
+
+_returnValue
diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf
index 299aa81631..08f44a1437 100644
--- a/addons/captives/functions/fnc_doEscortCaptive.sqf
+++ b/addons/captives/functions/fnc_doEscortCaptive.sqf
@@ -51,7 +51,7 @@ if (_state) then {
_unit setVariable [QGVAR(escortedUnit), objNull, true];
};
};
- [_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
+ [_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
} else {
_unit setVariable [QGVAR(isEscorting), false, true];
diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf
index 54133e2362..cf7d2c7271 100644
--- a/addons/captives/functions/fnc_handleGetIn.sqf
+++ b/addons/captives/functions/fnc_handleGetIn.sqf
@@ -19,6 +19,12 @@
PARAMS_3(_vehicle,_dontcare,_unit);
-if ((local _unit) && (_unit getVariable [QGVAR(isEscorting), false])) then {
- _unit setVariable [QGVAR(isEscorting), false, true];
+if (local _unit) then {
+ if (_unit getVariable [QGVAR(isEscorting), false]) then {
+ _unit setVariable [QGVAR(isEscorting), false, true];
+ };
+
+ if (_unit getVariable [QGVAR(isSurrendering), false]) then {
+ [_unit, false] call FUNC(setSurrender);
+ };
};
diff --git a/addons/captives/functions/fnc_handleKnockedOut.sqf b/addons/captives/functions/fnc_handleKnockedOut.sqf
deleted file mode 100644
index 3257d544ca..0000000000
--- a/addons/captives/functions/fnc_handleKnockedOut.sqf
+++ /dev/null
@@ -1,2 +0,0 @@
-// by commy2
-
diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf
new file mode 100644
index 0000000000..9b73d34485
--- /dev/null
+++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf
@@ -0,0 +1,36 @@
+/*
+ * Author: commy2, PabstMirror
+ * Handles the "medical_onUnconscious" event
+ *
+ * Arguments:
+ * 0: Unit
+ * 0: Is Unconsisisiouses
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [bob, true] call ACE_captives_fnc_handleOnUnconscious
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+PARAMS_2(_unit,_isUnconc);
+
+if (!local _unit) exitWith {};
+
+systemChat format ["med: %1", _this];
+
+if (_isUnconc) then {
+ //Knocked out: If surrendering, stop
+ if (_unit getVariable [QGVAR(isSurrendering), false]) then {
+ [_unit, false] call FUNC(setSurrendered);
+ };
+} else {
+ //Woke up: if handcuffed, goto animation
+ if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
+ [_unit] call EFUNC(common,fixLoweredRifleAnimation);
+ [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
+ };
+};
diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf
index 13e284ef80..21fd1e1ec3 100644
--- a/addons/captives/functions/fnc_handlePlayerChanged.sqf
+++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf
@@ -18,10 +18,16 @@
PARAMS_2(_newUnit,_oldUnit);
+//set showHUD based on new unit status:
if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {
TRACE_1("Player Change (showHUD false)",_newUnit);
- showHUD false;
+ showHUD false;
} else {
TRACE_1("Player Change (showHUD true)",_newUnit);
showHUD true;
};
+
+//If old player was escorting, stop
+if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
+ _oldUnit setVariable [QGVAR(isEscorting), false, true];
+};
diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf
index 1a5a8f2ecd..a8b601300a 100644
--- a/addons/captives/functions/fnc_handleUnitInitPost.sqf
+++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf
@@ -29,6 +29,6 @@ if (local _unit) then {
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
_unit setVariable [QGVAR(isSurrendering), false];
- [_unit, true] call FUNC(surrender);
+ [_unit, true] call FUNC(setSurrendered);
};
};
diff --git a/addons/captives/functions/fnc_handleWokeUp.sqf b/addons/captives/functions/fnc_handleWokeUp.sqf
deleted file mode 100644
index 9bf2e1a2bc..0000000000
--- a/addons/captives/functions/fnc_handleWokeUp.sqf
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Author: commy2
- * TODO
- *
- * Arguments:
- * 0: _unit
- *
- * Return Value:
- * The return value
- *
- * Example:
- * [bob] call ACE_captives_fnc_handleWokeUp
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-PARAMS_1(_unit);
-
-if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
- [_unit] call EFUNC(common,fixLoweredRifleAnimation);
- [_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
-};
diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf
new file mode 100644
index 0000000000..84b90e78c2
--- /dev/null
+++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf
@@ -0,0 +1,31 @@
+/*
+ * Author: PabstMirror
+ * Handles ZeusDisplayChanged event
+ * Need to reset showHUD after closing zeus
+ *
+ * Arguments:
+ * 0: Unit
+ * 1: Display is now open
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [bob1, false] call ACE_captives_fnc_handleZeusDisplayChanged
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+PARAMS_2(_unit,_zeusIsOpen);
+
+//set showHUD based on unit status:
+if (!_zeusIsOpen) then {
+ if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then {
+ TRACE_1("Player Change (showHUD false)",_unit);
+ showHUD false;
+ } else {
+ TRACE_1("Player Change (showHUD true)",_unit);
+ showHUD true;
+ };
+};
diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf
index 5cbf43aacc..1a335131a8 100644
--- a/addons/captives/functions/fnc_moduleSurrender.sqf
+++ b/addons/captives/functions/fnc_moduleSurrender.sqf
@@ -27,19 +27,31 @@ if (local _logic) then {
if ((count _bisMouseOver) == 2) then {//check what mouse was over before the module was placed
_mouseOverObject = _bisMouseOver select 1;
if ((_mouseOverObject isKindOf "CAManBase") && {(vehicle _mouseOverObject) == _mouseOverObject}) then {
- systemChat format ["Debug - module surrendering %1", (name _mouseOverObject)];
- [_mouseOverObject, true] call FUNC(surrender);
+ TRACE_2("Debug - module surrendering %1",_mouseOverObject,(name _mouseOverObject));
+ if (alive _mouseOverObject) then {
+ if (!(_mouseOverObject getVariable [QGVAR(isSurrendering), false])) then {
+ ["SetSurrendered", [_mouseOverObject], [_mouseOverObject, true]] call EFUNC(common,targetEvent);
+ } else {
+ ["SetSurrendered", [_mouseOverObject], [_mouseOverObject, false]] call EFUNC(common,targetEvent);
+ };
+ } else {
+ ["STR_ACE_Captives_Zeus_OnlyAlive"] call EFUNC(common,displayTextStructured);
+ };
} else {
- systemChat format ["Only use on dismounted inf"];
+ ["STR_ACE_Captives_Zeus_OnlyInfentry"] call EFUNC(common,displayTextStructured);
};
} else {
- systemChat format ["Nothing under mouse"];
+ ["STR_ACE_Captives_Zeus_NothingSelected"] call EFUNC(common,displayTextStructured);
};
- } else {//an editor module
- {
- systemChat format ["Debug - module surrendering %1", (name _x)];
- [_x, true] call FUNC(surrender);
- } forEach _units;
+ } else {
+ //an editor module
+ //Modules run before postInit can instal the event handler, so we need to wait a little bit
+ [{
+ PARAMS_1(_units);
+ {
+ ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
+ } forEach _units;
+ }, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute);
};
deleteVehicle _logic;
diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf
index 912b00662f..5917532874 100644
--- a/addons/captives/functions/fnc_setHandcuffed.sqf
+++ b/addons/captives/functions/fnc_setHandcuffed.sqf
@@ -18,19 +18,23 @@
PARAMS_2(_unit,_state);
-// We only want this function to work on local machines
-if (!local _unit) exitwith {
- [_this, QUOTE(FUNC(setHandcuffed)), _unit] call EFUNC(common,execRemoteFnc);
- TRACE_2("running setHandcuffed on remote unit",_unit,_state);
-};
-if (_state isEqualTo (_unit getVariable [QGVAR(isHandcuffed), false])) then {
- LOG("setHandcuffed: current state same as new");
+if (!local _unit) exitwith {
+ ERROR("running setHandcuffed on remote unit");
+};
+if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith {
+ ERROR("setHandcuffed: current state same as new");
};
if (_state) then {
_unit setVariable [QGVAR(isHandcuffed), true, true];
[_unit, QGVAR(Handcuffed), true] call EFUNC(common,setCaptivityStatus);
+
+ if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
+ [_unit, false] call FUNC(setSurrendered);
+ };
+
+ //Set unit cargoIndex (will be -1 if dismounted)
_unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true];
if (_unit == ACE_player) then {
@@ -43,13 +47,32 @@ if (_state) then {
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
+
+ //Adds an animation changed eh
+ //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
+ _animChangedEHID = _unit addEventHandler ["AnimChanged", {
+ PARAMS_2(_unit,_newAnimation);
+ if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
+ ERROR("Handcuff animation interrupted");
+ systemChat format ["debug %2: new %1", _newAnimation, time];
+ [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
+ };
+ }];
+ _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
+
};
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
} else {
_unit setVariable [QGVAR(isHandcuffed), false, true];
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
- if ((vehicle _unit) == _unit) then {
- //Break out of hands up animation loop (doAnimation handles Unconscious prioity)
+
+ //remove AnimChanged EH
+ _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
+ _unit removeEventHandler ["AnimChanged", _animChangedEHID];
+ _unit setVariable [QGVAR(handcuffAnimEHID), -1];
+
+ if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
+ //Break out of hands up animation loop
[_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
};
diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf
new file mode 100644
index 0000000000..3a7436abc7
--- /dev/null
+++ b/addons/captives/functions/fnc_setSurrendered.sqf
@@ -0,0 +1,101 @@
+/*
+ * Author: commy2 PabstMirror
+ * Lets a unit surrender
+ *
+ * Arguments:
+ * 0: Unit
+ * 1: True to surrender, false to un-surrender
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [Pierre, true] call ACE_captives_fnc_setSurrendered;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+PARAMS_2(_unit,_state);
+
+
+if (!local _unit) exitwith {
+ ERROR("running surrender on remote unit");
+};
+
+if ((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _state) exitWith {
+ ERROR("Surrender: current state same as new");
+};
+
+if (_state) then {
+ if ((vehicle _unit) != _unit) exitWith {ERROR("Cannot surrender while mounted");};
+ if (_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {ERROR("Cannot surrender while handcuffed");};
+
+ _unit setVariable [QGVAR(isSurrendering), true, true];
+
+ [_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus);
+
+ if (_unit == ACE_player) then {
+ showHUD false;
+ };
+
+ [_unit] call EFUNC(common,fixLoweredRifleAnimation);
+ [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
+
+ // fix anim on mission start (should work on dedicated servers)
+ [{
+ PARAMS_1(_unit);
+ if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
+ //Adds an animation changed eh
+ //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
+ _animChangedEHID = _unit addEventHandler ["AnimChanged", {
+ PARAMS_2(_unit,_newAnimation);
+ if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
+ ERROR("Surrender animation interrupted");
+ systemChat format ["debug %2: new %1", _newAnimation, time];
+ [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
+ };
+ }];
+ _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
+ };
+ }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
+} else {
+ _unit setVariable [QGVAR(isSurrendering), false, true];
+ [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
+
+ //remove AnimChanged EH
+ _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
+ _unit removeEventHandler ["AnimChanged", _animChangedEHID];
+ _unit setVariable [QGVAR(surrenderAnimEHID), -1];
+
+ if (_unit == ACE_player) then {
+ //only re-enable HUD if not handcuffed
+ if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
+ showHUD true;
+ };
+ };
+
+ if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
+
+ //if we are in "hands up" animationState, crack it now
+ if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) then {
+ [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
+ } else {
+ //spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up"
+ //Handles long animation chains
+ [{
+ PARAMS_2(_args,_pfID);
+ EXPLODE_2_PVT(_args,_unit,_maxTime);
+ //If waited long enough or they re-surrendered or they are unconscious, exit loop
+ if ((time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {
+ [_pfID] call CBA_fnc_removePerFrameHandler;
+ };
+ //Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition)
+ if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) exitWith {
+ [_pfID] call CBA_fnc_removePerFrameHandler;
+ //Break out of hands up animation loop
+ [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
+ };
+ }, 0, [_unit, (time + 20)]] call CBA_fnc_addPerFrameHandler;
+ };
+};
diff --git a/addons/captives/functions/fnc_surrender.sqf b/addons/captives/functions/fnc_surrender.sqf
deleted file mode 100644
index 1f0e232926..0000000000
--- a/addons/captives/functions/fnc_surrender.sqf
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Author: commy2 PabstMirror
- * Lets a unit surrender
- *
- * Arguments:
- * 0: Unit
- * 1: State
- *
- * Return Value:
- * Nothing
- *
- * Example:
- * [Pierre, true] call ACE_captives_fnc_surrender;
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-PARAMS_2(_unit,_state);
-
-// We only want this function to work on local machines
-if (!local _unit) exitwith {
- [_this, QUOTE(FUNC(surrender)), _unit] call EFUNC(common,execRemoteFnc);
- TRACE_2("running surrender on remote unit",_unit,_state);
-};
-
-if ((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _state) then {
- LOG("Surrender: current state same as new");
-};
-
-if (_state) then {
- _unit setVariable [QGVAR(isSurrendering), true, true];
- [_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus);
-
- if (_unit == ACE_player) then {
- showHUD false;
- };
-
- // fix anim on mission start (should work on dedicated servers)
- [{
- PARAMS_1(_unit);
- if (_unit getVariable [QGVAR(isSurrendering), false] && {vehicle _unit == _unit}) then {
- [_unit] call EFUNC(common,fixLoweredRifleAnimation);
- [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
- };
- }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
-
- //PFEH - (TODO: move to event system?)
- [{
- EXPLODE_1_PVT((_this select 0),_unit);
- if (_unit getVariable [QGVAR(isSurrendering), false]) then {
- //If unit dies, gets knocked out, or is handcuffed then end surrender
- if ((!alive _unit) || {_unit getVariable ["ACE_isUnconscious", false]} || {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
- [_unit, false] call FUNC(surrender);
- [(_this select 1)] call CBA_fnc_removePerFrameHandler;
- };
- } else {
- [(_this select 1)] call cba_fnc_removePerFrameHandler;
- };
- }, 0.0, [_unit]] call CBA_fnc_addPerFrameHandler;
-} else {
- _unit setVariable [QGVAR(isSurrendering), false, true];
- [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
-
- if ((vehicle _unit) == _unit) then {
- //Break out of hands up animation loop (doAnimation handles Unconscious prioity)
- [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
- };
-
- if (_unit == ACE_player) then {
- //only re-enable HUD if not handcuffed
- if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
- showHUD true;
- };
- };
-};
diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml
index 7d8096b3e6..f03f30a113 100644
--- a/addons/captives/stringtable.xml
+++ b/addons/captives/stringtable.xml
@@ -1,5 +1,5 @@

-
+
@@ -136,5 +136,14 @@
Stop Surrendering
+
+ Only use on alive units
+
+
+ Only use on dismounted inf
+
+
+ Nothing under mouse
+
\ No newline at end of file
diff --git a/addons/common/FixPickup.hpp b/addons/common/CfgActions.hpp
similarity index 61%
rename from addons/common/FixPickup.hpp
rename to addons/common/CfgActions.hpp
index 79ddf77026..8e556b38e3 100644
--- a/addons/common/FixPickup.hpp
+++ b/addons/common/CfgActions.hpp
@@ -1,5 +1,6 @@
class CfgActions {
+ // fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care
class None;
class TakeWeapon: None {
show = 0;
diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp
index 522df03d4f..eef90451ae 100644
--- a/addons/common/CfgEventHandlers.hpp
+++ b/addons/common/CfgEventHandlers.hpp
@@ -42,19 +42,3 @@ class Extended_Respawn_EventHandlers {
};
};
};
-
-class Extended_Killed_EventHandlers {
- class CAManBase {
- class GVAR(dropObject) {
- Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
- };
- };
-};
-
-class Extended_GetIn_EventHandlers {
- class CAManBase {
- class GVAR(dropObject) {
- GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
- };
- };
-};
diff --git a/addons/common/CfgMoves.hpp b/addons/common/CfgMoves.hpp
new file mode 100644
index 0000000000..b0df9a4466
--- /dev/null
+++ b/addons/common/CfgMoves.hpp
@@ -0,0 +1,76 @@
+
+class CfgMovesBasic {
+ class Default;
+ class Actions {
+ // fixes grab animation with equipped pistol
+ class NoActions;
+ class PistolStandActions: NoActions {
+ grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
+ };
+ class LauncherKneelActions: NoActions {
+ grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
+ };
+ class CivilStandActions: NoActions {
+ grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
+ };
+ };
+};
+
+class CfgMovesMaleSdr: CfgMovesBasic {
+ class AgonyBase;
+ class AgonyBaseRfl;
+ class StandBase;
+ class HealBase;
+
+ class States {
+ // fixes being able to reload in some animations, can't remember now what exactly
+ class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
+ canReload = 0;
+ };
+ class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
+ canReload = 0;
+ };
+ class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
+ canReload = 0;
+ };
+ class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
+ canReload = 0;
+ };
+
+ class AmovPpneMstpSnonWnonDnon_injured;
+ class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
+ canReload = 0;
+ };
+ class AmovPpneMstpSrasWrflDnon_injured;
+ class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
+ canReload = 0;
+ };
+
+ // mark as on ladder animation
+ class LadderCivilStatic: StandBase {
+ ACE_isLadder = 1;
+ };
+
+ // dunno, important
+ class AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1;
+ class AcinPknlMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
+ enableDirectControl = 1;
+ };
+ class AcinPknlMwlkSnonWnonDb: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
+ enableDirectControl = 1;
+ };
+
+ // fix falling back to unconsciousness animation and disable rotating in that state
+ class Unconscious: Default {
+ ConnectTo[] = {};
+ head = "headNo";
+ forceAim = 1;
+ static = 1;
+ };
+
+ // idk. Flummi?
+ class AinvPknlMstpSnonWnonDnon_medic0: HealBase {
+ variantsPlayer[] = {};
+ };
+ };
+};
diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp
index d54dec7150..45f384eaf8 100644
--- a/addons/common/CfgVehicles.hpp
+++ b/addons/common/CfgVehicles.hpp
@@ -33,7 +33,7 @@ class CfgVehicles {
function = QFUNC(moduleCheckPBOs);
scope = 2;
isGlobal = 1;
- icon = QUOTE(PATHTOF(UI\IconCheckPBO_ca.paa));
+ icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
class Arguments {
class Action {
displayName = "Action";
@@ -87,6 +87,7 @@ class CfgVehicles {
displayName = "LSD Vehicles";
function = "ACE_Common_fnc_moduleLSDVehicles";
scope = 2;
+ icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa));
isGlobal = 1;
class Arguments {
};
diff --git a/addons/common/NoVoice.hpp b/addons/common/CfgVoice.hpp
similarity index 99%
rename from addons/common/NoVoice.hpp
rename to addons/common/CfgVoice.hpp
index a34e30c08e..9c53338e6e 100644
--- a/addons/common/NoVoice.hpp
+++ b/addons/common/CfgVoice.hpp
@@ -218,6 +218,7 @@ class CfgVoice {
displayName = "$STR_ACE_Common_NoVoice";
};
};
+
class CfgVoiceTypes {
class ACE_NoVoice {
name = "$STR_ACE_Common_NoVoice";
diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp
index 5df5d75da8..6035ee84bf 100644
--- a/addons/common/CfgWeapons.hpp
+++ b/addons/common/CfgWeapons.hpp
@@ -7,14 +7,38 @@ class CfgWeapons {
simulation = "ItemMineDetector";
};
- class Rifle_Base_F;
+ class Rifle;
+ class Rifle_Base_F: Rifle {
+ class WeaponSlotsInfo;
+ };
+
class ACE_FakePrimaryWeapon: Rifle_Base_F {
+ scope = 2;
+ displayName = "";
+ model = "";
+ picture = "";
+ magazines[] = {"ACE_FakeMagazine"};
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
- displayName = "";
- picture = "";
- model = "";
- magazines[] = {"ACE_FakeMagazine"};
+
+ class WeaponSlotsInfo: WeaponSlotsInfo {
+ mass = 0;
+ };
+ };
+
+ class InventoryItem_Base_F;
+ class ACE_Banana: ACE_ItemCore {
+ author = "$STR_ACE_Common_ACETeam";
scope = 2;
+ displayName = "$STR_ACE_Common_bananaDisplayName";
+ descriptionShort = "$STR_ACE_Common_bananaDescr";
+ model = PATHTOF(data\banana.p3d);
+ picture = PATHTOF(data\icon_banana_ca.paa);
+ icon = "iconObject_circle";
+ mapSize = 0.034;
+ class ItemInfo: InventoryItem_Base_F {
+ mass = 1;
+ };
};
};
+
diff --git a/addons/common/DefaultItems.hpp b/addons/common/DefaultItems.hpp
deleted file mode 100644
index 539eb3beff..0000000000
--- a/addons/common/DefaultItems.hpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*
-
-Autoexported while playing the unmodded game.
-
-
-A = "_c = _x >> 'items'; isArray _c" configClasses (configFile >> "CfgVehicles");
-
-B = []; {B set [_forEachIndex, inheritsFrom _x]} forEach A;
-E = B - A;
-
-C = []; {C set [_forEachIndex, getArray (_x >> "items")]} forEach A;
-D = []; {D set [_forEachIndex, getArray (_x >> "respawnItems")]} forEach A;
-
-{A set [_forEachIndex, configName _x]} forEach A;
-{B set [_forEachIndex, configName _x]} forEach B;
-{E set [_forEachIndex, configName _x]} forEach E;
-
-diag_log text "=====================";
-
-{
- diag_log text format ["class %1;", _x];
-} forEach E;
-
-{
- diag_log text format ["class %1: %2 {", _x, B select _forEachIndex];
- _s = str (C select _forEachIndex); _s = toString (toArray _s - [91,93]);
- diag_log text format [" items[] = {%1};", _s];
- _s = str (D select _forEachIndex); _s = toString (toArray _s - [91,93]);
- diag_log text format [" respawnItems[] = {%1};", _s];
- diag_log text "};";
-} forEach A;
-
-*/
-
-class SoldierWB;
-class SoldierGB;
-class SoldierEB;
-class C_man_1;
-class B_Soldier_base_F: SoldierWB {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_02_f: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_03_f: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_04_f: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_05_f: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_RangeMaster_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_lite_F: B_Soldier_03_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_GL_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_AR_F: B_Soldier_02_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_SL_F: B_Soldier_03_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_TL_F: B_Soldier_03_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_M_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_LAT_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_medic_F: B_Soldier_02_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_repair_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_exp_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Helipilot_F: B_Soldier_04_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_A_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_AT_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_AA_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_engineer_F: B_Soldier_03_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_crew_F: B_Soldier_03_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_officer_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Competitor_F: B_RangeMaster_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Pilot_F: B_Soldier_05_f {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_helicrew_F: B_Helipilot_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_PG_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_UAV_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class b_soldier_unarmed_f: B_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_diver_base_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_diver_F: B_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_diver_TL_F: B_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_diver_exp_F: B_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_recon_base: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_LAT_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_exp_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_medic_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_TL_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_M_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_recon_JTAC_F: B_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_sniper_base_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_spotter_F: B_Soldier_sniper_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_sniper_F: B_Soldier_sniper_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Story_SF_Captain_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Story_Protagonist_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Story_Engineer_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Story_Colonel_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Story_Pilot_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Story_Tank_Commander_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class b_soldier_survival_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_CTRG_soldier_GL_LAT_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_CTRG_soldier_engineer_exp_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_CTRG_soldier_M_medic_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_CTRG_soldier_AR_A_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_support_base_F: B_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_AAR_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_AAT_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_soldier_AAA_F: B_soldier_AAT_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_support_MG_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_support_GMG_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_support_Mort_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_support_AMG_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_support_AMort_F: B_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_base_F: SoldierGB {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_lite_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_SL_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_TL_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_AR_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_medic_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_engineer_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_exp_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_GL_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_M_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_LAT_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Soldier_A_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_officer_F: I_G_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_F: I_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_F: I_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_lite_F: I_G_Soldier_lite_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_lite_F: I_G_Soldier_lite_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_SL_F: I_G_Soldier_SL_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_SL_F: I_G_Soldier_SL_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_TL_F: I_G_Soldier_TL_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_TL_F: I_G_Soldier_TL_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_AR_F: I_G_Soldier_AR_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_AR_F: I_G_Soldier_AR_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_medic_F: I_G_medic_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_medic_F: I_G_medic_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_engineer_F: I_G_engineer_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_engineer_F: I_G_engineer_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_exp_F: I_G_Soldier_exp_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_exp_F: I_G_Soldier_exp_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_GL_F: I_G_Soldier_GL_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_GL_F: I_G_Soldier_GL_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_M_F: I_G_Soldier_M_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_M_F: I_G_Soldier_M_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_LAT_F: I_G_Soldier_LAT_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_LAT_F: I_G_Soldier_LAT_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_Soldier_A_F: I_G_Soldier_A_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_Soldier_A_F: I_G_Soldier_A_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_G_officer_F: I_G_officer_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_G_officer_F: I_G_officer_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class i_g_soldier_unarmed_f: I_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class b_g_soldier_unarmed_f: B_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class o_g_soldier_unarmed_f: O_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class i_g_survivor_F: I_G_Soldier_F {
- items[] = {};
- respawnItems[] = {};
-};
-class b_g_survivor_F: B_G_Soldier_F {
- items[] = {};
- respawnItems[] = {};
-};
-class o_g_survivor_F: O_G_Soldier_F {
- items[] = {};
- respawnItems[] = {};
-};
-class I_G_Story_Protagonist_F: B_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_Story_SF_Captain_F: B_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_resistanceLeader_F: I_G_Story_Protagonist_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_G_resistanceCommander_F: I_G_Story_Protagonist_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_base_F: SoldierGB {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_02_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_03_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_04_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_soldier_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_lite_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_A_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_GL_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_AR_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_SL_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_TL_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_M_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_LAT_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_AT_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_AA_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_medic_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_repair_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_exp_F: I_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_engineer_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_crew_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_helipilot_F: I_Soldier_03_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_pilot_F: I_Soldier_04_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_helicrew_F: I_helipilot_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_officer_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Story_Colonel_F: I_officer_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_soldier_UAV_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class i_soldier_unarmed_f: I_soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_diver_base_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_diver_F: I_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_diver_exp_F: I_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_diver_TL_F: I_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_sniper_base_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Spotter_F: I_Soldier_sniper_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Sniper_F: I_Soldier_sniper_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_support_base_F: I_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_AAR_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_AAT_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_Soldier_AAA_F: I_Soldier_AAT_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_support_MG_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_support_GMG_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_support_Mort_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_support_AMG_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_support_AMort_F: I_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_base_F: SoldierEB {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_officer_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_02_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_lite_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_GL_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_AR_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_SL_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_TL_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldier_M_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_LAT_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_medic_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldier_repair_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldier_exp_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_helipilot_F: O_Soldier_02_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_A_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_AT_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_AA_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_engineer_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_crew_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Pilot_F: O_helipilot_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_helicrew_F: O_helipilot_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldier_PG_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Story_Colonel_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Story_CEO_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldier_UAV_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class o_soldier_unarmed_f: O_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_diver_base_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_diver_F: O_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_diver_TL_F: O_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_diver_exp_F: O_Soldier_diver_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_sniper_base_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_spotter_F: O_Soldier_sniper_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_sniper_F: O_Soldier_sniper_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_recon_base: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_M_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_LAT_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_medic_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_exp_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_JTAC_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_recon_TL_F: O_Soldier_recon_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_support_base_F: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_AAR_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_AAT_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_AAA_F: O_Soldier_AAT_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_support_MG_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_support_GMG_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_support_Mort_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_support_AMG_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_support_AMort_F: O_Soldier_support_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_Soldier_Urban_base: O_Soldier_base_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_AR_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_AAR_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_LAT_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_AT_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_AAT_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_AA_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_AAA_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_TL_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_SoldierU_SL_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_medic_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_repair_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_exp_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_engineer_U_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_M_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_soldierU_A_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_SoldierU_GL_F: O_Soldier_Urban_base {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class C_Marshal_F: B_RangeMaster_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class B_Soldier_VR_F: B_Soldier_base_F {
- items[] = {};
- respawnItems[] = {};
-};
-class O_Soldier_VR_F: O_Soldier_base_F {
- items[] = {};
- respawnItems[] = {};
-};
-class I_Soldier_VR_F: I_Soldier_base_F {
- items[] = {};
- respawnItems[] = {};
-};
-class C_Soldier_VR_F: C_man_1 {
- items[] = {};
- respawnItems[] = {};
-};
-class B_Protagonist_VR_F: B_Soldier_base_F {
- items[] = {};
- respawnItems[] = {};
-};
-class O_Protagonist_VR_F: O_Soldier_base_F {
- items[] = {};
- respawnItems[] = {};
-};
-class I_Protagonist_VR_F: I_Soldier_base_F {
- items[] = {};
- respawnItems[] = {};
-};
-class B_UAV_AI: B_Helipilot_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class O_UAV_AI: O_helipilot_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class I_UAV_AI: O_UAV_AI {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class Underwear_F: B_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class b_survivor_F: B_Soldier_F {
- items[] = {};
- respawnItems[] = {};
-};
-class o_survivor_F: O_Soldier_F {
- items[] = {};
- respawnItems[] = {};
-};
-class i_survivor_F: I_soldier_F {
- items[] = {};
- respawnItems[] = {};
-};
-class b_soldier_universal_f: B_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class b_g_soldier_universal_f: B_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class o_soldier_universal_f: O_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class o_g_soldier_universal_f: O_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class i_soldier_universal_f: I_soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
-class i_g_soldier_universal_f: I_G_Soldier_F {
- items[] = {"FirstAidKit"};
- respawnItems[] = {"FirstAidKit"};
-};
diff --git a/addons/common/FixAnimations.hpp b/addons/common/FixAnimations.hpp
deleted file mode 100644
index d389391ba1..0000000000
--- a/addons/common/FixAnimations.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-
-class CfgMovesBasic;
-class CfgMovesMaleSdr: CfgMovesBasic {
- class AgonyBase;
- class AgonyBaseRfl;
- class StandBase;
-
- class States {
- class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
- canReload = 0;
- };
- class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
- canReload = 0;
- };
- class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
- canReload = 0;
- };
- class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
- canReload = 0;
- };
-
- class AmovPpneMstpSnonWnonDnon_injured;
- class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
- canReload = 0;
- };
- class AmovPpneMstpSrasWrflDnon_injured;
- class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
- canReload = 0;
- };
-
- class LadderCivilStatic: StandBase {
- ACE_isLadder = 1;
- };
- };
-};
diff --git a/addons/common/HintConfig.hpp b/addons/common/HintConfig.hpp
index 5dc0e6384a..bd74ac510a 100644
--- a/addons/common/HintConfig.hpp
+++ b/addons/common/HintConfig.hpp
@@ -53,17 +53,6 @@ class RscTitles {
};
};
- class ACE_EventHandlerHelper: ACE_Rsc_Display_Base {
- idd = -1;
- class controls {
- class CameraView: RscMapControl {
- onDraw = "if (cameraView != uiNamespace getVariable 'ACE_EventHandler_CameraMode') then {uiNamespace setVariable ['ACE_EventHandler_CameraMode', cameraView]; {[uiNamespace getVariable 'ACE_EventHandler_CameraMode'] call _x; nil} count ((missionNamespace getVariable 'ACE_EventHandler_CameraMode') select 2);};";
- idc = -1;
- w = 0;
- h = 0;
- };
- };
- };
class ACE_EventHandlerHelper2: ACE_Rsc_Display_Base {
class controls {
class MapMarkerCreated: RscMapControl {
diff --git a/addons/common/UI/IconCheckPBO_ca.paa b/addons/common/UI/IconCheckPBO_ca.paa
deleted file mode 100644
index fff094413e..0000000000
Binary files a/addons/common/UI/IconCheckPBO_ca.paa and /dev/null differ
diff --git a/addons/common/UI/Icon_Module_CheckPBO_ca.paa b/addons/common/UI/Icon_Module_CheckPBO_ca.paa
new file mode 100644
index 0000000000..8ca937dbd8
Binary files /dev/null and b/addons/common/UI/Icon_Module_CheckPBO_ca.paa differ
diff --git a/addons/common/UI/Icon_Module_LSD_ca.paa b/addons/common/UI/Icon_Module_LSD_ca.paa
new file mode 100644
index 0000000000..fa4c106177
Binary files /dev/null and b/addons/common/UI/Icon_Module_LSD_ca.paa differ
diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf
index 35b0f5c3fe..e3d2ed9327 100644
--- a/addons/common/XEH_postInit.sqf
+++ b/addons/common/XEH_postInit.sqf
@@ -20,6 +20,21 @@ if (hasInterface) then {
};
}] call FUNC(addEventhandler);
+["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler);
+["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler);
+["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler);
+
+["lockVehicle", {
+ _this setVariable [QGVAR(lockStatus), locked _this];
+ _this lock 2;
+}] call FUNC(addEventhandler);
+
+["unlockVehicle", {
+ _this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
+}] call FUNC(addEventhandler);
+
+["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
+
// hack to get PFH to work in briefing
[QGVAR(onBriefingPFH), "onEachFrame", {
if (time > 0) exitWith {
@@ -55,8 +70,6 @@ if (_currentVersion != _previousVersion) then {
if (!hasInterface) exitWith {};
call COMPILE_FILE(scripts\assignedItemFix);
-
-call COMPILE_FILE(scripts\initCanInteractFunction);
call COMPILE_FILE(scripts\initScrollWheel);
0 spawn {
@@ -88,6 +101,7 @@ GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312);
GVAR(OldCameraView) = cameraView;
GVAR(OldPlayerVehicle) = vehicle ACE_player;
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
+GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
// PFH to raise varios events
[{
@@ -148,11 +162,17 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
};
+ // "playerWeaponChanged" event
+ _newPlayerWeapon = currentWeapon ACE_player;
+ if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then {
+ // Raise ACE event locally
+ GVAR(OldPlayerWeapon) = _newPlayerWeapon;
+ ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
+ };
+
}, 0, []] call cba_fnc_addPerFrameHandler;
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
-[QGVAR(carriedBy),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable);
-[QGVAR(carriedObj),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable);
["VehicleSetFuel", {
PARAMS_2(_vehicle,_fuelLevel);
@@ -161,3 +181,6 @@ _vehicle setFuel _fuelLevel;
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
+
+["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition);
+["isNotInside", {_this select 0 == _this select 1 || {vehicle (_this select 0) == _this select 0}}] call FUNC(addCanInteractWithCondition);
diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf
index 62fbd7404f..c23c6b1dd2 100644
--- a/addons/common/XEH_preInit.sqf
+++ b/addons/common/XEH_preInit.sqf
@@ -6,8 +6,7 @@ ADDON = false;
// ACE Common Function
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
-PREP(addCameraEventHandler);
-PREP(addCustomEventHandler);
+PREP(addCanInteractWithCondition);
PREP(addLineToDebugDraw);
PREP(addMapMarkerCreatedEventHandler);
PREP(addScrollWheelEventHandler);
@@ -15,17 +14,14 @@ PREP(addSetting);
PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
-PREP(beingCarried);
+PREP(ASLToPosition);
PREP(binarizeNumber);
PREP(blurScreen);
-PREP(callCustomEventHandlers);
-PREP(callCustomEventHandlersGlobal);
+PREP(cachedCall);
PREP(canGetInPosition);
PREP(canInteract);
PREP(canInteractWith);
PREP(canUseWeapon);
-PREP(carriedByObj);
-PREP(carryObj);
PREP(changeProjectileDirection);
PREP(checkPBOs);
PREP(claim);
@@ -46,17 +42,19 @@ PREP(displayTextPicture);
PREP(displayTextStructured);
PREP(doAnimation);
PREP(endRadioTransmission);
+PREP(eraseCache);
PREP(execNextFrame);
PREP(execPersistentFnc);
PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
+PREP(fixCollision);
+PREP(fixFloating);
PREP(fixLoweredRifleAnimation);
+PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getCaptivityStatus);
-PREP(getCarriedBy);
-PREP(getCarriedObj);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getDeathAnim);
@@ -108,6 +106,7 @@ PREP(insertionSort);
PREP(interpolateFromArray);
PREP(inTransitionAnim);
PREP(inWater);
+PREP(isAlive);
PREP(isArrested);
PREP(isAutoWind);
PREP(isAwake);
@@ -118,7 +117,6 @@ PREP(isModLoaded);
PREP(isPlayer);
PREP(isTurnedOut);
PREP(letterToCode);
-PREP(limitMovementSpeed);
PREP(loadPerson);
PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
@@ -135,16 +133,17 @@ PREP(onLoadRscDisplayChannel);
PREP(owned);
PREP(player);
PREP(playerSide);
+PREP(positionToASL);
PREP(progressBar);
PREP(queueAnimation);
PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
-PREP(removeCameraEventHandler);
-PREP(removeCustomEventHandler);
+PREP(removeCanInteractWithCondition);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
+PREP(removeSpecificMagazine);
PREP(requestCallback);
PREP(resetAllDefaults);
PREP(restoreVariablesJIP);
@@ -155,7 +154,6 @@ PREP(serverLog);
PREP(setArrestState);
PREP(setCanInteract);
PREP(setCaptivityStatus);
-PREP(setCarriedBy);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus);
@@ -197,6 +195,9 @@ PREP(logDisplays);
PREP(monitor);
PREP(showUser);
+PREP(dumpPerformanceCounters);
+PREP(dumpArray);
+
// ACE_CuratorFix
PREP(addCuratorUnloadEventhandler);
PREP(fixCrateContent);
@@ -225,6 +226,9 @@ PREP(hashListSelect);
PREP(hashListSet);
PREP(hashListPush);
+//Debug
+ACE_COUNTERS = [];
+
// Load settings
if (isServer) then {
call FUNC(loadSettingsOnServer);
@@ -241,14 +245,15 @@ if (hasInterface) then {
ACE_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player];
uiNamespace setVariable ["ACE_player", ACE_player];
- // Raise custom event. @todo, remove
- [missionNamespace, "playerChanged", [ACE_player, _oldPlayer]] call FUNC(callCustomEventHandlers);
// Raise ACE event
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent);
};
}, 0, []] call cba_fnc_addPerFrameHandler;
};
+// Init toHex
+[0] call FUNC(toHex);
+
ADDON = true;
isHC = !(hasInterface || isDedicated);
diff --git a/addons/common/config.cpp b/addons/common/config.cpp
index d562d185ec..afd118ff1c 100644
--- a/addons/common/config.cpp
+++ b/addons/common/config.cpp
@@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
units[] = {"ACE_Box_Misc"};
- weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon"};
+ weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"};
author[] = {"KoffeinFlummi"};
@@ -13,11 +13,16 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
+
#include "CfgSounds.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
+#include "CfgActions.hpp"
+#include "CfgMoves.hpp"
+#include "CfgVoice.hpp"
+
class ACE_Rsc_Display_Base {
idd = -1;
type = 0;
@@ -51,12 +56,6 @@ class ACE_Rsc_Control_Base {
h = 0;
};
-class ACE_canInteractConditions {
- class GVAR(notOnMap) {
- condition = "!visibleMap";
- };
-};
-
class ACE_Settings {
/*
*class GVAR(sampleSetting) {
@@ -88,12 +87,12 @@ class ACE_Settings {
value = 0;
typeName = "BOOL";
};
- class GVAR(enableNumberHotkeys) {
+ /*class GVAR(enableNumberHotkeys) {
value = 1;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Common_EnableNumberHotkeys";
- };
+ };*/
class GVAR(settingFeedbackIcons) {
value = 1;
typeName = "SCALAR";
@@ -132,9 +131,6 @@ class ACE_Settings {
#include
#include
#include
-#include
-#include
-#include
class CfgUIGrids {
class IGUI {
diff --git a/addons/common/data/banana.p3d b/addons/common/data/banana.p3d
new file mode 100644
index 0000000000..f347ab17eb
Binary files /dev/null and b/addons/common/data/banana.p3d differ
diff --git a/addons/common/data/banana_co.paa b/addons/common/data/banana_co.paa
new file mode 100644
index 0000000000..55d7651721
Binary files /dev/null and b/addons/common/data/banana_co.paa differ
diff --git a/addons/common/data/icon_banana_ca.paa b/addons/common/data/icon_banana_ca.paa
new file mode 100644
index 0000000000..0d96102bbd
Binary files /dev/null and b/addons/common/data/icon_banana_ca.paa differ
diff --git a/addons/common/functions/fnc_ASLToPosition.sqf b/addons/common/functions/fnc_ASLToPosition.sqf
new file mode 100644
index 0000000000..4ff880c019
--- /dev/null
+++ b/addons/common/functions/fnc_ASLToPosition.sqf
@@ -0,0 +1,21 @@
+/*
+ * Author: esteldunedain
+ * Converts ASL to Arma "Position"
+ *
+ * Arguments:
+ * 0: position x
+ * 1: position y
+ * 2: position z
+ *
+ * Return Value:
+ * None
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+if (surfaceIsWater _this) then {
+ _this
+} else {
+ ASLtoATL _this
+};
diff --git a/addons/common/functions/fnc_addCameraEventHandler.sqf b/addons/common/functions/fnc_addCameraEventHandler.sqf
deleted file mode 100644
index 45fdb3bdca..0000000000
--- a/addons/common/functions/fnc_addCameraEventHandler.sqf
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Author: commy2
- *
- * Add a camera view event handler. The event script is called when the camera view changes.
- * The argument of the called function is stored in the _this variable and has as first element the new camera mode. Possible arguments are ["INTERNAL"], ["EXTERNAL"], ["GUNNER"] and ["GROUP"].
- *
- * Argument:
- * 0: Code to execute (Code or String)
- *
- * Return value:
- * ID of the event script (used to remove it later).
- */
-#include "script_component.hpp"
-
-private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
-
-_statement = _this select 0;
-
-if (typeName _statement == "STRING") then {
- _statement = compile _statement;
-};
-
-_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]];
-
-_id = (_actionsVar select 0) + 1;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-if (_id == 0) then {
- uiNamespace setVariable ["ACE_EventHandler_CameraMode", cameraView];
- (QGVAR(EventHandlerHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(EventHandlerHelper), "PLAIN"];
-};
-
-_actionIDs pushBack _id;
-_actions pushBack _statement;
-
-missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_id, _actionIDs, _actions]];
-
-_id
diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf
new file mode 100644
index 0000000000..99815a08a7
--- /dev/null
+++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf
@@ -0,0 +1,38 @@
+/*
+ * Author: commy2
+ *
+ * Add a condition that gets checked by ace_common_fnc_canInteractWith.
+ *
+ * Arguments:
+ * 0: The conditions id. Used to remove later or as exception name. An already existing name overwrites. (String)
+ * 1: The condition to check. format of "_this" is "[_player, _target]". (Code)
+ *
+ * Return Value:
+ * Unit can interact?
+ *
+ */
+#include "script_component.hpp"
+
+private ["_conditionName", "_conditionFunc"];
+
+_conditionName = toLower (_this select 0);
+_conditionFunc = _this select 1;
+
+private ["_conditions", "_conditionNames", "_conditionFuncs"];
+
+_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
+
+_conditionNames = _conditions select 0;
+_conditionFuncs = _conditions select 1;
+
+private "_index";
+_index = _conditionNames find _conditionName;
+
+if (_index == -1) then {
+ _index = count _conditionNames;
+};
+
+_conditionNames set [_index, _conditionName];
+_conditionFuncs set [_index, _conditionFunc];
+
+GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs];
diff --git a/addons/common/functions/fnc_addCustomEventHandler.sqf b/addons/common/functions/fnc_addCustomEventHandler.sqf
deleted file mode 100644
index e31730dbb3..0000000000
--- a/addons/common/functions/fnc_addCustomEventHandler.sqf
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Author: commy2
- *
- * Add a custom event to a unit. The event scripts are called by FUNC(callCustomEventHandlers).
- *
- * Argument:
- * 0: Object the event should be assigned to or namespace (Object OR Namespace)
- * 1: Name of the event (String)
- * 2: Code to execute (Code or String)
- *
- * Return value:
- * ID of the event script (used to remove it later).
- */
-#include "script_component.hpp"
-
-private ["_object", "_type", "_statement", "_name", "_actionsVar", "_id", "_actionIDs", "_actions"];
-
-_object = _this select 0;
-_type = _this select 1;
-_statement = _this select 2;
-
-if (typeName _statement == "STRING") then {
- _statement = compile _statement;
-};
-
-_name = format ["ACE_CustomEventHandlers_%1", _type];
-
-_actionsVar = _object getVariable [_name, [-1, [], []]];
-
-_id = (_actionsVar select 0) + 1;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_actionIDs pushBack _id;
-_actions pushBack _statement;
-
-_object setVariable [_name, [_id, _actionIDs, _actions]];
-
-_id
diff --git a/addons/common/functions/fnc_addLineToDebugDraw.sqf b/addons/common/functions/fnc_addLineToDebugDraw.sqf
index 1c7d5d5cd1..4b8b235811 100644
--- a/addons/common/functions/fnc_addLineToDebugDraw.sqf
+++ b/addons/common/functions/fnc_addLineToDebugDraw.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
*
* Add line to draw on debug
*
diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf
index 866b7fb35b..d3f97f8ae0 100644
--- a/addons/common/functions/fnc_addSetting.sqf
+++ b/addons/common/functions/fnc_addSetting.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Adds a new setting at runtime, with all it's metadata.
* If has only local effects.
*
diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf
index 034129735a..f29ff9e8e5 100644
--- a/addons/common/functions/fnc_ambientBrightness.sqf
+++ b/addons/common/functions/fnc_ambientBrightness.sqf
@@ -11,4 +11,4 @@
*/
#include "script_component.hpp"
-sunOrMoon * sunOrMoon + moonIntensity/5 min 1
+sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5 min 1) * (1 - overcast)
diff --git a/addons/common/functions/fnc_beingCarried.sqf b/addons/common/functions/fnc_beingCarried.sqf
deleted file mode 100644
index ed0c7832bb..0000000000
--- a/addons/common/functions/fnc_beingCarried.sqf
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * fn_beingCarried.sqf
- * @Descr: Check if object is being carried
- * @Author: Glowbal
- *
- * @Arguments: [object OBJECT]
- * @Return: BOOL True if object is being carried
- * @PublicAPI: true
- */
-#include "script_component.hpp"
-
-!(isNull ([_this select 0] call FUNC(getCarriedObj)));
\ No newline at end of file
diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf
new file mode 100644
index 0000000000..ac6687fd4f
--- /dev/null
+++ b/addons/common/functions/fnc_cachedCall.sqf
@@ -0,0 +1,65 @@
+/*
+ * Author: esteldunedain and Jaynus
+ * Returns the result of the function and caches it up to a given time or event
+ *
+ * Arguments:
+ * 0: Parameters
+ * 1: Function
+ * 2: Namespace to store the cache on
+ * 3: Cache uid
+ * 4: Max duration of the cache
+ * 5: Event that clears the cache (Optional)
+ *
+ * Return Value:
+ * Result of the function
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration);
+
+if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
+ _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
+
+ // Does the cache needs to be cleared on an event?
+ if (count _this > 5) then {
+ private ["_event","_varName","_cacheList"];
+ _event = _this select 5;
+ _varName = format [QGVAR(clearCache_%1),_event];
+ _cacheList = missionNamespace getVariable _varName;
+
+ // If there was no EH to clear these caches, add one
+ if (isNil {_cacheList}) then {
+ _cacheList = [];
+ missionNamespace setVariable [_varName, _cacheList];
+
+ [_event, {
+ private ["_varName","_cacheList"];
+ // _eventName is defined on the function that calls the event
+ #ifdef DEBUG_MODE_FULL
+ diag_log text format ["ACE: Clear cached variables on event: %1", _eventName];
+ #endif
+ // Get the list of caches to clear
+ _varName = format [QGVAR(clearCache_%1),_eventName];
+ _cacheList = missionNamespace getVariable [_varName, []];
+ // Erase all the cached results
+ {
+ _x call FUNC(eraseCache);
+ } forEach _cacheList;
+ // Empty the list
+ missionNamespace setVariable [_varName, []];
+ }] call FUNC(addEventhandler);
+ };
+
+ // Add this cache to the list of the event
+ _cacheList pushBack [_namespace, _uid];
+ };
+#ifdef DEBUG_MODE_FULL
+ diag_log format ["Calculated result: %1 %2", _namespace, _uid];
+} else {
+ diag_log format ["Cached result : %1 %2", _namespace, _uid];
+#endif
+};
+
+(_namespace getVariable _uid) select 1
diff --git a/addons/common/functions/fnc_callCustomEventHandlers.sqf b/addons/common/functions/fnc_callCustomEventHandlers.sqf
deleted file mode 100644
index 4b822e0754..0000000000
--- a/addons/common/functions/fnc_callCustomEventHandlers.sqf
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Author: commy2
- *
- * Execute all custom event script assigned to this object.
- *
- * Argument:
- * 0: Object the eventhandlers are assigned to or namespace (Object or Namespace)
- * 1: Name of the event (String)
- * 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to])
- *
- * Return value:
- * None.
- */
-#include "script_component.hpp"
-
-private ["_object", "_type", "_argument", "_name", "_actions"];
-
-_object = _this select 0;
-_type = _this select 1;
-_argument = _this select 2;
-
-if (isNil "_argument") then {_argument = [_object]};
-
-_name = format ["ACE_CustomEventHandlers_%1", _type];
-
-_actions = (_object getVariable [_name, [-1, [], []]]) select 2;
-
-{
- _argument call _x; nil;
-} count _actions;
-nil
diff --git a/addons/common/functions/fnc_callCustomEventHandlersGlobal.sqf b/addons/common/functions/fnc_callCustomEventHandlersGlobal.sqf
deleted file mode 100644
index e1dddd5916..0000000000
--- a/addons/common/functions/fnc_callCustomEventHandlersGlobal.sqf
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Author: commy2
- *
- * Execute all custom event script assigned to this object on every machine.
- *
- * Argument:
- * 0: Object the eventhandlers are assigned to or namespace (Object or Namespace)
- * 1: Name of the event (String)
- * 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to])
- *
- * Return value:
- * None.
- */
-#include "script_component.hpp"
-
-[_this, QUOTE(FUNC(callCustomEventHandlers)), 2] call FUNC(execRemoteFnc);
diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf
index 859d8ed461..5ac4c527fd 100644
--- a/addons/common/functions/fnc_canGetInPosition.sqf
+++ b/addons/common/functions/fnc_canGetInPosition.sqf
@@ -69,7 +69,7 @@ switch (_position) do {
case "gunner" : {
private "_turretConfig";
- _turret = [typeOf _vehicle] call FUNC(getTurretGunner);
+ _turret = [_vehicle] call FUNC(getTurretGunner);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@@ -82,7 +82,7 @@ switch (_position) do {
case "commander" : {
private "_turretConfig";
- _turret = [typeOf _vehicle] call FUNC(getTurretCommander);
+ _turret = [_vehicle] call FUNC(getTurretCommander);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@@ -95,7 +95,7 @@ switch (_position) do {
case "copilot" : {
private "_turretConfig";
- _turret = [typeOf _vehicle] call FUNC(getTurretCopilot);
+ _turret = [_vehicle] call FUNC(getTurretCopilot);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@@ -108,7 +108,7 @@ switch (_position) do {
case "turret" : {
private ["_turrets", "_turretConfig"];
- _turrets = [typeOf _vehicle] call FUNC(getTurretsOther);
+ _turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
@@ -136,7 +136,7 @@ switch (_position) do {
case "ffv" : {
private ["_turrets", "_turretConfig"];
- _turrets = [typeOf _vehicle] call FUNC(getTurretsFFV);
+ _turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf
index 9c5405452e..667aec38b3 100644
--- a/addons/common/functions/fnc_canInteractWith.sqf
+++ b/addons/common/functions/fnc_canInteractWith.sqf
@@ -1,11 +1,53 @@
-// by commy2
+/*
+ * Author: commy2
+ * Check if the unit can interact.
+ *
+ * Arguments:
+ * 0: The player.
+ * 1: The interaction target. objNull to ignore.
+ * 2: Exceptions. What general conditions are to skip? (Optional)
+ *
+ * Return Value:
+ * Unit can interact?
+ *
+ * Public: No
+ */
#include "script_component.hpp"
-private ["_unit", "_target", "_owner"];
+private ["_unit", "_target", "_exceptions"];
_unit = _this select 0;
_target = _this select 1;
+_exceptions = if (count _this > 2) then {
+ _this select 2;
+} else {
+ [];
+};
-_owner = _target getVariable ["ACE_isUsedBy", objNull];
+_exceptions = [_exceptions, {toLower _this}] call FUNC(map);
-isNull _owner || {_unit == _owner} || {!isPlayer _owner}
+// exit if the target is not free to interact
+private "_owner";
+_owner = _target getVariable [QGVAR(owner), objNull];
+
+if (!isNull _owner && {_unit != _owner}) exitWith {false};
+
+// check general conditions
+
+private ["_conditions", "_conditionNames", "_conditionFuncs"];
+
+_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
+
+_conditionNames = _conditions select 0;
+_conditionFuncs = _conditions select 1;
+
+private "_canInteract";
+_canInteract = true;
+
+{
+ if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith {
+ _canInteract = false;
+ };
+} forEach _conditionNames;
+
+_canInteract
diff --git a/addons/common/functions/fnc_carriedByObj.sqf b/addons/common/functions/fnc_carriedByObj.sqf
deleted file mode 100644
index 139a449c77..0000000000
--- a/addons/common/functions/fnc_carriedByObj.sqf
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * fn_carriedByObj.sqf
- * @Descr: Check if object A is being carried by object B.
- * @Author: Glowbal
- *
- * @Arguments: [object OBJECT, unit OBJECT]
- * @Return: BOOL True if B is carrying A.
- * @PublicAPI: true
- */
-
-#include "script_component.hpp"
-
-([(_this select 0)] call FUNC(getCarriedBy) == [(_this select 1)] call FUNC(getCarriedBy));
\ No newline at end of file
diff --git a/addons/common/functions/fnc_carryObj.sqf b/addons/common/functions/fnc_carryObj.sqf
deleted file mode 100644
index 6d911029a2..0000000000
--- a/addons/common/functions/fnc_carryObj.sqf
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * fn_carryObj.sqf
- * @Descr: Have a unit carry an object. Use ObjNull for second parameter if you want the unit to carry nothing
- * @Author: Glowbal
- *
- * @Arguments: [unit OBJECT, objectToCarry OBJECT, attachToVector ARRAY (Optional)]
- * @Return: BOOL Returns true if succesful
- * @PublicAPI: true
- */
-
-#include "script_component.hpp"
-
-private ["_unit","_to","_return", "_fallDown", "_carriedObj", "_positionUnit"];
-_unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param;
-_to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param;
-_fallDown = false;
-if (count _this > 3) then {
- _fallDown = _this select 3;
-};
-_return = false;
-
-[format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call FUNC(debug);
-
-if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) || isNull _to) then {
- if (vehicle _unit != _unit) exitwith {};
- if (!isNull _to) then {
- if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then {
- _return = true;
- _unit setvariable [QGVAR(carriedObj),_to,true];
- if (_fallDown) then {
- // [_unit,_fallDown] call FUNC(limitMovementSpeed);
- };
- [_to, _unit] call FUNC(setCarriedBy);
- if (count _this > 2) then {
- if (count (_this select 2) == 3) then {
- _to attachTo [_unit,(_this select 2)];
- [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug);
- };
- };
- ["carryObject", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent);
- // ["carryObject", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent;
- };
- } else {
- if (!isNull ([_unit] call FUNC(getCarriedObj))) then {
- [format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug);
- _carriedObj = ([_unit] call FUNC(getCarriedObj));
-
- detach _carriedObj;
- //_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0];
- if (!surfaceIsWater getPos _unit) then {
- _positionUnit = getPosATL _carriedObj;
- _positionUnit set [2, ((getPosATL _unit) select 2) + 0.1];
- _carriedObj setPosATL _positionUnit;
- } else {
- _positionUnit = getPosASL _carriedObj;
- _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1];
- _carriedObj setPosASL _positionUnit;
- };
-
- [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy);
- _unit setvariable [QGVAR(carriedObj),_to,true];
- _return = true;
-
- ["carryObjectDropped", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent);
- // ["carryObjectDropped", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent;
-
- };
- };
-} else {
- [format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug);
-};
-_return
diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf
index cf960ac462..73317ee876 100644
--- a/addons/common/functions/fnc_claim.sqf
+++ b/addons/common/functions/fnc_claim.sqf
@@ -1,7 +1,20 @@
-// by commy2
+/*
+ * Author: commy2
+ *
+ * Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc.
+ *
+ * Arguments:
+ * 0: Unit that claims another object. ObjNull to remove claim. (Object)
+ * 1: The object that gets claimed. (Object)
+ * 2: Lock the claimed object aswell? (Bool)
+ *
+ * Return Value:
+ * NONE
+ *
+ */
#include "script_component.hpp"
-private ["_unit", "_target", "_lockTarget", "_owner"];
+private ["_unit", "_target", "_lockTarget"];
_unit = _this select 0;
_target = _this select 1;
@@ -9,20 +22,26 @@ _lockTarget = _this select 2;
if (isNil "_lockTarget") then {_lockTarget = false};
-_owner = _target getVariable ["ACE_isUsedBy", objNull];
+private "_owner";
+_owner = _target getVariable [QGVAR(owner), objNull];
if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then {
diag_log text "[ACE] ERROR: Claiming already owned object.";
};
-_target setVariable ["ACE_isUsedBy", _unit, true];
+// transfer this immediately
+_target setVariable [QGVAR(owner), _unit, true];
+// lock target object
if (_lockTarget) then {
- if (!isNull _unit) then {
- [_target, "{_locked = locked _this; _this setVariable ['ACE_lockStatus', _locked]; _this lock 2}", _target] call FUNC(execRemoteFnc);
- } else {
- [_target, "{_this lock (_this getVariable ['ACE_lockStatus', locked _this])}", _target] call FUNC(execRemoteFnc);
- };
+ if (!isNull _unit) then {
+ ["lockVehicle", _target, _target] call FUNC(targetEvent);
+ } else {
+ ["unlockVehicle", _target, _target] call FUNC(targetEvent);
+ };
};
-//systemChat str locked _target; systemChat str (_target getVariable ['ACE_lockStatus', locked _target]);
+/*
+systemChat str locked _target;
+systemChat str (_target getVariable [QGVAR(lockStatus), locked _target]);
+*/
diff --git a/addons/common/functions/fnc_createOrthonormalReference.sqf b/addons/common/functions/fnc_createOrthonormalReference.sqf
index a92464a7f3..346127c658 100644
--- a/addons/common/functions/fnc_createOrthonormalReference.sqf
+++ b/addons/common/functions/fnc_createOrthonormalReference.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
*
* Returns a orthonormal system of reference aligned with the supplied vector
*
diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf
index 923575dd97..57be44fe43 100644
--- a/addons/common/functions/fnc_disableUserInput.sqf
+++ b/addons/common/functions/fnc_disableUserInput.sqf
@@ -50,13 +50,13 @@ if (_state) then {
};
_ctrl = _dlg displayctrl 103;
- _ctrl ctrlSetEventHandler ["buttonClick", "while {!isNull (uiNamespace getVariable ['GVAR(dlgDisableMouse)', displayNull])} do {closeDialog 0}; failMission 'LOSER'; [false] call FUNC(disableUserInput);"];
+ _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable true;
_ctrl ctrlSetText "ABORT";
_ctrl ctrlSetTooltip "Abort.";
_ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer);
- _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; player setDamage 1; [false] call FUNC(disableUserInput);"];
+ _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}});
_ctrl ctrlSetText "RESPAWN";
_ctrl ctrlSetTooltip "Respawn.";
diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf
new file mode 100644
index 0000000000..a6f08cdd39
--- /dev/null
+++ b/addons/common/functions/fnc_dumpArray.sqf
@@ -0,0 +1,25 @@
+//fnc_dumpArray.sqf
+#include "script_component.hpp"
+
+private ["_var", "_depth", "_pad", "_i", "_x"];
+
+_var = _this select 0;
+_depth = _this select 1;
+_pad = "";
+for "_i" from 0 to _depth do {
+ _pad = _pad + toString [9];
+};
+_depth = _depth + 1;
+if(IS_ARRAY(_var)) then {
+ if((count _var) > 0) then {
+ diag_log text format["%1[", _pad];
+ {
+ [_x, _depth] call FUNC(dumpArray);
+ } forEach _var;
+ diag_log text format["%1],", _pad];
+ } else {
+ diag_log text format["%1[],", _pad];
+ };
+} else {
+ diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
+};
diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf
new file mode 100644
index 0000000000..ded6514c9a
--- /dev/null
+++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf
@@ -0,0 +1,73 @@
+//fnc_dumpPerformanceCounters.sqf
+#define DEBUG_MODE_FULL
+#include "script_component.hpp"
+
+/*
+diag_log text format["REGISTERED ACE PFH HANDLERS"];
+diag_log text format["-------------------------------------------"];
+if(!isNil "ACE_PFH") then {
+ {
+ private["_pfh"];
+ _pfh = _x select 0;
+ diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
+ } forEach ACE_PFH;
+};*/
+
+diag_log text format["ACE COUNTER RESULTS"];
+diag_log text format["-------------------------------------------"];
+{
+ private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
+ _counterEntry = _x;
+ _iter = 0;
+ _total = 0;
+ _count = 0;
+ _averageResult = 0;
+ if( (count _counterEntry) > 3) then {
+ // calc
+ {
+ if(_iter > 2) then {
+ _count = _count + 1;
+ _delta = (_x select 1) - (_x select 0);
+
+ _total = _total + _delta;
+ };
+ _iter = _iter + 1;
+ } forEach _counterEntry;
+
+ // results
+ _averageResult = (_total / _count) * 1000;
+
+ // dump results
+ diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult];
+ } else {
+ diag_log text format["%1: No results", (_counterEntry select 0) ];
+ };
+} forEach ACE_COUNTERS;
+
+/*
+// Dump PFH Trackers
+diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
+diag_log text format["-------------------------------------------"];
+{
+ private["_delay"];
+ _delay = _x select 2;
+ //if(_delay > 0) then { _delay = _delay / 1000; };
+
+ diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
+} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
+
+// Dump PFH Trackers
+diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
+diag_log text format["-------------------------------------------"];
+{
+ private["_delta"];
+ _delta = _x select 1;
+ //if(_delta > 0) then { _delta = _delta / 1000; };
+ diag_log text format[" DELTA: %1s", _delta];
+} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
+
+//{
+//
+//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
+
+*/
\ No newline at end of file
diff --git a/addons/common/functions/fnc_eraseCache.sqf b/addons/common/functions/fnc_eraseCache.sqf
new file mode 100644
index 0000000000..94592ad409
--- /dev/null
+++ b/addons/common/functions/fnc_eraseCache.sqf
@@ -0,0 +1,18 @@
+/*
+ * Author: esteldunedain
+ * Deletes a cached result
+ *
+ * Arguments:
+ * 0: Namespace to store the cache on
+ * 1: Cache uid
+ *
+ * Return Value:
+ * None
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_2_PVT(_this,_namespace,_uid);
+
+_namespace setVariable [_uid, nil];
diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf
index e0dd49e86c..a0f71f9d51 100644
--- a/addons/common/functions/fnc_execNextFrame.sqf
+++ b/addons/common/functions/fnc_execNextFrame.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
*
* Executes a code on the next frame
*
diff --git a/addons/common/functions/fnc_fixCollision.sqf b/addons/common/functions/fnc_fixCollision.sqf
new file mode 100644
index 0000000000..6b43cec469
--- /dev/null
+++ b/addons/common/functions/fnc_fixCollision.sqf
@@ -0,0 +1,21 @@
+/*
+ * Author: commy2
+ * Attempt to fix physx collisions causing unreasonable impact forces and damage.
+ *
+ * Arguments:
+ * 0: Object
+ *
+ * Return Value:
+ * Nothing
+ *
+ */
+#include "script_component.hpp"
+
+// allowDamage requires local object
+if (!local _this) exitWith {};
+
+// prevent collision damage, @todo allowDamage API
+_this allowDamage false;
+
+// re-allow damage after 2 seconds
+[{_this allowDamage true}, _this, 2, 0] call EFUNC(common,waitAndExecute);
diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf
new file mode 100644
index 0000000000..6f08af1482
--- /dev/null
+++ b/addons/common/functions/fnc_fixFloating.sqf
@@ -0,0 +1,32 @@
+/*
+ * Author: commy2
+ * Attempt to fix floating physx with disabled damage after setPosXXX commands.
+ *
+ * Arguments:
+ * Physx object (Object)
+ *
+ * Return Value:
+ * Nothing
+ *
+ */
+#include "script_component.hpp"
+
+private "_object";
+
+_object = _this;
+
+// setHitPointDamage requires local object
+if (!local _object) exitWith {};
+
+// save and restore hitpoints, see below why
+private ["_hitPoints", "_hitPointDamages"];
+
+_hitPoints = [_object] call FUNC(getHitpoints);
+_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map);
+
+// this prevents physx objects from floating when near other physx objects with allowDamage false
+_object setDamage damage _object;
+
+{
+ _object setHitPointDamage [_x, _hitPointDamages select _forEachIndex];
+} forEach _hitPoints;
diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf
new file mode 100644
index 0000000000..32cde87e52
--- /dev/null
+++ b/addons/common/functions/fnc_fixPosition.sqf
@@ -0,0 +1,29 @@
+/*
+ * Author: commy2
+ *
+ * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object.
+ *
+ * Argument:
+ * Object (Object)
+ *
+ * Return value:
+ * NONE
+ */
+#include "script_component.hpp"
+
+// setVectorUp requires local object
+if (!local _this) exitWith {};
+
+private "_position";
+_position = getPos _this;
+
+// don't place the object below the ground
+if (_position select 2 < -0.1) then {
+ _position set [2, -0.1];
+ _this setPos _position;
+};
+
+// adjust position to sloped terrain, if placed on ground
+if (getPosATL _this select 2 == _position select 2) then {
+ _this setVectorUp surfaceNormal _position;
+};
diff --git a/addons/common/functions/fnc_getCarriedBy.sqf b/addons/common/functions/fnc_getCarriedBy.sqf
deleted file mode 100644
index 2b3c374eb3..0000000000
--- a/addons/common/functions/fnc_getCarriedBy.sqf
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * fn_getCarriedBy.sqf
- * @Descr: Get the object that is carrying given unit or object
- * @Author: Glowbal
- *
- * @Arguments: [unit OBJECT]
- * @Return: OBJECT Returns the object that is carrying the unit. Otherwise returns ObjNull
- * @PublicAPI: true
- */
-
-#include "script_component.hpp"
-
-((_this select 0) getvariable [QGVAR(carriedBy),objNull]);
\ No newline at end of file
diff --git a/addons/common/functions/fnc_getCarriedObj.sqf b/addons/common/functions/fnc_getCarriedObj.sqf
deleted file mode 100644
index 8cb1209791..0000000000
--- a/addons/common/functions/fnc_getCarriedObj.sqf
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * fn_getCarriedObj.sqf
- * @Descr: Grab the registered carried object
- * @Author: Glowbal
- *
- * @Arguments: [unit OBJECT]
- * @Return: OBJECT Returns the object that the unit is currently carrying. If not carrying, returns ObjNull
- * @PublicAPI: true
- */
-
-#include "script_component.hpp"
-
-((_this select 0) getvariable [QGVAR(carriedObj),objNull]);
diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf
index 5fca3af81c..4003c2a51f 100644
--- a/addons/common/functions/fnc_getConfigCommander.sqf
+++ b/addons/common/functions/fnc_getConfigCommander.sqf
@@ -4,7 +4,7 @@
* Get the commander config of a vehicles turret.
*
* Argument:
- * 0: vehicle type (String)
+ * 0: vehicle (Object)
*
* Return value:
* Commander config (Config)
@@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
_vehicle = _this select 0;
-_config = configFile >> "CfgVehicles" >> _vehicle;
+_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretCommander);
[_config, _turret] call FUNC(getTurretConfigPath)
diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf
index 0c09461a04..80bdfb2cfa 100644
--- a/addons/common/functions/fnc_getConfigGunner.sqf
+++ b/addons/common/functions/fnc_getConfigGunner.sqf
@@ -4,7 +4,7 @@
* Get the gunner config of a vehicles turret.
*
* Argument:
- * 0: vehicle type (String)
+ * 0: vehicle (Object)
*
* Return value:
* Gunner config (Config)
@@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
_vehicle = _this select 0;
-_config = configFile >> "CfgVehicles" >> _vehicle;
+_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretGunner);
[_config, _turret] call FUNC(getTurretConfigPath)
diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf
index eadaeb2000..cfa7e0532c 100644
--- a/addons/common/functions/fnc_getDoorTurrets.sqf
+++ b/addons/common/functions/fnc_getDoorTurrets.sqf
@@ -4,23 +4,23 @@
* Gets the turret index of door gunners
*
* Argument:
- * 0: Vehicle type (String)
+ * 0: Vehicle (Object)
*
* Return value:
* Turret indexes of the door gunner. Empty array means no gunner position. (Array)
*/
#include "script_component.hpp"
-private ["_vehicleType", "_turrets", "_doorTurrets", "_config"];
+private ["_vehicle", "_turrets", "_doorTurrets", "_config"];
-_vehicleType = _this select 0;
+_vehicle = _this select 0;
-_turrets = [_vehicleType] call FUNC(getTurrets);
+_turrets = allTurrets [_vehicle, true];
_doorTurrets = [];
{
- _config = configFile >> "CfgVehicles" >> _vehicleType;
+ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then {
diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf
index 0cfce1e124..062cc6cae4 100644
--- a/addons/common/functions/fnc_getInPosition.sqf
+++ b/addons/common/functions/fnc_getInPosition.sqf
@@ -64,7 +64,7 @@ switch (_position) do {
};
case "gunner" : {
- _turret = [typeOf _vehicle] call FUNC(getTurretGunner);
+ _turret = [_vehicle] call FUNC(getTurretGunner);
if (CANGETINTURRETINDEX) then {
_script = [
@@ -75,7 +75,7 @@ switch (_position) do {
};
case "commander" : {
- _turret = [typeOf _vehicle] call FUNC(getTurretCommander);
+ _turret = [_vehicle] call FUNC(getTurretCommander);
if (CANGETINTURRETINDEX) then {
_script = [
@@ -86,7 +86,7 @@ switch (_position) do {
};
case "copilot" : {
- _turret = [typeOf _vehicle] call FUNC(getTurretCopilot);
+ _turret = [_vehicle] call FUNC(getTurretCopilot);
if (CANGETINTURRETINDEX) then {
_script = [
@@ -100,7 +100,7 @@ switch (_position) do {
case "turret" : {
private "_turrets";
- _turrets = [typeOf _vehicle] call FUNC(getTurretsOther);
+ _turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [
@@ -127,7 +127,7 @@ switch (_position) do {
case "ffv" : {
private "_turrets";
- _turrets = [typeOf _vehicle] call FUNC(getTurretsFFV);
+ _turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [
diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf
index 3dd2582860..a3733560da 100644
--- a/addons/common/functions/fnc_getSettingData.sqf
+++ b/addons/common/functions/fnc_getSettingData.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Returns the metadata of a setting if it exists
*
* Arguments:
diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf
index 4c2b1139c8..b26060b221 100644
--- a/addons/common/functions/fnc_getTurretCommander.sqf
+++ b/addons/common/functions/fnc_getTurretCommander.sqf
@@ -4,7 +4,7 @@
* Get the turret index of a vehicles commander.
*
* Argument:
- * 0: Vehicle type (String)
+ * 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles commander. Empty array means no observer position. (Array)
@@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
-_turrets = [_vehicle] call FUNC(getTurrets);
+_turrets = allTurrets [_vehicle, true];
_turret = [];
{
- _config = configFile >> "CfgVehicles" >> _vehicle;
+ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf
index c2a7e81778..9f51f8724c 100644
--- a/addons/common/functions/fnc_getTurretCopilot.sqf
+++ b/addons/common/functions/fnc_getTurretCopilot.sqf
@@ -4,7 +4,7 @@
* Get the turret index of a vehicles copilot.
*
* Argument:
- * 0: Vehicle type (String)
+ * 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no copilot position. (Array)
@@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
-_turrets = [_vehicle] call FUNC(getTurrets);
+_turrets = allTurrets [_vehicle, true];
_turret = [];
{
- _config = configFile >> "CfgVehicles" >> _vehicle;
+ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf
index fd1134dc83..ba1802c37f 100644
--- a/addons/common/functions/fnc_getTurretGunner.sqf
+++ b/addons/common/functions/fnc_getTurretGunner.sqf
@@ -4,7 +4,7 @@
* Get the turret index of a vehicles gunner.
*
* Argument:
- * 0: Vehicle type (String)
+ * 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no gunner position. (Array)
@@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
-_turrets = [_vehicle] call FUNC(getTurrets);
+_turrets = allTurrets [_vehicle, true];
_turret = [];
{
- _config = configFile >> "CfgVehicles" >> _vehicle;
+ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf
index fd75d221fd..85d69b6828 100644
--- a/addons/common/functions/fnc_getTurretIndex.sqf
+++ b/addons/common/functions/fnc_getTurretIndex.sqf
@@ -18,7 +18,6 @@ _vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {[]};
-//_turrets = [typeOf _vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_units = [];
diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf
index b09dfed027..f915d6c096 100644
--- a/addons/common/functions/fnc_getTurretsFFV.sqf
+++ b/addons/common/functions/fnc_getTurretsFFV.sqf
@@ -4,7 +4,7 @@
* Get the turret indices of ffv turrets.
*
* Argument:
- * 0: Vehicle type (String)
+ * 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array)
@@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
-_turrets = [_vehicle] call FUNC(getTurrets);
+_turrets = allTurrets [_vehicle, true];
_turret = [];
{
- _config = configFile >> "CfgVehicles" >> _vehicle;
+ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf
index 53673b5a8d..102c1a9d1c 100644
--- a/addons/common/functions/fnc_getTurretsOther.sqf
+++ b/addons/common/functions/fnc_getTurretsOther.sqf
@@ -4,7 +4,7 @@
* Get the turret indices of other turrets (not gunner, commander, copilot or ffv).
*
* Argument:
- * 0: Vehicle type (String)
+ * 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no other turrets. (Array)
@@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
-_turrets = [_vehicle] call FUNC(getTurrets);
+_turrets = allTurrets [_vehicle, true];
_turret = [];
{
- _config = configFile >> "CfgVehicles" >> _vehicle;
+ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf
index dd614f8dd0..db52a48d80 100644
--- a/addons/common/functions/fnc_hadamardProduct.sqf
+++ b/addons/common/functions/fnc_hadamardProduct.sqf
@@ -19,7 +19,7 @@ _vector2 = _this select 1;
_newVector = [];
for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do {
- _newVector = _newVector + [(_vector1 select _i) * (_vector2 select _i)];
+ _newVector pushBack ((_vector1 select _i) * (_vector2 select _i));
};
_newVector
diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf
new file mode 100644
index 0000000000..1d5a99ac6b
--- /dev/null
+++ b/addons/common/functions/fnc_isAlive.sqf
@@ -0,0 +1,14 @@
+/*
+ * Author: commy2
+ *
+ * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true.
+ *
+ * Argument:
+ * 0: Any object (Object)
+ *
+ * Return value:
+ * The object exists and is alive (Bool).
+ */
+#include "script_component.hpp"
+
+!isNull (_this select 0) && {alive (_this select 0)}
diff --git a/addons/common/functions/fnc_limitMovementSpeed.sqf b/addons/common/functions/fnc_limitMovementSpeed.sqf
deleted file mode 100644
index ad3d08c66c..0000000000
--- a/addons/common/functions/fnc_limitMovementSpeed.sqf
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * fn_limitMovementSpeed.sqf
- * @Descr: Limits the movement speed of a unit
- * @Author: Glowbal
- *
- * @Arguments: [unit OBJECT, fallDown BOOL (Optional)]
- * @Return: void
- * @PublicAPI: true
- */
-
-#include "script_component.hpp"
-
-private ["_unit","_carriedObj"];
-_unit = _this select 0;
-_fallDown = false;
-if (count _this > 1) then {
- _fallDown = _this select 1;
-};
-
-if ((_unit getvariable [QGVAR(limitMovementSpeed),false])) exitwith {
- _unit setvariable [QGVAR(limitMovementSpeed),nil,true];
-};
-
-[{
- private["_unit","_fallDown","_carriedObj"];
- _unit = (_this select 0) select 0;
- _fallDown = (_this select 0) select 1;
-
- _carriedObj = [_unit] call FUNC(getCarriedObj);
-
- if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith {
- [(_this select 1)] call cba_fnc_removePerFrameHandler;
- };
- if !((!isNull _carriedObj) && (alive _unit)) exitwith {
- [(_this select 1)] call cba_fnc_removePerFrameHandler;
- };
-
- if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then {
-
- _unit setVelocity [0,0,0];
-
- if (_fallDown) then {
- _unit playMove "amovppnemstpsraswrfldnon";
- };
-
- if (_carriedObj isKindOf "Man") then {
- hint "You can not move this fast while transporting this person.";
- } else {
- hint "You can not move this fast while carrying this object";
- };
- [_unit,ObjNull] call FUNC(carryObj);
- };
-}, 0.5, [_unit,_fallDown] ] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf
index 0d2995db1b..53bf51d599 100644
--- a/addons/common/functions/fnc_loadPerson.sqf
+++ b/addons/common/functions/fnc_loadPerson.sqf
@@ -35,8 +35,6 @@ if (_unit distance _loadcar <= 10) then {
};
if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
- [_caller,objNull] call FUNC(carryObj);
- [_unit,objNull] call FUNC(carryObj);
[[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc);
};
_vehicle
\ No newline at end of file
diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf
index 1e8e9001aa..69d86eac98 100644
--- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf
+++ b/addons/common/functions/fnc_loadSettingsFromProfile.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Load the user setable settings from the user profile.
* Config < Server UserConfig < Mission Config < Client settings
*
diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf
index 20a7e1c40f..2548c44bec 100644
--- a/addons/common/functions/fnc_loadSettingsOnServer.sqf
+++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Load the parameters on the server.
* Config < Server UserConfig < Mission Config
*
diff --git a/addons/common/functions/fnc_logControls.sqf b/addons/common/functions/fnc_logControls.sqf
index 5a0a17c317..5bcaea779b 100644
--- a/addons/common/functions/fnc_logControls.sqf
+++ b/addons/common/functions/fnc_logControls.sqf
@@ -1,15 +1,4 @@
// by commy2
#include "script_component.hpp"
-private ["_array", "_index"];
-
-_array = [];
-
-for "_index" from 0 to 10000 do {
- if (str (findDisplay _this displayCtrl _index) != "No control") then {
- diag_log text str (findDisplay _this displayCtrl _index);
- _array pushBack _index;
- };
-};
-
-_array;
+[allControls findDisplay _this, {ctrlIDC _this}] call FUNC(map)
diff --git a/addons/common/functions/fnc_logDisplays.sqf b/addons/common/functions/fnc_logDisplays.sqf
index 81598facf4..0ab4fbe5bc 100644
--- a/addons/common/functions/fnc_logDisplays.sqf
+++ b/addons/common/functions/fnc_logDisplays.sqf
@@ -1,15 +1,4 @@
// by commy2
#include "script_component.hpp"
-private ["_array", "_index"];
-
-_array = [];
-
-for "_index" from 0 to 10000 do {
- if (str (findDisplay _index) != "No Display") then {
- diag_log text str findDisplay _index;
- _array pushBack _index;
- };
-};
-
-_array;
+[allDisplays, {ctrlIDD _this}] call FUNC(map)
diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf
index 465955b455..fe62ab626b 100644
--- a/addons/common/functions/fnc_numberToDigits.sqf
+++ b/addons/common/functions/fnc_numberToDigits.sqf
@@ -12,33 +12,29 @@
*/
#include "script_component.hpp"
-private ["_number", "_minLength", "_length", "_digits", "_index", "_count"];
+private ["_number", "_minLength", "_length", "_digits"];
_number = _this select 0;
_minLength = _this select 1;
_number = _number min 999999;
-_length = floor (log _number + 1);
-if !(isNil "_minLength") then {_length = (_length max _minLength) min 6};
+_number = str _number;
+
+_length = count _number;
+
+if (isNil "_minLength") then {_minLength = _length};
+
+_minLength = _minLength min 6;
+
+while {_length < _minLength} do {
+ _number = "0" + _number;
+ _length = _length + 1;
+};
_digits = [];
-
-if (_number < 1) exitWith {
- for "_index" from 0 to (_length - 1) do {
- _digits set [_index, 0];
- };
- _digits
+for "_x" from 0 to (_length - 1) do {
+ _digits pushBack parseNumber (_number select [_x, 1]);
};
-while {
- _count = count _digits;
- _count < _length
-} do {
- _digit = floor (_number / (10 ^ (_length - _count - 1)));
- {
- _digit = _digit - _x * (10 ^ (_count - _forEachIndex));
- } forEach _digits;
- _digits set [_count, _digit];
-};
_digits
diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf
index db4e33e6cb..24b3791d68 100644
--- a/addons/common/functions/fnc_numberToDigitsString.sqf
+++ b/addons/common/functions/fnc_numberToDigitsString.sqf
@@ -12,14 +12,24 @@
*/
#include "script_component.hpp"
-private ["_digits", "_count", "_string", "_index"];
+private ["_number", "_minLength", "_length"];
-_digits = _this call FUNC(numberToDigits);
+_number = _this select 0;
+_minLength = _this select 1;
-_count = count _digits;
+_number = _number min 999999;
-_string = "";
-for "_index" from 0 to (_count - 1) do {
- _string = _string + str (_digits select _index);
+_number = str _number;
+
+_length = count _number;
+
+if (isNil "_minLength") then {_minLength = _length};
+
+_minLength = _minLength min 6;
+
+while {_length < _minLength} do {
+ _number = "0" + _number;
+ _length = _length + 1;
};
-_string
+
+_number
diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf
index 4fa1dbeb98..5588c23781 100644
--- a/addons/common/functions/fnc_owned.sqf
+++ b/addons/common/functions/fnc_owned.sqf
@@ -1,8 +1,19 @@
-// by commy2
+/*
+ * Author: commy2
+ *
+ * Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit.
+ *
+ * Arguments:
+ * 0: Any object. (Object)
+ *
+ * Return Value:
+ * Is this object claimed by someone?
+ *
+ */
#include "script_component.hpp"
-private "_object";
+private "_target";
-_object = _this select 0;
+_target = _this select 0;
-!isNull (_object getVariable ["ACE_isUsedBy", objNull])
+!isNull (_target getVariable [QGVAR(owner), objNull])
diff --git a/addons/common/functions/fnc_positionToASL.sqf b/addons/common/functions/fnc_positionToASL.sqf
new file mode 100644
index 0000000000..d933e67125
--- /dev/null
+++ b/addons/common/functions/fnc_positionToASL.sqf
@@ -0,0 +1,21 @@
+/*
+ * Author: esteldunedain
+ * Converts Arma "Position" to ASL
+ *
+ * Arguments:
+ * 0: position x
+ * 1: position y
+ * 2: position z
+ *
+ * Return Value:
+ * None
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+if (surfaceIsWater _this) then {
+ _this
+} else {
+ ATLtoASL _this
+};
diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf
index 0b8fcc7ac4..3191a57d72 100644
--- a/addons/common/functions/fnc_progressBar.sqf
+++ b/addons/common/functions/fnc_progressBar.sqf
@@ -1,24 +1,24 @@
/*
-* Author: commy2, Glowbal, PabstMirror
-*
-* Draw progress bar and execute given function if succesful.
-* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
-*
-* Argument:
-* 0: NUMBER - Total Time (in game "time" seconds)
-* 1: ARRAY - Arguments, passed to condition, fail and finish
-* 2: CODE or STRING - On Finish: Code called or STRING raised as event.
-* 3: CODE or STRING - On Failure: Code called or STRING raised as event.
-* 4: STRING - (Optional) Localized Title
-* 5: CODE - (Optional) Code to check each frame
-* 6: ARRAY - (Optional) Exceptions for checking EGVAR(common,canInteract)
-*
-* Return value:
-* Nothing
-*
-* Example:
-* [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar
-*/
+ * Author: commy2, Glowbal, PabstMirror
+ *
+ * Draw progress bar and execute given function if succesful.
+ * Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
+ *
+ * Argument:
+ * 0: NUMBER - Total Time (in game "time" seconds)
+ * 1: ARRAY - Arguments, passed to condition, fail and finish
+ * 2: CODE or STRING - On Finish: Code called or STRING raised as event.
+ * 3: CODE or STRING - On Failure: Code called or STRING raised as event.
+ * 4: STRING - (Optional) Localized Title
+ * 5: CODE - (Optional) Code to check each frame
+ * 6: ARRAY - (Optional) Exceptions for checking EFUNC(common,canInteractWith)
+ *
+ * Return value:
+ * Nothing
+ *
+ * Example:
+ * [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar
+ */
#include "script_component.hpp"
@@ -36,65 +36,70 @@ createDialog QGVAR(ProgressBar_Dialog);
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle;
if (GVAR(SettingProgressBarLocation) == 1) then {
- private "_ctrlPos";
- _ctrlPos = [1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2), 29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2), 38 * (((safezoneW / safezoneH) min 1.2) / 40), 0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)];
- (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos;
- (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos;
- (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0;
- (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0;
+ private "_ctrlPos";
+ _ctrlPos = [1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2), 29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2), 38 * (((safezoneW / safezoneH) min 1.2) / 40), 0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)];
+ (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos;
+ (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos;
+ (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0;
+ (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0;
};
_perFrameFunction = {
- PARAMS_2(_parameters,_pfhID);
- EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions);
- private ["_elapsedTime", "_errorCode"];
+ PARAMS_2(_parameters,_pfhID);
+ EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions);
+ private ["_elapsedTime", "_errorCode"];
- _elapsedTime = time - _startTime;
- _errorCode = -1;
+ _elapsedTime = time - _startTime;
+ _errorCode = -1;
- if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then {
- _errorCode = 1;
- } else {
- if (ACE_player != _player) then {
- _errorCode = 2;
+ // this does not check: target fell unconscious, target died, target moved inside vehicle / left vehicle, target moved outside of players range, target moves at all.
+ if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then {
+ _errorCode = 1;
} else {
- if (!([_args, _elapsedTime, _totalTime, _errorCode] call _condition)) then {
- _errorCode = 3;
- } else {
- if (!(_exceptions call EGVAR(common,canInteract))) then {
- _errorCode = 4;
+ if (ACE_player != _player) then {
+ _errorCode = 2;
} else {
- if (_elapsedTime >= _totalTime) then {
- _errorCode = 0;
- };
+ if (!([_args, _elapsedTime, _totalTime, _errorCode] call _condition)) then {
+ _errorCode = 3;
+ } else {
+ if (!([_player, objNull, _exceptions] call EFUNC(common,canInteractWith))) then {
+ _errorCode = 4;
+ } else {
+ if (_elapsedTime >= _totalTime) then {
+ _errorCode = 0;
+ };
+ };
+ };
};
- };
};
- };
- if (_errorCode != -1) then {
- //Error or Success, close dialog and remove PFEH
- closeDialog 0;
- [_pfhID] call CBA_fnc_removePerFrameHandler;
+ if (_errorCode != -1) then {
+ //Error or Success, close dialog and remove PFEH
- if (_errorCode == 0) then {
- if ((typeName _onFinish) == (typeName "")) then {
- [_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
- } else {
- [_args, _elapsedTime, _totalTime, _errorCode] call _onFinish;
- };
+ //Only close dialog if it's the progressBar:
+ if (!isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then {
+ closeDialog 0;
+ };
+ [_pfhID] call CBA_fnc_removePerFrameHandler;
+
+ if (_errorCode == 0) then {
+ if ((typeName _onFinish) == (typeName "")) then {
+ [_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
+ } else {
+ [_args, _elapsedTime, _totalTime, _errorCode] call _onFinish;
+ };
+ } else {
+ if ((typeName _onFail) == (typeName "")) then {
+ [_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
+ } else {
+ [_args, _elapsedTime, _totalTime, _errorCode] call _onFail;
+ };
+ };
} else {
- if ((typeName _onFail) == (typeName "")) then {
- [_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
- } else {
- [_args, _elapsedTime, _totalTime, _errorCode] call _onFail;
- };
+ //Update Progress Bar (ratio of elepased:total)
+ (uiNamespace getVariable QGVAR(ctrlProgressBar)) progressSetPosition (_elapsedTime / _totalTime);
};
- } else {
- //Update Progress Bar (ratio of elepased:total)
- (uiNamespace getVariable QGVAR(ctrlProgressBar)) progressSetPosition (_elapsedTime / _totalTime);
- };
};
[_perFrameFunction, 0, [_args, _onFinish, _onFail, _condition, _player, time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf
index 0f3ab447b1..c92bb4ab94 100644
--- a/addons/common/functions/fnc_readSettingFromModule.sqf
+++ b/addons/common/functions/fnc_readSettingFromModule.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
*
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
* Must be called on the server, effect is global.
diff --git a/addons/common/functions/fnc_removeCameraEventHandler.sqf b/addons/common/functions/fnc_removeCameraEventHandler.sqf
deleted file mode 100644
index 0fe8953078..0000000000
--- a/addons/common/functions/fnc_removeCameraEventHandler.sqf
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Author: commy2
- *
- * Remove a camera view event handler.
- *
- * Argument:
- * 0: ID of the event handler (Number)
- *
- * Return value:
- * None.
- */
-#include "script_component.hpp"
-
-private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
-
-_id = _this select 0;
-
-_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]];
-
-_currentId = _actionsVar select 0;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_id = _actionIDs find _id;
-
-if (_id == -1) exitWith {};
-
-_actionIDs set [_id, -1];
-_actionIDs = _actionIDs - [-1];
-
-_actions set [_id, []];//{}
-_actions = _actions - [[]];//[{}]
-
-missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_currentId, _actionIDs, _actions]];
diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf
new file mode 100644
index 0000000000..6cfd751c4c
--- /dev/null
+++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf
@@ -0,0 +1,34 @@
+/*
+ * Author: commy2
+ *
+ * Remove a condition that gets checked by ace_common_fnc_canInteractWith.
+ *
+ * Arguments:
+ * 0: The conditions id. (String)
+ *
+ * Return Value:
+ * Unit can interact?
+ *
+ */
+#include "script_component.hpp"
+
+private "_conditionName";
+
+_conditionName = toLower (_this select 0);
+
+private ["_conditions", "_conditionNames", "_conditionFuncs"];
+
+_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
+
+_conditionNames = _conditions select 0;
+_conditionFuncs = _conditions select 1;
+
+private "_index";
+_index = _conditionNames find _conditionName;
+
+if (_index == -1) exitWith {};
+
+_conditionNames deleteAt _index;
+_conditionFuncs deleteAt _index;
+
+GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs];
diff --git a/addons/common/functions/fnc_removeCustomEventHandler.sqf b/addons/common/functions/fnc_removeCustomEventHandler.sqf
deleted file mode 100644
index 771ea9f5bf..0000000000
--- a/addons/common/functions/fnc_removeCustomEventHandler.sqf
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Author: commy2
- *
- * Remove a custom event handler from an object.
- *
- * Argument:
- * 0: Unit the event handler is assigned to or namespace (Object OR Namespace)
- * 1: Name of the event (String)
- * 2: ID of the event handler (Number)
- *
- * Return value:
- * None.
- */
-#include "script_component.hpp"
-
-private ["_object", "_type", "_id", "_name", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
-
-_object = _this select 0;
-_type = _this select 1;
-_id = _this select 2;
-
-_name = format ["ACE_CustomEventHandlers_%1", _type];
-
-_actionsVar = _object getVariable [_name, [-1, [], []]];
-
-_currentId = _actionsVar select 0;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_id = _actionIDs find _id;
-
-if (_id == -1) exitWith {};
-
-_actionIDs set [_id, -1];
-_actionIDs = _actionIDs - [-1];
-
-_actions set [_id, []];//{}
-_actions = _actions - [[]];//[{}]
-
-_object setVariable [_name, [_currentId, _actionIDs, _actions]];
diff --git a/addons/common/functions/fnc_removeSpecificMagazine.sqf b/addons/common/functions/fnc_removeSpecificMagazine.sqf
new file mode 100644
index 0000000000..ec24dbf618
--- /dev/null
+++ b/addons/common/functions/fnc_removeSpecificMagazine.sqf
@@ -0,0 +1,69 @@
+/*
+ * Author: esteldunedain
+ * Removes a magazine from the unit that has an specific ammo count
+ *
+ * Argument:
+ * 0: Player
+ * 1: Magazine
+ * 2: Ammo count
+ *
+ * Return value:
+ * None
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_player,_magazineType,_ammoCount);
+
+private ["_magazines","_index","_isRemoved"];
+_isRemoved = false;
+
+// Check uniform
+_magazines = [magazinesAmmoCargo uniformContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
+_index = _magazines find [_magazineType,_ammoCount];
+if (_index > -1) exitWith {
+ {
+ _player removeItemFromUniform (_x select 0);
+ } forEach _magazines;
+
+ {
+ if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
+ _isRemoved = true;
+ } else {
+ (uniformContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
+ };
+ } forEach _magazines;
+};
+
+// Check vest
+_magazines = [magazinesAmmoCargo vestContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
+_index = _magazines find [_magazineType,_ammoCount];
+if (_index > -1) exitWith {
+ {
+ _player removeItemFromVest (_x select 0);
+ } forEach _magazines;
+
+ {
+ if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
+ _isRemoved = true;
+ } else {
+ (vestContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
+ };
+ } forEach _magazines;
+};
+
+// Check backpack
+_magazines = [magazinesAmmoCargo backpackContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
+_index = _magazines find [_magazineType,_ammoCount];
+if (_index > -1) exitWith {
+ {
+ _player removeItemFromBackpack (_x select 0);
+ } forEach _magazines;
+
+ {
+ if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
+ _isRemoved = true;
+ } else {
+ (backpackContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
+ };
+ } forEach _magazines;
+};
diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf
index 44717915db..85f743150e 100644
--- a/addons/common/functions/fnc_sanitizeString.sqf
+++ b/addons/common/functions/fnc_sanitizeString.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard, based on Killzone-Kid code
+ * Author: esteldunedain, based on Killzone-Kid code
*
* Removes quotation marks to avoid exploits and optionally html tags from text to avoid conflicts with structured text.
*
diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf
index e2c981302d..058b68b3cc 100644
--- a/addons/common/functions/fnc_serverLog.sqf
+++ b/addons/common/functions/fnc_serverLog.sqf
@@ -1,4 +1,4 @@
-// by CAA-Picard
+// by esteldunedain
#include "script_component.hpp"
if (isServer) then {
diff --git a/addons/common/functions/fnc_setCarriedBy.sqf b/addons/common/functions/fnc_setCarriedBy.sqf
deleted file mode 100644
index 2ea5f3f469..0000000000
--- a/addons/common/functions/fnc_setCarriedBy.sqf
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * fn_setCarriedBy.sqf
- * @Descr: Registers an object being carried by another object
- * @Author: Glowbal
- *
- * @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT]
- * @Return: BOOL True if succesfully registered
- * @PublicAPI: false
- */
-
-#include "script_component.hpp"
-
-private ["_unit","_to","_return"];
-_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
-_to = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param;
-_return = false;
-if ((isNull ([_unit] call FUNC(getCarriedBy))) || isNull _to) then {
- _return = true;
- _unit setvariable [QGVAR(carriedBy),_to,true];
-};
-_return
\ No newline at end of file
diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf
index 889c242bb3..4dbc5fc84e 100644
--- a/addons/common/functions/fnc_setParameter.sqf
+++ b/addons/common/functions/fnc_setParameter.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
*
* Sets the value of an ACE_Parameter and makes it public.
*
diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf
index ae4b1d6655..67068c6ad1 100644
--- a/addons/common/functions/fnc_setSetting.sqf
+++ b/addons/common/functions/fnc_setSetting.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Change the value of an existing setting if it was not previously forced. Force if neccesary.
* If executed on clients it has local effect.
* If executed on server it can have global effect if the last parameter is set to true.
diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf
index 27c727acab..9d93b9e62d 100644
--- a/addons/common/functions/fnc_setSettingFromConfig.sqf
+++ b/addons/common/functions/fnc_setSettingFromConfig.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Load a setting from config if it was not previosuly forced. Force if neccesary.
*
* Arguments:
diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf
index 6953d39fb5..e5e30b6664 100644
--- a/addons/common/functions/fnc_throttledPublicVariable.sqf
+++ b/addons/common/functions/fnc_throttledPublicVariable.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
* Schedules the publishment of an object variable to reduce network overhead
*
* Arguments:
diff --git a/addons/common/functions/fnc_toHex.sqf b/addons/common/functions/fnc_toHex.sqf
index df8f3654de..2d7d7a383e 100644
--- a/addons/common/functions/fnc_toHex.sqf
+++ b/addons/common/functions/fnc_toHex.sqf
@@ -1,47 +1,48 @@
/*
-Author: commy2
+Author: commy2, esteldunedain
Description:
Converts number to hexadecimal number
Arguments:
-A number
+A number between 0 and 255
Return Value:
A hexadecimal number, String
*/
#include "script_component.hpp"
-private ["_number", "_minLength", "_sign", "_hex", "_rest"];
+private ["_number"];
+_number = ((round abs (_this select 0)) max 0) min 255;
-_number = _this select 0;
-_minLength = _this select 1;
+if (isNil QGVAR(hexArray)) then {
+ private ["_minLength", "_i", "_num", "_hex", "_rest"];
-if (isNil "_minLength") then {_minLength = 1};
+ GVAR(hexArray) = [];
+ _minLength = 2;
+ for [{_i = 0;}, {_i < 256}, {_i = _i + 1}] do {
+ _num = _i;
+ _hex = ["", "0"] select (_i == 0);
-_sign = ["", "-"] select (_number < 0);
-
-_number = round abs _number;
-_hex = ["", "0"] select (_number == 0);
-
-while {_number > 0} do {
- _rest = _number mod 16;
- _rest = switch _rest do {
- case 10 : {"A"};
- case 11 : {"B"};
- case 12 : {"C"};
- case 13 : {"D"};
- case 14 : {"E"};
- case 15 : {"F"};
- default {str _rest};
- };
- _number = floor (_number / 16);
-
- _hex = _rest + _hex;
+ while {_num > 0} do {
+ _rest = _num mod 16;
+ _rest = switch _rest do {
+ case 10 : {"A"};
+ case 11 : {"B"};
+ case 12 : {"C"};
+ case 13 : {"D"};
+ case 14 : {"E"};
+ case 15 : {"F"};
+ default {str _rest};
+ };
+ _num = floor (_num / 16);
+ _hex = _rest + _hex;
+ };
+ while {count toArray _hex < _minLength} do {
+ _hex = "0" + _hex;
+ };
+ GVAR(hexArray) pushBack _hex;
+ };
};
-while {count toArray _hex < _minLength} do {
- _hex = "0" + _hex;
-};
-
-_sign + _hex
+(GVAR(hexArray) select _number)
diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf
index 7b106cc0c1..777cd72c0a 100644
--- a/addons/common/functions/fnc_waitAndExecute.sqf
+++ b/addons/common/functions/fnc_waitAndExecute.sqf
@@ -1,5 +1,5 @@
/*
- * Author: CAA-Picard
+ * Author: esteldunedain
*
* Executes a code once with a given game time delay, using a PFH
*
diff --git a/addons/common/scripts/initCanInteractFunction.sqf b/addons/common/scripts/initCanInteractFunction.sqf
deleted file mode 100644
index a0a6eb787f..0000000000
--- a/addons/common/scripts/initCanInteractFunction.sqf
+++ /dev/null
@@ -1,20 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-private ["_function", "_configFile", "_count", "_index", "_config", "_configName", "_condition"];
-
-_function = "private '_exceptions'; _exceptions = _this; alive ACE_player";
-
-_configFile = configFile >> "ACE_canInteractConditions";
-_count = count _configFile;
-
-for "_index" from 0 to (_count -1) do {
- _config = _configFile select _index;
- _configName = configName _config;
-
- _condition = getText (_config >> "condition");
-
- _function = _function + format ["&& {%1 || {'%2' in _exceptions}}", _condition, _configName];
-};
-
-GVAR(canInteract) = compileFinal _function;
diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml
index d1462c1214..71d7bcd5a0 100644
--- a/addons/common/stringtable.xml
+++ b/addons/common/stringtable.xml
@@ -339,6 +339,13 @@
The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified.
+
+
+ Banana
+
+
+ A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa.
+
\ No newline at end of file
diff --git a/addons/disposable/CfgEventHandlers.hpp b/addons/disposable/CfgEventHandlers.hpp
index 304f304774..02d0cb625f 100644
--- a/addons/disposable/CfgEventHandlers.hpp
+++ b/addons/disposable/CfgEventHandlers.hpp
@@ -1,44 +1,44 @@
class Extended_PreInit_EventHandlers {
- class ADDON {
- init = QUOTE( call COMPILE_FILE(XEH_preInit) );
- };
+ class ADDON {
+ init = QUOTE( call COMPILE_FILE(XEH_preInit) );
+ };
};
class Extended_PostInit_EventHandlers {
- class ADDON {
- clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) );
- };
+ class ADDON {
+ clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) );
+ };
};
class Extended_FiredBIS_EventHandlers {
- class CAManBase {
- class ADDON {
- firedBIS = QUOTE( _this call FUNC(replaceATWeapon) );
+ class CAManBase {
+ class ADDON {
+ firedBIS = QUOTE( _this call FUNC(replaceATWeapon) );
+ };
};
- };
};
// handle preloaded missile
class Extended_Init_EventHandlers {
- class CAManBase {
- class ADDON {
- init = QUOTE( _this call FUNC(takeLoadedATWeapon) );
+ class CAManBase {
+ class ADDON {
+ init = QUOTE( _this call FUNC(takeLoadedATWeapon) );
+ };
};
- };
};
class Extended_Take_EventHandlers {
- class CAManBase {
- class ADDON {
- take = QUOTE( _this call FUNC(takeLoadedATWeapon); [_this select 0] call FUNC(updateInventoryDisplay); );
+ class CAManBase {
+ class ADDON {
+ take = QUOTE( _this call FUNC(takeLoadedATWeapon); [_this select 0] call FUNC(updateInventoryDisplay); );
+ };
};
- };
};
class Extended_Put_EventHandlers {
- class CAManBase {
- class ADDON {
- put = QUOTE( [_this select 0] call FUNC(updateInventoryDisplay); );
+ class CAManBase {
+ class ADDON {
+ put = QUOTE( [_this select 0] call FUNC(updateInventoryDisplay); );
+ };
};
- };
};
diff --git a/addons/disposable/CfgMagazines.hpp b/addons/disposable/CfgMagazines.hpp
index 993d53f46c..8fbae08dfd 100644
--- a/addons/disposable/CfgMagazines.hpp
+++ b/addons/disposable/CfgMagazines.hpp
@@ -1,24 +1,24 @@
class CfgMagazines {
- class NLAW_F;
- class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine
- author = "$STR_ACE_Common_ACETeam";
- scope = 1;
- displayName = "$STR_ACE_Disposable_PreloadedMissileDummy";
- picture = PATHTOEF(common,UI\blank_CO.paa);
- weaponPoolAvailable = 0;
- mass = 0;
- };
- class ACE_FiredMissileDummy: ACE_PreloadedMissileDummy {
- count = 0;
- };
- class ACE_UsedTube_F: NLAW_F {
- author = "$STR_ACE_Common_ACETeam";
- displayName = "$STR_ACE_Disposable_UsedTube";
- descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription";
- displayNameShort = "-";
- count = 0;
- weaponPoolAvailable = 0;
- modelSpecial = "";
- mass = 0;
- };
+ class NLAW_F;
+ class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine
+ author = "$STR_ACE_Common_ACETeam";
+ scope = 1;
+ displayName = "$STR_ACE_Disposable_PreloadedMissileDummy";
+ picture = PATHTOEF(common,UI\blank_CO.paa);
+ weaponPoolAvailable = 0;
+ mass = 0;
+ };
+ class ACE_FiredMissileDummy: ACE_PreloadedMissileDummy {
+ count = 0;
+ };
+ class ACE_UsedTube_F: NLAW_F {
+ author = "$STR_ACE_Common_ACETeam";
+ displayName = "$STR_ACE_Disposable_UsedTube";
+ descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription";
+ displayNameShort = "-";
+ count = 0;
+ weaponPoolAvailable = 0;
+ modelSpecial = "";
+ mass = 0;
+ };
};
diff --git a/addons/disposable/CfgVehicles.hpp b/addons/disposable/CfgVehicles.hpp
index b3b9436484..13d4cedf4b 100644
--- a/addons/disposable/CfgVehicles.hpp
+++ b/addons/disposable/CfgVehicles.hpp
@@ -1,146 +1,146 @@
class CfgVehicles {
- #define MACRO_NONLAW \
- class TransportMagazines { \
- class _xx_NLAW_F { \
- count = 0; \
- }; \
+#define MACRO_NONLAW \
+ class TransportMagazines { \
+ class _xx_NLAW_F { \
+ count = 0; \
+ }; \
+ };
+
+ class ReammoBox_F;
+ class NATO_Box_Base: ReammoBox_F {};
+ class Box_NATO_Ammo_F: NATO_Box_Base {
+ MACRO_NONLAW
+ };
+ class Box_NATO_WpsLaunch_F: NATO_Box_Base {
+ MACRO_NONLAW
};
- class ReammoBox_F;
- class NATO_Box_Base: ReammoBox_F {};
- class Box_NATO_Ammo_F: NATO_Box_Base {
- MACRO_NONLAW
- };
- class Box_NATO_WpsLaunch_F: NATO_Box_Base {
- MACRO_NONLAW
- };
+ class IND_Box_Base: ReammoBox_F {};
+ class Box_IND_WpsLaunch_F: IND_Box_Base {
+ MACRO_NONLAW
+ };
+ class Box_IND_Ammo_F: IND_Box_Base {
+ MACRO_NONLAW
+ };
- class IND_Box_Base: ReammoBox_F {};
- class Box_IND_WpsLaunch_F: IND_Box_Base {
- MACRO_NONLAW
- };
- class Box_IND_Ammo_F: IND_Box_Base {
- MACRO_NONLAW
- };
+ class B_supplyCrate_F: ReammoBox_F {
+ MACRO_NONLAW
+ };
+ class I_supplyCrate_F: B_supplyCrate_F {
+ MACRO_NONLAW
+ };
+ class C_supplyCrate_F: ReammoBox_F {
+ MACRO_NONLAW
+ };
- class B_supplyCrate_F: ReammoBox_F {
- MACRO_NONLAW
- };
- class I_supplyCrate_F: B_supplyCrate_F {
- MACRO_NONLAW
- };
- class C_supplyCrate_F: ReammoBox_F {
- MACRO_NONLAW
- };
+ class B_AssaultPack_rgr;
+ class B_AssaultPack_rgr_LAT: B_AssaultPack_rgr {
+ MACRO_NONLAW
+ };
+ class B_AssaultPack_rgr_ReconLAT: B_AssaultPack_rgr {
+ MACRO_NONLAW
+ };
- class B_AssaultPack_rgr;
- class B_AssaultPack_rgr_LAT: B_AssaultPack_rgr {
- MACRO_NONLAW
- };
- class B_AssaultPack_rgr_ReconLAT: B_AssaultPack_rgr {
- MACRO_NONLAW
- };
+ class B_Carryall_mcamo;
+ class B_AssaultPack_mcamo_Ammo: B_Carryall_mcamo {
+ MACRO_NONLAW
+ };
+ class B_Carryall_oli;
+ class I_Fieldpack_oli_Ammo: B_Carryall_oli {
+ MACRO_NONLAW
+ };
- class B_Carryall_mcamo;
- class B_AssaultPack_mcamo_Ammo: B_Carryall_mcamo {
- MACRO_NONLAW
- };
- class B_Carryall_oli;
- class I_Fieldpack_oli_Ammo: B_Carryall_oli {
- MACRO_NONLAW
- };
+ class B_AssaultPack_dgtl;
+ class I_Fieldpack_oli_LAT: B_AssaultPack_dgtl {
+ MACRO_NONLAW
+ };
- class B_AssaultPack_dgtl;
- class I_Fieldpack_oli_LAT: B_AssaultPack_dgtl {
- MACRO_NONLAW
- };
+ class CargoNet_01_ammo_base_F;
+ class B_CargoNet_01_ammo_F: CargoNet_01_ammo_base_F {
+ MACRO_NONLAW
+ };
+ class I_CargoNet_01_ammo_F: CargoNet_01_ammo_base_F {
+ MACRO_NONLAW
+ };
- class CargoNet_01_ammo_base_F;
- class B_CargoNet_01_ammo_F: CargoNet_01_ammo_base_F {
- MACRO_NONLAW
- };
- class I_CargoNet_01_ammo_F: CargoNet_01_ammo_base_F {
- MACRO_NONLAW
- };
+ class Slingload_01_Base_F;
+ class B_Slingload_01_Cargo_F: Slingload_01_Base_F {
+ MACRO_NONLAW
+ };
- class Slingload_01_Base_F;
- class B_Slingload_01_Cargo_F: Slingload_01_Base_F {
+ class Tank_F;
+ class APC_Tracked_01_base_F: Tank_F {
+ MACRO_NONLAW
+ };
+ /*class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {
MACRO_NONLAW
- };
-
- class Tank_F;
- class APC_Tracked_01_base_F: Tank_F {
- MACRO_NONLAW
- };
- /*class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {
- MACRO_NONLAW
- };
- class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
- MACRO_NONLAW
- };
- class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F {
- MACRO_NONLAW
- };
- class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
- MACRO_NONLAW
- };*/
-
- class Car_F;
- class MRAP_01_base_F: Car_F {
- MACRO_NONLAW
- };
- /*class MRAP_01_gmg_base_F: MRAP_01_base_F {
- MACRO_NONLAW
- };
- class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {
- MACRO_NONLAW
- };
- class B_MRAP_01_F: MRAP_01_base_F {
- MACRO_NONLAW
- };
- class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F {
- MACRO_NONLAW
- };
- class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F {
- MACRO_NONLAW
- };*/
-
- class MRAP_03_base_F: Car_F {
- MACRO_NONLAW
- };
- /*class MRAP_03_hmg_base_F: MRAP_03_base_F {
- MACRO_NONLAW
- };
- class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {
- MACRO_NONLAW
- };
- class I_MRAP_03_F: MRAP_03_base_F {
- MACRO_NONLAW
- };
- class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F {
- MACRO_NONLAW
- };
- class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F {
- MACRO_NONLAW
- };*/
-
- class Wheeled_APC_F: Car_F {};
- class APC_Wheeled_03_base_F: Wheeled_APC_F {
- MACRO_NONLAW
- };
- class APC_Wheeled_01_base_F: Wheeled_APC_F {
- MACRO_NONLAW
- };
- /*class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {
- MACRO_NONLAW
- };
- class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
- MACRO_NONLAW
- };
- class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F {
- MACRO_NONLAW
- };
- class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F {
- MACRO_NONLAW
- };*/
+};
+class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
+ MACRO_NONLAW
+};
+class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F {
+ MACRO_NONLAW
+};
+class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
+ MACRO_NONLAW
+};*/
+
+ class Car_F;
+ class MRAP_01_base_F: Car_F {
+ MACRO_NONLAW
+ };
+ /*class MRAP_01_gmg_base_F: MRAP_01_base_F {
+ MACRO_NONLAW
+};
+class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {
+ MACRO_NONLAW
+};
+class B_MRAP_01_F: MRAP_01_base_F {
+ MACRO_NONLAW
+};
+class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F {
+ MACRO_NONLAW
+};
+class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F {
+ MACRO_NONLAW
+};*/
+
+ class MRAP_03_base_F: Car_F {
+ MACRO_NONLAW
+ };
+ /*class MRAP_03_hmg_base_F: MRAP_03_base_F {
+ MACRO_NONLAW
+};
+class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {
+ MACRO_NONLAW
+};
+class I_MRAP_03_F: MRAP_03_base_F {
+ MACRO_NONLAW
+};
+class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F {
+ MACRO_NONLAW
+};
+class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F {
+ MACRO_NONLAW
+};*/
+
+ class Wheeled_APC_F: Car_F {};
+ class APC_Wheeled_03_base_F: Wheeled_APC_F {
+ MACRO_NONLAW
+ };
+ class APC_Wheeled_01_base_F: Wheeled_APC_F {
+ MACRO_NONLAW
+ };
+ /*class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {
+ MACRO_NONLAW
+};
+class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
+ MACRO_NONLAW
+};
+class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F {
+ MACRO_NONLAW
+};
+class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F {
+ MACRO_NONLAW
+};*/
};
diff --git a/addons/disposable/CfgWeapons.hpp b/addons/disposable/CfgWeapons.hpp
index 4bd36ce3ed..965d97521c 100644
--- a/addons/disposable/CfgWeapons.hpp
+++ b/addons/disposable/CfgWeapons.hpp
@@ -1,18 +1,18 @@
class CfgWeapons {
- class Launcher_Base_F;
- class launch_NLAW_F: Launcher_Base_F {
- ACE_UsedTube = "ACE_launch_NLAW_Used_F"; // The class name of the used tube.
- magazines[] = {"ACE_PreloadedMissileDummy"}; // The dummy magazine
- };
- class ACE_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher
- scope = 1;
- ACE_isUsedLauncher = 1;
- author = "$STR_ACE_Common_ACETeam";
- displayName = "$STR_ACE_Disposable_UsedTube";
- descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription";
- magazines[] = {"ACE_FiredMissileDummy"}; // This will disable the used launcher class from being fired again.
- //picture = ""; @todo
- //model = ""; @todo
- weaponPoolAvailable = 0;
- };
+ class Launcher_Base_F;
+ class launch_NLAW_F: Launcher_Base_F {
+ ACE_UsedTube = "ACE_launch_NLAW_Used_F"; // The class name of the used tube.
+ magazines[] = {"ACE_PreloadedMissileDummy"}; // The dummy magazine
+ };
+ class ACE_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher
+ scope = 1;
+ ACE_isUsedLauncher = 1;
+ author = "$STR_ACE_Common_ACETeam";
+ displayName = "$STR_ACE_Disposable_UsedTube";
+ descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription";
+ magazines[] = {"ACE_FiredMissileDummy"}; // This will disable the used launcher class from being fired again.
+ //picture = ""; @todo
+ //model = ""; @todo
+ weaponPoolAvailable = 0;
+ };
};
diff --git a/addons/disposable/README.md b/addons/disposable/README.md
index 7dd85fff32..73418cd49d 100644
--- a/addons/disposable/README.md
+++ b/addons/disposable/README.md
@@ -1,7 +1,7 @@
ace_disposable
==============
-Makes the NLAW a disposable one-way weapon.
+Makes the NLAW a disposable one-shot weapon.
## Maintainers
diff --git a/addons/disposable/XEH_postInitClient.sqf b/addons/disposable/XEH_postInitClient.sqf
index 17911f5da5..1fe598137f 100644
--- a/addons/disposable/XEH_postInitClient.sqf
+++ b/addons/disposable/XEH_postInitClient.sqf
@@ -4,10 +4,8 @@
#include "script_component.hpp"
-if (isNil QGVAR(UpdateInventoryDisplay_EHID)) then {
- GVAR(UpdateInventoryDisplay_EHID) = ["inventoryDisplayLoaded",{
+["inventoryDisplayLoaded",{
_player = ACE_player;
- [_player, secondaryWeapon _player] call FUNC(takeLoadedATWeapon);
+ [_player] call FUNC(takeLoadedATWeapon);
[_player, (_this select 0)] call FUNC(updateInventoryDisplay);
- }] call EFUNC(common,addEventHandler);
-};
+}] call EFUNC(common,addEventHandler);
\ No newline at end of file
diff --git a/addons/disposable/XEH_preInit.sqf b/addons/disposable/XEH_preInit.sqf
index 26543c369a..020187b730 100644
--- a/addons/disposable/XEH_preInit.sqf
+++ b/addons/disposable/XEH_preInit.sqf
@@ -2,7 +2,6 @@
ADDON = false;
-PREP(aiDropWeaponCallback);
PREP(replaceATWeapon);
PREP(takeLoadedATWeapon);
PREP(updateInventoryDisplay);
diff --git a/addons/disposable/config.cpp b/addons/disposable/config.cpp
index be2b52735a..0f256824d7 100644
--- a/addons/disposable/config.cpp
+++ b/addons/disposable/config.cpp
@@ -1,15 +1,15 @@
#include "script_component.hpp"
class CfgPatches {
- class ADDON {
- units[] = {};
- weapons[] = {};
- requiredVersion = REQUIRED_VERSION;
- requiredAddons[] = {"ace_common"};
- author[] = {"commy2"};
- authorUrl = "https://github.com/commy2/";
- VERSION_CONFIG;
- };
+ class ADDON {
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"ace_common"};
+ author[] = {"commy2"};
+ authorUrl = "https://github.com/commy2/";
+ VERSION_CONFIG;
+ };
};
#include "CfgEventHandlers.hpp"
diff --git a/addons/disposable/functions/fnc_aiDropWeaponCallback.sqf b/addons/disposable/functions/fnc_aiDropWeaponCallback.sqf
deleted file mode 100644
index f6947f7e44..0000000000
--- a/addons/disposable/functions/fnc_aiDropWeaponCallback.sqf
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-* Author: bux, commy2
-*
-* Remove the ai's missle launcher tube
-*
-* Return value:
-* Nothing
-*/
-
-#include "script_component.hpp"
-
-private ["_unit", "_tube", "_projectile", "_logic"];
-
-_unit = (_this select 0) select 0;
-_tube = (_this select 0) select 1;
-_projectile = (_this select 0) select 2;
-
-if (!isNull _projectile) exitWith {};
-
-//remove frameEH
-[(_this select 1)] call cba_fnc_removePerFrameHandler;
-
-if ([_unit] call EFUNC(common,isPlayer)) exitWith {}; //Just in case a player took control
-if (!alive _unit) exitWith {}; //No point doing this for dead
-
-//If AI still has tube, throw it on ground
-if (secondaryWeapon _unit == _tube) then {
- _logic = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"];
- _logic addWeaponCargoGlobal [_tube, 1]; // @todo secondary weapon items
-
- _unit removeWeaponGlobal _tube;
-};
diff --git a/addons/disposable/functions/fnc_replaceATWeapon.sqf b/addons/disposable/functions/fnc_replaceATWeapon.sqf
index ea107d1643..8c55209123 100644
--- a/addons/disposable/functions/fnc_replaceATWeapon.sqf
+++ b/addons/disposable/functions/fnc_replaceATWeapon.sqf
@@ -1,38 +1,79 @@
/*
- * Author: commy2
- *
+ * Author: bux, commy2
* Replace the disposable launcher with the used dummy.
- *
- * Argument:
- * Input from "Fired" eventhandler
- *
- * Return value:
+ *
+ * Arguments:
+ * 0: unit - Object the event handler is assigned to
+ * 1: weapon - Fired weapon
+ * 2: muzzle - Muzzle that was used
+ * 3: mode - Current mode of the fired weapon
+ * 4: ammo - Ammo used
+ * 5: magazine - magazine name which was used
+ * 6: projectile - Object of the projectile that was shot
+ *
+ * Return Value:
* Nothing
+ *
+ * Example:
+ * [fromBisFiredEH] call ace_disposable_fnc_replaceATWeapon;
+ *
+ * Public: No
*/
-
#include "script_component.hpp"
-private ["_unit", "_tube", "_projectile"];
+private ["_unit", "_weapon", "_projectile", "_replacementTube", "_items"];
_unit = _this select 0;
-_tube = getText (configFile >> "CfgWeapons" >> (_this select 1) >> "ACE_UsedTube");
+_weapon = _this select 1;
_projectile = _this select 6;
if (!local _unit) exitWith {};
-if (_tube == "") exitWith {};
-private "_items";
+_replacementTube = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_UsedTube");
+if (_replacementTube == "") exitWith {}; //If no replacement defined just exit
+if (_weapon != (secondaryWeapon _unit)) exitWith {}; //just to be sure
+
+//Save array of items attached to launcher
_items = secondaryWeaponItems _unit;
-
-_unit addWeapon _tube;
-_unit selectWeapon _tube;
+//Replace the orginal weapon with the 'usedTube' weapon
+_unit addWeapon _replacementTube;
+//Makes sure the used tube is still equiped
+_unit selectWeapon _replacementTube;
+//Re-add all attachments to the used tube
{
- if (_x != "") then {_unit addSecondaryWeaponItem _x};
+ if (_x != "") then {_unit addSecondaryWeaponItem _x};
} forEach _items;
-// AI
+
+// AI - Remove the ai's missle launcher tube after the missle has exploded
if !([_unit] call EFUNC(common,isPlayer)) then {
- //waits until _projectile is null, so random 0-2 tickTime seconds after that
- [FUNC(aiDropWeaponCallback), 2, [_unit, _tube, _projectile]] call CBA_fnc_addPerFrameHandler;
+ [{
+ EXPLODE_2_PVT(_this,_params,_pfhId);
+ EXPLODE_3_PVT(_params,_unit,_tube,_projectile);
+
+ //don't do anything until projectile is null (exploded/max range)
+ if (isNull _projectile) then {
+ //Remove PFEH:
+ [_pfhId] call cba_fnc_removePerFrameHandler;
+
+ //If (tube is dropped) OR (is dead) OR (is player) just exit
+ if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {};
+
+ private ["_items", "_container"];
+
+ // _items = secondaryWeaponItems _unit;
+ _container = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"];
+ _container setPosAsl (getPosAsl _unit);
+ _container addWeaponCargoGlobal [_tube, 1];
+
+ //This will duplicate attachements, because we will be adding a weapon that may already have attachments on it
+ //We either need a way to add a clean weapon, or a way to add a fully configured weapon to a container:
+ // {
+ // if (_x != "") then {_container addItemCargoGlobal [_x, 1];};
+ // } forEach _items;
+
+ _unit removeWeaponGlobal _tube;
+ };
+ }, 1, [_unit, _replacementTube, _projectile]] call CBA_fnc_addPerFrameHandler;
};
diff --git a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf
index ea1b1fb379..de3875dfa0 100644
--- a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf
+++ b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf
@@ -1,48 +1,50 @@
/*
* Author: commy2
- *
* Handle the take event. Add a dummy magazine if a disposable rocket launcher is taken.
- *
- * Argument:
- * Input from "Take" eventhandler
- *
- * Return value:
- * Nothing
+ *
+ * Arguments:
+ * 0: unit - Object the event handler is assigned to
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [fromTakeEH] call ace_disposable_fnc_takeLoadedATWeapon;
+ *
+ * Public: No
*/
-
#include "script_component.hpp"
private ["_unit", "_launcher", "_config"];
-_unit = _this select 0;
-_launcher = secondaryWeapon _unit;
-
+PARAMS_1(_unit);
if (!local _unit) exitWith {};
+_launcher = secondaryWeapon _unit;
_config = configFile >> "CfgWeapons" >> _launcher;
if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber (_config >> "ACE_isUsedLauncher") != 1} && {count secondaryWeaponMagazine _unit == 0}) then {
- private ["_magazine", "_isLauncherSelected"];
+ private ["_magazine", "_isLauncherSelected"];
- _magazine = getArray (_config >> "magazines") select 0;
+ _magazine = getArray (_config >> "magazines") select 0;
- _isLauncherSelected = currentWeapon _unit == _launcher;
+ _isLauncherSelected = currentWeapon _unit == _launcher;
- _unit removeMagazines _magazine;
+ _unit removeMagazines _magazine;
- if (backpack _unit == "") then {
- _unit addBackpack "Bag_Base";
+ if (backpack _unit == "") then {
+ _unit addBackpack "Bag_Base";
- _unit addMagazine _magazine;
- _unit addWeapon _launcher;
+ _unit addMagazine _magazine;
+ _unit addWeapon _launcher;
- removeBackpack _unit;
- } else {
- _unit addMagazine _magazine;
- _unit addWeapon _launcher;
- };
+ removeBackpack _unit;
+ } else {
+ _unit addMagazine _magazine;
+ _unit addWeapon _launcher;
+ };
- if (_isLauncherSelected) then {
- _unit selectWeapon _launcher;
- };
+ if (_isLauncherSelected) then {
+ _unit selectWeapon _launcher;
+ };
};
diff --git a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf
index f33ed0dc73..3f9d6f9802 100644
--- a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf
+++ b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf
@@ -1,26 +1,28 @@
/*
* Author: bux, commy2
- *
* Hide or show the secondary weapon magazine inventory slot to prevent unloading of dummy magazines.
- *
- * Argument:
- * 0: The player. (Object)
- *
- * Return value:
- * Nothing
+ *
+ * Arguments:
+ * 0: unit - Object the event handler is assigned to
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [player] call ace_disposable_fnc_updateInventoryDisplay;
+ *
+ * Public: No
*/
-
#include "script_component.hpp"
-private ["_player", "_display"];
+disableSerialization;
-_player = _this select 0;
+PARAMS_1(_player);
+DEFAULT_PARAM(1,_display,(findDisplay 602));
_player removeMagazines "ACE_PreloadedMissileDummy";
_player removeMagazines "ACE_FiredMissileDummy";
-disableSerialization;
-_display = [_this, 1, (findDisplay 602)] call BIS_fnc_param;
if (isNull _display) exitWith {};
private ["_launcher", "_control", "_config"];
@@ -28,21 +30,21 @@ private ["_launcher", "_control", "_config"];
_launcher = secondaryWeapon _player;
if (_launcher == "" || {getText (configFile >> "CfgWeapons" >> _launcher >> "ACE_UsedTube") == ""}) then {
- _control = _display displayCtrl 627;
- _config = configFile >> "RscDisplayInventory" >> "controls" >> "SlotSecondaryMagazine";
- _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
- _control ctrlCommit 0;
+ _control = _display displayCtrl 627;
+ _config = configFile >> "RscDisplayInventory" >> "controls" >> "SlotSecondaryMagazine";
+ _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
+ _control ctrlCommit 0;
- _control = _display displayCtrl 1251;
- _config = configFile >> "RscDisplayInventory" >> "controls" >> "BackgroundSlotSecondaryMagazine";
- _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
- _control ctrlCommit 0;
+ _control = _display displayCtrl 1251;
+ _config = configFile >> "RscDisplayInventory" >> "controls" >> "BackgroundSlotSecondaryMagazine";
+ _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
+ _control ctrlCommit 0;
} else {
- _control = _display displayCtrl 627;
- _control ctrlSetPosition [0, 0, 0, 0];
- _control ctrlCommit 0;
+ _control = _display displayCtrl 627;
+ _control ctrlSetPosition [0, 0, 0, 0];
+ _control ctrlCommit 0;
- _control = _display displayCtrl 1251;
- _control ctrlSetPosition [0, 0, 0, 0];
- _control ctrlCommit 0;
+ _control = _display displayCtrl 1251;
+ _control ctrlSetPosition [0, 0, 0, 0];
+ _control ctrlCommit 0;
};
diff --git a/addons/dragging/$PBOPREFIX$ b/addons/dragging/$PBOPREFIX$
new file mode 100644
index 0000000000..4090738414
--- /dev/null
+++ b/addons/dragging/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\dragging
\ No newline at end of file
diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp
new file mode 100644
index 0000000000..f568eace4e
--- /dev/null
+++ b/addons/dragging/CfgEventHandlers.hpp
@@ -0,0 +1,52 @@
+
+class Extended_PreInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_preInit));
+ };
+};
+
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
+ serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit));
+ };
+};
+
+class Extended_Init_EventHandlers {
+ class CAManBase {
+ class ADDON {
+ init = QUOTE(_this call DFUNC(initPerson));
+ };
+ };
+ class StaticWeapon {
+ class ADDON {
+ init = QUOTE(_this call DFUNC(initObject));
+ };
+ };
+ class StaticMortar {
+ class ADDON {
+ init = QUOTE(_this call DFUNC(initObject));
+ };
+ };
+ class ReammoBox_F {
+ class ADDON {
+ init = QUOTE(_this call DFUNC(initObject));
+ };
+ };
+};
+
+class Extended_Killed_EventHandlers {
+ class CAManBase {
+ class ADDON {
+ killed = QUOTE(_this call DFUNC(handleKilled));
+ };
+ };
+};
+
+class Extended_AnimChanged_EventHandlers {
+ class CAManBase {
+ class ADDON {
+ animChanged = QUOTE(_this call DFUNC(handleAnimChanged));
+ };
+ };
+};
diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp
new file mode 100644
index 0000000000..5ac84b7038
--- /dev/null
+++ b/addons/dragging/CfgVehicles.hpp
@@ -0,0 +1,86 @@
+
+class CfgVehicles {
+ // Static weapons
+ class LandVehicle;
+ class StaticWeapon: LandVehicle {
+ GVAR(canCarry) = 1;
+ GVAR(carryPosition[]) = {0,1.2,0};
+ GVAR(carryDirection) = 0;
+
+ GVAR(canDrag) = 1;
+ GVAR(dragPosition[]) = {0,1.2,0};
+ GVAR(dragDirection) = 0;
+ };
+
+ //remove actions from Taru Pods
+ class Pod_Heli_Transport_04_base_F: StaticWeapon {
+ GVAR(canCarry) = 0;
+ GVAR(canDrag) = 0;
+ };
+
+ class StaticMortar;
+ class Mortar_01_base_F: StaticMortar {
+ GVAR(canCarry) = 1;
+ GVAR(carryPosition[]) = {0,1.2,0};
+ GVAR(carryDirection) = 0;
+
+ GVAR(canDrag) = 1;
+ GVAR(dragPosition[]) = {0,1.2,0};
+ GVAR(dragDirection) = 0;
+ };
+
+ // ammo boxes
+ class ThingX;
+ class ReammoBox_F: ThingX {
+ XEH_ENABLED;
+ GVAR(canCarry) = 0;
+ GVAR(carryPosition[]) = {0,1,1};
+ GVAR(carryDirection) = 0;
+
+ GVAR(canDrag) = 0;
+ GVAR(dragPosition[]) = {0,1.2,0};
+ GVAR(dragDirection) = 0;
+ };
+
+ class Slingload_base_F: ReammoBox_F {
+ GVAR(canCarry) = 0;
+ GVAR(canDrag) = 0;
+ };
+
+ class EAST_Box_Base: ReammoBox_F {
+ GVAR(canCarry) = 1;
+ GVAR(canDrag) = 1;
+ };
+ class IND_Box_Base: ReammoBox_F {
+ GVAR(canCarry) = 1;
+ GVAR(canDrag) = 1;
+ };
+ /*class FIA_Box_Base_F: ReammoBox_F {
+ GVAR(canCarry) = 1;
+ GVAR(canDrag) = 1;
+ };*/
+ class NATO_Box_Base: ReammoBox_F {
+ GVAR(canCarry) = 1;
+ GVAR(canDrag) = 1;
+ };
+
+ // Remove Larger crate dragging support.
+ // Would be better to allow some sort of joint push/drag functionality
+ // Requiring 2 units to access the larger crates and attaching them together (a crappy method of doing it)
+ // in order to move the bigger ones. Currently simply remove support.
+ // I believe these crates are currently broken (hitbox doesn't work or something) in 1.22 (2014-07-04)
+ class Box_East_AmmoVeh_F: EAST_Box_Base {
+ GVAR(canCarry) = 0;
+ GVAR(canDrag) = 0;
+ };
+
+ class Box_NATO_AmmoVeh_F: NATO_Box_Base {
+ GVAR(canCarry) = 0;
+ GVAR(canDrag) = 0;
+ };
+
+ class Box_IND_AmmoVeh_F: IND_Box_Base {
+ GVAR(canCarry) = 0;
+ GVAR(canDrag) = 0;
+ };
+};
diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf
new file mode 100644
index 0000000000..21d699c688
--- /dev/null
+++ b/addons/dragging/XEH_clientInit.sqf
@@ -0,0 +1,25 @@
+// by PabstMirror, commy2
+#include "script_component.hpp"
+
+[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
+
+if (isNil "ACE_maxWeightDrag") then {
+ ACE_maxWeightDrag = 800;
+};
+
+if (isNil "ACE_maxWeightCarry") then {
+ ACE_maxWeightCarry = 600;
+};
+
+["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition);
+["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
+
+// release object on player change. This does work when returning to lobby, but not when hard disconnecting.
+["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
+["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
+["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler);
+
+// handle waking up dragged unit and falling unconscious while dragging
+["medical_onUnconscious", {_this call DFUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
+
+//@todo Captivity?
diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf
new file mode 100644
index 0000000000..f596a89493
--- /dev/null
+++ b/addons/dragging/XEH_preInit.sqf
@@ -0,0 +1,32 @@
+#include "script_component.hpp"
+
+ADDON = false;
+
+PREP(canCarry);
+PREP(canDrag);
+PREP(canDrop);
+PREP(canDrop_carry);
+PREP(carryObject);
+PREP(carryObjectPFH);
+PREP(dragObject);
+PREP(dragObjectPFH);
+PREP(dropObject);
+PREP(dropObject_carry);
+PREP(getWeight);
+PREP(handleAnimChanged);
+PREP(handleKilled);
+PREP(handlePlayerChanged);
+PREP(handlePlayerWeaponChanged);
+PREP(handleScrollWheel);
+PREP(handleUnconscious);
+PREP(initObject);
+PREP(initPerson);
+PREP(isObjectOnObject);
+PREP(setCarryable);
+PREP(setDraggable);
+PREP(startCarry);
+PREP(startCarryPFH);
+PREP(startDrag);
+PREP(startDragPFH);
+
+ADDON = true;
diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf
new file mode 100644
index 0000000000..f6c231d275
--- /dev/null
+++ b/addons/dragging/XEH_serverInit.sqf
@@ -0,0 +1,5 @@
+// by commy2
+#include "script_component.hpp"
+
+// release object on hard disconnection. Function is identical to killed
+addMissionEventHandler ["HandleDisconnect", {_this call DFUNC(handleKilled)}];
diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp
new file mode 100644
index 0000000000..2d5854d86f
--- /dev/null
+++ b/addons/dragging/config.cpp
@@ -0,0 +1,16 @@
+#include "script_component.hpp"
+
+class CfgPatches {
+ class ADDON {
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"ace_common","ace_interaction","ace_interact_menu"};
+ author[] = {"Garth 'L-H' de Wet","commy2"};
+ authorUrl = "https://github.com/commy2/";
+ VERSION_CONFIG;
+ };
+};
+
+#include "CfgEventHandlers.hpp"
+#include "CfgVehicles.hpp"
diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf
new file mode 100644
index 0000000000..dbbacae915
--- /dev/null
+++ b/addons/dragging/functions/fnc_canCarry.sqf
@@ -0,0 +1,25 @@
+/*
+ * Author: commy2
+ *
+ * Check if unit can carry the object. Doesn't check weight.
+ *
+ * Argument:
+ * 0: Unit that should do the carrying (Object)
+ * 1: Object to carry (Object)
+ *
+ * Return value:
+ * Can the unit carry the object? (Bool)
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
+
+// a static weapon has to be empty for dragging
+if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
+
+alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"]}
diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf
new file mode 100644
index 0000000000..be3cda7e6c
--- /dev/null
+++ b/addons/dragging/functions/fnc_canDrag.sqf
@@ -0,0 +1,25 @@
+/*
+ * Author: commy2
+ *
+ * Check if unit can drag the object. Doesn't check weight.
+ *
+ * Argument:
+ * 0: Unit that should do the dragging (Object)
+ * 1: Object to drag (Object)
+ *
+ * Return value:
+ * Can the unit drag the object? (Bool)
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
+
+// a static weapon has to be empty for dragging
+if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
+
+alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"]}
diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf
new file mode 100644
index 0000000000..df75b9540f
--- /dev/null
+++ b/addons/dragging/functions/fnc_canDrop.sqf
@@ -0,0 +1,22 @@
+/*
+ * Author: commy2
+ *
+ * Check if unit can drop the object.
+ *
+ * Argument:
+ * 0: Unit that currently drags a object (Object)
+ * 1: Object that is dragged (Object)
+ *
+ * Return value:
+ * Can the unit drop the object? (Bool)
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false};
+
+_unit getVariable [QGVAR(draggedObject), objNull] == _target
diff --git a/addons/dragging/functions/fnc_canDrop_carry.sqf b/addons/dragging/functions/fnc_canDrop_carry.sqf
new file mode 100644
index 0000000000..9efbbe9b0f
--- /dev/null
+++ b/addons/dragging/functions/fnc_canDrop_carry.sqf
@@ -0,0 +1,22 @@
+/*
+ * Author: commy2
+ *
+ * Check if unit can drop the carried object.
+ *
+ * Argument:
+ * 0: Unit that currently carries a object (Object)
+ * 1: Object that is carried (Object)
+ *
+ * Return value:
+ * Can the unit drop the object? (Bool)
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false};
+
+_unit getVariable [QGVAR(carriedObject), objNull] == _target
diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf
new file mode 100644
index 0000000000..2037dfc3f0
--- /dev/null
+++ b/addons/dragging/functions/fnc_carryObject.sqf
@@ -0,0 +1,77 @@
+/*
+ * Author: commy2
+ *
+ * Carry an object.
+ *
+ * Argument:
+ * 0: Unit that should do the carrying (Object)
+ * 1: Object to carry (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+// get attachTo offset and direction.
+private ["_position", "_direction"];
+
+_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
+_direction = _target getVariable [QGVAR(carryDirection), 0];
+
+// handle objects vs persons
+if (_target isKindOf "CAManBase") then {
+
+ [_unit, "AcinPercMstpSnonWnonDnon", 2, true] call EFUNC(common,doAnimation);
+ [_target, "AinjPfalMstpSnonWnonDf_carried_dead", 2, true] call EFUNC(common,doAnimation);
+
+ // attach person
+ _target attachTo [_unit, _position, "LeftShoulder"];
+
+} else {
+
+ // add height offset of model
+ private "_offset";
+ _offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2);
+
+ _position = _position vectorAdd [0, 0, _offset];
+
+ // attach object
+ _target attachTo [_unit, _position];
+
+};
+["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent);
+
+_unit setVariable [QGVAR(isCarrying), true, true];
+_unit setVariable [QGVAR(carriedObject), _target, true];
+
+// add scrollwheel action to release object
+private "_actionID";
+_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
+
+if (_actionID != -1) then {
+ _unit removeAction _actionID;
+};
+
+_actionID = _unit addAction [
+ format ["%1 ", localize "STR_ACE_Dragging_Drop"],
+ QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)),
+ nil,
+ 20,
+ false,
+ true,
+ "",
+ QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)]))
+];
+
+_unit setVariable [QGVAR(ReleaseActionID), _actionID];
+
+// check everything
+[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
+
+// reset current dragging height.
+GVAR(currentHeightChange) = 0;
diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf
new file mode 100644
index 0000000000..8afa0f541a
--- /dev/null
+++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf
@@ -0,0 +1,21 @@
+// by commy2
+#include "script_component.hpp"
+
+#ifdef DEBUG_ENABLED_DRAGGING
+ systemChat format ["%1 carryObjectPFH running", time];
+#endif
+
+private ["_unit", "_target"];
+
+_unit = _this select 0 select 0;
+_target = _this select 0 select 1;
+
+if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
+
+// drop if the crate is destroyed
+if !([_target] call EFUNC(common,isAlive)) then {
+ [_unit, _target] call FUNC(dropObject_carry);
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf
new file mode 100644
index 0000000000..f614af9548
--- /dev/null
+++ b/addons/dragging/functions/fnc_dragObject.sqf
@@ -0,0 +1,68 @@
+/*
+ * Author: commy2
+ *
+ * Drag an object. Called from ace_dragging_fnc_startDrag
+ *
+ * Argument:
+ * 0: Unit that should do the dragging (Object)
+ * 1: Object to drag (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+// get attachTo offset and direction.
+private ["_position", "_direction"];
+
+_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
+_direction = _target getVariable [QGVAR(dragDirection), 0];
+
+// add height offset of model
+private "_offset";
+_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2);
+
+_position = _position vectorAdd [0, 0, _offset];
+
+// attach object
+_target attachTo [_unit, _position];
+["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent);
+
+if (_target isKindOf "CAManBase") then {
+ [_target, "AinjPpneMrunSnonWnonDb_still", 0, true] call EFUNC(common,doAnimation);
+};
+
+_unit setVariable [QGVAR(isDragging), true, true];
+_unit setVariable [QGVAR(draggedObject), _target, true];
+
+// add scrollwheel action to release object
+private "_actionID";
+_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
+
+if (_actionID != -1) then {
+ _unit removeAction _actionID;
+};
+
+_actionID = _unit addAction [
+ format ["%1 ", localize "STR_ACE_Dragging_Drop"],
+ QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)),
+ nil,
+ 20,
+ false,
+ true,
+ "",
+ QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)]))
+];
+
+_unit setVariable [QGVAR(ReleaseActionID), _actionID];
+
+// check everything
+[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
+
+// reset current dragging height.
+GVAR(currentHeightChange) = 0;
diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf
new file mode 100644
index 0000000000..2290c65e9d
--- /dev/null
+++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf
@@ -0,0 +1,21 @@
+// by commy2
+#include "script_component.hpp"
+
+#ifdef DEBUG_ENABLED_DRAGGING
+ systemChat format ["%1 dragObjectPFH running", time];
+#endif
+
+private ["_unit", "_target"];
+
+_unit = _this select 0 select 0;
+_target = _this select 0 select 1;
+
+if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
+
+// drop if the crate is destroyed
+if !([_target] call EFUNC(common,isAlive)) then {
+ [_unit, _target] call FUNC(dropObject);
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf
new file mode 100644
index 0000000000..489457bfbc
--- /dev/null
+++ b/addons/dragging/functions/fnc_dropObject.sqf
@@ -0,0 +1,60 @@
+/*
+ * Author: commy2
+ *
+ * Drop a dragged object.
+ *
+ * Argument:
+ * 0: Unit that drags the other object (Object)
+ * 1: Dragged object to drop (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+// remove scroll wheel action
+_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
+
+private "_inBuilding";
+_inBuilding = [_unit] call FUNC(isObjectOnObject);
+
+// play release animation
+_unit playAction "released";
+
+// prevent collision damage
+["fixCollision", _unit] call EFUNC(common,localEvent);
+["fixCollision", _target, _target] call EFUNC(common,targetEvent);
+
+// release object
+detach _target;
+
+if (_target isKindOf "CAManBase") then {
+ if (_target getVariable ["ACE_isUnconscious", false]) then {
+ [_target, "unconscious", 2, true] call EFUNC(common,doAnimation);
+ } else {
+ [_target, "", 2, true] call EFUNC(common,doAnimation); //@todo "AinjPpneMrunSnonWnonDb_release" seems to fall back to unconsciousness anim.
+ };
+};
+
+_unit removeWeapon "ACE_FakePrimaryWeapon";
+
+// prevent object from flipping inside buildings
+if (_inBuilding) then {
+ _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
+};
+
+_unit setVariable [QGVAR(isDragging), false, true];
+_unit setVariable [QGVAR(draggedObject), objNull, true];
+
+// make object accesable for other units
+[objNull, _target, true] call EFUNC(common,claim);
+
+if !(_target isKindOf "CAManBase") then {
+ ["fixPosition", _target, _target] call EFUNC(common,targetEvent);
+ ["fixFloating", _target, _target] call EFUNC(common,targetEvent);
+};
diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf
new file mode 100644
index 0000000000..5e2ea8b8c1
--- /dev/null
+++ b/addons/dragging/functions/fnc_dropObject_carry.sqf
@@ -0,0 +1,68 @@
+/*
+ * Author: commy2
+ *
+ * Drop a carried object.
+ *
+ * Argument:
+ * 0: Unit that carries the other object (Object)
+ * 1: Carried object to drop (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+// remove scroll wheel action
+_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
+
+private "_inBuilding";
+_inBuilding = [_unit] call FUNC(isObjectOnObject);
+
+// prevent collision damage
+["fixCollision", _unit] call EFUNC(common,localEvent);
+["fixCollision", _target, _target] call EFUNC(common,targetEvent);
+
+// release object
+detach _target;
+
+// fix anim when aborting carrying persons
+if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then {
+ if (vehicle _unit == _unit) then {
+ [_unit, "", 2, true] call EFUNC(common,doAnimation);
+ };
+
+ if (_target getVariable ["ACE_isUnconscious", false]) then {
+ [_target, "unconscious", 2, true] call EFUNC(common,doAnimation);
+ } else {
+ [_target, "", 2, true] call EFUNC(common,doAnimation); //@todo
+ };
+};
+
+// properly remove fake weapon
+_unit removeWeapon "ACE_FakePrimaryWeapon";
+
+// reselect weapon and re-enable sprint
+_unit selectWeapon primaryWeapon _unit;
+
+[_unit, "isDragging", false] call EFUNC(common,setforceWalkStatus);
+
+// prevent object from flipping inside buildings
+if (_inBuilding) then {
+ _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
+};
+
+_unit setVariable [QGVAR(isCarrying), false, true];
+_unit setVariable [QGVAR(carriedObject), objNull, true];
+
+// make object accesable for other units
+[objNull, _target, true] call EFUNC(common,claim);
+
+if !(_target isKindOf "CAManBase") then {
+ ["fixPosition", _target, _target] call EFUNC(common,targetEvent);
+ ["fixFloating", _target, _target] call EFUNC(common,targetEvent);
+};
diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf
new file mode 100644
index 0000000000..2b44bf90d9
--- /dev/null
+++ b/addons/dragging/functions/fnc_getWeight.sqf
@@ -0,0 +1,54 @@
+/*
+ Name: AGM_Drag_fnc_GetWeight
+
+ Author(s):
+ L-H, edited by commy2
+
+ Description:
+ Returns the weight of a crate.
+
+ Parameters:
+ 0: OBJECT - Crate to get weight of
+
+ Returns:
+ NUMBER - Weight
+
+ Example:
+ _weight = Crate1 call AGM_Drag_fnc_GetWeight;
+*/
+#include "script_component.hpp"
+
+private "_object";
+
+_object = _this select 0;
+
+private ["_totalWeight", "_fnc","_fnc_Extra"];
+_totalWeight = 0;
+_fnc_Extra = {
+ private ["_weight", "_items"];
+ _items = _this select 0;
+ _weight = 0;
+ {
+ _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex));
+ } foreach (_items select 0);
+
+ _weight
+};
+_fnc = {
+ private ["_weight", "_items"];
+ _items = _this select 0;
+ _weight = 0;
+ {
+ _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex));
+ } foreach (_items select 0);
+
+ _weight
+};
+_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc);
+_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra);
+_totalWeight = _totalWeight + ([getWeaponCargo _object, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra);
+_totalWeight = _totalWeight + ([getBackpackCargo _object, "CfgVehicles"] call _fnc);
+
+_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of).
+
+_totalWeight
diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf
new file mode 100644
index 0000000000..91fa3d681b
--- /dev/null
+++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf
@@ -0,0 +1,35 @@
+// by commy2
+#include "script_component.hpp"
+
+private ["_unit", "_anim"];
+
+_unit = _this select 0;
+_anim = _this select 1;
+
+if (_unit getVariable [QGVAR(isDragging), false]) then {
+
+ // drop dragged object when not in valid animation
+ if !(_anim in DRAG_ANIMATIONS) then {
+ private "_draggedObject";
+ _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
+
+ if (!isNull _draggedObject) then {
+ [_unit, _draggedObject] call FUNC(dropObject);
+ };
+ };
+
+};
+
+if (_unit getVariable [QGVAR(isCarrying), false]) then {
+
+ // drop carried object when not standing
+ if (stance _unit != "STAND") then {
+ private "_carriedObject";
+ _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
+
+ if (!isNull _carriedObject) then {
+ [_unit, _carriedObject] call FUNC(dropObject_carry);
+ };
+ };
+
+};
diff --git a/addons/dragging/functions/fnc_handleKilled.sqf b/addons/dragging/functions/fnc_handleKilled.sqf
new file mode 100644
index 0000000000..4dcfc77fcd
--- /dev/null
+++ b/addons/dragging/functions/fnc_handleKilled.sqf
@@ -0,0 +1,20 @@
+// by commy2
+#include "script_component.hpp"
+
+private "_unit";
+
+_unit = _this select 0;
+
+if (_unit getVariable [QGVAR(isDragging), false]) then {
+ private "_draggedObject";
+ _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
+
+ [_unit, _draggedObject] call FUNC(dropObject);
+};
+
+if (_unit getVariable [QGVAR(isCarrying), false]) then {
+ private "_carriedObject";
+ _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
+
+ [_unit, _carriedObject] call FUNC(dropObject_carry);
+};
diff --git a/addons/dragging/functions/fnc_handlePlayerChanged.sqf b/addons/dragging/functions/fnc_handlePlayerChanged.sqf
new file mode 100644
index 0000000000..e2dd41021b
--- /dev/null
+++ b/addons/dragging/functions/fnc_handlePlayerChanged.sqf
@@ -0,0 +1,17 @@
+// by commy2
+#include "script_component.hpp"
+
+private ["_newPlayer", "_oldPlayer"];
+
+_newPlayer = _this select 0;
+_oldPlayer = _this select 1;
+
+{
+ if (_x getVariable [QGVAR(isDragging), false]) then {
+ [_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
+ };
+
+ if (_x getVariable [QGVAR(isCarrying), false]) then {
+ [_x, _x getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry);
+ };
+} forEach [_newPlayer, _oldPlayer];
diff --git a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf
new file mode 100644
index 0000000000..a7f9be7681
--- /dev/null
+++ b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf
@@ -0,0 +1,40 @@
+// by commy2
+#include "script_component.hpp"
+
+private ["_unit", "_weapon"];
+
+_unit = _this select 0;
+_weapon = _this select 1;
+
+if (_unit getVariable [QGVAR(isDragging), false]) then {
+
+ // drop dragged object when selecting a non-primary weapon
+ if (_weapon != primaryWeapon _unit) then {
+ private "_draggedObject";
+ _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
+
+ [_unit, _draggedObject] call FUNC(dropObject);
+ };
+
+};
+
+if (_unit getVariable [QGVAR(isCarrying), false]) then {
+
+ private "_carriedObject";
+ _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
+
+ if (_carriedObject isKindOf "CAManBase") then {
+
+ if (_weapon != primaryWeapon _unit) then {
+ [_unit, _carriedObject] call FUNC(dropObject_carry);
+ };
+
+ } else {
+
+ // drop carried object when selecting any weapon
+ if (_weapon != "") then {
+ [_unit, _carriedObject] call FUNC(dropObject_carry);
+ };
+
+ };
+};
diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf
new file mode 100644
index 0000000000..0782e64db7
--- /dev/null
+++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf
@@ -0,0 +1,48 @@
+/*
+ * Author: L-H, commy2
+ *
+ * Handles raising and lowering the dragged weapon to be able to place it on top of objects.
+ *
+ * Argument:
+ * 0: Scroll amount (Number)
+ *
+ * Return value:
+ * Handled or not. (Bool)
+ */
+#include "script_component.hpp"
+
+// requires modifier key to be hold down
+if (GETMVAR(ACE_Modifier,0) == 0) exitWith {false};
+
+private "_unit";
+_unit = ACE_player;
+
+// EH is always assigned. Exit and don't overwrite input if not carrying
+if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
+
+private "_scrollAmount";
+
+_scrollAmount = _this select 0;
+
+// move carried item 15 cm per scroll interval
+_scrollAmount = _scrollAmount * 0.15;
+
+private "_carriedItem";
+_carriedItem = _unit getVariable [QGVAR(carriedObject), objNull];
+
+//disabled for persons
+if (_carriedItem isKindOf "CAManBase") exitWith {false};
+
+private ["_position", "_maxHeight"];
+
+_position = getPosATL _carriedItem;
+_maxHeight = (_unit ModelToWorld [0,0,0]) select 2;
+
+_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];
+
+// move up/down object and reattach at current position
+detach _carriedItem;
+_carriedItem setPosATL _position;
+_carriedItem attachTo [_unit];
+
+true
diff --git a/addons/dragging/functions/fnc_handleUnconscious.sqf b/addons/dragging/functions/fnc_handleUnconscious.sqf
new file mode 100644
index 0000000000..6ca9609b63
--- /dev/null
+++ b/addons/dragging/functions/fnc_handleUnconscious.sqf
@@ -0,0 +1,44 @@
+// by commy2
+#include "script_component.hpp"
+
+private ["_unit", "_isUnconscious"];
+
+_unit = _this select 0;
+_isUnconscious = _this select 1;
+
+private "_player";
+_player = ACE_player;
+
+if (_player getVariable [QGVAR(isDragging), false]) then {
+
+ private "_draggedObject";
+ _draggedObject = _player getVariable [QGVAR(draggedObject), objNull];
+
+ // handle falling unconscious
+ if (_unit == _player) then {
+ [_unit, _draggedObject] call FUNC(dropObject);
+ };
+
+ // handle waking up dragged unit
+ if (_unit == _draggedObject) then {
+ [_player, _draggedObject] call FUNC(dropObject);
+ };
+
+};
+
+if (_player getVariable [QGVAR(isCarrying), false]) then {
+
+ private "_carriedObject";
+ _carriedObject = _player getVariable [QGVAR(carriedObject), objNull];
+
+ // handle falling unconscious
+ if (_unit == _player) then {
+ [_unit, _carriedObject] call FUNC(dropObject_carry);
+ };
+
+ // handle waking up dragged unit
+ if (_unit == _carriedObject) then {
+ [_player, _carriedObject] call FUNC(dropObject_carry);
+ };
+
+};
diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf
new file mode 100644
index 0000000000..65866bd028
--- /dev/null
+++ b/addons/dragging/functions/fnc_initObject.sqf
@@ -0,0 +1,37 @@
+/*
+ * Author: commy2
+ *
+ * Initialize variables for drag or carryable objects. Called from init EH.
+ *
+ * Argument:
+ * 0: Any object (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private "_object";
+
+_object = _this select 0;
+
+private "_config";
+_config = configFile >> "CfgVehicles" >> typeOf _object;
+
+if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
+ private ["_position", "_direction"];
+
+ _position = getArray (_config >> QGVAR(dragPosition));
+ _direction = getNumber (_config >> QGVAR(dragDirection));
+
+ [_object, true, _position, _direction] call FUNC(setDraggable);
+};
+
+if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
+ private ["_position", "_direction"];
+
+ _position = getArray (_config >> QGVAR(carryPosition));
+ _direction = getNumber (_config >> QGVAR(carryDirection));
+
+ [_object, true, _position, _direction] call FUNC(setCarryable);
+};
diff --git a/addons/dragging/functions/fnc_initPerson.sqf b/addons/dragging/functions/fnc_initPerson.sqf
new file mode 100644
index 0000000000..0dc2af1389
--- /dev/null
+++ b/addons/dragging/functions/fnc_initPerson.sqf
@@ -0,0 +1,19 @@
+/*
+ * Author: commy2
+ *
+ * Initialize variables for drag or carryable persons. Called from init EH.
+ *
+ * Argument:
+ * 0: Any Unit (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private "_unit";
+
+_unit = _this select 0;
+
+[_unit, true, [0,1.1,0.092], 180] call FUNC(setDraggable);
+[_unit, true, [0.4,-0.1,-1.25], 195] call FUNC(setCarryable); // hard-coded selection: "LeftShoulder"
diff --git a/addons/dragging/functions/fnc_isObjectOnObject.sqf b/addons/dragging/functions/fnc_isObjectOnObject.sqf
new file mode 100644
index 0000000000..0a8624820e
--- /dev/null
+++ b/addons/dragging/functions/fnc_isObjectOnObject.sqf
@@ -0,0 +1,6 @@
+// by commy2
+
+private "_object";
+_object = _this select 0;
+
+(getPosATL _object select 2) - (getPos _object select 2) > 1E-5
diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf
new file mode 100644
index 0000000000..bc6da1f04d
--- /dev/null
+++ b/addons/dragging/functions/fnc_setCarryable.sqf
@@ -0,0 +1,55 @@
+/*
+ * Author: commy2
+ *
+ * Enable the object to be carried.
+ *
+ * Argument:
+ * 0: Any object (Object)
+ * 1: true to enable carrying, false to disable (Bool)
+ * 2: Position offset for attachTo command (Array, optinal; default: [0,1,1])
+ * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_object", "_enableCarry", "_position", "_direction"];
+
+_this resize 4;
+
+_object = _this select 0;
+_enableCarry = _this select 1;
+_position = _this select 2;
+_direction = _this select 3;
+
+if (isNil "_position") then {
+ _position = _object getVariable [QGVAR(carryPosition), [0,1,1]];
+};
+
+if (isNil "_direction") then {
+ _direction = _object getVariable [QGVAR(carryDirection), 0];
+};
+
+// update variables
+_object setVariable [QGVAR(canCarry), _enableCarry];
+_object setVariable [QGVAR(carryPosition), _position];
+_object setVariable [QGVAR(carryDirection), _direction];
+
+// add action to class if it is not already present
+private ["_type", "_initializedClasses"];
+
+_type = typeOf _object;
+_initializedClasses = GETGVAR(initializedClasses_carry,[]);
+
+// do nothing if the class is already initialized
+if (_type in _initializedClasses) exitWith {};
+
+_initializedClasses pushBack _type;
+GVAR(initializedClasses_carry) = _initializedClasses;
+
+_carryAction = [QGVAR(carry), localize "STR_ACE_Dragging_Carry", "", {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction);
+_dropAction = [QGVAR(drop_carry), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction);
+
+[_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass);
+[_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass);
diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf
new file mode 100644
index 0000000000..da2d0310b4
--- /dev/null
+++ b/addons/dragging/functions/fnc_setDraggable.sqf
@@ -0,0 +1,55 @@
+/*
+ * Author: commy2
+ *
+ * Enable the object to be dragged.
+ *
+ * Argument:
+ * 0: Any object (Object)
+ * 1: true to enable dragging, false to disable (Bool)
+ * 2: Position offset for attachTo command (Array, optinal; default: [0,0,0])
+ * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_object", "_enableDrag", "_position", "_direction"];
+
+_this resize 4;
+
+_object = _this select 0;
+_enableDrag = _this select 1;
+_position = _this select 2;
+_direction = _this select 3;
+
+if (isNil "_position") then {
+ _position = _object getVariable [QGVAR(dragPosition), [0,0,0]];
+};
+
+if (isNil "_direction") then {
+ _direction = _object getVariable [QGVAR(dragDirection), 0];
+};
+
+// update variables
+_object setVariable [QGVAR(canDrag), _enableDrag];
+_object setVariable [QGVAR(dragPosition), _position];
+_object setVariable [QGVAR(dragDirection), _direction];
+
+// add action to class if it is not already present
+private ["_type", "_initializedClasses"];
+
+_type = typeOf _object;
+_initializedClasses = GETGVAR(initializedClasses,[]);
+
+// do nothing if the class is already initialized
+if (_type in _initializedClasses) exitWith {};
+
+_initializedClasses pushBack _type;
+GVAR(initializedClasses) = _initializedClasses;
+
+_dragAction = [QGVAR(drag), localize "STR_ACE_Dragging_Drag", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction);
+_dropAction = [QGVAR(drop), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction);
+
+[_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass);
+[_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass);
diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf
new file mode 100644
index 0000000000..9f1c0bca23
--- /dev/null
+++ b/addons/dragging/functions/fnc_startCarry.sqf
@@ -0,0 +1,70 @@
+/*
+ * Author: commy2
+ *
+ * Start the carrying process.
+ *
+ * Argument:
+ * 0: Unit that should do the carrying (Object)
+ * 1: Object to carry (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+// check weight
+private "_weight";
+_weight = [_target] call FUNC(getWeight);
+
+if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith {
+ [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured);
+};
+
+private "_timer";
+_timer = time + 5;
+
+// handle objects vs persons
+if (_target isKindOf "CAManBase") then {
+
+ // add a primary weapon if the unit has none.
+ if (primaryWeapon _unit == "") then {
+ _unit addWeapon "ACE_FakePrimaryWeapon";
+ };
+
+ // select primary, otherwise the drag animation actions don't work.
+ _unit selectWeapon primaryWeapon _unit;
+
+ // move a bit closer and adjust direction when trying to pick up a person
+ _target setDir (getDir _unit + 180);
+ _target setPos (getPos _unit vectorAdd vectorDir _unit);
+
+ [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2, true] call EFUNC(common,doAnimation);
+ [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2, true] call EFUNC(common,doAnimation);
+
+ _timer = time + 15;
+
+} else {
+
+ // select no weapon and stop sprinting
+ _unit action ["SwitchWeapon", _unit, _unit, 99];
+ [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation);
+
+ [_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus);
+
+ // prevent multiple players from accessing the same object
+ [_unit, _target, true] call EFUNC(common,claim);
+
+};
+
+// prevents draging and carrying at the same time
+_unit setVariable [QGVAR(isCarrying), true, true];
+
+// required for aborting animation
+_unit setVariable [QGVAR(carriedObject), _target, true];
+
+[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf
new file mode 100644
index 0000000000..a932d4e189
--- /dev/null
+++ b/addons/dragging/functions/fnc_startCarryPFH.sqf
@@ -0,0 +1,49 @@
+// by commy2
+#include "script_component.hpp"
+
+#ifdef DEBUG_ENABLED_DRAGGING
+ systemChat format ["%1 startCarryPFH running", time];
+#endif
+
+private ["_unit", "_target", "_timeOut"];
+
+_unit = _this select 0 select 0;
+_target = _this select 0 select 1;
+_timeOut = _this select 0 select 2;
+
+// handle aborting carry
+if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
+
+// same as dragObjectPFH, checks if object is deleted or dead.
+if !([_target] call EFUNC(common,isAlive)) then {
+ [_unit, _target] call FUNC(dropObject);
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
+
+// handle persons vs objects
+if (_target isKindOf "CAManBase") then {
+ if (time > _timeOut) exitWith {
+ [_unit, _target] call FUNC(carryObject);
+
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+ };
+} else {
+ if (time > _timeOut) exitWith {
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+
+ // drop if in timeout
+ private "_draggedObject";
+ _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
+ [_unit, _draggedObject] call FUNC(dropObject);
+ };
+
+ // wait for the unit to stand up
+ if (stance _unit == "STAND") exitWith {
+ [_unit, _target] call FUNC(carryObject);
+
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+ };
+
+};
diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf
new file mode 100644
index 0000000000..fbf0f4608c
--- /dev/null
+++ b/addons/dragging/functions/fnc_startDrag.sqf
@@ -0,0 +1,54 @@
+/*
+ * Author: commy2
+ *
+ * Start the dragging process.
+ *
+ * Argument:
+ * 0: Unit that should do the dragging (Object)
+ * 1: Object to drag (Object)
+ *
+ * Return value:
+ * NONE.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+
+// check weight
+private "_weight";
+_weight = [_target] call FUNC(getWeight);
+
+if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith {
+ [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured);
+};
+
+// add a primary weapon if the unit has none.
+// @todo prevent opening inventory when equipped with a fake weapon
+if (primaryWeapon _unit == "") then {
+ _unit addWeapon "ACE_FakePrimaryWeapon";
+};
+
+// select primary, otherwise the drag animation actions don't work.
+_unit selectWeapon primaryWeapon _unit;
+
+// prevent multiple players from accessing the same object
+[_unit, _target, true] call EFUNC(common,claim);
+
+// can't play action that depends on weapon if it was added the same frame
+[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame);
+
+// move a bit closer and adjust direction when trying to pick up a person
+if (_target isKindOf "CAManBase") then {
+ _target setDir (getDir _unit + 180);
+ _target setPos (getPos _unit vectorAdd (vectorDir _unit vectorMultiply 1.5));
+
+ [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation);
+};
+
+// prevents draging and carrying at the same time
+_unit setVariable [QGVAR(isDragging), true, true];
+
+[FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf
new file mode 100644
index 0000000000..10d9d896a8
--- /dev/null
+++ b/addons/dragging/functions/fnc_startDragPFH.sqf
@@ -0,0 +1,40 @@
+// by commy2
+#include "script_component.hpp"
+
+#ifdef DEBUG_ENABLED_DRAGGING
+ systemChat format ["%1 startDragPFH running", time];
+#endif
+
+private ["_unit", "_target", "_timeOut"];
+
+_unit = _this select 0 select 0;
+_target = _this select 0 select 1;
+_timeOut = _this select 0 select 2;
+
+// handle aborting drag
+if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
+
+// same as dragObjectPFH, checks if object is deleted or dead.
+if !([_target] call EFUNC(common,isAlive)) then {
+ [_unit, _target] call FUNC(dropObject);
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
+
+// timeout. Do nothing. Quit. time, because anim length is linked to ingame time.
+if (time > _timeOut) exitWith {
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+
+ // drop if in timeout
+ private "_draggedObject";
+ _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
+ [_unit, _draggedObject] call FUNC(dropObject);
+};
+
+// unit is ready to start dragging
+if (animationState _unit in DRAG_ANIMATIONS) exitWith {
+ [_unit, _target] call FUNC(dragObject);
+
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+};
diff --git a/addons/dragging/functions/script_component.hpp b/addons/dragging/functions/script_component.hpp
new file mode 100644
index 0000000000..9d257a69d3
--- /dev/null
+++ b/addons/dragging/functions/script_component.hpp
@@ -0,0 +1 @@
+#include "\z\ace\addons\dragging\script_component.hpp"
\ No newline at end of file
diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp
new file mode 100644
index 0000000000..2427f89739
--- /dev/null
+++ b/addons/dragging/script_component.hpp
@@ -0,0 +1,17 @@
+#define COMPONENT dragging
+#include "\z\ace\addons\main\script_mod.hpp"
+
+//#define DEBUG_ENABLED_DRAGGING
+
+#ifdef DEBUG_ENABLED_DRAGGING
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_ENABLED_DRAGGING
+ #define DEBUG_SETTINGS DEBUG_ENABLED_DRAGGING
+#endif
+
+#include "\z\ace\addons\main\script_macros.hpp"
+
+#define DRAG_ANIMATIONS ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon", "acinpknlmwlksraswrfldb", "acinpknlmwlksnonwnondb"]
+#define CARRY_ANIMATIONS ["acinpercmstpsnonwnondnon", "acinpknlmstpsnonwnondnon_acinpercmrunsnonwnondnon"]
diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml
new file mode 100644
index 0000000000..1fca04fee1
--- /dev/null
+++ b/addons/dragging/stringtable.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+ Drag
+ Đ¢Đ°Ñ‰Đ¸Ñ‚ÑŒ
+ Arrastrar
+ CiÄ…gnij
+ TĂ¡hnout
+ Tracter
+ Ziehen
+ Arrastar
+ Trascina
+ HĂºzĂ¡s
+
+
+ Release
+ ĐÑ‚Đ¿ÑƒÑÑ‚Đ¸Ñ‚ÑŒ
+ Soltar
+ Puść
+ Položit
+ LĂ¢cher
+ Loslassen
+ Largar
+ Lascia
+ Elengedés
+
+
+ Item to heavy
+ Gegenstand zu schwer
+
+
+
+ Carry
+ Tragen
+ Portar
+ NieÅ›
+ Porter
+ NĂ©st
+ Carregar
+ Trascina
+ Felvesz
+ ĐеÑÑ‚Đ¸
+
+
+
diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp
index 0e2503f7a0..fe467cbb53 100644
--- a/addons/explosives/CfgModule.hpp
+++ b/addons/explosives/CfgModule.hpp
@@ -1,12 +1,12 @@
class Module_F;
class ACE_ModuleExplosive: Module_F {
- author = "ACE Team";
+ author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = "Explosive System";
function = QUOTE(FUNC(module));
scope = 2;
isGlobal = 1;
- icon = PATHTOF(UI\IconExplosives_ca.paa);
+ icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa);
class Arguments {
class RequireSpecialist {
displayName = "Require specialists?";
diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp
index 983bc0972a..af2ed90cb6 100644
--- a/addons/explosives/CfgVehicles.hpp
+++ b/addons/explosives/CfgVehicles.hpp
@@ -1,8 +1,3 @@
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
-};
-
class CfgVehicles {
class Man;
@@ -12,18 +7,17 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Menu;
condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)]));
statement = "";
- exceptions[] = {"ACE_Interaction_isNotSwimming"};
+ exceptions[] = {"isNotSwimming"};
showDisabled = 1;
priority = 4;
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
- subMenu[] = {"ACE_Explosives", 1};
hotkey = "X";
//Sub-menu items
class ACE_Detonate {
displayName = $STR_ACE_Explosives_Detonate;
condition = QUOTE([_player] call FUNC(canDetonate));
statement = QUOTE([_player] call FUNC(openTransmitterUI););
- exceptions[] = {"ACE_Interaction_isNotSwimming"};
+ exceptions[] = {"isNotSwimming"};
showDisabled = 1;
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
priority = 2;
@@ -33,7 +27,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Place;
condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)});
statement = QUOTE([_player] call FUNC(openPlaceUI););
- exceptions[] = {"ACE_Interaction_isNotSwimming"};
+ exceptions[] = {"isNotSwimming"};
showDisabled = 1;
icon = PATHTOF(UI\Place_Explosive_ca.paa);
priority = 1;
@@ -43,7 +37,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE([_player] call FUNC(canDefuse));
statement = QUOTE([ARR_2(_player,EGVAR(Interaction,Target))] call FUNC(startDefuse););
- exceptions[] = {"ACE_Interaction_isNotSwimming"};
+ exceptions[] = {"isNotSwimming"};
showDisabled = 0;
icon = PATHTOF(UI\Defuse_ca.paa);
priority = 0.8;
@@ -53,7 +47,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_cellphone_displayName;
condition = "('ACE_Cellphone' in (items ace_player))";
statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';";
- exceptions[] = {"ACE_Interaction_isNotSwimming"};
+ exceptions[] = {"isNotSwimming"};
showDisabled = 0;
icon = PATHTOF(Data\UI\Cellphone_UI.paa);
priority = 0.8;
@@ -143,47 +137,47 @@ class CfgVehicles {
class Box_NATO_AmmoOrd_F: NATO_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_Clacker,12)
- MACRO_ADDITEM(ACE_M26_Clacker,6)
- MACRO_ADDITEM(ACE_DefusalKit,12)
+ MACRO_ADDITEM(ACE_Clacker,12);
+ MACRO_ADDITEM(ACE_M26_Clacker,6);
+ MACRO_ADDITEM(ACE_DefusalKit,12);
};
};
class Box_East_AmmoOrd_F: EAST_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_Clacker,12)
- MACRO_ADDITEM(ACE_M26_Clacker,6)
- MACRO_ADDITEM(ACE_DefusalKit,12)
+ MACRO_ADDITEM(ACE_Clacker,12);
+ MACRO_ADDITEM(ACE_M26_Clacker,6);
+ MACRO_ADDITEM(ACE_DefusalKit,12);
};
};
class Box_IND_AmmoOrd_F: IND_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_Clacker,12)
- MACRO_ADDITEM(ACE_M26_Clacker,6)
- MACRO_ADDITEM(ACE_DefusalKit,12)
- MACRO_ADDITEM(ACE_Deadmanswitch,2)
- MACRO_ADDITEM(ACE_Cellphone,3)
+ MACRO_ADDITEM(ACE_Clacker,12);
+ MACRO_ADDITEM(ACE_M26_Clacker,6);
+ MACRO_ADDITEM(ACE_DefusalKit,12);
+ MACRO_ADDITEM(ACE_Deadmanswitch,2);
+ MACRO_ADDITEM(ACE_Cellphone,3);
};
};
class Box_FIA_Ammo_F: FIA_Box_Base_F {
class TransportItems {
- MACRO_ADDITEM(ACE_Clacker,2)
- MACRO_ADDITEM(ACE_M26_Clacker,2)
- MACRO_ADDITEM(ACE_DefusalKit,2)
- MACRO_ADDITEM(ACE_Deadmanswitch,1)
- MACRO_ADDITEM(ACE_Cellphone,2)
+ MACRO_ADDITEM(ACE_Clacker,2);
+ MACRO_ADDITEM(ACE_M26_Clacker,2);
+ MACRO_ADDITEM(ACE_DefusalKit,2);
+ MACRO_ADDITEM(ACE_Deadmanswitch,1);
+ MACRO_ADDITEM(ACE_Cellphone,2);
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
- MACRO_ADDITEM(ACE_Clacker,12)
- MACRO_ADDITEM(ACE_M26_Clacker,6)
- MACRO_ADDITEM(ACE_DefusalKit,12)
- MACRO_ADDITEM(ACE_Deadmanswitch,6)
- MACRO_ADDITEM(ACE_Cellphone,10)
+ MACRO_ADDITEM(ACE_Clacker,12);
+ MACRO_ADDITEM(ACE_M26_Clacker,6);
+ MACRO_ADDITEM(ACE_DefusalKit,12);
+ MACRO_ADDITEM(ACE_Deadmanswitch,6);
+ MACRO_ADDITEM(ACE_Cellphone,10);
};
};
diff --git a/addons/explosives/UI/IconExplosives_ca.paa b/addons/explosives/UI/IconExplosives_ca.paa
deleted file mode 100644
index 628df3f657..0000000000
Binary files a/addons/explosives/UI/IconExplosives_ca.paa and /dev/null differ
diff --git a/addons/explosives/UI/Icon_Module_Explosives_ca.paa b/addons/explosives/UI/Icon_Module_Explosives_ca.paa
new file mode 100644
index 0000000000..a9fd23307b
Binary files /dev/null and b/addons/explosives/UI/Icon_Module_Explosives_ca.paa differ
diff --git a/addons/explosives/functions/fnc_openPlaceUI.sqf b/addons/explosives/functions/fnc_openPlaceUI.sqf
index 5ad79381b1..6eb2d478bf 100644
--- a/addons/explosives/functions/fnc_openPlaceUI.sqf
+++ b/addons/explosives/functions/fnc_openPlaceUI.sqf
@@ -51,8 +51,5 @@ _actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosive
},
{
call EFUNC(interaction,hideMenu);
- if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then {
- "ACE_Explosives" call EFUNC(interaction,openMenuSelf);
- };
}
] call EFUNC(interaction,openSelectMenu);
diff --git a/addons/explosives/functions/fnc_openTransmitterUI.sqf b/addons/explosives/functions/fnc_openTransmitterUI.sqf
index b87673c214..f90636474e 100644
--- a/addons/explosives/functions/fnc_openTransmitterUI.sqf
+++ b/addons/explosives/functions/fnc_openTransmitterUI.sqf
@@ -43,9 +43,6 @@ if (count _detonators == 0) then {
},
{
call EFUNC(interaction,hideMenu);
- if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then {
- "ACE_Explosives" call EFUNC(interaction,openMenuSelf);
- };
}
] call EFUNC(interaction,openSelectMenu);
};
diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml
index 0b67fe5a7e..c19c65ccb2 100644
--- a/addons/explosives/stringtable.xml
+++ b/addons/explosives/stringtable.xml
@@ -3,16 +3,16 @@
Place >>
diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp
index 961a05b27d..a03ca847ea 100644
--- a/addons/fcs/CfgEventHandlers.hpp
+++ b/addons/fcs/CfgEventHandlers.hpp
@@ -36,6 +36,11 @@ class Extended_Init_EventHandlers {
serverInit = QUOTE(_this call FUNC(vehicleInit));
};
};
+ class StaticWeapon {
+ class ADDON {
+ serverInit = QUOTE(_this call FUNC(vehicleInit));
+ };
+ };
};
class Extended_Respawn_EventHandlers {
@@ -64,6 +69,11 @@ class Extended_Respawn_EventHandlers {
respawn = QUOTE(_this call FUNC(vehicleInit));
};
};
+ class StaticWeapon {
+ class ADDON {
+ respawn = QUOTE(_this call FUNC(vehicleInit));
+ };
+ };
};
class Extended_FiredBIS_EventHandlers {
@@ -92,4 +102,9 @@ class Extended_FiredBIS_EventHandlers {
firedBIS = QUOTE(_this call FUNC(firedEH));
};
};
+ class StaticWeapon {
+ class ADDON {
+ firedBIS = QUOTE(_this call FUNC(firedEH));
+ };
+ };
};
diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp
index 4cc010f917..97628b58ea 100644
--- a/addons/fcs/CfgVehicles.hpp
+++ b/addons/fcs/CfgVehicles.hpp
@@ -26,9 +26,8 @@ class CfgVehicles {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
- enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
- statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
+ statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
@@ -40,9 +39,8 @@ class CfgVehicles {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
- enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
- statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
+ statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
@@ -492,13 +490,13 @@ class CfgVehicles {
};*/
};
- class I_Heli_light_03_base_F: Helicopter_Base_F {
+ class Heli_light_03_base_F;
+ class I_Heli_light_03_base_F: Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
-
- class I_Heli_light_03_F: I_Heli_light_03_base_F {
+ class I_Heli_light_03_F: Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf
index f17693d33e..67c7e1d301 100644
--- a/addons/fcs/functions/fnc_firedEH.sqf
+++ b/addons/fcs/functions/fnc_firedEH.sqf
@@ -12,7 +12,7 @@
#include "script_component.hpp"
-private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"];
+private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"];
_vehicle = _this select 0;
_weapon = _this select 1;
@@ -30,7 +30,7 @@ if !([_gunner] call EFUNC(common,isPlayer)) exitWith {};
private ["_FCSMagazines", "_FCSElevation", "_offset"];
-_FCSMagazines = _vehicle getVariable format ["%1_%2", QGVAR(Magazines), _turret];
+_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []];
_FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
if !(_magazine in _FCSMagazines) exitWith {};
@@ -43,8 +43,12 @@ _offset = 0;
};
} forEach _FCSMagazines;
-[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection);
+// Correct velocity for weapons that have initVelocity
+// @todo: Take into account negative initVelocities
+_velocityCorrection = (vectorMagnitude velocity _projectile) -
+ getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
+[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection);
// Air burst missile
// handle locally only
diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf
index 7699b82a20..8646ce8468 100644
--- a/addons/fcs/functions/fnc_keyDown.sqf
+++ b/addons/fcs/functions/fnc_keyDown.sqf
@@ -30,7 +30,7 @@ if (_distance == 0) then {
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
-if (_turret isEqualTo ([typeOf _vehicle] call EFUNC(common,getTurretCommander))) then {
+if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
_weaponDirection = eyeDirection _vehicle;
};
diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf
index 1e5878f0b5..d33bd08893 100644
--- a/addons/fcs/functions/fnc_keyUp.sqf
+++ b/addons/fcs/functions/fnc_keyUp.sqf
@@ -35,7 +35,7 @@ private ["_weaponDirection", "_angleTarget"];
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
-if (_turret isEqualTo ([typeOf _vehicle] call EFUNC(common,getTurretCommander))) then {
+if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
_weaponDirection = eyeDirection _vehicle;
};
diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf
index dd1a94b78e..7d1cc8f09b 100644
--- a/addons/fcs/initKeybinds.sqf
+++ b/addons/fcs/initKeybinds.sqf
@@ -1,81 +1,59 @@
// by commy2
-["ACE3",
- localize "STR_ACE_FCS_LaseTarget",
- {
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
+["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget",
+{
+ // Conditions: canInteract
+ if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
- // prevent holding down
- if (GETGVAR(isDownStateKey1,false)) exitWith {false};
- GVAR(isDownStateKey1) = true;
+ if (GETGVAR(isDownStateKey1,false)) exitWith {false};
+ GVAR(isDownStateKey1) = true;
- // Statement
- [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
- // Return false so it doesn't block the rest weapon action
- false
- },
- [15, [false, false, false]],
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
+ // Statement
+ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
+ // Return false so it doesn't block the rest weapon action
+ false
+},
+{
+ // prevent holding down
+ GVAR(isDownStateKey1) = false;
-["ACE3",
- localize "STR_ACE_FCS_LaseTarget",
- {
- // prevent holding down
- GVAR(isDownStateKey1) = false;
+ // Conditions: canInteract
+ if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
+ // Statement
+ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
+ false
+},
+[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key
- // Statement
- [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
- false
- },
- [15, [false, false, false]],
- false,
- "keyup"
-] call cba_fnc_registerKeybind;
+["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp",
+{
+ // Conditions: canInteract
+ if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
-["ACE3",
- localize "STR_ACE_FCS_AdjustRangeUp",
- {
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
+ // Statement
+ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
+ true
+},
+{false},
+[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key
- // Statement
- [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
- true
- },
- [201, [false, false, false]],
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
+["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown",
+{
+ // Conditions: canInteract
+ if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
-["ACE3",
- localize "STR_ACE_FCS_AdjustRangeDown",
- {
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
-
- // Statement
- [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
- true
- },
- [209, [false, false, false]],
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
+ // Statement
+ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
+ true
+},
+{false},
+[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key
diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp
index c9d13d3ce3..58ed5573e1 100644
--- a/addons/frag/CfgAmmo.hpp
+++ b/addons/frag/CfgAmmo.hpp
@@ -26,7 +26,7 @@ class CfgAmmo {
ACE_FRAG_SKIP = 0;
ACE_FRAG_FORCE = 1;
// This is a good high-drag frag type for grenades.
- ACE_FRAG_CLASSES[] = {"ACE_frag_medium_HD"};
+ ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"};
/*
These values are based on the M67 Grenade, should be tweaked for
individual grenades.
diff --git a/addons/frag/XEH_post_init.sqf b/addons/frag/XEH_post_init.sqf
index 25cb5132c8..ed0e715376 100644
--- a/addons/frag/XEH_post_init.sqf
+++ b/addons/frag/XEH_post_init.sqf
@@ -1,8 +1,8 @@
#include "script_component.hpp"
-[QUOTE(ffsBIS), "oneachframe", QUOTE(FUNC(onFrame))] call BIS_fnc_addStackedEventHandler;
if(isServer) then {
- [QGVAR(frag_eh), { _this call FUNC(frago); }] call CBA_fnc_addClientToServerEventhandler;
+ [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler;
};
+/*
GVAR(replacedBisArtyWrapper) = false;
[] spawn {
waitUntil {
@@ -15,3 +15,4 @@ GVAR(replacedBisArtyWrapper) = false;
GVAR(replacedBisArtyWrapper)
};
};
+*/
\ No newline at end of file
diff --git a/addons/frag/XEH_pre_Init.sqf b/addons/frag/XEH_pre_Init.sqf
index 406e6e7f63..5b3aa36b18 100644
--- a/addons/frag/XEH_pre_Init.sqf
+++ b/addons/frag/XEH_pre_Init.sqf
@@ -1,6 +1,6 @@
#include "script_component.hpp"
-#define ACE_TRACE_DRAW_INC 1
+
ADDON = false;
PREP(fired);
@@ -14,7 +14,7 @@ GVAR(trackedObjects) = [];
GVAR(blackList) = [];
GVAR(traceFrags) = false;
-GVAR(replacedBisArtyWrapper) = false;
+GVAR(replacedBisArtyWrapper) = true;
GVAR(TOTALFRAGS) = 0;
diff --git a/addons/frag/functions/fnc_addManualTrack.sqf b/addons/frag/functions/fnc_addManualTrack.sqf
index 1719842240..066499f6aa 100644
--- a/addons/frag/functions/fnc_addManualTrack.sqf
+++ b/addons/frag/functions/fnc_addManualTrack.sqf
@@ -3,5 +3,5 @@ private ["_round"];
_round = _this select 0;
if(alive _round) then {
GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round];
- [FUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler;
+ [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler;
};
\ No newline at end of file
diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf
index 4ffaef5a7c..65ad3b6a22 100644
--- a/addons/frag/functions/fnc_addTrack.sqf
+++ b/addons/frag/functions/fnc_addTrack.sqf
@@ -17,4 +17,4 @@ _objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)
_positions set[(count _positions), [(getPos _obj), _objTVel]];
_data = [_origin, typeOf _origin, typeOf _obj, _objTVel, _positions, _color];
GVAR(traces) set[_index, _data];
-[FUNC(trackTrace), 0, [_obj, _index, time]] call cba_fnc_addPerFrameHandler;
\ No newline at end of file
+[DFUNC(trackTrace), 0, [_obj, _index, time]] call cba_fnc_addPerFrameHandler;
\ No newline at end of file
diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf
index 92b67e0256..5560a4f0af 100644
--- a/addons/frag/functions/fnc_doSpall.sqf
+++ b/addons/frag/functions/fnc_doSpall.sqf
@@ -44,13 +44,12 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
_exit = false;
_vm = 1;
_velocity = _initialData select 5;
- _unitDir = _velocity call BIS_fnc_unitVector;
_oldVelocity = _velocity call BIS_fnc_magnitude;
_curVelocity = (velocity _round) call BIS_fnc_magnitude;
if(alive _round) then {
- _diff = [_velocity, (velocity _round)] call FUNC(vectorDiffFast);
+ _diff = _velocity vectorDiff (velocity _round);
_polar = _diff call CBA_fnc_vect2polar;
// player sideChat format["polar: %1", _polar];
if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then {
@@ -63,7 +62,7 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
};
};
if(!_exit) then {
- _unitDir = _velocity call BIS_fnc_unitVector;
+ _unitDir = vectorNormalized _velocity;
_pos = _hpData select 3;
_spallPos = nil;
for "_i" from 0 to 100 do {
@@ -137,7 +136,6 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
_fragment setPosASL _spallPos;
_fragment setVelocity _spallFragVect;
- // [fnc_spallTrackPFH, 0, [_fragment, diag_tickTime]] call cba_fnc_addPerFrameHandler;
if(GVAR(traceFrags)) then {
[player, _fragment, [1,0.5,0,1]] call FUNC(addTrack);
};
@@ -159,7 +157,6 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
_fragment setPosASL _spallPos;
_fragment setVelocity _spallFragVect;
- // [fnc_spallTrackPFH, 0, [_fragment, diag_tickTime]] call cba_fnc_addPerFrameHandler;
if(GVAR(traceFrags)) then {
[player, _fragment, [1,0,0,1]] call FUNC(addTrack);
};
diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf
index 5910d2481b..a6e934c667 100644
--- a/addons/frag/functions/fnc_fired.sqf
+++ b/addons/frag/functions/fnc_fired.sqf
@@ -1,5 +1,4 @@
#include "script_component.hpp"
-/*
private ["_gun", "_type", "_round", "_doFragTrack", "_doSpall"];
if !(isNil QGVAR(enabled) && {GVAR(enabled)}) exitWith {};
@@ -23,7 +22,7 @@ if(_gun == player) then {
};
};
};
-_doSpall = true;
+_doSpall = false;
if(_doSpall) then {
if(GVAR(spallIsTrackingCount) <= 0) then {
GVAR(spallHPData) = [];
@@ -36,15 +35,14 @@ if(_doSpall) then {
};
};
// player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
-[player, _round, [1,0,0,1]] call FUNC(addTrack);
+[player, _round, [1,0,0,1]] call nou_fnc_addTrack;
if(_doFragTrack && alive _round) then {
- GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round];
+ GVAR(trackedObjects) pushBack _round;
_spallTrack = [];
_spallTrackID = [];
- [FUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler;
+ [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler;
if(_doSpall) then {
[_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack);
};
// player sideChat "WTF2";
};
-*/
\ No newline at end of file
diff --git a/addons/frag/functions/fnc_frag_trace.sqf b/addons/frag/functions/fnc_frag_trace.sqf
index 9b0c8dc3db..f4e14fa12a 100644
--- a/addons/frag/functions/fnc_frag_trace.sqf
+++ b/addons/frag/functions/fnc_frag_trace.sqf
@@ -6,5 +6,5 @@ _shell = _params select 0;
if(alive _shell) then {
drop ["\Ca\Data\Cl_basic","","Billboard",1,30,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""];
} else {
- [_this select 1] call FUNC(removeBISPFH);
+ [_this select 1] call cba_fnc_removePerFrameHandler;
};
\ No newline at end of file
diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf
index 88ec0c4742..79eea53cd7 100644
--- a/addons/frag/functions/fnc_frago.sqf
+++ b/addons/frag/functions/fnc_frago.sqf
@@ -130,11 +130,12 @@ if(_isArmed && (count _objects) > 0) then {
_targetVel = (velocity _target);
- _targetPos set[2, (_targetPos select 2)+_add];
+
_targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))];
_targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))];
-
- _baseVec = [_lastPos, _targetPos] call BIS_fnc_vectorFromXToY;
+ _targetPos set[2, (_targetPos select 2)+_add];
+
+ _baseVec = _lastPos vectorFromTo _targetPos;
_dir = floor(_baseVec call CBA_fnc_vectDir);
_currentCount = _fragArcs select _dir;
@@ -213,7 +214,6 @@ if(_isArmed && (count _objects) > 0) then {
_fragObj setVelocity _vel;
#ifdef DEBUG_MODE_FULL
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
- // [FUNC(frag_trace), 0, [_fragObj]] call cba_fnc_addPerFrameHandler;
GVAR(traceFrags) = true;
#endif
if(GVAR(traceFrags)) then {
diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf
index aeba4e7a5d..89ba572ce2 100644
--- a/addons/frag/functions/fnc_spallHP.sqf
+++ b/addons/frag/functions/fnc_spallHP.sqf
@@ -21,7 +21,7 @@ if((_this select 0) <= (count GVAR(spallHPData))) then {
// diag_log text format["%1: %2", _forEachIndex, _x];
// } forEach _hp;
// } forEach (_this select 1);
- [FUNC(doSpall), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler;
+ [DFUNC(doSpall), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler;
// player sideChat "WEEE";
} forEach (_this select 1);
};
diff --git a/addons/frag/functions/fnc_stopTracing.sqf b/addons/frag/functions/fnc_stopTracing.sqf
index 02b4fd7f59..693390fff2 100644
--- a/addons/frag/functions/fnc_stopTracing.sqf
+++ b/addons/frag/functions/fnc_stopTracing.sqf
@@ -1,5 +1,5 @@
#include "script_component.hpp"
if(GVAR(tracesStarted)) then {
GVAR(tracesStarted) = false;
- [GVAR(traceID)] call FUNC(removeBISPFH);
+ [GVAR(traceID)] call cba_fnc_removePerFrameHandler;
};
\ No newline at end of file
diff --git a/addons/frag/functions/fnc_trackFragRound.sqf b/addons/frag/functions/fnc_trackFragRound.sqf
index 2780a85664..0a8e3948d0 100644
--- a/addons/frag/functions/fnc_trackFragRound.sqf
+++ b/addons/frag/functions/fnc_trackFragRound.sqf
@@ -12,7 +12,7 @@ _spallTrack = _params select 7;
_foundObjectHPIds = _params select 8;
if (!alive _round) then {
- [_this select 1] call FUNC(removeBISPFH);
+ [_this select 1] call cba_fnc_removePerFrameHandler;
if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then {
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
_skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP");
@@ -22,7 +22,7 @@ if (!alive _round) then {
_force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_FORCE");
_fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange));
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
- [QGVAR(frag_eh), _params] call CBA_fnc_clientToServerEvent;
+ [QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent;
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
};
};
@@ -38,7 +38,7 @@ if (!alive _round) then {
};
} else {
if(!(_round in GVAR(trackedObjects)) || {_round in GVAR(blackList)}) then {
- [_this select 1] call FUNC(removeBISPFH);
+ [_this select 1] call cba_fnc_removePerFrameHandler;
if(_round in GVAR(blackList)) then {
GVAR(blackList) = GVAR(blackList) - [_round];
};
diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf
index 71b4a9a866..628fece605 100644
--- a/addons/frag/functions/fnc_trackTrace.sqf
+++ b/addons/frag/functions/fnc_trackTrace.sqf
@@ -10,5 +10,5 @@ if(alive _tracerObj && (count GVAR(traces)) > 0) then {
_objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2);
_positions set[(count _positions), [(getPos _tracerObj), _objTVel]];
} else {
- [(_this select 1)] call FUNC(removeBISPFH);
+ [(_this select 1)] call cba_fnc_removePerFrameHandler;
};
\ No newline at end of file
diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp
index 274270cbbb..371067db3e 100644
--- a/addons/frag/script_component.hpp
+++ b/addons/frag/script_component.hpp
@@ -1,7 +1,7 @@
#define COMPONENT frag
#include "\z\ace\Addons\main\script_mod.hpp"
-#define DEBUG_ENABLED_FRAG
+//#define DEBUG_ENABLED_FRAG
#ifdef DEBUG_ENABLED_FRAG
#define DEBUG_MODE_FULL
@@ -11,4 +11,6 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG
#endif
-#include "\z\ace\Addons\main\script_macros.hpp"
\ No newline at end of file
+#include "\z\ace\Addons\main\script_macros.hpp"
+
+#define ACE_TRACE_DRAW_INC 1
\ No newline at end of file
diff --git a/addons/gforces/$PBOPREFIX$ b/addons/gforces/$PBOPREFIX$
index 215e681d94..15f2f61c42 100644
--- a/addons/gforces/$PBOPREFIX$
+++ b/addons/gforces/$PBOPREFIX$
@@ -1 +1 @@
-z\ace\addons\hearing
\ No newline at end of file
+z\ace\addons\gforces
diff --git a/addons/gforces/config.cpp b/addons/gforces/config.cpp
index e81b034fd9..6c40f4ce1c 100644
--- a/addons/gforces/config.cpp
+++ b/addons/gforces/config.cpp
@@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
- author[] = {"KoffeinFlummi", "CAA-Picard"};
+ author[] = {"KoffeinFlummi", "esteldunedain"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf
index 839110fd2b..c2a08ee73f 100644
--- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf
+++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf
@@ -1,5 +1,5 @@
/*
- * Author: KoffeinFlummi and CAA-Picard
+ * Author: KoffeinFlummi and esteldunedain
* Calculates average g-forces and triggers g-effects
*
* Argument:
diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf
index 4c7160bdb3..ee62dfdd66 100644
--- a/addons/goggles/XEH_postInit.sqf
+++ b/addons/goggles/XEH_postInit.sqf
@@ -17,17 +17,19 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
-["ACE3", localize "STR_ACE_Goggles_WipeGlasses",
+["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses",
{
- if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
- call FUNC(clearGlasses);
- true
- };
- false
-}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
+ if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
+ call FUNC(clearGlasses);
+ true
+ };
+ false
+},
+{false},
+[20, [true, true, false]], false] call cba_fnc_addKeybind;
if isNil(QGVAR(UsePP)) then {
- GVAR(UsePP) = true;
+ GVAR(UsePP) = true;
};
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
@@ -47,78 +49,78 @@ GVAR(RainActive) = false;
GVAR(RainLastLevel) = 0;
FUNC(CheckGlasses) = {
- if (GVAR(Current) != (goggles ace_player)) then {
- GVAR(Current) = (goggles ace_player);
- ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
- };
+ if (GVAR(Current) != (goggles ace_player)) then {
+ GVAR(Current) = (goggles ace_player);
+ ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
+ };
};
player addEventHandler ["Explosion", {
- if (alive ace_player) then {
- call FUNC(ApplyDirtEffect);
- if (GETBROKEN) exitWith {};
- if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
- if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
- _effects = GETGLASSES(ace_player);
- _effects set [BROKEN, true];
- SETGLASSES(ace_player,_effects);
- if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
- if (call FUNC(ExternalCamera)) exitWith {};
- if (isNull(GLASSDISPLAY)) then {
- 150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
- };
- (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
+ if (alive ace_player) then {
+ call FUNC(ApplyDirtEffect);
+ if (GETBROKEN) exitWith {};
+ if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
+ if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
+ _effects = GETGLASSES(ace_player);
+ _effects set [BROKEN, true];
+ SETGLASSES(ace_player,_effects);
+ if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
+ if (call FUNC(ExternalCamera)) exitWith {};
+ if (isNull(GLASSDISPLAY)) then {
+ 150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
+ };
+ (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
+ };
+ ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
};
- ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
- };
}];
player addEventHandler ["Killed",{
- GVAR(PostProcessEyes) ppEffectEnable false;
- SETGLASSES(ace_player,GLASSESDEFAULT);
- call FUNC(removeGlassesEffect);
- GVAR(EffectsActive)=false;
- ace_player setVariable ["ACE_EyesDamaged", false];
- if (GVAR(EyesDamageScript) != -1) then {
- [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
- };
- if (GVAR(DustHandler) != -1) then {
- [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
- GVAR(DustHandler) = -1;
- };
+ GVAR(PostProcessEyes) ppEffectEnable false;
+ SETGLASSES(ace_player,GLASSESDEFAULT);
+ call FUNC(removeGlassesEffect);
+ GVAR(EffectsActive)=false;
+ ace_player setVariable ["ACE_EyesDamaged", false];
+ if (GVAR(EyesDamageScript) != -1) then {
+ [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
+ };
+ if (GVAR(DustHandler) != -1) then {
+ [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
+ GVAR(DustHandler) = -1;
+ };
}];
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
["GlassesChanged",{
- SETGLASSES(ace_player,GLASSESDEFAULT);
+ SETGLASSES(ace_player,GLASSESDEFAULT);
- if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
+ if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
- if ([ace_player] call FUNC(isGogglesVisible)) then {
- [_this select 0] call FUNC(applyGlassesEffect);
- } else {
- call FUNC(removeGlassesEffect);
- };
+ if ([ace_player] call FUNC(isGogglesVisible)) then {
+ [_this select 0] call FUNC(applyGlassesEffect);
+ } else {
+ call FUNC(removeGlassesEffect);
+ };
}] call EFUNC(common,addEventHandler);
["GlassesCracked",{
- if (_this select 0 != ace_player) exitWith {};
- ace_player setVariable ["ACE_EyesDamaged", true];
- if (GVAR(EyesDamageScript) != -1) then {
- [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
- };
- GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
- GVAR(PostProcessEyes) ppEffectCommit 0;
- GVAR(PostProcessEyes) ppEffectEnable true;
- GVAR(EyesDamageScript) = [{
- GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
- GVAR(PostProcessEyes) ppEffectCommit 5;
+ if (_this select 0 != ace_player) exitWith {};
+ ace_player setVariable ["ACE_EyesDamaged", true];
+ if (GVAR(EyesDamageScript) != -1) then {
+ [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
+ };
+ GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
+ GVAR(PostProcessEyes) ppEffectCommit 0;
+ GVAR(PostProcessEyes) ppEffectEnable true;
GVAR(EyesDamageScript) = [{
- GVAR(PostProcessEyes) ppEffectEnable false;
- ace_player setVariable ["ACE_EyesDamaged", false];
- GVAR(EyesDamageScript) = -1;
- }, [], 5, 1] call EFUNC(common,waitAndExecute);
- }, [], 25, 5] call EFUNC(common,waitAndExecute);
+ GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
+ GVAR(PostProcessEyes) ppEffectCommit 5;
+ GVAR(EyesDamageScript) = [{
+ GVAR(PostProcessEyes) ppEffectEnable false;
+ ace_player setVariable ["ACE_EyesDamaged", false];
+ GVAR(EyesDamageScript) = -1;
+ }, [], 5, 1] call EFUNC(common,waitAndExecute);
+ }, [], 25, 5] call EFUNC(common,waitAndExecute);
}] call EFUNC(common,addEventHandler);
call FUNC(checkGlasses);
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/grenades/CfgVehicles.hpp b/addons/grenades/CfgVehicles.hpp
index d4ff039bf7..7cf2085193 100644
--- a/addons/grenades/CfgVehicles.hpp
+++ b/addons/grenades/CfgVehicles.hpp
@@ -1,8 +1,3 @@
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
- };
-
class CfgVehicles {
class NATO_Box_Base;
class EAST_Box_Base;
@@ -11,35 +6,35 @@ class CfgVehicles {
class Box_NATO_Grenades_F: NATO_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_HandFlare_White,12)
- MACRO_ADDITEM(ACE_HandFlare_Green,12)
- MACRO_ADDITEM(ACE_M84,12)
+ MACRO_ADDITEM(ACE_HandFlare_White,12);
+ MACRO_ADDITEM(ACE_HandFlare_Green,12);
+ MACRO_ADDITEM(ACE_M84,12);
};
};
class Box_East_Grenades_F: EAST_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_HandFlare_Yellow,12)
- MACRO_ADDITEM(ACE_HandFlare_Red,12)
- MACRO_ADDITEM(ACE_M84,12)
+ MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
+ MACRO_ADDITEM(ACE_HandFlare_Red,12);
+ MACRO_ADDITEM(ACE_M84,12);
};
};
class Box_IND_Grenades_F: IND_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_HandFlare_Yellow,12)
- MACRO_ADDITEM(ACE_HandFlare_Green,12)
- MACRO_ADDITEM(ACE_M84,12)
+ MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
+ MACRO_ADDITEM(ACE_HandFlare_Green,12);
+ MACRO_ADDITEM(ACE_M84,12);
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
- MACRO_ADDITEM(ACE_HandFlare_White,12)
- MACRO_ADDITEM(ACE_HandFlare_Red,12)
- MACRO_ADDITEM(ACE_HandFlare_Green,12)
- MACRO_ADDITEM(ACE_HandFlare_Yellow,12)
- MACRO_ADDITEM(ACE_M84,12)
+ MACRO_ADDITEM(ACE_HandFlare_White,12);
+ MACRO_ADDITEM(ACE_HandFlare_Red,12);
+ MACRO_ADDITEM(ACE_HandFlare_Green,12);
+ MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
+ MACRO_ADDITEM(ACE_M84,12);
};
};
};
diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf
index 0b6bb16ffb..7572a41c10 100644
--- a/addons/grenades/XEH_postInit.sqf
+++ b/addons/grenades/XEH_postInit.sqf
@@ -10,19 +10,15 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
// Add keybinds
-["ACE3",
- localize "STR_ACE_Grenades_SwitchGrenadeMode",
- {
- // Conditions: canInteract
- _exceptions = [QEGVAR(captives,isNotEscorting)];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
+["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode",
+{
+ // Conditions: canInteract
+ if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
- // Statement
- [] call FUNC(nextMode);
- },
- [9, [false, false, false]], //8 key
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
+ // Statement
+ [] call FUNC(nextMode);
+},
+{false},
+[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key
diff --git a/addons/hearing/CfgAmmo.hpp b/addons/hearing/CfgAmmo.hpp
index dea7901434..ddc2bf3297 100644
--- a/addons/hearing/CfgAmmo.hpp
+++ b/addons/hearing/CfgAmmo.hpp
@@ -4,4 +4,4 @@ class CfgAmmo {
class B_127x108_Ball: BulletBase {
audibleFire = 15;
};
-};
\ No newline at end of file
+};
diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp
index 9f0acc6c7c..94b1ab0703 100644
--- a/addons/hearing/CfgEventHandlers.hpp
+++ b/addons/hearing/CfgEventHandlers.hpp
@@ -22,7 +22,7 @@ class Extended_Init_EventHandlers {
class Extended_FiredNear_EventHandlers {
class CAManBase {
class GVAR(FiredNear) {
- clientFiredNear = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(firedNear)}; );
+ clientFiredNear = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(firedNear)}; );
};
};
};
@@ -30,7 +30,7 @@ class Extended_FiredNear_EventHandlers {
class Extended_Explosion_EventHandlers {
class CAManBase {
class GVAR(ExplosionNear) {
- clientExplosion = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(explosionNear)}; );
+ clientExplosion = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(explosionNear)}; );
};
};
-};
\ No newline at end of file
+};
diff --git a/addons/hearing/CfgSounds.hpp b/addons/hearing/CfgSounds.hpp
index 17436088c3..ac64f42c4e 100644
--- a/addons/hearing/CfgSounds.hpp
+++ b/addons/hearing/CfgSounds.hpp
@@ -11,4 +11,4 @@ class CfgSounds {
sound[] = {QUOTE(PATHTOF(sounds\ACE_earringing_heavy.wav)),8,1.7};
titles[] = {};
};
-};
\ No newline at end of file
+};
diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp
index 11eb55ef7f..6c77255384 100644
--- a/addons/hearing/CfgVehicles.hpp
+++ b/addons/hearing/CfgVehicles.hpp
@@ -1,33 +1,27 @@
-
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
-};
-
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_Equipment {
class ACE_PutInEarplugs {
- displayName = "$STR_ACE_Hearing_Earbuds_On";
- condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarBuds' in items _player} );
+ displayName = "$STR_ACE_Hearing_EarPlugs_On";
+ condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} );
+ exceptions[] = {"isNotInside"};
statement = QUOTE( [_player] call FUNC(putInEarPlugs) );
showDisabled = 0;
priority = 2.5;
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
hotkey = "E";
- enableInside = 1;
};
class ACE_RemoveEarplugs {
- displayName = "$STR_ACE_Hearing_Earbuds_Off";
+ displayName = "$STR_ACE_Hearing_EarPlugs_Off";
condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) );
+ exceptions[] = {"isNotInside"};
statement = QUOTE( [_player] call FUNC(removeEarPlugs) );
showDisabled = 0;
priority = 2.5;
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
hotkey = "E";
- enableInside = 1;
};
};
};
@@ -41,61 +35,84 @@ class CfgVehicles {
class Box_NATO_Support_F: NATO_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class B_supplyCrate_F: ReammoBox_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class Box_East_Support_F: EAST_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class O_supplyCrate_F: B_supplyCrate_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class Box_IND_Support_F: IND_Box_Base {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class Box_FIA_Support_F: FIA_Box_Base_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class I_supplyCrate_F: B_supplyCrate_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class IG_supplyCrate_F: ReammoBox_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class C_supplyCrate_F: ReammoBox_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
- MACRO_ADDITEM(ACE_EarBuds,12)
+ MACRO_ADDITEM(ACE_EarPlugs,12);
+ };
+ };
+
+
+ class Module_F;
+ class ACE_ModuleHearing: Module_F {
+ author = "$STR_ACE_Common_ACETeam";
+ category = "ACE";
+ displayName = "Hearing";
+ function = QFUNC(moduleHearing);
+ scope = 2;
+ isGlobal = 1;
+ icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
+ class Arguments {
+ class EnableCombatDeafness {
+ displayName = "Enable combat deafness?";
+ description = "Enable combat deafness?";
+ typeName = "BOOL";
+ class values {
+ class Yes { name = "Yes"; value = 1; default = 1; };
+ class No { name = "No"; value = 0; };
+ };
+ };
};
};
};
diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp
index 15fa2097a3..e70cc62c25 100644
--- a/addons/hearing/CfgWeapons.hpp
+++ b/addons/hearing/CfgWeapons.hpp
@@ -2,9 +2,9 @@ class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_F;
- class ACE_EarBuds: ACE_ItemCore {
- displayName = "$STR_ACE_Hearing_Earbuds_Name";
- descriptionShort = "$STR_ACE_Hearing_Earbuds_Description";
+ class ACE_EarPlugs: ACE_ItemCore {
+ displayName = "$STR_ACE_Hearing_EarPlugs_Name";
+ descriptionShort = "$STR_ACE_Hearing_EarPlugs_Description";
model = PATHTOF(ACE_earplugs.p3d);
picture = PATHTOF(UI\ACE_earplugs_x_ca.paa);
scope = 2;
@@ -12,4 +12,4 @@ class CfgWeapons {
mass = 1;
};
};
-};
\ No newline at end of file
+};
diff --git a/addons/hearing/UI/Icon_Module_Hearing_ca.paa b/addons/hearing/UI/Icon_Module_Hearing_ca.paa
new file mode 100644
index 0000000000..5c51645e09
Binary files /dev/null and b/addons/hearing/UI/Icon_Module_Hearing_ca.paa differ
diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf
index 95d317b4b1..0785a32aff 100644
--- a/addons/hearing/XEH_preInit.sqf
+++ b/addons/hearing/XEH_preInit.sqf
@@ -7,6 +7,7 @@ PREP(earRinging);
PREP(explosionNear);
PREP(firedNear);
PREP(hasEarPlugsIn);
+PREP(moduleHearing);
PREP(putInEarPlugs);
PREP(removeEarPlugs);
PREP(updateVolume);
diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp
index 4499e647f6..b822204484 100644
--- a/addons/hearing/config.cpp
+++ b/addons/hearing/config.cpp
@@ -3,10 +3,10 @@
class CfgPatches {
class ADDON {
units[] = {};
- weapons[] = {"ACE_EarBuds"};
+ weapons[] = {"ACE_EarPlugs"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common", "ace_interaction"};
- author[] = {"KoffeinFlummi", "CAA-Picard", "HopeJ", "commy2"};
+ author[] = {"KoffeinFlummi", "esteldunedain", "HopeJ", "commy2"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
@@ -23,10 +23,22 @@ class CfgPatches {
#include "CfgAmmo.hpp"
class ACE_Settings {
+ class GVAR(EnableCombatDeafness) {
+ value = 1;
+ typeName = "BOOL";
+ };
+ class GVAR(EarplugsVolume) {
+ value = 0.5;
+ typeName = "SCALAR";
+ };
+ class GVAR(UnconsciousnessVolume) {
+ value = 0.4;
+ typeName = "SCALAR";
+ };
class GVAR(DisableEarRinging) {
- default = 1;
+ value = 0;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Hearing_DisableEarRinging";
};
-};
\ No newline at end of file
+};
diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf
index 9253717c11..455de07fd9 100644
--- a/addons/hearing/functions/fnc_addEarPlugs.sqf
+++ b/addons/hearing/functions/fnc_addEarPlugs.sqf
@@ -1,13 +1,17 @@
/*
* Author: commy2
- *
* Called on unit initialization. Adds earplugs if the unit is equipped with either a really loud primary weapon or a rocket launcher.
*
- * Argument:
- * 0: A Soldier (Object)
+ * Arguments:
+ * 0: A Soldier
*
- * Return value:
- * Nothing
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [guy] call ace_hearing_fnc_addEarPlugs
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -19,7 +23,7 @@ _unit = _this select 0;
_launcher = secondaryWeapon _unit;
if (_launcher != "") exitWith {
- _unit addItem "ACE_EarBuds";
+ _unit addItem "ACE_EarPlugs";
};
// otherwise add earplugs if the soldier has a big rifle
@@ -32,5 +36,5 @@ if (isNil "_magazine") exitWith {};
_ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "audiblefire") > 8) then {
- _unit addItem "ACE_EarBuds";
+ _unit addItem "ACE_EarPlugs";
};
diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf
index 4581a6fdd9..2460e0fd5c 100644
--- a/addons/hearing/functions/fnc_earRinging.sqf
+++ b/addons/hearing/functions/fnc_earRinging.sqf
@@ -1,13 +1,18 @@
/*
* Author: KoffeinFlummi, commy2
- *
* Creates ear ringing effect with set strength.
*
* Arguments:
- * 0: strength of ear ringing (Number between 0 and 1)
+ * 0: Unit (player)
+ * 1: strength of ear ringing (Number between 0 and 1)
*
* Return Value:
- * none
+ * None
+ *
+ * Example:
+ * [clientExplosionEvent] call ace_hearing_fnc_earRinging
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -17,7 +22,7 @@ _unit = _this select 0;
_strength = _this select 1;
if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
- _strength = _strength / 4;
+ _strength = _strength / 4;
};
GVAR(newStrength) = GVAR(newStrength) max _strength;
@@ -28,24 +33,24 @@ if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith {
if (GVAR(DisableEarRinging)) exitWith {};
if (_strength > 0.75) exitWith {
- playSound "ACE_EarRinging_Heavy";
- GVAR(isEarRingingPlaying) = true;
- [
+ playSound "ACE_EarRinging_Heavy";
+ GVAR(isEarRingingPlaying) = true;
+ [
{GVAR(isEarRingingPlaying) = false;}, [], 7.0, 0.25
- ] call EFUNC(common,waitAndExecute);
+ ] call EFUNC(common,waitAndExecute);
};
if (_strength > 0.5) exitWith {
- playSound "ACE_EarRinging_Medium";
- GVAR(isEarRingingPlaying) = true;
- [
+ playSound "ACE_EarRinging_Medium";
+ GVAR(isEarRingingPlaying) = true;
+ [
{GVAR(isEarRingingPlaying) = false;}, [], 5.0, 0.25
- ] call EFUNC(common,waitAndExecute);
+ ] call EFUNC(common,waitAndExecute);
};
if (_strength > 0.2) exitWith {
- playSound "ACE_EarRinging_Weak";
- GVAR(isEarRingingPlaying) = true;
+ playSound "ACE_EarRinging_Weak";
GVAR(isEarRingingPlaying) = true;
- [
+ GVAR(isEarRingingPlaying) = true;
+ [
{GVAR(isEarRingingPlaying) = false;}, [], 3.0, 0.25
- ] call EFUNC(common,waitAndExecute);
+ ] call EFUNC(common,waitAndExecute);
};
diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf
index 8c7b477da0..b213a1304a 100644
--- a/addons/hearing/functions/fnc_explosionNear.sqf
+++ b/addons/hearing/functions/fnc_explosionNear.sqf
@@ -1,13 +1,18 @@
/*
* Author: KoffeinFlummi, commy2
- *
* Handles deafness due to explosions going off near the player.
*
* Arguments:
- * -> Explosion Event Handler
+ * 0: vehicle - Object the event handler is assigned to (player)
+ * 1: damage - Damage inflicted to the object
*
* Return Value:
- * none
+ * None
+ *
+ * Example:
+ * [clientExplosionEvent] call ace_hearing_fnc_explosionNear
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -19,7 +24,4 @@ _damage = _this select 1;
_strength = (_damage * 2) min 1;
if (_strength < 0.01) exitWith {};
-[_unit, _strength] spawn {
- sleep 0.2;
- _this call FUNC(earRinging);
-};
+[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);
diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf
index 10e8508617..c66361801e 100644
--- a/addons/hearing/functions/fnc_firedNear.sqf
+++ b/addons/hearing/functions/fnc_firedNear.sqf
@@ -1,13 +1,23 @@
/*
* Author: KoffeinFlummi, commy2
- *
* Handles deafness due to large-caliber weapons going off near the player.
*
* Arguments:
- * -> FiredNear Event Handler
+ * 0: Unit - Object the event handler is assigned to
+ * 1: Firer: Object - Object which fires a weapon near the unit
+ * 2: Distance - Distance in meters between the unit and firer
+ * 3: weapon - Fired weapon
+ * 4: muzzle - Muzzle that was used
+ * 5: mod - Current mode of the fired weapon
+ * 6: ammo - Ammo used
*
* Return Value:
- * none
+ * None
+ *
+ * Example:
+ * [clientFiredNearEvent] call ace_hearing_fnc_firedNear
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -25,17 +35,17 @@ if (_weapon in ["Throw", "Put"]) exitWith {};
if (_unit != vehicle _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {};
_silencer = switch (_weapon) do {
- case (primaryWeapon _unit) : {primaryWeaponItems _unit select 0};
- case (secondaryWeapon _unit) : {secondaryWeaponItems _unit select 0};
- case (handgunWeapon _unit) : {handgunItems _unit select 0};
- default {""};
+ case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0};
+ case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0};
+ case (handgunWeapon _firer) : {(handgunItems _firer) select 0};
+ default {""};
};
_audibleFireCoef = 1;
//_audibleFireTimeCoef = 1;
if (_silencer != "") then {
- _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire");
- //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime");
+ _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire");
+ //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime");
};
_audibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire");
@@ -46,7 +56,4 @@ _strength = _loudness - (_loudness/50 * _distance); // linear drop off
if (_strength < 0.01) exitWith {};
-[_unit, _strength] spawn {
- sleep 0.2;
- _this call FUNC(earRinging);
-};
+[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);
diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf
index 8fcfe1eeb1..58dc302888 100644
--- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf
+++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf
@@ -1,18 +1,20 @@
/*
* Author: commy2
- *
* Check if the unit has earplugs put in.
*
- * Argument:
- * A soldier (Object)
+ * Arguments:
+ * 0:Unit (player)
*
- * Return value:
- * Boolean (Bool)
+ * Return Value:
+ * Have Earplugs in
+ *
+ * Example:
+ * [ace_player] call ace_hearing_fnc_hasEarPlugsIn
+ *
+ * Public: No
*/
#include "script_component.hpp"
-private "_unit";
-
-_unit = _this select 0;
+PARAMS_1(_unit);
_unit getVariable ["ACE_hasEarPlugsin", false]
diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf
new file mode 100644
index 0000000000..d7b43e0092
--- /dev/null
+++ b/addons/hearing/functions/fnc_moduleHearing.sqf
@@ -0,0 +1,20 @@
+/*
+ * Author: esteldunedain
+ * Initializes the Map module.
+ *
+ * Arguments:
+ * Whatever the module provides. (I dunno.)
+ *
+ * Return Value:
+ * None
+ */
+#include "script_component.hpp"
+
+_logic = _this select 0;
+_activated = _this select 2;
+
+if !(_activated) exitWith {};
+
+[_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule);
+
+diag_log text "[ACE]: Interaction Module Initialized.";
diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf
index 767ec9c698..b02a19d5bc 100644
--- a/addons/hearing/functions/fnc_putInEarplugs.sqf
+++ b/addons/hearing/functions/fnc_putInEarplugs.sqf
@@ -1,27 +1,28 @@
/*
- * Author: Hope Johnson
- * Edited by commy2
- *
- * Puts in / takes out earplugs.
+ * Author: Hope Johnson and commy2
+ * Puts in earplugs.
*
* Arguments:
- * none
+ * 0:Unit (player)
*
* Return Value:
- * none
+ * None
+ *
+ * Example:
+ * [ace_player] call ace_hearing_fnc_putInEarplugs
+ *
+ * Public: No
*/
#include "script_component.hpp"
-private "_player";
+PARAMS_1(_player);
-_player = _this select 0;
-
-// Buds in inventory, putting them in
-_player removeItem "ACE_EarBuds";
+// Plugs in inventory, putting them in
+_player removeItem "ACE_EarPlugs";
_player setVariable ["ACE_hasEarPlugsIn", true, true];
-[localize "STR_ACE_Hearing_Earbuds_Are_On"] call EFUNC(common,displayTextStructured);
+[localize "STR_ACE_Hearing_EarPlugs_Are_On"] call EFUNC(common,displayTextStructured);
-/*// No Ear Buds in inventory, telling user
-[localize "STR_ACE_Hearing_NoBuds"] call EFUNC(common,displayTextStructured);*/
+/*// No Ear Plugs in inventory, telling user
+[localize "STR_ACE_Hearing_NoPlugs"] call EFUNC(common,displayTextStructured);*/
diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf
index 9436807a46..e2d0b68d51 100644
--- a/addons/hearing/functions/fnc_removeEarplugs.sqf
+++ b/addons/hearing/functions/fnc_removeEarplugs.sqf
@@ -1,28 +1,29 @@
/*
- * Author: Hope Johnson
- * Edited by commy2
- *
- * Puts in / takes out earplugs.
+ * Author: Hope Johnson and commy2
+ * Takes out earplugs.
*
* Arguments:
- * none
+ * 0:Unit (player)
*
* Return Value:
- * none
+ * None
+ *
+ * Example:
+ * [ace_player] call ace_hearing_fnc_removeEarplugs
+ *
+ * Public: No
*/
#include "script_component.hpp"
-private "_player";
+PARAMS_1(_player);
-_player = _this select 0;
-
-if !(_player canAdd "ACE_EarBuds") exitWith { // inventory full
- [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured);
+if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full
+ [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured);
};
-// Buds already in and removing them.
-_player addItem "ACE_EarBuds";
+// Plugs already in and removing them.
+_player addItem "ACE_EarPlugs";
_player setVariable ["ACE_hasEarPlugsIn", false, true];
-[localize "STR_ACE_Hearing_Earbuds_Are_Off"] call EFUNC(common,displayTextStructured);
+[localize "STR_ACE_Hearing_EarPlugs_Are_Off"] call EFUNC(common,displayTextStructured);
diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf
index 187d4ce116..1aa38848a5 100644
--- a/addons/hearing/functions/fnc_updateVolume.sqf
+++ b/addons/hearing/functions/fnc_updateVolume.sqf
@@ -1,22 +1,39 @@
-// by commy2 and CAA-Picard
+/*
+ * Author: commy2 and esteldunedain
+ * Updates and applys the current deafness. Called every 0.1 sec from a PFEH.
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call ace_hearing_fnc_updateVolume
+ *
+ * Public: No
+ */
#include "script_component.hpp"
#define STRENGHTODEAFNESS 3
#define MAXDEAFNESS 1.1
+// Exit if combat deafness is disabled
+if !(GVAR(enableCombatDeafness)) exitWith {};
+
// Check if new noises increase deafness
if (GVAR(newStrength) * STRENGHTODEAFNESS > GVAR(currentDeafness)) then {
- GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS;
+ GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS;
};
GVAR(newStrength) = 0;
// Recover rate is slower if deafness is severe
_recoverRate = 0.01;
if (GVAR(currentDeafness) > 0.7) then {
- _recoverRate = 0.005;
- if (GVAR(currentDeafness) > 0.9) then {
- _recoverRate = 0.002;
- };
+ _recoverRate = 0.005;
+ if (GVAR(currentDeafness) > 0.9) then {
+ _recoverRate = 0.002;
+ };
};
// Deafness recovers with time
@@ -27,19 +44,19 @@ _volume = (1 - GVAR(currentDeafness) max 0)^2 max 0.04;
// Earplugs reduce hearing 50%
if ([ACE_player] call FUNC(hasEarPlugsIn)) then {
- _volume = _volume min 0.5;
+ _volume = _volume min GVAR(EarplugsVolume);
};
// Reduce volume if player is unconscious
if (ACE_player getVariable ["ACE_isUnconscious", false]) then {
- _volume = _volume min 0.4;
+ _volume = _volume min GVAR(UnconsciousnessVolume);
};
if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then {
- 0.1 fadeSound _volume;
- 0.1 fadeSpeech _volume;
- ACE_player setVariable ["tf_globalVolume", _volume];
- ACE_player setVariable ["acre_sys_core_globalVolume", _volume];
+ 0.1 fadeSound _volume;
+ 0.1 fadeSpeech _volume;
+ ACE_player setVariable ["tf_globalVolume", _volume];
+ if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume] call acre_api_fnc_setGlobalVolume;};
};
//hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume];
diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml
index 385bf35936..7f6110915a 100644
--- a/addons/hearing/stringtable.xml
+++ b/addons/hearing/stringtable.xml
@@ -2,7 +2,7 @@
-
+
Ear Plugs
Ohrenstöpsel
Tapones para los oĂdos
@@ -14,8 +14,8 @@
Protetor auricular
Tappi auricolari
-
- Protective Ear Buds allow the wearer to be near loud weaponry without damage to his hearing.
+
+ Protective Ear Plugs allow the wearer to be near loud weaponry without damage to his hearing.
SchĂ¼tzende Ohrenstöpsel, die es dem Träger ermöglichen, sich in der Nähe lauter Waffen aufzuhalten.
Los tapones para los oĂdos permiten al usuario operar armamento ruidoso sin sufrir pĂ©rdida de audiciĂ³n.
Stopery do uszu umożliwiają użytkownikowi przebywać w pobliżu głośnej broni bez poniesienia konsekwencji jaką jest utrata słuchu.
@@ -26,7 +26,7 @@
Protetor para ouvidos permitem que o usuĂ¡rio esteja prĂ³ximo a ruĂdos sem danificar sua audiĂ§Ă£o.
Proteggono l'apparato uditivo, permettendo a chi li indossa di resistere ai suoni particolarmente forti senza alcun danno.
-
+
Earplugs in
Ohrenstöpsel drinnen
Poner tapones
@@ -38,7 +38,7 @@
Protetores colocados
Indossa i tappi auricolari
-
+
Earplugs out
Ohrenstöpsel raus
Quitar tapones
@@ -50,7 +50,7 @@
Protetores retirados
Levati i tappi auricolari
-
+
Earplugs in
Ohrenstöpsel drinnen
Tapones puestos
@@ -62,7 +62,7 @@
Protetores colocados
Indossa i tappi auricolari
-
+
Earplugs out
Ohrenstöpsel raus
Tapones quitados
@@ -74,7 +74,7 @@
Protetores retirados
Levati i tappi auricolari
-
+
You have no ear plugs
Keine Ohrenstöpsel im Inventar
No tienes tapones para los oĂdos
diff --git a/addons/hitreactions/$PBOPREFIX$ b/addons/hitreactions/$PBOPREFIX$
new file mode 100644
index 0000000000..b2a9a05ac5
--- /dev/null
+++ b/addons/hitreactions/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\hitreactions
\ No newline at end of file
diff --git a/addons/hitreactions/CfgEventHandlers.hpp b/addons/hitreactions/CfgEventHandlers.hpp
new file mode 100644
index 0000000000..1eea968973
--- /dev/null
+++ b/addons/hitreactions/CfgEventHandlers.hpp
@@ -0,0 +1,14 @@
+
+class Extended_PreInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_preInit));
+ };
+};
+
+class Extended_Hit_EventHandlers {
+ class CAManBase {
+ class ADDON {
+ hit = QUOTE(_this call FUNC(fallDown));
+ };
+ };
+};
diff --git a/addons/hitreactions/XEH_preInit.sqf b/addons/hitreactions/XEH_preInit.sqf
new file mode 100644
index 0000000000..d3c0973ee7
--- /dev/null
+++ b/addons/hitreactions/XEH_preInit.sqf
@@ -0,0 +1,7 @@
+#include "script_component.hpp"
+
+ADDON = false;
+
+PREP(fallDown);
+
+ADDON = true;
diff --git a/addons/hitreactions/config.cpp b/addons/hitreactions/config.cpp
new file mode 100644
index 0000000000..33d2665311
--- /dev/null
+++ b/addons/hitreactions/config.cpp
@@ -0,0 +1,15 @@
+#include "script_component.hpp"
+
+class CfgPatches {
+ class ADDON {
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"ace_common"};
+ author[] = {"commy2"};
+ authorUrl = "https://github.com/commy2";
+ VERSION_CONFIG;
+ };
+};
+
+#include "CfgEventHandlers.hpp"
diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf
new file mode 100644
index 0000000000..ea368b79af
--- /dev/null
+++ b/addons/hitreactions/functions/fnc_fallDown.sqf
@@ -0,0 +1,83 @@
+// by commy2
+#include "script_component.hpp"
+
+private ["_unit", "_firer", "_damage"];
+
+_unit = _this select 0;
+_firer = _this select 1;
+_damage = _this select 2;
+
+// don't fall on collision damage
+if (_unit == _firer) exitWith {};
+
+// cam shake for player
+if (_unit == ACE_player) then {
+ addCamShake [3, 5, _damage + random 10];
+};
+
+private "_vehicle";
+_vehicle = vehicle _unit;
+
+// handle static weapons
+if (_vehicle isKindOf "StaticWeapon") exitwith {
+ if (!alive _unit) then {
+ _unit action ["Eject", _vehicle];
+ unassignVehicle _unit;
+ };
+};
+
+// don't fall after minor damage
+if (_damage < 0.1) exitWith {};
+
+// play sound
+if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
+ [_unit] call EFUNC(medical,playInjuredSound);
+};
+
+// this checks most things, so it doesn't mess with being inside vehicles or while dragging etc.
+if !([_unit, _vehicle] call EFUNC(common,canInteractWith)) exitWith {};
+
+// handle ladders
+if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit >> "AGM_isLadder") == 1) exitWith {
+ _unit action ["LadderOff", nearestObject [position _unit, "House"]];
+};
+
+// only play animation when standing due to lack of animations, sry
+if !(stance _unit in ["CROUCH", "STAND"]) exitWith {};
+
+private "_velocity";
+_velocity = vectorMagnitude velocity _unit;
+
+// only fall when moving
+if (_velocity < 2) exitWith {};
+
+// get correct animation by weapon
+private "_anim";
+_anim = switch (currentWeapon _unit) do {
+ case (""): {"AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"};
+ case (primaryWeapon _unit): {
+ [
+ ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select (_velocity > 4),
+ ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select (_velocity > 4),
+ "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
+ "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
+ ] select floor random 4;
+ };
+ case (handgunWeapon _unit): {
+ [
+ "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
+ "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
+ "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
+ "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
+ ] select floor random 4;
+ };
+ default {""};
+};
+
+// exit if no animation for this weapon exists, i.E. binocular or rocket launcher
+if (_anim == "") exitWith {};
+
+// don't mess with transitions. don't fall then.
+if ([_unit] call EFUNC(common,inTransitionAnim)) exitWith {};
+
+[_unit, _anim, 2] call EFUNC(common,doAnimation);
diff --git a/addons/hitreactions/functions/script_component.hpp b/addons/hitreactions/functions/script_component.hpp
new file mode 100644
index 0000000000..ba26402e2b
--- /dev/null
+++ b/addons/hitreactions/functions/script_component.hpp
@@ -0,0 +1 @@
+#include "\z\ace\addons\hitreactions\script_component.hpp"
\ No newline at end of file
diff --git a/addons/hitreactions/script_component.hpp b/addons/hitreactions/script_component.hpp
new file mode 100644
index 0000000000..011a3b6c31
--- /dev/null
+++ b/addons/hitreactions/script_component.hpp
@@ -0,0 +1,12 @@
+#define COMPONENT hitreactions
+#include "\z\ace\addons\main\script_mod.hpp"
+
+#ifdef DEBUG_ENABLED_HITREACTIONS
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_ENABLED_HITREACTIONS
+ #define DEBUG_SETTINGS DEBUG_ENABLED_HITREACTIONS
+#endif
+
+#include "\z\ace\addons\main\script_macros.hpp"
\ No newline at end of file
diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp
new file mode 100644
index 0000000000..d13813b92e
--- /dev/null
+++ b/addons/interact_menu/CursorMenus.hpp
@@ -0,0 +1,47 @@
+class GVAR(cursorMenu) {
+ idd = 91919;
+ movingEnable = false;
+ onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgCursorMenu)),_this select 0)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),true)]);
+ onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),false)]);
+ objects[] = {};
+ /*class controlsBackground {
+ class Background {
+ idc = 91920;
+ moving = 0;
+ font = "TahomaB";
+ text = "";
+ sizeEx = 0;
+ lineSpacing = 0;
+ access = 0;
+ type = 0;
+ style = 0;
+ size = 1;
+ colorBackground[] = {0, 0, 0, 0.5};
+ colorText[] = {0, 0, 0, 0};
+ x = "safezoneX";
+ y = "safezoneY";
+ w = "safezoneW";
+ h = "safezoneH";
+ };
+ };*/
+ class controls {
+ class Canvas {
+ idc = 91921;
+ moving = 0;
+ font = "TahomaB";
+ text = "";
+ sizeEx = 0;
+ lineSpacing = 0;
+ access = 0;
+ type = 0;
+ style = 0;
+ size = 1;
+ colorBackground[] = {0, 0, 0, 0};
+ colorText[] = {0, 0, 0, 0};
+ x = "safezoneX";
+ y = "safezoneY";
+ w = "safezoneW";
+ h = "safezoneH";
+ };
+ };
+};
diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf
index a2ce5ef8a6..72bea512d6 100644
--- a/addons/interact_menu/XEH_clientInit.sqf
+++ b/addons/interact_menu/XEH_clientInit.sqf
@@ -1,41 +1,26 @@
//XEH_clientInit.sqf
#include "script_component.hpp"
-_fnc = {
- _this call FUNC(render);
+// Install the render EH on the main display
+addMissionEventHandler ["Draw3D", DFUNC(render)];
+
+// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is.
+// The thread dies as soon as the mission start, so it's not really compiting for scheduler space.
+[] spawn {
+ // Wait until the map display is detected
+ waitUntil {(!isNull findDisplay 12)};
+
+ // Install the render EH on the map screen
+ ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)];
};
-// [_fnc, 0, []] call cba_fnc_addPerFrameHandler;
-addMissionEventHandler ["Draw3D", _fnc];
-_fnc = {
- _this call FUNC(probe);
-};
-[_fnc, 0.5, []] call cba_fnc_addPerFrameHandler;
-["ACE3",
-"Interact Key",
-{_this call FUNC(keyDown)},
-[219, [false, false, false]],
-false,
-"keydown"] call cba_fnc_registerKeybind;
+["ACE3", QGVAR(InteractKey), "Interact Key",
+{[0] call FUNC(keyDown)},
+{[0] call FUNC(keyUp)},
+[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
-["ACE3",
-"Interact Key",
-{_this call FUNC(keyUp)},
-[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,
-"keyUp"] call cba_fnc_registerKeybind;
\ No newline at end of file
+["ACE3", QGVAR(SelfInteractKey), "Self Actions Key",
+{[1] call FUNC(keyDown)},
+{[1] call FUNC(keyUp)},
+[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf
index d3766cf765..c15f8d388d 100644
--- a/addons/interact_menu/XEH_preInit.sqf
+++ b/addons/interact_menu/XEH_preInit.sqf
@@ -2,40 +2,39 @@
ADDON = false;
-PREP(addAction);
+PREP(addActionToClass);
+PREP(addActionToObject);
PREP(compileMenu);
PREP(compileMenuSelfAction);
+PREP(collectActiveActionTree);
+PREP(createAction);
+PREP(findActionNode);
+PREP(isSubPath);
PREP(keyDown);
-PREP(keyDownSelfAction);
PREP(keyUp);
-PREP(keyUpSelfAction);
-PREP(probe);
-PREP(removeAction);
+PREP(removeActionFromClass);
+PREP(removeActionFromObject);
PREP(render);
+PREP(renderActionPoints);
+PREP(renderBaseMenu);
PREP(renderIcon);
PREP(renderMenu);
-PREP(rotateVectLine);
-PREP(rotateVectLineGetMap);
-
-GVAR(toRender) = [];
+PREP(renderSelector);
+PREP(splitPath);
GVAR(keyDown) = false;
GVAR(keyDownSelfAction) = false;
GVAR(keyDownTime) = 0;
+GVAR(openedMenuType) = -1;
GVAR(lastTime) = diag_tickTime;
GVAR(rotationAngle) = 0;
-GVAR(selectedAction) = {};
+GVAR(selectedAction) = [[],[]];
GVAR(actionSelected) = false;
GVAR(selectedTarget) = objNull;
-GVAR(filter) = [];
-
GVAR(menuDepthPath) = [];
-GVAR(renderDepth) = 0;
-GVAR(lastRenderDepth) = 0;
-GVAR(vecLineMap) = [];
GVAR(lastPos) = [0,0,0];
GVAR(currentOptions) = [];
@@ -44,13 +43,9 @@ GVAR(lastPath) = [];
GVAR(expanded) = false;
-GVAR(maxRenderDepth) = 0;
GVAR(startHoverTime) = diag_tickTime;
+GVAR(expandedTime) = diag_tickTime;
GVAR(iconCtrls) = [];
GVAR(iconCount) = 0;
-GVAR(objectActionsHash) = HASH_CREATE;
-
-GVAR(uidCounter) = 0;
-
ADDON = true;
diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp
index 784c6529d6..17900c2f6b 100644
--- a/addons/interact_menu/config.cpp
+++ b/addons/interact_menu/config.cpp
@@ -6,10 +6,21 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
- author[] = {"NouberNou", "CAA-Picard"};
+ author[] = {"NouberNou", "esteldunedain"};
authorUrl = "";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
+
+#include "CursorMenus.hpp"
+
+class ACE_Settings {
+ class GVAR(AlwaysUseCursorSelfInteraction) {
+ value = 0;
+ typeName = "BOOL";
+ isClientSetable = 1;
+ displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction";
+ };
+};
diff --git a/addons/interact_menu/functions/fnc_addAction.sqf b/addons/interact_menu/functions/fnc_addAction.sqf
deleted file mode 100644
index 3d445a4b13..0000000000
--- a/addons/interact_menu/functions/fnc_addAction.sqf
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Author: commy2 and NouberNou
- * Add an ACE action to an object or inside a parent action. Note: This function is NOT global.
- *
- * Argument:
- * 0: Object the action should be assigned to or parent action or
- * 1: Name of the action shown in the menu
- * 2: Icon
- * 3: Position (Position or Selection Name) or
- * 4: Statement
- * 5: Condition
- * 6: Distance
- *
- * Return value:
- * The entry array, which can be used to remove the entry, or add children entries .
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-EXPLODE_7_PVT(_this,_object,_displayName,_icon,_position,_statement,_condition,_distance);
-
-
-private ["_actions","_entry"];
-_actions = [];
-if(IS_OBJECT(_object)) then {
- _actions = _object getVariable [QUOTE(GVAR(actionData)), []];
- if((count _actions) == 0) then {
- _object setVariable [QUOTE(GVAR(actionData)), _actions]
- };
-} else {
- if(IS_ARRAY(_object)) then {
- _actions = _object select 6;
- };
-};
-
-_entry = [
- _displayName,
- _icon,
- _position,
- _statement,
- _condition,
- _distance,
- [],
- GVAR(uidCounter)
- ];
-GVAR(uidCounter) = GVAR(uidCounter) + 1;
-_actions pushBack _entry;
-_entry;
diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf
new file mode 100644
index 0000000000..7a8278c72d
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf
@@ -0,0 +1,45 @@
+/*
+ * Author: esteldunedain
+ * Insert an ACE action to a class, under a certain path
+ * Note: This function is NOT global.
+ *
+ * Argument:
+ * 0: TypeOf of the class
+ * 1: Type of action, 0 for actions, 1 for self-actions
+ * 2: Parent path of the new action
+ * 3: Action
+ *
+ * Return value:
+ * The entry full path, which can be used to remove the entry, or add children entries .
+ *
+ * Example:
+ * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_4_PVT(_this,_objectType,_typeNum,_parentPath,_action);
+
+// Ensure the config menu was compiled first
+if (_typeNum == 0) then {
+ [_objectType] call FUNC(compileMenu);
+} else {
+ [_objectType] call FUNC(compileMenuSelfAction);
+};
+
+private ["_varName","_actionTrees", "_parentNode"];
+_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType];
+_actionTrees = missionNamespace getVariable [_varName, []];
+if((count _actionTrees) == 0) then {
+ missionNamespace setVariable [_varName, _actionTrees];
+};
+
+_parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode);
+if (isNil {_parentNode}) exitWith {};
+
+// Add action node as children of the correct node of action tree
+(_parentNode select 1) pushBack [_action,[]];
+
+// Return the full path
+(+ _parentPath) pushBack (_action select 0)
diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf
new file mode 100644
index 0000000000..9c4b5013ae
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf
@@ -0,0 +1,35 @@
+/*
+ * Author: esteldunedain
+ * Insert an ACE action to an object, under a certain config path
+ * Note: This function is NOT global.
+ *
+ * Argument:
+ * 0: Object the action should be assigned to
+ * 1: Type of action, 0 for actions, 1 for self-actions
+ * 2: Parent path of the new action
+ * 3: Action
+ *
+ * Return value:
+ * The entry full path, which can be used to remove the entry, or add children entries .
+ *
+ * Example:
+ * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_4_PVT(_this,_object,_typeNum,_parentPath,_action);
+
+private ["_varName","_actionList"];
+_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
+_actionList = _object getVariable [_varName, []];
+if((count _actionList) == 0) then {
+ _object setVariable [_varName, _actionList];
+};
+
+// Add action and parent path to the list of object actions
+_actionList pushBack [_action, +_parentPath];
+
+// Return the full path
+(+ _parentPath) pushBack (_action select 0)
diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf
new file mode 100644
index 0000000000..582fe750a8
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf
@@ -0,0 +1,78 @@
+/*
+ * Author: esteldunedain
+ * Collect a entire tree of active actions
+ *
+ * Argument:
+ * 0: Object
+ * 1: Original action tree
+ * 2: Parent path
+ *
+ * Return value:
+ * Active children
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_object,_origAction,_parentPath);
+EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren);
+
+private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_action","_actionData","_x"];
+
+_target = _object;
+_player = ACE_player;
+
+// Return nothing if the action itself is not active
+if !([_target, ACE_player, _origActionData select 6] call (_origActionData select 4)) exitWith {
+ []
+};
+
+_fullPath = +_parentPath;
+_fullPath pushBack (_origActionData select 0);
+_activeChildren = [];
+
+// If there's a statement to dynamically insert children then execute it
+if !({} isEqualTo (_origActionData select 5)) then {
+ _dynamicChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5);
+
+ // Collect dynamic children class actions
+ {
+ _action = [_x select 2, _x, _fullPath] call FUNC(collectActiveActionTree);
+ if ((count _action) > 0) then {
+ _activeChildren pushBack _action;
+ };
+ } forEach _dynamicChildren;
+};
+
+// Collect children class actions
+{
+ _action = [_object, _x, _fullPath] call FUNC(collectActiveActionTree);
+ if ((count _action) > 0) then {
+ _activeChildren pushBack _action;
+ };
+} forEach _origActionChildren;
+
+// Collect children object actions
+{
+ EXPLODE_2_PVT(_x,_actionData,_pPath);
+
+ // Check if the action is children of the original action
+ if (count _pPath == count _fullPath &&
+ {_pPath isEqualTo _fullPath}) then {
+
+ _action = [_object, _action, _fullPath] call FUNC(collectActiveActionTree);
+ if ((count _action) > 0) then {
+ _activeChildren pushBack _action;
+ };
+ };
+} forEach GVAR(objectActions);
+
+
+// If the original action has no statement, and no children, don't display it
+if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) exitWith {
+ // @todo: Account for showDisabled?
+ []
+};
+
+
+[_origActionData, _activeChildren, _object]
diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf
index 0bcecf0732..a0b9b31dd4 100644
--- a/addons/interact_menu/functions/fnc_compileMenu.sqf
+++ b/addons/interact_menu/functions/fnc_compileMenu.sqf
@@ -1,9 +1,9 @@
/*
- * Author: NouberNou
- * Compile the action menu from config for a given object.
+ * Author: NouberNou and esteldunedain
+ * Compile the action menu from config for an object's class
*
* Argument:
- * 0: Object
+ * 0: Object or class name or
*
* Return value:
* None
@@ -12,33 +12,26 @@
*/
#include "script_component.hpp";
-EXPLODE_1_PVT(_this,_object);
+EXPLODE_1_PVT(_this,_target);
-/*
-[
- [
- "Launch",
- "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
- [0,0,0],
- { (_this select 0) setVelocity [0,0,10]; },
- { true },
- 1,
- []
- ]
-]
-*/
-
-private ["_objectType","_recurseFnc","_actions"];
-_objectType = typeOf _object;
-_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";
+private ["_objectType","_actionsVarName"];
+_objectType = _target;
+if (typeName _target == "OBJECT") then {
+ _objectType = typeOf _target;
+};
+_actionsVarName = format [QGVAR(Act_%1), _objectType];
+// Exit if the action menu is already compiled for this class
+if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {};
+private "_recurseFnc";
_recurseFnc = {
private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled",
- "_enableInside", "_children", "_entry", "_actionsCfg"];
+ "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"];
+ EXPLODE_1_PVT(_this,_actionsCfg);
_actions = [];
- _actionsCfg = _this select 0;
- for "_i" from 0 to (count _actionsCfg)-1 do {
+
+ for "_i" from 0 to (count _actionsCfg) - 1 do {
_entryCfg = _actionsCfg select _i;
if(isClass _entryCfg) then {
_displayName = getText (_entryCfg >> "displayName");
@@ -53,30 +46,60 @@ _recurseFnc = {
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")];
+ _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")];
- _showDisabled = getNumber (_entryCfg >> "showDisabled");
- _enableInside = getNumber (_entryCfg >> "enableInside");
+ _insertChildren = compile (getText (_entryCfg >> "insertChildren"));
+
+ _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
+ _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
+ _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
+ _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
_condition = compile _condition;
_children = [_entryCfg] call _recurseFnc;
+
_entry = [
- _displayName,
- _icon,
- _selection,
- _statement,
- _condition,
- _distance,
- _children,
- GVAR(uidCounter)
+ [
+ configName _entryCfg,
+ _displayName,
+ _icon,
+ _statement,
+ _condition,
+ _insertChildren,
+ [],
+ _selection,
+ _distance,
+ [_showDisabled,_enableInside,_canCollapse,_runOnHover]
+ ],
+ _children
];
- GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
};
};
_actions
};
-_actions = [_actionsCfg] call _recurseFnc;
+private "_actionsCfg";
+_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";
-_object setVariable [QUOTE(GVAR(actionData)), _actions];
+missionNamespace setVariable [_actionsVarName, [_actionsCfg] call _recurseFnc];
+
+/*
+[
+ [
+ [
+ "MyAction",
+ "My Action",
+ "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
+ { (_this select 0) setVelocity [0,0,10]; },
+ { true },
+ {},
+ [],
+ [0,0,0],
+ 1,
+ [false,false,false]
+ ],
+ [children actions]
+ ]
+]
+*/
diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf
index 0135d64eb8..195d741761 100644
--- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf
+++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf
@@ -1,9 +1,9 @@
/*
- * Author: NouberNou and CAA-Picard
- * Compile the self action menu from config for a given object.
+ * Author: NouberNou and esteldunedain
+ * Compile the self action menu from config for an object's class
*
* Argument:
- * 0: Object
+ * 0: Object or class name or
*
* Return value:
* None
@@ -12,36 +12,30 @@
*/
#include "script_component.hpp";
-EXPLODE_1_PVT(_this,_object);
+EXPLODE_1_PVT(_this,_target);
-/*
-[
- [
- "Launch",
- "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
- [0,0,0],
- { (_this select 0) setVelocity [0,0,10]; },
- { true },
- 1,
- []
- ]
-]
-*/
-
-private ["_objectType","_recurseFnc","_actions"];
-_objectType = typeOf _object;
-_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
+private ["_objectType","_actionsVarName"];
+_objectType = _target;
+if (typeName _target == "OBJECT") then {
+ _objectType = typeOf _target;
+};
+_actionsVarName = format [QGVAR(SelfAct_%1), _objectType];
+// Exit if the action menu is already compiled for this class
+if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {};
+private "_recurseFnc";
_recurseFnc = {
- private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_condition", "_showDisabled",
- "_enableInside", "_children", "_entry", "_actionsCfg"];
+ private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled",
+ "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"];
+ EXPLODE_1_PVT(_this,_actionsCfg);
_actions = [];
- _actionsCfg = _this select 0;
- for "_i" from 0 to (count _actionsCfg)-1 do {
+
+ 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"));
@@ -49,44 +43,62 @@ _recurseFnc = {
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")];
+ _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")];
- _showDisabled = getNumber (_entryCfg >> "showDisabled");
- _enableInside = getNumber (_entryCfg >> "enableInside");
+ _insertChildren = compile (getText (_entryCfg >> "insertChildren"));
+
+ _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
+ _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
+ _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
+ _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
_condition = compile _condition;
_children = [_entryCfg] call _recurseFnc;
+
_entry = [
- _displayName,
- _icon,
- [0,0,0],
- _statement,
- _condition,
- 10, //distace
- _children,
- GVAR(uidCounter)
+ [
+ configName _entryCfg,
+ _displayName,
+ _icon,
+ _statement,
+ _condition,
+ _insertChildren,
+ [],
+ [0,0,0],
+ 10, //distace
+ [_showDisabled,_enableInside,_canCollapse,_runOnHover]
+ ],
+ _children
];
- GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
};
};
_actions
};
-_actions = [_actionsCfg] call _recurseFnc;
+private "_actionsCfg";
+_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
// Create a master action to base on self action
-_actions = [[
- "Self Actions",
- "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
- "Spine3",
- { true },
- { true },
- 10,
- _actions,
- GVAR(uidCounter)
-]
+_actions = [
+ [
+ [
+ "ACE_SelfActions",
+ "Self Actions",
+ "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
+ {
+ // Dummy statement so it's not collapsed when there's no available actions
+ true
+ },
+ {[ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)},
+ {},
+ [],
+ "Spine3",
+ 10,
+ [false,true,false]
+ ],
+ [_actionsCfg] call _recurseFnc
+ ]
];
-GVAR(uidCounter) = GVAR(uidCounter) + 1;
-_object setVariable [QUOTE(GVAR(selfActionData)), _actions];
+missionNamespace setVariable [_actionsVarName, _actions];
diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf
new file mode 100644
index 0000000000..768d51f2a7
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_createAction.sqf
@@ -0,0 +1,74 @@
+/*
+ * Author: esteldunedain
+ * Creates an isolated ACE action
+ * Note: This function is NOT global.
+ *
+ * Argument:
+ * 0: Action name
+ * 1: Name of the action shown in the menu
+ * 2: Icon
+ * 3: Statement
+ * 4: Condition
+ * 5: Insert children code (Optional)
+ * 6: Action parameters (Optional)
+ * 7: Position (Position or Selection Name) or (Optional)
+ * 8: Distance (Optional)
+ * 9: Other parameters (Optional)
+ *
+ * Return value:
+ * Action
+ *
+ * Example:
+ * [VulcanPinch","Vulcan Pinch",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition);
+
+private ["_insertChildren","_customParams","_position","_distance","_params"];
+
+_insertChildren = if (count _this > 5) then {
+ _this select 5
+} else {
+ {}
+};
+
+_customParams = if (count _this > 6) then {
+ _this select 6
+} else {
+ []
+};
+
+_position = if (count _this > 7) then {
+ _this select 7
+} else {
+ [0,0,0]
+};
+
+_distance = if (count _this > 8) then {
+ _this select 8
+} else {
+ 2
+};
+
+_params = if (count _this > 9) then {
+ _this select 9
+} else {
+ [false,false,false,false]
+};
+
+[
+ _actionName,
+ _displayName,
+ _icon,
+ _statement,
+ _condition,
+
+ _insertChildren,
+ _customParams,
+ _position,
+ _distance,
+ _params
+]
diff --git a/addons/interact_menu/functions/fnc_findActionNode.sqf b/addons/interact_menu/functions/fnc_findActionNode.sqf
new file mode 100644
index 0000000000..4027b7a852
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_findActionNode.sqf
@@ -0,0 +1,56 @@
+/*
+ * Author: esteldunedain
+ * Return action point from path
+ * Note: This function is NOT global.
+ *
+ * Argument:
+ * 0: List of Action Tree
+ * 1: Path
+ *
+ * Return value:
+ * Action node .
+ *
+ * Example:
+ * [_actionTree, ["ACE_TapShoulderRight","VulcanPinchAction"]] call ace_interact_menu_fnc_findActionNode;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_2_PVT(_this,_actionTreeList,_parentPath);
+
+private ["_parentNode", "_foundParentNode", "_fnc_findFolder"];
+
+// Hack to make this work on the root node too
+if (count _parentPath == 0) exitWith {
+ [[],_actionTreeList]
+};
+
+// Search the class action trees and find where to insert the entry
+_parentNode = [[],_actionTreeList];
+_foundParentNode = false;
+
+_fnc_findFolder = {
+ EXPLODE_3_PVT(_this,_parentPath,_level,_actionNode);
+
+ {
+ EXPLODE_2_PVT(_x,_actionData,_actionChildren);
+ if ((_actionData select 0) isEqualTo (_parentPath select _level)) exitWith {
+
+ if (count _parentPath == _level + 1) exitWith {
+ _parentNode = _x;
+ _foundParentNode = true;
+ };
+
+ // The action should go somewhere in here
+ [_parentPath, _level + 1, _x] call _fnc_findFolder;
+ };
+ } forEach (_actionNode select 1);
+};
+
+[_parentPath, 0, [[],_actionTreeList]] call _fnc_findFolder;
+
+// Exit if there's no entry point to insert this action
+if (!_foundParentNode) exitWith {};
+
+_parentNode
diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf
new file mode 100644
index 0000000000..ec22b0aa9e
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_isSubPath.sqf
@@ -0,0 +1,29 @@
+/*
+ * Author: esteldunedain
+ * Check if the first path is a subpath of the other
+ *
+ * Argument:
+ * 0: LongPath
+ * 1: ShortPath
+ *
+ * Return value:
+ * Bool
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_2_PVT(_this,_longPath,_shortPath);
+
+private ["_isSubPath","_i"];
+_isSubPath = true;
+
+if (count _shortPath > count _longPath) exitWith {false};
+
+for [{_i = 0},{_i < count _shortPath},{_i = _i + 1}] do {
+ if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith {
+ _isSubPath = false;
+ };
+};
+
+_isSubPath
diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf
index 5d37019858..faa5b0f453 100644
--- a/addons/interact_menu/functions/fnc_keyDown.sqf
+++ b/addons/interact_menu/functions/fnc_keyDown.sqf
@@ -1,9 +1,9 @@
/*
- * Author: NouberNou
- * Handle interaction key down
+ * Author: NouberNou and esteldunedain
+ * Handle interactions key down
*
* Argument:
- * None
+ * 0: Type of key: 0 interaction / 1 self interaction
*
* Return value:
* true
@@ -12,8 +12,42 @@
*/
#include "script_component.hpp"
-if(!GVAR(keyDown)) then {
- GVAR(keyDown) = true;
- GVAR(keyDownTime) = diag_tickTime;
+EXPLODE_1_PVT(_this,_menuType);
+
+if (GVAR(openedMenuType) == _menuType) exitWith {true};
+
+while {dialog} do {
+ closeDialog 0;
};
+
+if (_menuType == 0) then {
+ GVAR(keyDown) = true;
+ GVAR(keyDownSelfAction) = false;
+} else {
+ GVAR(keyDown) = false;
+ GVAR(keyDownSelfAction) = true;
+};
+GVAR(keyDownTime) = diag_tickTime;
+GVAR(openedMenuType) = _menuType;
+
+GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) ||
+ visibleMap ||
+ (GVAR(AlwaysUseCursorSelfInteraction) && _menuType == 1);
+if (GVAR(useCursorMenu)) then {
+ createDialog QGVAR(cursorMenu);
+ // The dialog sets:
+ // uiNamespace getVariable QGVAR(dlgCursorMenu);
+ // uiNamespace getVariable QGVAR(cursorMenuOpened);
+ ctrlEnable [91921, true];
+ ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", {
+ GVAR(cursorPos) = [_this select 1, _this select 2, 0];
+ }];
+ setMousePosition [0.5, 0.5];
+};
+
+GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff
+ ((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL));
+
+["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent);
+
true
diff --git a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf
deleted file mode 100644
index be46dd132c..0000000000
--- a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Author: NouberNou
- * Handle self action key down
- *
- * Argument:
- * None
- *
- * Return value:
- * true
- *
- * Public: No
- */
-#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
diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf
index 6a39f40f95..5ab9b61788 100644
--- a/addons/interact_menu/functions/fnc_keyUp.sqf
+++ b/addons/interact_menu/functions/fnc_keyUp.sqf
@@ -1,9 +1,9 @@
/*
- * Author: NouberNou
- * Handle interaction key up
+ * Author: NouberNou and esteldunedain
+ * Handle interactions key up
*
* Argument:
- * None
+ * 0: Type of key: 0 interaction / 1 self interaction
*
* Return value:
* true
@@ -12,15 +12,42 @@
*/
#include "script_component.hpp"
-GVAR(keyDown) = false;
+// Exit if there's no menu opened
+if (GVAR(openedMenuType) < 0) exitWith {true};
+
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
+
+ private ["_player","_target","_actionData"];
_player = ACE_Player;
_target = GVAR(selectedTarget);
- [GVAR(selectedTarget), player] call GVAR(selectedAction);
+
+ // Clear the conditions caches
+ ["clearConditionCaches", []] call EFUNC(common,localEvent);
+
+ // Check the action conditions
+ _actionData = GVAR(selectedAction) select 0;
+ if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
+ // Call the statement
+ [_target, _player, _actionData select 6] call (_actionData select 3);
+
+ // Clear the conditions caches again if the action was performed
+ ["clearConditionCaches", []] call EFUNC(common,localEvent);
+ };
};
+
+GVAR(keyDown) = false;
+GVAR(keyDownSelfAction) = false;
+GVAR(openedMenuType) = -1;
+
+if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
+ closeDialog 0;
+};
+
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
-GVAR(vecLineMap) = [];
+
+["interactMenuClosed", [GVAR(openedMenuType)]] call EFUNC(common,localEvent);
+
true
diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf
deleted file mode 100644
index 82130c9993..0000000000
--- a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Author: NouberNou
- * Handle self action key up
- *
- * Argument:
- * None
- *
- * Return value:
- * true
- *
- * Public: No
- */
-#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
diff --git a/addons/interact_menu/functions/fnc_probe.sqf b/addons/interact_menu/functions/fnc_probe.sqf
deleted file mode 100644
index dc1b7e6c87..0000000000
--- a/addons/interact_menu/functions/fnc_probe.sqf
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Author: NouberNou
- * Scan de vicinity of the player and collect every interaction available around it on
- * the GVAR(toRender) array.
- *
- * Argument:
- * None
- *
- * Return value:
- * None
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-private ["_nearestObjects", "_actionObject", "_x", "_actionData", "_renderData", "_actionItem", "_active", "_renderItem", "_object", "_forEachIndex"];
-if(!GVAR(keyDown)) then {
- _nearestObjects = nearestObjects [(getPos ACE_player), ["All"], 100];
-
- GVAR(toRender) = [];
- {
- _actionObject = _x;
- _actionData = _actionObject getVariable [QUOTE(GVAR(actionData)), []];
-
- if((count _actionData) > 0) then {
- _renderData = [];
- {
- _actionItem = _x;
- this = _actionObject;
- _target = _actionObject;
- _player = ACE_player;
- _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];
- if(_active) then {
- _renderItem = +_actionItem;
- _renderItem set[4, true];
- _renderData set[(count _renderData), _renderItem];
- };
- } forEach _actionData;
- if((count _renderData) > 0) then {
- GVAR(toRender) set[(count GVAR(toRender)), [_actionObject, _renderData]];
- };
- };
- } forEach _nearestObjects;
- // player sideChat format["p: %1", count GVAR(toRender)];
-} else {
- GVAR(filter) = [];
- {
- _object = _x select 0;
- if(_object distance ACE_player > 100) then {
- GVAR(filter) set[(count GVAR(filter)), _forEachIndex];
- };
- } forEach GVAR(toRender);
-};
diff --git a/addons/interact_menu/functions/fnc_removeAction.sqf b/addons/interact_menu/functions/fnc_removeAction.sqf
deleted file mode 100644
index 3ab4379768..0000000000
--- a/addons/interact_menu/functions/fnc_removeAction.sqf
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Author: commy2 and NouberNou
- * Remove an action from an object
- *
- * Argument:
- * 0: Object the action should be assigned to
- * 1: Entry to remove or
- *
- * Return value:
- * None
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-EXPLODE_2_PVT(_this,_object,_entry);
-
-private ["_found", "_actions", "_searchFnc"];
-
-
-if(!IS_OBJECT(_object)) exitWith {false};
-
-_actions = _object getVariable [QUOTE(GVAR(actionData)), []];
-if(IS_ARRAY(_entry)) then {
- _entry = _entry select 7;
-};
-
-_found = false;
-_searchFnc = {
- private ["_actions", "_entry", "_childActions"];
- _actions = _this select 0;
- _entry = _this select 1;
- {
- if((_x select 7) == _entry) then {
- _actions set[_forEachIndex, "aceactiondelete"];
- _actions = _actions - ["aceactiondelete"];
- _found = true;
- } else {
- if(!_found && {count (_x select 6) > 0}) then {
- _childActions = [(_x select 6), _entry] call _searchFnc;
- _x set[6, _childActions];
- };
- };
- } forEach _actions;
- _actions;
-};
-_actions = [_actions, _entry] call _searchFnc;
-_object setVariable [QUOTE(GVAR(actionData)), _actions];
-
-_found;
diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf
new file mode 100644
index 0000000000..898228d6d8
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf
@@ -0,0 +1,39 @@
+/*
+ * Author: esteldunedain
+ * Removes an action from a class
+ *
+ * Argument:
+ * 0: TypeOf of the class
+ * 1: Type of action, 0 for actions, 1 for self-actions
+ * 2: Full path of the new action
+ *
+ * Return value:
+ * None
+ *
+ * Example:
+ * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath);
+
+private ["_res","_varName","_actionTrees"];
+_res = _fullPath call FUNC(splitPath);
+EXPLODE_2_PVT(_res,_parentPath,_actionName);
+
+_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType];
+_actionTrees = missionNamespace getVariable [_varName, []];
+
+_parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode);
+if (isNil {_parentNode}) exitWith {};
+
+// Iterate through children of the father
+{
+ if (((_x select 0) select 0) == _actionName) exitWith {
+ (_parentNode select 1) deleteAt _forEachIndex;
+ };
+} forEach (_parentNode select 1);
+
+_parentLevel deleteAt _actionIndex;
diff --git a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf
new file mode 100644
index 0000000000..bab740c578
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf
@@ -0,0 +1,33 @@
+/*
+ * Author: commy2, NouberNou and esteldunedain
+ * Removes an action from an object
+ *
+ * Argument:
+ * 0: Object the action is assigned to
+ * 1: Type of action, 0 for actions, 1 for self-actions
+ * 2: Full path of the action to remove
+ *
+ * Return value:
+ * None
+ *
+ * Example:
+ * [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromObject;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_object,_typeNum,_fullPath);
+
+private ["_res","_varName","_actionList"];
+_res = _fullPath call FUNC(splitPath);
+EXPLODE_2_PVT(_res,_parentPath,_actionName);
+
+_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
+_actionList = _object getVariable [_varName, []];
+{
+ if (((_x select 0) select 0) isEqualTo _actionName &&
+ {(_x select 1) isEqualTo _parentPath}) exitWith {
+ _actionList deleteAt _forEachIndex;
+ };
+} forEach _actionList;
diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf
index 79d300019a..b9afa75616 100644
--- a/addons/interact_menu/functions/fnc_render.sqf
+++ b/addons/interact_menu/functions/fnc_render.sqf
@@ -1,5 +1,5 @@
/*
- * Author: NouberNou and CAA-Picard
+ * Author: NouberNou and esteldunedain
* Render all available nearby interactions
*
* Argument:
@@ -12,113 +12,115 @@
*/
#include "script_component.hpp"
+BEGIN_COUNTER(fnc_render);
+
private ["_cursorPos1", "_cursorPos2", "_cursorVec", "_p1", "_p2", "_p", "_v", "_cp", "_forEachIndex", "_renderTargets", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_pos", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i"];
_foundTarget = false;
_cursorPos1 = positionCameraToWorld [0, 0, 0];
_cursorPos2 = positionCameraToWorld [0, 0, 2];
-GVAR(currentOptions) = [];
-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 {
- GVAR(lastPos) = getPosASL player;
- _cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY;
- _p1 = [0,0,0];
- _p2 = +_cursorVec;
- _p = (_cursorVec call CBA_fnc_vect2polar);
- _v = [(_p select 0), (_p select 1), (_p select 2)+90] call CBA_fnc_polar2vect;
- _cp = [_cursorVec, _v] call BIS_fnc_crossProduct;
- GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap);
- };
- if (GVAR(keyDown)) then {
- // Render all nearby interaction menus
- {
- if(!(_forEachIndex in GVAR(filter))) then {
- GVAR(renderDepth) = 0;
- _renderTargets = _x;
- {
- [_renderTargets select 0, _x, 0, [180, 360]] call FUNC(renderMenu);
- } forEach (_renderTargets select 1);
- };
- } 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);
+
+if (GVAR(openedMenuType) >= 0) then {
+ // Render all available nearby interactions
+ call FUNC(renderActionPoints);
+
+ // Draw the red selector only when there's no cursor
+ if !(uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
+ [[0.5,0.5], "\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa"] call FUNC(renderSelector);
};
- // player sideChat format["c: %1", count GVAR(toRender)];
-};
+ _cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
-if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
-
- _cursorScreenPos = worldToScreen _cursorPos2;
_closestDistance = 1000000;
_closestSelection = -1;
{
- _pos = _x select 1;
- _sPos = worldToScreen _pos;
- if(count _sPos > 0) then {
- _disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2);
- if(_disSq < 0.0125 && _disSq < _closestDistance) then {
- _closestDistance = _disSq;
- _closestSelection = _forEachIndex;
- };
+ _sPos = _x select 1;
+ _disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2);
+ if(_disSq < 0.0125 && _disSq < _closestDistance) then {
+ _closestDistance = _disSq;
+ _closestSelection = _forEachIndex;
};
} forEach GVAR(currentOptions);
- if(_closestSelection != -1) then {
- _closest = GVAR(currentOptions) select _closestSelection;
+ if(_closestSelection == -1) exitWith {};
- _pos = _closest select 1;
- _cTime = diag_tickTime;
- _delta = _cTime - GVAR(lastTime);
- GVAR(lastTime) = _cTime;
- GVAR(rotationAngle) = GVAR(rotationAngle) + (180*_delta);
- if(GVAR(rotationAngle) > 360) then {
- GVAR(rotationAngle) = GVAR(rotationAngle) - 360;
- };
- drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,.75], _pos, 0.6*SafeZoneW, 0.6*SafeZoneW, GVAR(rotationAngle), "", 0.5, 0.025, "TahomaB"];
- _foundTarget = true;
- GVAR(actionSelected) = true;
- GVAR(selectedTarget) = (_closest select 0) select 0;
- GVAR(selectedAction) = ((_closest select 0) select 1) select 3;
- _misMatch = false;
- _hoverPath = (_closest select 2);
- if((count GVAR(lastPath)) != (count _hoverPath)) then {
- _misMatch = true;
- } else {
- {
- if(_x != (_hoverPath select _forEachIndex)) exitWith {
- _misMatch = true;
+ _closest = GVAR(currentOptions) select _closestSelection;
+
+ _sPos = _closest select 1;
+ _cTime = diag_tickTime;
+ _delta = _cTime - GVAR(lastTime);
+ GVAR(lastTime) = _cTime;
+
+ GVAR(rotationAngle) = (GVAR(rotationAngle) + (270*_delta)) mod 360;
+ [_sPos, format [QUOTE(PATHTOF(ui\selector%1.paa)), floor (((abs GVAR(rotationAngle)) mod 90) / 6)]] call FUNC(renderSelector);
+
+ _foundTarget = true;
+ GVAR(actionSelected) = true;
+ GVAR(selectedAction) = (_closest select 0) select 1;
+ GVAR(selectedTarget) = (GVAR(selectedAction)) select 2;
+
+ _misMatch = false;
+ _hoverPath = (_closest select 2);
+
+ if((count GVAR(lastPath)) != (count _hoverPath)) then {
+ _misMatch = true;
+ } else {
+ {
+ if !(_x isEqualTo (_hoverPath select _forEachIndex)) exitWith {
+ _misMatch = true;
+ };
+ } forEach GVAR(lastPath);
+ };
+
+ if(_misMatch && {diag_tickTime-GVAR(expandedTime) > 0.25}) then {
+ GVAR(startHoverTime) = diag_tickTime;
+ GVAR(lastPath) = _hoverPath;
+ GVAR(expanded) = false;
+ } else {
+ if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then {
+ GVAR(expanded) = true;
+
+ // Start the expanding menu animation only if the user is not going up the menu
+ if !([GVAR(menuDepthPath),GVAR(lastPath)] call FUNC(isSubPath)) then {
+ GVAR(expandedTime) = diag_tickTime;
+ };
+ GVAR(menuDepthPath) = +GVAR(lastPath);
+
+ // Execute the current action if it's run on hover
+ private "_runOnHover";
+ _runOnHover = ((GVAR(selectedAction) select 0) select 9) select 3;
+ if (_runOnHover) then {
+ this = GVAR(selectedTarget);
+ _player = ACE_Player;
+ _target = GVAR(selectedTarget);
+
+ // Clear the conditions caches
+ ["clearConditionCaches", []] call EFUNC(common,localEvent);
+
+ // Check the action conditions
+ _actionData = GVAR(selectedAction) select 0;
+ if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
+ // Call the statement
+ [_target, _player, _actionData select 6] call (_actionData select 3);
+
+ // Clear the conditions caches again if the action was performed
+ ["clearConditionCaches", []] call EFUNC(common,localEvent);
};
- } forEach GVAR(lastPath);
- };
-
- if(_misMatch) then {
- GVAR(lastPath) = _hoverPath;
- GVAR(startHoverTime) = diag_tickTime;
- GVAR(expanded) = false;
- } else {
- if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then {
- GVAR(expanded) = true;
- GVAR(menuDepthPath) = +GVAR(lastPath);
};
};
};
- drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa", [1,0,0,1], _cursorPos2, 1, 1, 0, "", 0.5, 0.025, "TahomaB"];
};
+
if(!_foundTarget && GVAR(actionSelected)) then {
GVAR(actionSelected) = false;
GVAR(expanded) = false;
GVAR(lastPath) = [];
- if(!GVAR(keyDown)) then {
- GVAR(vecLineMap) = [];
- };
};
for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do {
ctrlDelete (GVAR(iconCtrls) select _i);
};
GVAR(iconCtrls) resize GVAR(iconCount);
GVAR(iconCount) = 0;
+
+END_COUNTER(fnc_render);
diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf
new file mode 100644
index 0000000000..d35bcc9a93
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf
@@ -0,0 +1,113 @@
+/*
+ * Author: NouberNou and esteldunedain
+ * Render all action points
+ *
+ * Argument:
+ * None
+ *
+ * Return value:
+ * None
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+GVAR(currentOptions) = [];
+
+private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active"];
+_player = ACE_player;
+
+
+_fnc_renderNearbyActions = {
+ // Render all nearby interaction menus
+ #define MAXINTERACTOBJECTS 3
+
+ _numInteractObjects = 0;
+ _nearestObjects = nearestObjects [(getPos ACE_player), ["All"], 15];
+ {
+ _target = _x;
+
+ _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 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 _classActions;
+
+ // Limit the amount of objects the player can interact with
+ if (_numInteractions > 0) then {
+ _numInteractObjects = _numInteractObjects + 1;
+ };
+ };
+ if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {};
+
+ } forEach _nearestObjects;
+};
+
+
+
+_fnc_renderSelfActions = {
+ _target = _this;
+
+ // Iterate through object actions, find base level actions and render them if appropiate
+ _actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target];
+ GVAR(objectActionList) = _target getVariable [QGVAR(selfActions), []];
+ /*
+ {
+ _action = _x;
+ // Only render them directly if they are base level actions
+ if (count (_action select 7) == 1) then {
+ [_target, _action, 0, [180, 360]] call FUNC(renderMenu);
+ };
+ } forEach GVAR(objectActionList);
+ */
+
+ // Iterate through base level class actions and render them if appropiate
+ _actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target];
+ _classActions = missionNamespace getVariable [_actionsVarName, []];
+ {
+ _action = _x;
+
+ _pos = if !(visibleMap) then {
+ (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition)
+ } else {
+ [0.5, 0.5]
+ };
+ [_target, _action, _pos] call FUNC(renderBaseMenu);
+ } forEach _classActions;
+};
+
+
+// Render nearby actions, unit self actions or vehicle self actions as appropiate
+if (GVAR(openedMenuType) == 0) then {
+
+ if (vehicle ACE_player == ACE_player) then {
+ call _fnc_renderNearbyActions;
+ } else {
+ (vehicle ACE_player) call _fnc_renderSelfActions;
+ };
+
+} else {
+ ACE_player call _fnc_renderSelfActions;
+};
diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf
new file mode 100644
index 0000000000..077a9239f0
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf
@@ -0,0 +1,101 @@
+/*
+ * Author: NouberNou and esteldunedain
+ * Render the interaction menu for a base action
+ *
+ * Argument:
+ * 0: Object
+ * 1: Action node
+ * 2: 3D position or 2D position (Optional)
+ *
+ * Return value:
+ * Was the menu rendered
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+BEGIN_COUNTER(fnc_renderBaseMenu)
+
+private ["_distance","_pos","_weaponDir","_ref","_cameraPos","_sPos","_activeActionTree"];
+
+EXPLODE_2_PVT(_this,_object,_baseActionNode);
+EXPLODE_1_PVT(_baseActionNode,_actionData);
+
+_distance = _actionData select 8;
+
+// Obtain a 3D position for the action
+if((count _this) > 2) then {
+ _pos = _this select 2;
+} else {
+ if(typeName (_actionData select 7) == "ARRAY") then {
+ _pos = _object modelToWorld (_actionData select 7);
+ } else {
+ if ((_actionData select 7) == "weapon") then {
+ // Craft a suitable position for weapon interaction
+ _weaponDir = _object weaponDirection currentWeapon _object;
+ _ref = _weaponDir call EFUNC(common,createOrthonormalReference);
+ _pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1);
+ } else {
+ _pos = _object modelToWorld (_object selectionPosition (_actionData select 7));
+ };
+ };
+ // Compensate for movement during the frame to get rid of jittering
+ _pos = _pos vectorAdd ((visiblePositionASL _object) vectorDiff (getPosASL _object));
+};
+
+// For non-self actions, exit if the action is too far away
+if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player &&
+ {(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false};
+
+// Exit if the action is behind you
+_sPos = if (count _pos != 2) then {
+ worldToScreen _pos
+} else {
+ _pos
+};
+if(count _sPos == 0) exitWith {false};
+
+// Exit if the action is off screen
+if ((_sPos select 0) < safeZoneXAbs || (_sPos select 0) > safeZoneXAbs + safeZoneWAbs) exitWith {false};
+if ((_sPos select 1) < safeZoneY || (_sPos select 1) > safeZoneY + safeZoneH) exitWith {false};
+
+
+BEGIN_COUNTER(fnc_collectActiveActionTree)
+
+// Collect active tree
+private "_uid";
+_uid = format [QGVAR(ATCache_%1), _actionData select 0];
+_activeActionTree = [
+ [_object, _baseActionNode, []],
+ DFUNC(collectActiveActionTree),
+ _object, _uid, 1.0, "interactMenuClosed"
+ ] call EFUNC(common,cachedCall);
+
+END_COUNTER(fnc_collectActiveActionTree)
+
+/*
+diag_log "Printing: _activeActionTree";
+_fnc_print = {
+ EXPLODE_2_PVT(_this,_level,_node);
+ EXPLODE_3_PVT(_node,_actionData,_children,_object);
+ diag_log text format ["Level %1 -> %2 on %3", _level, _actionData select 0, _object];
+ {
+ [_level + 1, _x] call _fnc_print;
+ } forEach _children;
+};
+[0, _activeActionTree] call _fnc_print;
+*/
+// Check if there's something left for rendering
+if (count _activeActionTree == 0) exitWith {false};
+
+//EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren);
+
+BEGIN_COUNTER(fnc_renderMenus);
+
+[[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu);
+
+END_COUNTER(fnc_renderMenus);
+
+END_COUNTER(fnc_renderBaseMenu)
+
+true
diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf
index 4b04ff6909..8054e9d800 100644
--- a/addons/interact_menu/functions/fnc_renderIcon.sqf
+++ b/addons/interact_menu/functions/fnc_renderIcon.sqf
@@ -1,11 +1,11 @@
/*
- * Author: NouberNou and CAA-Picard
+ * Author: NouberNou and esteldunedain
* Render a single interaction icon
*
* Argument:
* 0: Text
* 1: Color
- * 2: 3d position ASL
+ * 2: 2d position
* 3: ?
* 4: ?
* 5: ?
@@ -18,28 +18,25 @@
*/
#include "script_component.hpp"
#define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa)
-private ["_color", "_pos", "_sPos", "_ctrl", "_icon"];
+private ["_color", "_sPos", "_ctrl", "_icon"];
_text = _this select 0;
_color = _this select 1;
-_pos = _this select 2;
+_sPos = _this select 2;
_icon = _this select 6;
-_sPos = worldToScreen _pos;
-// _sPos = _pos;
-if(count _sPos > 0) then {
+//systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1];
- if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
- GVAR(iconCtrls) pushBack ((findDisplay 46) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
- };
- _ctrl = GVAR(iconCtrls) select GVAR(iconCount);
- GVAR(iconCount) = GVAR(iconCount) + 1;
- if(_icon == "") then {
- _icon = DEFAULT_ICON;
- };
- _text = format ["%4 ", _icon, _color, _color, _text];
- _ctrl ctrlSetStructuredText (parseText _text);
- _ctrl ctrlSetPosition [(_sPos select 0)-(0.2*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.035*SafeZoneW];
- //_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
- // _ctrl ctrlSetBackgroundColor [1,0,0,1];
- _ctrl ctrlCommit 0;
+if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
+ _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
+ GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
};
+_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
+GVAR(iconCount) = GVAR(iconCount) + 1;
+if(_icon == "") then {
+ _icon = DEFAULT_ICON;
+};
+_text = format ["%4 ", _icon, _color, _color, _text];
+_ctrl ctrlSetStructuredText (parseText _text);
+_ctrl ctrlSetPosition [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW];
+//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
+_ctrl ctrlCommit 0;
diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf
index 4c437aa6f3..42e8de16a2 100644
--- a/addons/interact_menu/functions/fnc_renderMenu.sqf
+++ b/addons/interact_menu/functions/fnc_renderMenu.sqf
@@ -1,14 +1,12 @@
/*
- * Author: NouberNou and CAA-Picard
- * Render a interaction menu
+ * Author: NouberNou and esteldunedain
+ * Render an interaction menu and it's children recursively
*
* Argument:
- * 0: Object
+ * 0: Parent path
* 1: Action data
- * 2: ?
+ * 2: 2D position
* 3: Angle range available for rendering
- * 4: 3D position (Optional)
- * 5: Path of UIDs (Optional)
*
* Return value:
* None
@@ -17,89 +15,105 @@
*/
#include "script_component.hpp"
-private ["_object", "_actionData", "_distance", "_uid", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"];
+private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"];
-_object = _this select 0;
-_actionData = _this select 1;
-_uid = _actionData select 7;//_this select 2;
-_angles = _this select 3;
-
-_distance = _actionData select 5;
+EXPLODE_4_PVT(_this,_parentPath,_action,_sPos,_angles);
+EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject);
EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan);
-if((count _this) > 4) then {
- _pos = _this select 4;
-} else {
- if(typeName (_actionData select 2) == "ARRAY") then {
- _pos = _object modelToWorld (_actionData select 2);
+_menuDepth = (count GVAR(menuDepthPath));
+
+//BEGIN_COUNTER(constructing_paths);
+
+// Store path to action
+_path = +_parentPath;
+_path pushBack [_actionData select 0,_actionObject];
+
+// Check if the menu is on the selected path
+_menuInSelectedPath = true;
+{
+ if (_forEachIndex >= (count GVAR(menuDepthPath))) exitWith {
+ _menuInSelectedPath = false;
+ };
+ if !(_x isEqualTo (GVAR(menuDepthPath) select _forEachIndex)) exitWith {
+ _menuInSelectedPath = false;
+ };
+} forEach _path;
+
+//END_COUNTER(constructing_paths);
+//BEGIN_COUNTER(constructing_colors);
+
+// Render icon
+// ARGB Color (First Hex Pair is transparancy)
+_color = "#FFFFFFFF";
+if(!_menuInSelectedPath) then {
+ if (_menuDepth > 0) then {
+ _color = format ["#%1FFFFFF", [255 * ((((count _path) - 1)/_menuDepth) max 0.25)] call EFUNC(common,toHex)];
} else {
- _pos = _object modelToWorld (_object selectionPosition (_actionData select 2));
+ _color = format ["#%1FFFFFF", [255 * 0.75] call EFUNC(common,toHex)];
};
};
-_cursorScreenPos = (positionCameraToWorld [0, 0, 0]);
-if(_cursorScreenPos distance _pos <= _distance) then {
- _path = [];
- if((count _this) > 5) then {
- _path = +(_this select 5);
- };
- _menuDepth = (count GVAR(menuDepthPath));
- // ARGB Color (First Hex Pair is transparancy)
- _color = "#FFFFFFFF";
- 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), _uid];
- [_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
- GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]];
- _currentRenderDepth = -1;
- _currentRenderDepth = GVAR(renderDepth);
- GVAR(renderDepth) = GVAR(renderDepth) + 1;
- if(_uid == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then {
- // 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];
+//END_COUNTER(constructing_colors);
+//BEGIN_COUNTER(fnc_renderIcons);
- private "_angleSpan";
- _angleSpan = _maxAngleSpan min (55 * (_numActions - 1));
+[_actionData select 1, _color, _sPos, 1, 1, 0, _actionData select 2, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
- private "_angle";
- _angle = _centerAngle - _angleSpan / 2;
- {
- this = _object;
- _target = _object;
- _player = ACE_player;
- _active = [_object, ACE_player] call (_x select 4);
- // diag_log text format["_active: %1: %2", (_x select 0), _active];
- if(_active) then {
- //systemChat format ["_angle: %1", _angle];
- _offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine);
- _mod = 0.15 max (0.15 * (_cursorScreenPos distance _pos)); //0.5;//0.1*_distance;
- _newPos = [
- (_pos select 0) + ((_offset select 0)*_mod),
- (_pos select 1) + ((_offset select 1)*_mod),
- (_pos select 2) + ((_offset select 2)*_mod)
- ];
- // drawLine3D [_pos, _newPos, [1,0,0,0.5]];
- [_object, _x, _forEachIndex, [_angle, 150], _newPos, _path] call FUNC(renderMenu);
+//END_COUNTER(fnc_renderIcons);
- if (_angle == 360) then {
- _angle = _angle + _angleSpan / _numActions;
- } else {
- _angle = _angle + _angleSpan / ((_numActions-1) max 1);
- };
- };
- } forEach (_actionData select 6);
- };
- GVAR(renderDepth) = GVAR(renderDepth) - 1;
+//BEGIN_COUNTER(currentOptions);
+
+// Add the action to current options
+GVAR(currentOptions) pushBack [_this, _sPos, _path];
+
+//END_COUNTER(currentOptions);
+
+// Exit without rendering children if it isn't
+if !(_menuInSelectedPath) exitWith {true};
+
+//BEGIN_COUNTER(children);
+
+private ["_numChildren","_angleSpan","_angle","_angleInterval","_scale","_offset"];
+_numChildren = count _activeChildren;
+_angleSpan = _maxAngleSpan min (55 * ((_numChildren) - 1));
+if (_angleSpan >= 305) then {
+ _angleSpan = 360;
};
+_angleInterval = 55;
+if (_angleSpan < 360) then {
+ if (_numChildren > 1) then {
+ _angleInterval = _angleSpan / (_numChildren - 1);
+ };
+} else {
+ _angleInterval = _angleSpan / (_numChildren);
+};
+if (_numChildren == 1) then {
+ _angleInterval = 55;
+};
+
+// Scale menu based on the amount of children
+_scale = 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5);
+// Animate menu scale
+if (_menuInSelectedPath && (_menuDepth == count _path)) then {
+ _scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1));
+};
+
+_target = _actionObject;
+_player = ACE_player;
+
+//END_COUNTER(children);
+_angle = _centerAngle - _angleSpan / 2;
+{
+ //BEGIN_COUNTER(children);
+ private ["_offset","_newPos"];
+ _newPos = [(_sPos select 0) -_scale * cos _angle,
+ (_sPos select 1) +_scale * (sin _angle) * 4/3];
+
+ //drawLine3D [_pos, _newPos, [1,0,0,0.8]];
+ //END_COUNTER(children);
+ [_path, _x, _newPos, [_angle, 150]] call FUNC(renderMenu);
+
+ _angle = _angle + _angleInterval;
+} forEach _activeChildren;
+
+true
diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf
new file mode 100644
index 0000000000..44ed15e9c4
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_renderSelector.sqf
@@ -0,0 +1,30 @@
+/*
+ * Author: esteldunedain
+ * Render a single interaction icon
+ *
+ * Argument:
+ * 0: 2d position
+ * 1: Icon
+ *
+ * Return value:
+ * None
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_2_PVT(_this,_sPos,_icon);
+
+if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
+ _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
+ GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
+};
+
+private "_ctrl";
+_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
+GVAR(iconCount) = GVAR(iconCount) + 1;
+
+_ctrl ctrlSetStructuredText (parseText format [" ", _icon]);
+_ctrl ctrlSetPosition [(_sPos select 0)-(0.05*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW];
+//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
+_ctrl ctrlCommit 0;
diff --git a/addons/interact_menu/functions/fnc_rotateVectLine.sqf b/addons/interact_menu/functions/fnc_rotateVectLine.sqf
deleted file mode 100644
index 4639a50903..0000000000
--- a/addons/interact_menu/functions/fnc_rotateVectLine.sqf
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Author: NouberNou
- * Rotate a vector line (?)
- *
- * Argument:
- * 0: Map
- * 1: Theta
- *
- * Return value:
- * 0: ??
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-private ["_theta", "_p", "_map", "_p1", "_p2", "_q1", "_q2", "_u", "_d"];
-_map = _this select 0;
-_theta = _this select 1;
-
-_p = _map select 0;
-_p1 = _map select 1;
-_p2 = _map select 2;
-
-_q1 = +(_map select 3);
-_q2 = +(_map select 4);
-_u = _map select 5;
-_d = _map select 6;
-
-/* Step 4 */
-_q2 set[0, (_q1 select 0) * cos(_theta) - (_q1 select 1) * sin(_theta)];
-_q2 set[1, (_q1 select 0) * sin(_theta) + (_q1 select 1) * cos(_theta)];
-_q2 set[2, (_q1 select 2)];
-
-/* Inverse of step 3 */
-_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)];
-_q1 set[1, (_q2 select 1)];
-_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
-
-/* Inverse of step 2 */
-if (_d != 0) then {
- _q2 set[0, (_q1 select 0)];
- _q2 set[1, (_q1 select 1) * (_u select 2) / _d + (_q1 select 2) * (_u select 1) / _d];
- _q2 set[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
-} else {
- _q2 = _q1;
-};
-
-/* Inverse of step 1 */
-_q1 set[0, (_q2 select 0) + (_p1 select 0)];
-_q1 set[1, (_q2 select 1) + (_p1 select 1)];
-_q1 set[2, (_q2 select 2) + (_p1 select 2)];
-_q1;
diff --git a/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf b/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf
deleted file mode 100644
index e695f3fa8e..0000000000
--- a/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Author: NouberNou
- * ?
- *
- * Argument:
- * 0: p0
- * 1: p1
- * 2: p2
- *
- * Return value:
- * Map
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-private ["_p", "_p1", "_p2", "_q1", "_q2", "_u", "_d"];
-
-_p = _this select 0;
-_p1 = _this select 1;
-_p2 = _this select 2;
-
-_q1 = [];
-_q2 = [];
-_u = [];
-
-/* Step 1 */
-_q1 set[0, (_p select 0) - (_p1 select 0)];
-_q1 set[1, (_p select 1) - (_p1 select 1)];
-_q1 set[2, (_p select 2) - (_p1 select 2)];
-
-_u set[0, (_p2 select 0) - (_p1 select 0)];
-_u set[1, (_p2 select 1) - (_p1 select 1)];
-_u set[2, (_p2 select 2) - (_p1 select 2)];
-_u = _u call BIS_fnc_unitVector;
-_d = sqrt((_u select 1)*(_u select 1) + (_u select 2)*(_u select 2));
-
-/* Step 2 */
-if (_d != 0) then {
- _q2 set[0, (_q1 select 0)];
- _q2 set[1, (_q1 select 1) * (_u select 2) / _d - (_q1 select 2) * (_u select 1) / _d];
- _q2 set[2, (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
-} else {
- _q2 = _q1;
-};
-
-/* Step 3 */
-_q1 set[0, (_q2 select 0) * _d - (_q2 select 2) * (_u select 0)];
-_q1 set[1, (_q2 select 1)];
-_q1 set[2, (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
-
-[_p, _p1, _p2, _q1, _q2, _u, _d]
diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf
new file mode 100644
index 0000000000..609f26f972
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_splitPath.sqf
@@ -0,0 +1,27 @@
+/*
+ * Author: esteldunedain
+ * Take full path and split it between parent path and action name
+ *
+ * Argument:
+ * Full path of the action to remove
+ *
+ * Return value:
+ * 0: Parent path
+ * 1: Action name
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+private ["_parentPath","_actionName"];
+_parentPath = [];
+for [{_i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do {
+ _parentPath pushBack (_this select _i);
+};
+_actionName = if (count _this > 0) then {
+ _this select ((count _this) - 1);
+} else {
+ ""
+};
+
+[_parentPath, _actionName]
diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml
new file mode 100644
index 0000000000..cecb24fee2
--- /dev/null
+++ b/addons/interact_menu/stringtable.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/addons/interact_menu/ui/selector0.paa b/addons/interact_menu/ui/selector0.paa
new file mode 100644
index 0000000000..107c0df8ba
Binary files /dev/null and b/addons/interact_menu/ui/selector0.paa differ
diff --git a/addons/interact_menu/ui/selector1.paa b/addons/interact_menu/ui/selector1.paa
new file mode 100644
index 0000000000..17f95562ee
Binary files /dev/null and b/addons/interact_menu/ui/selector1.paa differ
diff --git a/addons/interact_menu/ui/selector10.paa b/addons/interact_menu/ui/selector10.paa
new file mode 100644
index 0000000000..ed783b45ec
Binary files /dev/null and b/addons/interact_menu/ui/selector10.paa differ
diff --git a/addons/interact_menu/ui/selector11.paa b/addons/interact_menu/ui/selector11.paa
new file mode 100644
index 0000000000..cc70b12ef3
Binary files /dev/null and b/addons/interact_menu/ui/selector11.paa differ
diff --git a/addons/medical/data/border_arm_right.paa b/addons/interact_menu/ui/selector12.paa
similarity index 50%
rename from addons/medical/data/border_arm_right.paa
rename to addons/interact_menu/ui/selector12.paa
index 0aea4ce20e..b7aac55c75 100644
Binary files a/addons/medical/data/border_arm_right.paa and b/addons/interact_menu/ui/selector12.paa differ
diff --git a/addons/interact_menu/ui/selector13.paa b/addons/interact_menu/ui/selector13.paa
new file mode 100644
index 0000000000..1adcca3c8e
Binary files /dev/null and b/addons/interact_menu/ui/selector13.paa differ
diff --git a/addons/interact_menu/ui/selector14.paa b/addons/interact_menu/ui/selector14.paa
new file mode 100644
index 0000000000..f46fde1063
Binary files /dev/null and b/addons/interact_menu/ui/selector14.paa differ
diff --git a/addons/interact_menu/ui/selector2.paa b/addons/interact_menu/ui/selector2.paa
new file mode 100644
index 0000000000..7da669f90b
Binary files /dev/null and b/addons/interact_menu/ui/selector2.paa differ
diff --git a/addons/interact_menu/ui/selector3.paa b/addons/interact_menu/ui/selector3.paa
new file mode 100644
index 0000000000..c9becb268a
Binary files /dev/null and b/addons/interact_menu/ui/selector3.paa differ
diff --git a/addons/interact_menu/ui/selector4.paa b/addons/interact_menu/ui/selector4.paa
new file mode 100644
index 0000000000..eccec64c3a
Binary files /dev/null and b/addons/interact_menu/ui/selector4.paa differ
diff --git a/addons/interact_menu/ui/selector5.paa b/addons/interact_menu/ui/selector5.paa
new file mode 100644
index 0000000000..0647f14c2e
Binary files /dev/null and b/addons/interact_menu/ui/selector5.paa differ
diff --git a/addons/interact_menu/ui/selector6.paa b/addons/interact_menu/ui/selector6.paa
new file mode 100644
index 0000000000..a9555c2497
Binary files /dev/null and b/addons/interact_menu/ui/selector6.paa differ
diff --git a/addons/interact_menu/ui/selector7.paa b/addons/interact_menu/ui/selector7.paa
new file mode 100644
index 0000000000..b64f36af46
Binary files /dev/null and b/addons/interact_menu/ui/selector7.paa differ
diff --git a/addons/interact_menu/ui/selector8.paa b/addons/interact_menu/ui/selector8.paa
new file mode 100644
index 0000000000..4c3a422258
Binary files /dev/null and b/addons/interact_menu/ui/selector8.paa differ
diff --git a/addons/interact_menu/ui/selector9.paa b/addons/interact_menu/ui/selector9.paa
new file mode 100644
index 0000000000..c39a780c4f
Binary files /dev/null and b/addons/interact_menu/ui/selector9.paa differ
diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp
index 801e564384..02dd078a2b 100644
--- a/addons/interaction/CfgVehicles.hpp
+++ b/addons/interaction/CfgVehicles.hpp
@@ -1,8 +1,3 @@
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
-};
-
class CfgVehicles {
class Module_F;
@@ -13,7 +8,7 @@ class CfgVehicles {
function = "ACE_Interaction_fnc_moduleInteraction";
scope = 2;
isGlobal = 1;
- icon = PATHTOF(UI\IconInteraction_ca.paa);
+ icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
class Arguments {
class EnableTeamManagement {
displayName = "Enable Team Management";
@@ -32,119 +27,160 @@ class CfgVehicles {
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
- distance = 4;
+ distance = 5;
condition = QUOTE(true);
statement = "";
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
- selection = "spine3";
+ selection = "pelvis";
class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement";
- distance = 4;
+ distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)});
statement = "";
showDisabled = 0;
priority = 3.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "M";
- enableInside = 1;
class ACE_JoinTeamRed {
displayName = "$STR_ACE_Interaction_JoinTeamRed";
- distance = 4;
+ distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHTOF(UI\team\team_red_ca.paa);
priority = 2.4;
hotkey = "R";
- enableInside = 1;
};
class ACE_JoinTeamGreen {
displayName = "$STR_ACE_Interaction_JoinTeamGreen";
- distance = 4;
+ distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHTOF(UI\team\team_green_ca.paa);
priority = 2.3;
hotkey = "G";
- enableInside = 1;
};
class ACE_JoinTeamBlue {
displayName = "$STR_ACE_Interaction_JoinTeamBlue";
- distance = 4;
+ distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHTOF(UI\team\team_blue_ca.paa);
priority = 2.2;
hotkey = "B";
- enableInside = 1;
};
class ACE_JoinTeamYellow {
displayName = "$STR_ACE_Interaction_JoinTeamYellow";
- distance = 4;
+ distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam));
showDisabled = 1;
icon = PATHTOF(UI\team\team_yellow_ca.paa);
priority = 2.1;
hotkey = "Y";
- enableInside = 1;
};
class ACE_LeaveTeam {
displayName = "$STR_ACE_Interaction_LeaveTeam";
- distance = 4;
+ distance = 5;
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 = PATHTOF(UI\team\team_white_ca.paa);
priority = 2.5;
hotkey = "N";
- enableInside = 1;
};
};
class ACE_JoinGroup {
displayName = "$STR_ACE_Interaction_JoinGroup";
- distance = 4;
+ distance = 5;
condition = QUOTE(side group _player == side group _target && {group _player != group _target});
statement = QUOTE([_player] joinSilent group _target;);
showDisabled = 0;
priority = 2.6;
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "J";
- enableInside = 1;
};
class ACE_GetDown {
displayName = "$STR_ACE_Interaction_GetDown";
- distance = 4;
- condition = QUOTE([_target] call DFUNC(canInteractWith));
+ distance = 5;
+ condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
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 DFUNC(canInteractWith));
+ distance = 5;
+ condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
statement = QUOTE([_target] call DFUNC(sendAway));
showDisabled = 0;
priority = 2.0;
};
class ACE_Pardon {
displayName = "$STR_ACE_Interaction_Pardon";
- distance = 4;
+ distance = 5;
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;
};
};
+ class ACE_Torso {
+ displayName = "$STR_ACE_Interaction_Torso";
+ selection = "spine3";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
+ class ACE_Head {
+ displayName = "$STR_ACE_Interaction_Head";
+ selection = "pilot";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
+ class ACE_ArmLeft {
+ displayName = "$STR_ACE_Interaction_ArmLeft";
+ selection = "LeftForeArm";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
+ class ACE_ArmRight {
+ displayName = "$STR_ACE_Interaction_ArmRight";
+ selection = "RightForeArm";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
+ class ACE_LegLeft {
+ displayName = "$STR_ACE_Interaction_LegLeft";
+ selection = "LKnee";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
+ class ACE_LegRight {
+ displayName = "$STR_ACE_Interaction_LegRight";
+ selection = "RKnee";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
+ class ACE_Weapon {
+ displayName = "$STR_ACE_Interaction_Weapon";
+ selection = "weapon";
+ distance = 1.50;
+ condition = "";
+ statement = "";
+ };
class ACE_TapShoulderRight {
displayName = "$STR_ACE_Interaction_TapShoulder";
@@ -152,10 +188,6 @@ class CfgVehicles {
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder));
- showDisabled = 0;
- priority = 2.8;
- hotkey = "Q";
- enableInside = 1;
};
class ACE_TapShoulderLeft {
displayName = "$STR_ACE_Interaction_TapShoulder";
@@ -163,10 +195,6 @@ class CfgVehicles {
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder));
- showDisabled = 0;
- priority = 2.8;
- hotkey = "Q";
- enableInside = 1;
};
};
@@ -174,112 +202,93 @@ class CfgVehicles {
class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement";
condition = QUOTE(GVAR(EnableTeamManagement));
+ exceptions[] = {"isNotInside"};
statement = "";
showDisabled = 1;
priority = 3.2;
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);
+ exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam));
showDisabled = 1;
priority = 2.4;
icon = PATHTOF(UI\team\team_red_ca.paa);
- enableInside = 1;
hotkey = "R";
};
class ACE_JoinTeamGreen {
displayName = "$STR_ACE_Interaction_JoinTeamGreen";
condition = QUOTE(true);
+ exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam));
showDisabled = 1;
priority = 2.3;
icon = PATHTOF(UI\team\team_green_ca.paa);
- enableInside = 1;
hotkey = "G";
};
class ACE_JoinTeamBlue {
displayName = "$STR_ACE_Interaction_JoinTeamBlue";
condition = QUOTE(true);
+ exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_2(_player,'BLUE')] call FUNC(joinTeam));
showDisabled = 1;
priority = 2.2;
icon = PATHTOF(UI\team\team_blue_ca.paa);
- enableInside = 1;
hotkey = "B";
};
class ACE_JoinTeamYellow {
displayName = "$STR_ACE_Interaction_JoinTeamYellow";
condition = QUOTE(true);
+ exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_2(_player,'YELLOW')] call FUNC(joinTeam));
showDisabled = 1;
priority = 2.1;
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');
+ exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_2(_player,'MAIN')] call FUNC(joinTeam));
showDisabled = 1;
priority = 2.5;
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});
+ exceptions[] = {"isNotInside"};
statement = QUOTE(_newGroup = createGroup side group _player; (units group _player) joinSilent _newGroup; _newGroup selectLeader _player;);
showDisabled = 1;
priority = 1.0;
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);
+ exceptions[] = {"isNotInside"};
statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;);
showDisabled = 1;
priority = 1.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
- enableInside = 1;
hotkey = "M";
};
};
- /* DANCE ANIMATION DOESN'T WORK :(
- class ACE_Dance {
- displayName = "$STR_ACE_Interaction_Dance";
- condition = "isClass (configFile >> 'CfgPatches' >> 'ACE_Movement') and !ACE_Dancing";
- statement = "ACE_Dancing = true; [-2, {_this switchMove 'TestDance';}, player] call CBA_fnc_globalExecute;";
- showDisabled = 0;
- priority = -1.2;
- };
- class ACE_StopDancing {
- displayName = "$STR_ACE_Interaction_StopDancing";
- condition = "ACE_Dancing";
- statement = "ACE_Dancing = false; [-2, {_this switchMove '';}, player] call CBA_fnc_globalExecute;";
- showDisabled = 0;
- priority = -1.2;
- };
- */
-
class ACE_Gestures {
displayName = "$STR_ACE_Interaction_Gestures";
condition = "canStand _target";
statement = "";
showDisabled = 1;
priority = 3.5;
- subMenu[] = {"ACE_Gestures", 1};
icon = PATHTOF(UI\gestures_ca.paa);
hotkey = "G";
@@ -382,71 +391,171 @@ class CfgVehicles {
class ACE_Equipment {
displayName = "$STR_ACE_Interaction_Equipment";
condition = QUOTE(true);
+ exceptions[] = {"isNotInside","notOnMap"};
statement = "";
showDisabled = 1;
priority = 4.5;
icon = ""; // @todo
- subMenu[] = {"ACE_Equipment", 1};
- enableInside = 1;
hotkey = "E";
-
- class ACE_Dummy {
- displayName = "";
- condition = QUOTE(false);
- statement = "";
- showDisabled = 1;
- priority = -99;
- icon = PATHTOEF(common,UI\blank_CO.paa);
- enableInside = 1;
- };
};
};
};
class LandVehicle;
class Car: LandVehicle {
- class ACE_Actions {};
- class ACE_SelfActions {};
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "";
+ distance = 10;
+ condition = "true";
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
};
class Tank: LandVehicle {
- class ACE_Actions {};
- class ACE_SelfActions {};
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "";
+ distance = 10;
+ condition = "true";
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
};
class Air;
class Helicopter: Air {
- class ACE_Actions {};
- class ACE_SelfActions {};
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "";
+ distance = 10;
+ condition = "true";
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
};
class Plane: Air {
- class ACE_Actions {};
- class ACE_SelfActions {};
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "";
+ distance = 10;
+ condition = "true";
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
};
class Ship;
class Ship_F: Ship {
class ACE_Actions {
- class ACE_Push {
- displayName = "$STR_ACE_Interaction_Push";
- distance = 4;
- condition = QUOTE(getMass _target < 1000 && {alive _target});
- statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push););
- showDisabled = 0;
- priority = -1;
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "";
+ distance = 10;
+ condition = "true";
+
+ class ACE_Push {
+ displayName = "$STR_ACE_Interaction_Push";
+ distance = 6;
+ condition = QUOTE(getMass _target < 1000 && {alive _target});
+ statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push););
+ showDisabled = 0;
+ priority = -1;
+ };
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
+ };
+
+ class StaticWeapon: LandVehicle {
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "gunnerview";
+ distance = 2;
+ condition = "true";
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
+ };
+
+ class StaticMortar;
+ class Mortar_01_base_F: StaticMortar {
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "gunnerview";
+ distance = 2;
+ condition = "true";
+ };
+ };
+ class ACE_SelfActions {
+ class ACE_Passengers {
+ displayName = "$STR_ACE_Interaction_Passengers";
+ condition = "true";
+ statement = "";
+ insertChildren = QUOTE(_this call FUNC(addPassengersActions));
+ };
+ };
+ };
+
+ class thingX;
+ class ReammoBox_F: thingX {
+ class ACE_Actions {
+ class ACE_MainActions {
+ displayName = "$STR_ACE_Interaction_MainAction";
+ selection = "";
+ distance = 2;
+ condition = "true";
};
};
class ACE_SelfActions {};
};
- class StaticWeapon: LandVehicle {
- class ACE_Actions {};
- class ACE_SelfActions {};
- };
-
- class StaticMortar;
- class Mortar_01_base_F: StaticMortar {
- class ACE_Actions {};
- class ACE_SelfActions {};
- };
-
-};
\ No newline at end of file
+};
diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp
index ccd0f7d414..38f12066e0 100644
--- a/addons/interaction/Menu_Config.hpp
+++ b/addons/interaction/Menu_Config.hpp
@@ -43,370 +43,6 @@ class ACE_Interaction_Button_Base {
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
};
-#define ICON_BORDER 0.05
-
-// Old command rose
-class ACE_Interaction_Dialog {
- idd = 1713999;
- enableSimulation = 1;
- movingEnable = 0;
- onLoad = "_dlgInteractionDialog = _this select 0; for '_a' from 10 to 19 do {(_dlgInteractionDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['ACE_Interaction_Dialog', _dlgInteractionDialog];";
- objects[] = {};
- class controls {
- class Interaction_BackgroundMain: ACE_Interaction_Button_Base {
- type = 0;
- style = 2;
- idc = 2;
- colorBackground[] = {0,0,0,0.5};
- colorBackgroundDisabled[] = {0,0,0,0.5};
- x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY";
- w = "1.8 / 16 * safezoneW";
- h = "0.55 / 9 * safezoneH";
- };
-
- class Interaction_ButtonMain: ACE_Interaction_Button_Base {
- action = "-1 call ACE_Interaction_fnc_onClick;";
- style = 2;
- tooltip = "";
- text = "Interaction Menu";
- idc = 3;
- sizeEx = "0.6 / 40 / (getResolution select 5)";
- colorBackground[] = {0,0,0,0};
- colorBackgroundDisabled[] = {0,0,0,0};
- colorBackgroundActive[] = {1,1,1,0.2};
- colorFocused[] = {0,0,0,0};
- x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY";
- w = "1.8 / 16 * safezoneW";
- h = "0.55 / 9 * safezoneH";
- };
-
- class Interaction_Background0: ACE_Interaction_Button_Base {
- type = 0;
- style = 2;
- idc = 40;
- colorBackground[] = {0,0,0,0.5};
- colorBackgroundDisabled[] = {0,0,0,0.5};
- x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background1: Interaction_Background0 {
- idc = 41;
- x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background2: Interaction_Background0 {
- idc = 42;
- x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background3: Interaction_Background0 {
- idc = 43;
- x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background4: Interaction_Background0 {
- idc = 44;
- x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background5: Interaction_Background0 {
- idc = 45;
- x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background6: Interaction_Background0 {
- idc = 46;
- x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background7: Interaction_Background0 {
- idc = 47;
- x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background8: Interaction_Background0 {
- idc = 48;
- x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Background9: Interaction_Background0 {
- idc = 49;
- x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
-
- class Interaction_Icon0: ACE_Interaction_Button_Base {
- tooltip = "";
- text = "";
- idc = 20;
- type = 0;
- style = 48;
- colorBackground[] = {0,0,0,0};
- x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 - 2.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon1: Interaction_Icon0 {
- idc = 21;
- x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon2: Interaction_Icon0 {
- idc = 22;
- x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon3: Interaction_Icon0 {
- idc = 23;
- x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon4: Interaction_Icon0 {
- idc = 24;
- x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon5 : Interaction_Icon0 {
- idc = 25;
- x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 + 2.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon6: Interaction_Icon0 {
- idc = 26;
- x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon7: Interaction_Icon0 {
- idc = 27;
- x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon8: Interaction_Icon0 {
- idc = 28;
- x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
- class Interaction_Icon9: Interaction_Icon0 {
- idc = 29;
- x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX;
- y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY;
- w = (0.3-ICON_BORDER) / 16 * safezoneW;
- h = (0.3-ICON_BORDER) / 9 * safezoneH;
- };
-
- class Interaction_Shortcut0: ACE_Interaction_Button_Base {
- tooltip = "";
- text = "";
- idc = 30;
- style = 2;
- colorBackground[] = {0,0,0,0};
- x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut1: Interaction_Shortcut0 {
- idc = 31;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut2: Interaction_Shortcut0 {
- idc = 32;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut3: Interaction_Shortcut0 {
- idc = 33;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut4: Interaction_Shortcut0 {
- idc = 34;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut5 : Interaction_Shortcut0 {
- idc = 35;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut6: Interaction_Shortcut0 {
- idc = 36;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut7: Interaction_Shortcut0 {
- idc = 37;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut8: Interaction_Shortcut0 {
- idc = 38;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Shortcut9: Interaction_Shortcut0 {
- idc = 39;
- type = 0;
- x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
- w = "0.3 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
-
- class Interaction_Button0: ACE_Interaction_Button_Base {
- action = "0 call ACE_Interaction_fnc_onClick;";
- style = 2;
- tooltip = "";
- text = "";
- idc = 10;
- colorBackground[] = {0,0,0,0};
- colorBackgroundDisabled[] = {0,0,0,0};
- colorBackgroundActive[] = {1,1,1,0.2};
- colorFocused[] = {0,0,0,0};
- x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button1: Interaction_Button0 {
- action = "1 call ACE_Interaction_fnc_onClick;";
- idc = 11;
- x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button2: Interaction_Button0 {
- action = "2 call ACE_Interaction_fnc_onClick;";
- idc = 12;
- x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button3: Interaction_Button0 {
- action = "3 call ACE_Interaction_fnc_onClick;";
- idc = 13;
- x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button4: Interaction_Button0 {
- action = "4 call ACE_Interaction_fnc_onClick;";
- idc = 14;
- x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button5: Interaction_Button0 {
- action = "5 call ACE_Interaction_fnc_onClick;";
- idc = 15;
- x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button6: Interaction_Button0 {
- action = "6 call ACE_Interaction_fnc_onClick;";
- idc = 16;
- x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button7: Interaction_Button0 {
- action = "7 call ACE_Interaction_fnc_onClick;";
- idc = 17;
- x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button8: Interaction_Button0 {
- action = "8 call ACE_Interaction_fnc_onClick;";
- idc = 18;
- x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- class Interaction_Button9: Interaction_Button0 {
- action = "9 call ACE_Interaction_fnc_onClick;";
- idc = 19;
- x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
- y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
- w = "2.0 / 16 * safezoneW";
- h = "0.3 / 9 * safezoneH";
- };
- };
-};
-
class RscListbox;
class IGUIBack;
class RscText;
@@ -518,75 +154,6 @@ class RscInteractionText: RscText{
h = 1.5 * GUI_GRID_H;
};
class RscTitles {
- class ACE_FlowMenu {
- idd = 9920;
- enableSimulation = 1;
- movingEnable = 0;
- fadeIn=0.5;
- fadeOut=0.5;
- duration = 10e10;
- onLoad = "uiNamespace setVariable ['ACE_Flow_Display', _this select 0];";
-
- class controls {
- class RearIcon: RscInteractionIcon{
- idc = 999;
- text = PATHTOF(UI\CenterIcon_ca.paa);
- x = 17.9 * GUI_GRID_W;
- y = 10 * GUI_GRID_H;
- w = 3.7 * GUI_GRID_H;
- h = 5.75 * GUI_GRID_H;
- };
- class TopIcon: RscInteractionIcon{
- idc = 1200;
- h = 1 * GUI_GRID_H;
- y = 9 * GUI_GRID_H;
- };
- class FirstIcon: RscInteractionIcon{
- idc = 1201;
- y = 10.25 * GUI_GRID_H;
- h = 1.5 * GUI_GRID_H;
- };
- class SelectedItemIcon: RscInteractionIcon{
- idc = 1202;
- y = 12 * GUI_GRID_H;
- };
- class ThirdIcon: RscInteractionIcon{
- idc = 1203;
- y = 14.25 * GUI_GRID_H;
- h = 1.5 * GUI_GRID_H;
- };
- class BottomIcon: TopIcon{
- idc = 1204;
- y = 16 * GUI_GRID_H;
- };
- class ItemName: RscText{
- idc = 1000;
- style = 0x01;
- x = 5.25 * GUI_GRID_W;
- y = 12.15 * GUI_GRID_H;
- w = 13 * GUI_GRID_W;
- h = 1.5 * GUI_GRID_H;
- colorBackground[] = {0.3, 0.3, 0.3, 0.8};
- };
- class BackIcon: RscInteractionIcon{
- idc = 1210;
- text = PATHTOF(UI\backArrow_ca.paa);
- x = 18.25 * GUI_GRID_W;
- y = 12.69 * GUI_GRID_H;
- w = 0.5 * GUI_GRID_W;
- h = 0.5 * GUI_GRID_H;
- };
- class ItemDetails: RscStructuredText{
- idc = 1100;
- style = 0x0c;
- x = 23.5 * GUI_GRID_W;
- y = 11 * GUI_GRID_H;
- w = 13 * GUI_GRID_W;
- h = 3.9 * GUI_GRID_H;
- colorBackground[] = {0, 0, 0, 0.4};
- };
- };
- };
class GVAR(InteractionHelper) {
idd = 9930;
enableSimulation = 1;
diff --git a/addons/interaction/UI/IconInteraction_ca.paa b/addons/interaction/UI/IconInteraction_ca.paa
deleted file mode 100644
index 000c4bc9c6..0000000000
Binary files a/addons/interaction/UI/IconInteraction_ca.paa and /dev/null differ
diff --git a/addons/interaction/UI/Icon_Module_Interaction_ca.paa b/addons/interaction/UI/Icon_Module_Interaction_ca.paa
new file mode 100644
index 0000000000..8eb5be3f22
Binary files /dev/null and b/addons/interaction/UI/Icon_Module_Interaction_ca.paa differ
diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf
index 85232d1fcd..1ed3883f02 100644
--- a/addons/interaction/XEH_clientInit.sqf
+++ b/addons/interaction/XEH_clientInit.sqf
@@ -1,4 +1,4 @@
-// by commy2 and CAA-Picard
+// by commy2 and esteldunedain
#include "script_component.hpp"
@@ -16,92 +16,55 @@ GVAR(isOpeningDoor) = false;
// Add keybinds
-["ACE3",
- localize "STR_ACE_Interaction_OpenDoor",
- {
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !(!GVAR(isOpeningDoor) &&
- {[2] call FUNC(getDoor) select 1 != ''}
- ) exitWith {false};
+["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor",
+{
+ // Conditions: canInteract
+ if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false};
- // Statement
- call EFUNC(interaction,openDoor);
- true
- },
- [57, [false, true, false]],
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
+ // Statement
+ call EFUNC(interaction,openDoor);
+ true
+},
+{
+ //Probably don't want any condidtions here, so variable never gets locked down
+ // Statement
+ GVAR(isOpeningDoor) = false;
+ true
+},
+[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space
-["ACE3",
- localize "STR_ACE_Interaction_OpenDoor",
- {
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !(GVAR(isOpeningDoor)) exitWith {false};
- // Statement
- GVAR(isOpeningDoor) = false;
- true
- },
- [57, [false, true, false]],
- false,
- "keyup"
-] call cba_fnc_registerKeybind;
+["ACE3", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder",
+{
+ // Conditions: canInteract
+ if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
+ // Conditions: specific
+ if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
-["ACE3",
- localize "STR_ACE_Interaction_TapShoulder",
- {
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
+ // Statement
+ [ACE_player, cursorTarget] call FUNC(tapShoulder);
+ true
+},
+{false},
+[20, [true, false, false]], false] call cba_fnc_addKeybind;
- // Statement
- [ACE_player, cursorTarget] call FUNC(tapShoulder);
- true
- },
- [20, [true, false, false]],
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
+["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey",
+{
+ // Conditions: canInteract
+ //if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
-["ACE3",
- localize "STR_ACE_Interaction_ModifierKey",
- {
- // Conditions: canInteract
- _exceptions = ["ACE_Drag_isNotDragging"];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
+ // Statement
+ ACE_Modifier = 1;
+ // Return false so it doesn't block other actions
+ false
+},
+{
+ //Probably don't want any condidtions here, so variable never gets locked down
+ ACE_Modifier = 0;
+ false;
+},
+[29, [false, false, false]], false] call cba_fnc_addKeybind;
- // Statement
- ACE_Modifier = 1;
- // Return false so it doesn't block other actions
- false
- },
- [29, [false, false, false]],
- false,
- "keydown"
-] call cba_fnc_registerKeybind;
-
-["ACE3",
- localize "STR_ACE_Interaction_ModifierKey",
- {
- // Conditions: canInteract
- _exceptions = ["ACE_Drag_isNotDragging"];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
-
- // Statement
- ACE_Modifier = 0;
- // Return false so it doesn't block other actions
- false
- },
- [29, [false, false, false]],
- false,
- "keyup"
-] call cba_fnc_registerKeybind;
+["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf
index bcb8103ea2..671535c36d 100644
--- a/addons/interaction/XEH_preInit.sqf
+++ b/addons/interaction/XEH_preInit.sqf
@@ -2,49 +2,32 @@
ADDON = false;
-PREP(addInteraction);
-PREP(addInteractionSelf);
+PREP(addPassengerActions);
+PREP(addPassengersActions);
PREP(addSelectableItem);
-PREP(addToTooltip);
PREP(applyButtons);
-PREP(canInteractWith);
+PREP(canInteractWithCivilian);
PREP(canTapShoulder);
-PREP(getActions);
-PREP(getActions2);
PREP(getDoor);
PREP(getDoorAnimations);
PREP(getDown);
PREP(getSelectedButton);
PREP(hideMenu);
PREP(hideMouseHint);
-PREP(initialiseInteraction);
PREP(isInRange);
PREP(joinTeam);
-PREP(menuKeyInput);
PREP(moduleInteraction);
PREP(moveDown);
-PREP(onButtonDown);
-PREP(onButtonDownSelf);
-PREP(onButtonUp);
-PREP(onClick);
PREP(onSelectMenuDblClick);
PREP(openDoor);
-PREP(openMenu);
PREP(openMenuSelectUI);
-PREP(openMenuSelf);
PREP(openSelectMenu);
-PREP(openSubMenu);
-PREP(openSubMenuSelf);
PREP(prepareSelectMenu);
PREP(push);
-PREP(removeInteraction);
-PREP(removeInteractionSelf);
PREP(removeTag);
PREP(sendAway);
-PREP(showMenu);
PREP(showMouseHint);
PREP(sortOptionsByPriority);
PREP(tapShoulder);
-PREP(updateTooltipPosition);
ADDON = true;
diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp
index 90db08e9e2..cfca73a90b 100644
--- a/addons/interaction/config.cpp
+++ b/addons/interaction/config.cpp
@@ -5,8 +5,8 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
- requiredAddons[] = {"ace_common"};
- author[] = {"commy2", "KoffeinFlummi", "CAA-Picard", "bux578"};
+ requiredAddons[] = {"ace_interact_menu"};
+ author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
@@ -19,32 +19,8 @@ class CfgPatches {
#include
class ACE_Settings {
- class GVAR(FlowMenu) {
- value = 0;
- typeName = "BOOL";
- isClientSetable = 1;
- displayName = "$STR_ACE_Interaction_FlowMenu";
- };
- class GVAR(AutoCloseMenu) {
- value = 0;
- typeName = "BOOL";
- isClientSetable = 1;
- displayName = "$STR_ACE_Interaction_AutoCloseMenu";
- };
- class GVAR(AutoCenterCursor) {
- value = 1;
- typeName = "BOOL";
- isClientSetable = 1;
- displayName = "$STR_ACE_Interaction_AutoCenterCursor";
- };
class GVAR(EnableTeamManagement) {
value = 1;
typeName = "BOOL";
};
};
-
-class ACE_canInteractConditions {
- class GVAR(isNotSwimming) {
- condition = QUOTE( !underwater ACE_player );
- };
-};
diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_AddSelectableItem.sqf
index 1e3065d234..966c4fe043 100644
--- a/addons/interaction/functions/fnc_AddSelectableItem.sqf
+++ b/addons/interaction/functions/fnc_AddSelectableItem.sqf
@@ -29,13 +29,8 @@ if (_picture == "" || _picture == "PictureThing") then {
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
};
-if ((profileNamespace getVariable [QGVAR(FlowMenu), false])) then {
- //[_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]
- _container pushBack [_displayName, nil, {true},0,[], _picture, "", {true}, [], 4, "", _data];
-}else{
- _index = lbAdd [_container, _displayName];
- lbSetData [_container, _index, str _data];
- lbSetPicture [_container, _index, _picture];
-};
+_index = lbAdd [_container, _displayName];
+lbSetData [_container, _index, str _data];
+lbSetPicture [_container, _index, _picture];
_container
diff --git a/addons/interaction/functions/fnc_GetActions.sqf b/addons/interaction/functions/fnc_GetActions.sqf
deleted file mode 100644
index 67386331c1..0000000000
--- a/addons/interaction/functions/fnc_GetActions.sqf
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Author:
- commy2
- Garth de Wet (LH)
-
- Description:
-
- Parameters:
- 0: OBJECT - target
- 1: ARRAY - Parents of the target object
- 2: ARRAY - Actions
- 3: ARRAY - Patches
- 4: CONFIG - Parent config (ConfigFile >> "CfgVehicles"/MissionConfigFile >> "CfgVehicles")
- 5: BOOL - Is mission config file?
- 6: STRING - Classname ("ACE_Actions"/"ACE_SelfActions")
- 7: STRING - Sub-class
-
- Returns:
- Nothing
-
- Example:
- [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_Actions"] call ACE_Interaction_fnc_GetActions;
-
- [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_SelfActions"] call ACE_Interaction_fnc_GetActions;
-*/
-#include "script_component.hpp"
-
-#define DEFAULT_ICON QUOTE(PATHTOF(UI\dot_ca.paa))
-private ["_target", "_parents", "_actions", "_patches", "_baseConfig", "_actionType", "_i","_index", "_missionConfig", "_stdConfig"];
-_target = _this select 0;
-_parents = _this select 1;
-_actions = _this select 2;
-_patches = _this select 3;
-_baseConfig = _this select 4;
-_missionConfig = _this select 5;
-_actionType = _this select 6;
-_subClass = _this select 7;
-
-_stdConfig = (configFile >> "CfgVehicles" >> typeOf _target >> _actionType);
-if (_subClass != "") then {
- _stdConfig = _stdConfig >> _subClass;
-};
-
-_count = count _parents;
-for "_i" from 0 to (_count - 1) do {
- _config = _baseConfig >> _parents select _i >> _actionType;
- if (_subClass != "") then {
- _config = _config >> _subClass;
- };
-
- _count = count _config;
- if (_count > 0) then {
- for "_index" from 0 to (_count - 1) do {
- private ["_action", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority", "_tooltip", "_hotkey",
- "_subMenu", "_conditionShow", "_exceptions", "_icon", "_actionToCache", "_cacheActions", "_cache", "_indexCache", "_configName"];
- _action = if (_missionConfig) then {_config select _index} else {_stdConfig >> configName (_config select _index)};
- _cache = missionNamespace getVariable [QGVAR(MenuCache), [[], [], []]];
-
- if (count _action > 0) then {
- _configName = configName _action;
-
- _cacheConfigs = _cache select 0;
- _cacheActions = _cache select 1;
- _cacheIndices = _cache select 2;
-
- _indexCache = _cacheConfigs find _action;
- if (_indexCache == -1) then {
- _displayName = getText (_action >> "displayName");
- _distance = getNumber (_action >> "distance");
- _priority = getNumber (_action >> "priority");
- _subMenu = getArray (_action >> "subMenu");
- _tooltip = getText (_action >> "tooltip");
- _hotkey = getText (_action >> "hotkey");
- _enableInside = getNumber (_action >> "enableInside");
-
- // Condition
- _condition = getText (_action >> "condition");
- if (_condition == "") then {_condition = "true"};
-
- _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, GVAR(Target))] call EFUNC(common,canInteractWith)} ), getArray (_action >> "exceptions")];
- if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"};
-
- _condition = compile _condition;
-
- // Condition to show the action
- _conditionShow = getText (_action >> "conditionShow");
- _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow};
-
- _showDisabled = getNumber (_action >> "showDisabled") == 1;
- if (isText (_action >> "conditionShow")) then {
- _showDisabled = [_object, _player] call _conditionShow;
- };
-
- // Exceptions to the general conditions that have to be true
- _exceptions = getArray (_action >> "exceptions");
-
- // statement
- _statement = getText (_action >> "statement");
- _statement = compile _statement;
-
- if (profileNamespace getVariable [QGVAR(FlowMenu), false]) then {
- _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then {
- compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1];
- } else {
- compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement"));
- };
- };
-
- // icon
- _icon = getText (_action >> "Icon");
- if (_icon == "") then {
- _icon = DEFAULT_ICON;
- };
-
- _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey];
-
- if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call _condition}} && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then {
- _actions pushBack _actionToCache;
- _patches pushBack _configName;
- };
-
- _indexCache = _cacheActions find _actionToCache;
- if (_indexCache == -1) then {
- _indexCache = count _cacheActions;
- _cacheActions pushBack _actionToCache;
- };
-
- _cacheConfigs pushBack _action;
- _cacheIndices pushBack _indexCache;
-
- _cache = [_cacheConfigs, _cacheActions, _cacheIndices];
- ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log);
- } else {
- ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log);
-
- _cachedAction = _cacheActions select (_cacheIndices select _indexCache);
-
- _showDisabled = getNumber (_action >> "showDisabled") == 1;
- if (isText (_action >> "conditionShow")) then {
- _showDisabled = [_object, _player] call (_cachedAction select 7);
- };
-
- if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call (_cachedAction select 2)}} && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then {
- _actions pushBack _cachedAction;
- _patches pushBack _configName;
- };
- };
- };
-
- GVAR(MenuCache) = _cache;
- };
- };
-};
-[_actions, _patches]
diff --git a/addons/interaction/functions/fnc_addInteraction.sqf b/addons/interaction/functions/fnc_addInteraction.sqf
deleted file mode 100644
index 5e8889891d..0000000000
--- a/addons/interaction/functions/fnc_addInteraction.sqf
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Author: commy2
- *
- * Add an ACE action to an object. Note: This function is global.
- *
- * Argument:
- * 0: Object the action should be assigned to (Object)
- * 1: Name of the action shown in the menu (String)
- * 2: Distance the player can be away from the object (Number)
- * 3: Condition (Code or String)
- * 4: Statement (Code or String)
- * 5: Show the action even if the conditon is not met (Bool or Number)
- * 6: Priority (Number, optional default: 0)
- *
- * Return value:
- * ID of the action (used to remove it later).
- */
-
-#include "script_component.hpp"
-
-private ["_object", "_displayName", "_distance", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"];
-
-_object = _this select 0;
-_displayName = _this select 1;
-_distance = _this select 2;
-_condition = _this select 3;
-_statement = _this select 4;
-_showDisabled = _this select 5;
-_priority = _this select 6;
-
-if (typeName _condition == "STRING") then {
- _condition = compile _condition;
-};
-
-if (typeName _statement == "STRING") then {
- _statement = compile _statement;
-};
-
-if (typeName _showDisabled == "SCALAR") then {
- _showDisabled = _showDisabled > 0;
-};
-
-if (isNil "_priority") then {
- _priority = 0;
-};
-
-_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]];
-
-_id = (_actionsVar select 0) + 1;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_actionIDs pushBack _id;
-_actions pushBack [_displayName, _distance, _condition, _statement, _showDisabled, _priority];
-
-_object setVariable [QGVAR(Interactions), [_id, _actionIDs, _actions], true];
-_id
diff --git a/addons/interaction/functions/fnc_addInteractionSelf.sqf b/addons/interaction/functions/fnc_addInteractionSelf.sqf
deleted file mode 100644
index 48773fcb99..0000000000
--- a/addons/interaction/functions/fnc_addInteractionSelf.sqf
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Author: commy2
- *
- * Add an ACE self action to the player. Execute this on the local machine of the player.
- *
- * Argument:
- * 0: Name of the action shown in the menu (String)
- * 1: Condition (Code or String)
- * 2: Statement (Code or String)
- * 3: Show the action even if the conditon is not met (Bool or Number)
- * 4: Priority (Number, optional default: 0)
- *
- * Return value:
- * ID of the action (used to remove it later).
- */
-
-#include "script_component.hpp"
-
-private ["_displayName", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"];
-
-
-_displayName = _this select 0;
-
-_condition = _this select 1;
-_statement = _this select 2;
-_showDisabled = _this select 3;
-_priority = _this select 4;
-
-if (typeName _condition == "STRING") then {
- _condition = compile _condition;
-};
-
-if (typeName _statement == "STRING") then {
- _statement = compile _statement;
-};
-
-if (typeName _showDisabled == "SCALAR") then {
- _showDisabled = _showDisabled > 0;
-};
-
-if (isNil "_priority") then {
- _priority = 0;
-};
-
-_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]];
-
-_id = (_actionsVar select 0) + 1;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_actionIDs pushBack _id;
-_actions pushBack [_displayName, _condition, _statement, _showDisabled, _priority];
-
-ACE_player setVariable [QGVAR(InteractionsSelf), [_id, _actionIDs, _actions], false];
-_id
diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf
new file mode 100644
index 0000000000..1a079b1ac6
--- /dev/null
+++ b/addons/interaction/functions/fnc_addPassengerActions.sqf
@@ -0,0 +1,31 @@
+/*
+ * Author: esteldunedain
+ * Mount unit actions inside passenger submenu
+ *
+ * Argument:
+ * 0: Vehicle
+ * 1: Player
+ * 3: Parameters
+ *
+ * Return value:
+ * Children actions
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
+
+diag_log "addPassengerActions";
+
+private ["_unit","_actions"];
+_unit = _parameters select 0;
+
+_varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
+_actionTrees = missionNamespace getVariable [_varName, []];
+
+_actions = [];
+// Mount unit MainActions menu
+_actions pushBack [(_actionTrees select 0) select 0, (_actionTrees select 0) select 1, _unit];
+
+_actions
diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf
new file mode 100644
index 0000000000..c446be3737
--- /dev/null
+++ b/addons/interaction/functions/fnc_addPassengersActions.sqf
@@ -0,0 +1,42 @@
+/*
+ * Author: esteldunedain
+ * Create one action per passenger
+ *
+ * Argument:
+ * 0: Vehicle
+ * 1: Player
+ * 3: Parameters
+ *
+ * Return value:
+ * Children actions
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
+
+private ["_actions"];
+_actions = [];
+
+{
+ _unit = _x;
+ if (_x != _player) then {
+ _actions pushBack
+ [
+ [
+ str(_unit),
+ [_unit, true] call EFUNC(common,getName),
+ "",
+ {},
+ {true},
+ {_this call FUNC(addPassengerActions);},
+ [_unit]
+ ] call EFUNC(interact_menu,createAction),
+ [],
+ _unit
+ ];
+ };
+} forEach crew _vehicle;
+
+_actions
\ No newline at end of file
diff --git a/addons/interaction/functions/fnc_addToTooltip.sqf b/addons/interaction/functions/fnc_addToTooltip.sqf
deleted file mode 100644
index 9f5595a9bc..0000000000
--- a/addons/interaction/functions/fnc_addToTooltip.sqf
+++ /dev/null
@@ -1,5 +0,0 @@
-// by commy2
-
-#include "script_component.hpp"
-
-GVAR(CurrentTooltip) pushBack (_this select 0);
diff --git a/addons/interaction/functions/fnc_canInteractWith.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf
similarity index 61%
rename from addons/interaction/functions/fnc_canInteractWith.sqf
rename to addons/interaction/functions/fnc_canInteractWithCivilian.sqf
index 5a47782546..6408d66aa8 100644
--- a/addons/interaction/functions/fnc_canInteractWith.sqf
+++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf
@@ -2,13 +2,10 @@
#include "script_component.hpp"
-private ["_unit", "_isCivilian"];
-
-_unit = _this select 0;
-_isCivilian = _this select 1;
+EXPLODE_2_PVT(_this,_unit,_isCivilian);
if (isNil "_isCivilian") then {_isCivilian = true};
alive _unit
&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian
-//&& {count (weapons _unit) == 0}
+//&& {count (weapons _unit) == 0}
\ No newline at end of file
diff --git a/addons/interaction/functions/fnc_getActions2.sqf b/addons/interaction/functions/fnc_getActions2.sqf
deleted file mode 100644
index 0de4f7a534..0000000000
--- a/addons/interaction/functions/fnc_getActions2.sqf
+++ /dev/null
@@ -1,121 +0,0 @@
-// commy2
-#include "script_component.hpp"
-
-private ["_object", "_config", "_type", "_actions", "_configs"];
-
-_object = _this select 0;
-_config = _this select 1; // configFile, missionConfigFile
-_type = _this select 2; // "ACE_CfgInteractions", "ACE_CfgInteractionsSelf"
-_actions = _this select 3; // [];
-
-_configs = "_object isKindOf configName _x" configClasses (_config >> _type);
-
-// cache
-private ["_cache", "_cacheConfigs", "_cacheActions", "_cacheIndices"];
-
-_cache = uiNamespace getVariable [QGVAR(MenuCache), [[], [], []]];
-_cacheConfigs = _cache select 0;
-_cacheActions = _cache select 1;
-_cacheIndices = _cache select 2;
-
-// get interactions
-{
- private "_configActions";
-
- _configActions = "true" configClasses (_config >> _type >> configName _x);
- {
- private ["_action", "_configName", "_indexCache"];
-
- _action = _x;
- _configName = configName _action;
-
- _indexCache = _cacheConfigs find _action;
- if (_indexCache == -1) then {
- private ["_displayName", "_distance", "_priority", "_subMenu", "_tooltip", "_hotkey", "_enableInside", "_condition", "_conditionShow", "_showDisabled", "_exceptions", "_statement", "_icon"];
-
- _displayName = getText (_action >> "displayName");
- _distance = getNumber (_action >> "distance");
- _priority = getNumber (_action >> "priority");
- _subMenu = getArray (_action >> "subMenu");
- _tooltip = getText (_action >> "tooltip");
- _hotkey = getText (_action >> "hotkey");
- _enableInside = getNumber (_action >> "enableInside");
-
- // Condition
- _condition = getText (_action >> "condition");
- if (_condition == "") then {_condition = "true"};
-
- _condition = _condition + format [QUOTE(&& {%1 call EFUNC(common,canInteract)} && {[ARR_2(ACE_player, GVAR(Target))] call FUNC(canInteractWith)}), getArray (_action >> "exceptions")];
- if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"};
-
- _condition = compile _condition;
-
- // Condition to show the action
- _conditionShow = getText (_action >> "conditionShow");
- _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow};
-
- _showDisabled = getNumber (_action >> "showDisabled") == 1;
- if (isText (_action >> "conditionShow")) then {
- _showDisabled = [_object, _player] call _conditionShow;
- };
-
- // Exceptions to the general conditions that have to be true
- _exceptions = getArray (_action >> "exceptions");
-
- // statement
- _statement = getText (_action >> "statement");
- _statement = compile _statement;
-
- if (GVAR(FlowMenu)) then {
- _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then {
- compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1];
- } else {
- compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement"));
- };
- };
-
- // icon
- _icon = getText (_action >> "Icon");
- if (_icon == "") then {
- _icon = DEFAULT_ICON;
- };
-
- private "_actionToCache";
- _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey];
-
- if ((_showDisabled || {[_object, _player] call _condition}) && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then {
- _actions pushBack _actionToCache;
- };
-
- _indexCache = _cacheActions find _actionToCache;
- if (_indexCache == -1) then {
- _indexCache = count _cacheActions;
- _cacheActions pushBack _actionToCache;
- };
-
- _cacheConfigs pushBack _action;
- _cacheIndices pushBack _indexCache;
-
- _cache = [_cacheConfigs, _cacheActions, _cacheIndices];
- ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log);
- } else {
- ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log);
-
- private ["_cachedAction", "_showDisabled"];
- _cachedAction = _cacheActions select (_cacheIndices select _indexCache);
-
- _showDisabled = getNumber (_action >> "showDisabled") == 1;
- if (isText (_action >> "conditionShow")) then {
- _showDisabled = [_object, _player] call (_cachedAction select 7);
- };
-
- if ((_showDisabled || {[_object, _player] call (_cachedAction select 2)}) && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then {
- _actions pushBack _cachedAction;
- };
- };
- } forEach _configActions; //Actions of this CfgVehicles class
-} forEach _configs; //CfgVehicles class
-
-uiNamespace setVariable [QGVAR(MenuCache), _cache];
-
-_actions
diff --git a/addons/interaction/functions/fnc_initialiseInteraction.sqf b/addons/interaction/functions/fnc_initialiseInteraction.sqf
deleted file mode 100644
index 4d88eb4ea1..0000000000
--- a/addons/interaction/functions/fnc_initialiseInteraction.sqf
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- Author:
- commy2
- Garth de Wet (LH)
-
- Description:
- Initialises the interaction click handlers.
-
- Parameters:
- 0 : CODE - code to call when right clicking/center button
- 1 : BOOLEAN - Submenu
- 2 : BOOLEAN - Flow Menu
- 3 : BOOLEAN - Self interaction
- 4 : OBJECT - Target
-
- Returns:
- Nothing
-
- Example:
- [{"Default" call FUNC(openMenu);}, true, (profileNamespace getVariable [QGVAR(FlowMenu), false]), GVAR(Target)] call FUNC(initialiseInteraction);
-*/
-#include "script_component.hpp"
-
-private ["_subMenu", "_selfMenu", "_target"];
-GVAR(MainButton) = _this select 0;
-_subMenu = _this select 1;
-_selfMenu = _this select 3;
-_target = _this select 4;
-
-_player = ACE_player;
-_vehicle = vehicle _player;
-//_object = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
-
-if !([_target, 5] call FUNC(isInRange)) exitWith {};
-
-GVAR(Shortcuts) = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
-
-// Flow menu
-if (_this select 2) then {
- (QGVAR(FlowMenu) call BIS_fnc_rscLayer) cutRsc [QGVAR(FlowMenu), "PLAIN",0.5, false];
- ACE_Interaction_SelectedButton = 0;
- (findDisplay 1713999) closeDisplay 1;
- if (_player getVariable ["ACE_AcceptAction", -1] == -1) then {
- [{if(isNil {GVAR(MainButton)} || {!(profileNamespace getVariable [QGVAR(FlowMenu), false])})exitWith{false};(-(_this select 0) / 1.2) call FUNC(MoveDown);true}] call EFUNC(common,addScrollWheelEventHandler);
-
- _player setVariable ["ACE_AcceptAction", [_player, "DefaultAction", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {_action = GVAR(Buttons) select ACE_Interaction_SelectedButton;_target = GVAR(Target);_player = ACE_player;_vehicle = vehicle _player;if ([_target, _player] call (_action select 2)) then {call FUNC(hideMenu);if(count _action == 12) then{(_action select 11) call (_action select 1);}else{[_target, _player] call (_action select 1);};};}] call EFUNC(common,addActionEventHandler)];
- _player setVariable ["ACE_AcceptAction", [_player, "menuBack", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {call GVAR(MainButton);}] call EFUNC(common,addActionEventHandler)];
- };
- 0 call FUNC(moveDown);
- [localize "STR_ACE_Interaction_MakeSelection", if (_subMenu)then{localize "STR_ACE_Interaction_Back"}else{""}, localize "STR_ACE_Interaction_ScrollHint"] call FUNC(showMouseHint);
- ((uiNamespace getVariable QGVAR(Flow_Display)) displayCtrl (1210)) ctrlShow _subMenu;
-}else{ // Rose
- if (!isNull(uiNamespace getVariable QGVAR(Flow_Display))) then {
- (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0;
- call FUNC(hideMouseHint);
- };
- if (!_subMenu || {isNull (findDisplay 1713999)}) then {
- (findDisplay 1713999) closeDisplay 1;
-
- (findDisplay 46) createDisplay QGVAR(Dialog);
- // Add eventhandlers
- /*(findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))];
- (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))];*/
-
- (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call FUNC(menuKeyInput))];
- };
- disableSerialization;
- _dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog);
- _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3;
- if (GVAR(AutoCenterCursor)) then {setMousePosition [0.5, 0.5]};
- if !(_subMenu) then {
- _ctrlInteractionDialog ctrlSetText ([_target] call EFUNC(common,getName));
- } else {
- _ctrlInteractionDialog ctrlSetText localize "STR_ACE_Interaction_Back";
- };
-
- _buttons = GVAR(Buttons);
- _count = count _buttons;
-
- for "_i" from 0 to 9 do {
- _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _i);
- _ctrlInteractionDialog ctrlShow true;
-
- _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _i);
- _ctrlInteractionDialogShortcut = _dlgInteractionDialog displayCtrl (30 + _i);
- //_ctrlInteractionDialogBackground = _dlgInteractionDialog displayCtrl (40 + _i);
- if (_i < _count) then {
- _action = _buttons select _i;
- _ctrlInteractionDialog ctrlSetText (_action select 0);
- _ctrlInteractionDialog ctrlEnable ([_target, _player] call (_action select 2));
- _ctrlInteractionDialog ctrlSetTooltip (_action select 6);
-
- _ctrlInteractionDialogIcon ctrlSetText (_action select 5);
- _ctrlInteractionDialogShortcut ctrlSetText (_action select 10);
- //_ctrlInteractionDialogBackground ctrlShow true;
-
- GVAR(Shortcuts) set [_i, [_action select 10] call EFUNC(common,letterToCode)];
- } else {
- _ctrlInteractionDialog ctrlSetText "";
- _ctrlInteractionDialog ctrlEnable false;
- _ctrlInteractionDialog ctrlSetTooltip "";
-
- _ctrlInteractionDialogIcon ctrlSetText "";
- _ctrlInteractionDialogShortcut ctrlSetText "";
- //_ctrlInteractionDialogBackground ctrlShow false;
- };
- };
-
- // Update Buttons
- terminate (missionNamespace getVariable [QGVAR(updateMenuHandle), scriptNull]);
-
- GVAR(updateMenuHandle) = 0 spawn {
- disableSerialization;
- _dlgMenu = uiNamespace getVariable [QGVAR(Dialog), displayNull];
- _ctrlTooltip = _dlgMenu displayCtrl 40;
-
- _player = ACE_player;
- _vehicle = vehicle _player;
- _target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
-
- waitUntil {
- if !([_target, 5] call FUNC(isInRange)) exitWith {
- (findDisplay 1713999) closeDisplay 1
- };
-
- GVAR(Tooltips) = [[], [], [], [], [], [], [], [], [], []];
- {
- _ctrlText = _dlgMenu displayCtrl (10 + _forEachIndex);
- _ctrlIcon = _dlgMenu displayCtrl (20 + _forEachIndex);
-
- _condition = _x select 2;
- _conditionShow = _x select 7;
- _distance = _x select 9;
-
- GVAR(CurrentTooltip) = [];
-
- _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)];
-
- // apply conditional tooltips
- /*if (_forEachIndex == call ACE_Interaction_fnc_getSelectedButton) then {
- _tooltip = _x select 6;
-
- _showTooltip = _tooltip != "";
-
- _tooltip = text _tooltip;
-
- {
- _showTooltip = true;
- _tooltip = composeText [_tooltip, lineBreak, _x];
- } forEach (GVAR(Tooltips) select _forEachIndex);
-
- _ctrlTooltip ctrlSetStructuredText _tooltip;
- _ctrlTooltip ctrlShow _showTooltip;
- };*/
-
- _ctrlText ctrlEnable _enable;
- _ctrlIcon ctrlEnable _enable;
- } forEach GVAR(Buttons);
-
- sleep 0.5;
- isNull (findDisplay 1713999)
- };
- };
-};
diff --git a/addons/interaction/functions/fnc_menuKeyInput.sqf b/addons/interaction/functions/fnc_menuKeyInput.sqf
deleted file mode 100644
index 2390d6be14..0000000000
--- a/addons/interaction/functions/fnc_menuKeyInput.sqf
+++ /dev/null
@@ -1,17 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-private "_key";
-
-_key = _this select 1;
-
-if (_key in [28, 57, 156, 200, 208, 203, 205, 201, 209]) exitWith {true};
-
-_index = GVAR(Shortcuts) find _key;
-
-if (_index != -1 && {ctrlEnabled (findDisplay 1713999 displayCtrl (_index + 10))}) exitWith {
- _index call FUNC(onClick);
- true
-};
-
-false
diff --git a/addons/interaction/functions/fnc_onButtonDown.sqf b/addons/interaction/functions/fnc_onButtonDown.sqf
deleted file mode 100644
index 63f62ed4a0..0000000000
--- a/addons/interaction/functions/fnc_onButtonDown.sqf
+++ /dev/null
@@ -1,18 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-if (dialog) exitWith {
- closeDialog 0;
-};
-
-if (isNull (findDisplay 1713999)) then {
- if (ACE_player == vehicle ACE_player) then {"" call FUNC(openMenu)} else {[ACE_player, vehicle ACE_player] call FUNC(openMenuSelectUI)};
- setMousePosition [0.5, 0.5];
-} else {
- (findDisplay 1713999) closeDisplay 1;
-};
-
-// Raise custom event. @todo: remove
-[_player, "interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,callCustomEventHandlers);
-// Raise ACE localEvent
-["interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,localEvent);
diff --git a/addons/interaction/functions/fnc_onButtonDownSelf.sqf b/addons/interaction/functions/fnc_onButtonDownSelf.sqf
deleted file mode 100644
index 7b9abb926e..0000000000
--- a/addons/interaction/functions/fnc_onButtonDownSelf.sqf
+++ /dev/null
@@ -1,18 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-if (dialog) exitWith {
- closeDialog 0;
-};
-
-if (isNull (findDisplay 1713999)) then {
- "" call FUNC(openMenuSelf);
- setMousePosition [0.5, 0.5];
-} else {
- (findDisplay 1713999) closeDisplay 1;
-};
-
-// Raise custom event. @todo: remove
-[_player, "interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,callCustomEventHandlers);
-// Raise ACE localEvent
-["interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,localEvent);
diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf
index d8cd8b0693..dc9150491d 100644
--- a/addons/interaction/functions/fnc_openDoor.sqf
+++ b/addons/interaction/functions/fnc_openDoor.sqf
@@ -47,7 +47,7 @@ playSound "ACE_Sound_Click";
!GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1}
};
- if (!_usedMouseWheel && {time < _time}) then {
+ if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then {
_phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5);
{_house animate [_x, _phase]} forEach _animations;
diff --git a/addons/interaction/functions/fnc_openMenu.sqf b/addons/interaction/functions/fnc_openMenu.sqf
deleted file mode 100644
index 7785f2e4a4..0000000000
--- a/addons/interaction/functions/fnc_openMenu.sqf
+++ /dev/null
@@ -1,7 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-private "_target";
-_target = [cursorTarget, GVAR(Target)] select (_this == "Default");
-
-[0, _target, ""] call FUNC(showMenu);
diff --git a/addons/interaction/functions/fnc_openMenuSelf.sqf b/addons/interaction/functions/fnc_openMenuSelf.sqf
deleted file mode 100644
index 9ce84f7287..0000000000
--- a/addons/interaction/functions/fnc_openMenuSelf.sqf
+++ /dev/null
@@ -1,4 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-[1, ACE_player, ""] call FUNC(showMenu);
diff --git a/addons/interaction/functions/fnc_openSubMenu.sqf b/addons/interaction/functions/fnc_openSubMenu.sqf
deleted file mode 100644
index cda4e76537..0000000000
--- a/addons/interaction/functions/fnc_openSubMenu.sqf
+++ /dev/null
@@ -1,4 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-[2, GVAR(Target), _this select 0] call FUNC(showMenu);
diff --git a/addons/interaction/functions/fnc_openSubMenuSelf.sqf b/addons/interaction/functions/fnc_openSubMenuSelf.sqf
deleted file mode 100644
index e207603ebb..0000000000
--- a/addons/interaction/functions/fnc_openSubMenuSelf.sqf
+++ /dev/null
@@ -1,4 +0,0 @@
-// by commy2
-#include "script_component.hpp"
-
-[3, ACE_player, _this select 0] call FUNC(showMenu);
diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf
index 43c9eccdf1..acff7fa5e2 100644
--- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf
+++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf
@@ -18,18 +18,15 @@
private ["_buttonAction", "_header", "_buttonText", "_cancelButton"];
closeDialog 0;
-if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) exitWith {
- _header = _this select 0;
- _buttonText = _this select 1;
- if (isNil "_buttonText" or {_buttonText == ""}) then {
- _buttonText = localize "STR_ACE_Interaction_MakeSelection";
- };
- createDialog "RscACE_SelectAnItem";
- ctrlSetText [8860, _buttonText];
- ctrlSetText [8870, _header];
-
- lbClear 8866;
-
- 8866
+_header = _this select 0;
+_buttonText = _this select 1;
+if (isNil "_buttonText" or {_buttonText == ""}) then {
+ _buttonText = localize "STR_ACE_Interaction_MakeSelection";
};
-[]
+createDialog "RscACE_SelectAnItem";
+ctrlSetText [8860, _buttonText];
+ctrlSetText [8870, _header];
+
+lbClear 8866;
+
+8866
diff --git a/addons/interaction/functions/fnc_removeInteraction.sqf b/addons/interaction/functions/fnc_removeInteraction.sqf
deleted file mode 100644
index 141773da73..0000000000
--- a/addons/interaction/functions/fnc_removeInteraction.sqf
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Author: commy2
- *
- * Remove an ACE action from an object. Note: This function is global.
- *
- * Argument:
- * 0: Object (Object)
- * 1: ID of the action (Number)
- *
- * Return value:
- * None.
- */
-#include "script_component.hpp"
-
-private ["_object", "_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"];
-
-_object = _this select 0;
-_id = _this select 1;
-
-_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]];
-
-_currentID = _actionsVar select 0;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_id = _actionIDs find _id;
-
-if (_id == -1) exitWith {};
-
-_actionIDs set [_id, -1];
-_actionIDs = _actionIDs - [-1];
-
-_actions set [_id, []];
-_actions = _actions - [[]];
-
-_object setVariable [QGVAR(Interactions), [_currentID, _actionIDs, _actions], true];
diff --git a/addons/interaction/functions/fnc_removeInteractionSelf.sqf b/addons/interaction/functions/fnc_removeInteractionSelf.sqf
deleted file mode 100644
index fce0f6a5a0..0000000000
--- a/addons/interaction/functions/fnc_removeInteractionSelf.sqf
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Author: commy2
- *
- * Remove an ACE self action from the player.
- *
- * Argument:
- * 0: ID of the action (Number)
- *
- * Return value:
- * None.
- */
-#include "script_component.hpp"
-
-private ["_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"];
-
-
-_id = _this select 0;
-
-_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]];
-
-_currentID = _actionsVar select 0;
-_actionIDs = _actionsVar select 1;
-_actions = _actionsVar select 2;
-
-_id = _actionIDs find _id;
-
-if (_id == -1) exitWith {};
-
-_actionIDs set [_id, -1];
-_actionIDs = _actionIDs - [-1];
-
-_actions set [_id, []];
-_actions = _actions - [[]];
-
-ACE_player setVariable [QGVAR(InteractionsSelf), [_currentID, _actionIDs, _actions], false];
diff --git a/addons/interaction/functions/fnc_showMenu.sqf b/addons/interaction/functions/fnc_showMenu.sqf
deleted file mode 100644
index b567a22ea4..0000000000
--- a/addons/interaction/functions/fnc_showMenu.sqf
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Author:
- commy2
- Garth de Wet (LH)
- aeroson
-
- Description:
-
- Parameters:
- 0: NUMBER - Menu type (0 - interaction, 1 - self-interaction, 2 - sub-interaction, 3 - sub-self-interaction)
- 1: OBJECT - Target object
- 2: STRING - Sub-Menu ClassName
-
- Returns:
- Nothing
-
- Example:
- [0, GVAR(Target)] call FUNC(showMenu);
- [1, player] call FUNC(showMenu);
- [2, GVAR(Target), "ACE_Explosives"] call FUNC(showMenu);
- [3, player, "ACE_Explosives"] call FUNC(showMenu);
-*/
-#include "script_component.hpp"
-
-private ["_player", "_vehicle", "_mainButtonAction", "_object", "_index", "_actions", "_result", "_menuType"];
-#define DEFAULT_ICON QUOTE(PATHOF(UI\dot_ca.paa))
-#define DEFAULT_DISTANCE 4 // seems to be 4
-_player = ACE_player;
-_vehicle = vehicle _player;
-
-GVAR(MenuType) = _this select 0; // 0 Interaction, 1 Self Interaction
-
-_mainButtonAction = [
- {call FUNC(hideMenu)},
- {call FUNC(hideMenu)},
- {"Default" call FUNC(openMenu)},
- {"Default" call FUNC(openMenuSelf)}
-] select GVAR(MenuType);
-
-_menuType = GVAR(MenuType) % 2;
-uiNamespace setVariable [QGVAR(CursorPosition), [controlNull, 0.5, 0.5, -1]];
-
-GVAR(Target) = _this select 1;
-_object = GVAR(Target);
-
-if (_menuType == 0 && {(isNull (_object) || {!([_object, 4] call FUNC(isInRange))})}) exitWith {};
-if !([_player, _object] call EFUNC(common,canInteractWith)) exitWith {};
-
-// add actions or self actions of GVAR(Target)
-_parents = [configFile >> "CfgVehicles" >> typeOf _object, true] call BIS_fnc_returnParents;
-_result = [_object, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions);
-_actions = ([_object, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0);
-
-// add self actions of vehicle _player
-if (_menuType == 1 && {_player != _vehicle}) then {
- _parents = [configFile >> "CfgVehicles" >> typeOf _vehicle, true] call BIS_fnc_returnParents;
- _result = [_vehicle, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions);
- _actions = _actions + (([_vehicle, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0));
-};
-
-// custom defined actions, stored in variable instead of cfg like above
-if (GVAR(MenuType) < 2) then {
-
- private ["_customActions", "_customAction", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority"];
-
- // add interactions or self interactions of GVAR(Target)
- _customActions = (_object getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2;
-
- // add self interactions of vehicle _player
- if (_menuType == 1 && {_player != _vehicle}) then {
- _customActions = _customActions + ((_vehicle getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2);
- };
-
- if(_menuType==0) then {
-
- private ["_distance"];
-
- for "_index" from 0 to (count _customActions - 1) do {
-
- _customAction = _customActions select _index;
- _displayName = _customAction select 0;
- _distance = _customAction select 1;
- _condition = _customAction select 2;
- _statement = _customAction select 3;
- _showDisabled = _customAction select 4;
- _priority = _customAction select 5;
-
- if ((_showDisabled || {[_object, _player] call _condition}) && {[_object, _distance] call FUNC(isInRange) || {_distance == 0}}) then {
- _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], _distance, ""];
- };
- };
-
- } else { // self interactions do not have distance
-
- for "_index" from 0 to (count _customActions - 1) do {
-
- _customAction = _customActions select _index;
- _displayName = _customAction select 0;
- _condition = _customAction select 1;
- _statement = _customAction select 2;
- _showDisabled = _customAction select 3;
- _priority = _customAction select 4;
-
- if (_showDisabled || {[_object, _player] call _condition}) then {
- _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], DEFAULT_DISTANCE, ""];
- };
- };
-
- };
-
-
-};
-
-if (count _actions == 0) exitWith {};
-
-_actions call FUNC(sortOptionsByPriority);
-GVAR(Buttons) = _actions;
-[_mainButtonAction, (_this select 2) != "", (profileNamespace getVariable [QGVAR(FlowMenu), false]), _menuType == 1, _object] call FUNC(initialiseInteraction);
diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf
index 262012dbb9..297de3fff8 100644
--- a/addons/interaction/functions/fnc_tapShoulder.sqf
+++ b/addons/interaction/functions/fnc_tapShoulder.sqf
@@ -5,7 +5,7 @@ EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum);
if (_target != ACE_player) exitWith {
addCamShake [4, 0.5, 5];
- ACE_player playActionNow 'gestureAdvance';
+ ACE_player playActionNow "PutDown";
if !(local _target) then {
[[_tapper, _target, _shoulderNum], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc);
};
diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml
index 960d136c0f..a4417df4e8 100644
--- a/addons/interaction/stringtable.xml
+++ b/addons/interaction/stringtable.xml
@@ -3,7 +3,28 @@
- Interactions >>
+ Interactions
+
+
+ Torso
+
+
+ Head
+
+
+ Left Arm
+
+
+ Right Arm
+
+
+ Left Leg
+
+
+ Right Leg
+
+
+ Weapon
- Gestures >>
- Gesten >>
- Gestos >>
- Gesty >>
- Gesta >>
- Signaux >>
- ЖеÑÑ‚Ñ‹ >>
- KĂ©zjelek >>
- Gestos >>
- Segnali gestuali >>
+ Gestures
+ Gesten
+ Gestos
+ Gesty
+ Gesta
+ Signaux
+ ЖеÑÑ‚Ñ‹
+ KĂ©zjelek
+ Gestos
+ Segnali gestuali
Attack
@@ -414,16 +435,16 @@
A Terra!
- Team Management >>
- Team Management >>
- GestiĂ³n de equipo >>
- Gestion d'Ă©quipe >>
- Zarządzanie oddziałem >>
- SprĂ¡va tĂ½mu >>
- Đ£Đ¿Ñ€Đ°Đ²Đ»ĐµĐ½Đ¸Đµ Đ³Ñ€ÑƒĐ¿Đ¿Đ¾Đ¹ >>
- Gerenciamento de Equipe >>
- Organizzazione Squadra >>
- Csapat kezelés >>
+ Team<br/>Management
+ Team<br/>Management
+ GestiĂ³n<br/>de equipo
+ Gestion<br/>d'Ă©quipe
+ Zarządzanie<br/>oddziałem
+ SprĂ¡va<br/>tĂ½mu
+ Đ£Đ¿Ñ€Đ°Đ²Đ»ĐµĐ½Đ¸Đµ<br/>Đ³Ñ€ÑƒĐ¿Đ¿Đ¾Đ¹
+ Gerenciamento<br/>de Equipe
+ Organizzazione<br/>Squadra
+ Csapat<br/>kezelés
Red
@@ -474,52 +495,52 @@
SĂ¡rga
- Join Team Red
- Team Rot beitreten
- Unirse al equipo rojo
- Rejoindre Rouge
- Dołącz do drużyny czerwonej
- PÅ™ipojit do ÄŒervenĂ©ho TĂ½mu
- ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ Đº ĐºÑ€Đ°ÑĐ½Đ¾Đ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
- Unir-se Ă Equipe Vermelha
- Entra nella Squadra Rossa
- CsatlakozĂ¡s a piros csapathoz
+ Join Team<br/>Red
+ Team Rot<br/>beitreten
+ Unirse al<br/>equipo rojo
+ Rejoindre<br/>Rouge
+ Dołącz do drużyny<br/>czerwonej
+ PÅ™ipojit do<br/>ÄŒervenĂ©ho TĂ½mu
+ ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ<br/>Đº ĐºÑ€Đ°ÑĐ½Đ¾Đ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
+ Unir-se Ă <br/>Equipe Vermelha
+ Entra nella<br/>Squadra Rossa
+ CsatlakozĂ¡s a<br/>piros csapathoz
- Join Team Green
- Team GrĂ¼n beitreten
- Unirse al equipo verde
- Rejoindre Verte
- Dołącz do drużyny zielonej
- PÅ™ipojit do ZelenĂ©ho TĂ½mu
- ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ Đº Đ·ĐµĐ»ĐµĐ½Đ¾Đ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
- Unir-se Ă Equipe Verde
- Entra nella Squadra Verde
- CsatlakozĂ¡s a zöld csapathoz
+ Join Team<br/>Green
+ Team GrĂ¼n<br/>beitreten
+ Unirse al<br/>equipo verde
+ Rejoindre<br/>Verte
+ Dołącz do<br/>drużyny zielonej
+ PÅ™ipojit do<br/>ZelenĂ©ho TĂ½mu
+ ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ<br/>Đº Đ·ĐµĐ»ĐµĐ½Đ¾Đ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
+ Unir-se Ă <br/>Equipe Verde
+ Entra nella<br/>Squadra Verde
+ CsatlakozĂ¡s a<br/>zöld csapathoz
- Join Team Blue
- Team Blau beitreten
- Unirse al equipo azul
- Rejoindre Bleue
- Dołącz do drużyny niebieskiej
- PÅ™ipojit do ModrĂ©ho TĂ½mu
- ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ Đº ÑĐ¸Đ½ĐµĐ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
- Unir-se Ă Equipe Azul
- Entra nella Squadra Blu
- CsatlakozĂ¡s a kĂ©k csapathoz
+ Join Team<br/>Blue
+ Team Blau<br/>beitreten
+ Unirse al<br/>equipo azul
+ Rejoindre<br/>Bleue
+ Dołącz do<br/>drużyny niebieskiej
+ PÅ™ipojit do<br/>ModrĂ©ho TĂ½mu
+ ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ<br/>Đº ÑĐ¸Đ½ĐµĐ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
+ Unir-se Ă <br/>Equipe Azul
+ Entra nella<br/>Squadra Blu
+ CsatlakozĂ¡s a<br/>kĂ©k csapathoz
- Join Team Yellow
- Team Gelb beitreten
- Unirse al equipo amarillo
- Rejoindre Jaune
- DoÅ‚Ä…cz do drużyny Å¼Ă³Å‚tej
- PÅ™ipojit do ŽlutĂ©ho TĂ½mu
- ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ Đº Đ¶ĐµĐ»Ñ‚Đ¾Đ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
- Unir-se Ă Equipe Amarela
- Entra nella Squadra Gialla
- CsatlakozĂ¡s a sĂ¡rga csapathoz
+ Join Team<br/>Yellow
+ Team Gelb<br/>beitreten
+ Unirse al<br/>equipo amarillo
+ Rejoindre<br/>Jaune
+ DoÅ‚Ä…cz do<br/>drużyny Å¼Ă³Å‚tej
+ PÅ™ipojit do<br/>ŽlutĂ©ho TĂ½mu
+ ĐŸÑ€Đ¸ÑĐ¾ĐµĐ´Đ¸Đ½Đ¸Ñ‚ÑŒÑÑ<br/>Đº Đ¶ĐµĐ»Ñ‚Đ¾Đ¹ Đ³Ñ€ÑƒĐ¿Đ¿Đµ
+ Unir-se Ă <br/>Equipe Amarela
+ Entra nella<br/>Squadra Gialla
+ CsatlakozĂ¡s a<br/>sĂ¡rga csapathoz
You joined Team %1
@@ -569,18 +590,6 @@
Perdona
MegbocsĂ¡tĂ¡s
-
Scroll
Scrollen
@@ -616,34 +625,15 @@
Poza zasięgiem
Mimo dosah
-
-
- Auto Center Cursor
- Mauszeiger automatisch zentrieren
- Auto-centrar cursor
- Automatycznie centruj kursor
- VycentrovĂ¡nĂ kurzoru
- EgĂ©r auto-centrĂrozĂ¡sa
- ĐĐ²Ñ‚Đ¾Ñ†ĐµĐ½Ñ‚Ñ€Đ¸Ñ€Đ¾Đ²Đ°Đ½Đ¸Đµ ĐºÑƒÑ€ÑĐ¾Ñ€Đ°
-
- Equipment >>
- AusrĂ¼stung >>
- Equipamiento >>
- Équipment >>
- Ekwipunek >>
- VybavenĂ >>
- Felszerelés >>
- Đ¡Đ½Đ°Ñ€ÑĐ¶ĐµĐ½Đ¸Đµ >>
+ Equipment
+ AusrĂ¼stung
+ Equipamiento
+ Équipment
+ Ekwipunek
+ VybavenĂ
+ Felszerelés
+ Đ¡Đ½Đ°Ñ€ÑĐ¶ĐµĐ½Đ¸Đµ
Push
@@ -663,5 +653,8 @@
Interakcja
Interactuar
+
+ Passengers
+
diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp
new file mode 100644
index 0000000000..c8c93ab142
--- /dev/null
+++ b/addons/inventory/RscDisplayInventory.hpp
@@ -0,0 +1,516 @@
+/*
+Adjust the scaling of the inventory screen
+- changes it from scaling based on user's interface size to a dynamic size based on a setting variable
+- text size and row height size are uneffected (so more rows in a list)
+- also tweaks the height of the two ProgressBars which looked odd scaled up so much
+
+regex:
+x = "[-+]?(\d*[.]?\d+).*
+x = X_PART\(\1\);
+ */
+
+class RscText;
+class RscPicture;
+class RscListBox;
+class RscProgress;
+class RscStructuredText;
+class RscActiveText;
+class RscCombo;
+
+#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2))
+#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))
+#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40))
+#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))
+
+#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2))
+#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2))
+#define W_MAKEITBIGGA(num) (num * (safeZoneH / 40))
+#define H_MAKEITBIGGA(num) (num * (safeZoneH / 30))
+
+#define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), X_BIS(num), X_MAKEITBIGGA(num))])
+#define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), Y_BIS(num), Y_MAKEITBIGGA(num))])
+#define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), W_BIS(num), W_MAKEITBIGGA(num))])
+#define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), H_BIS(num), H_MAKEITBIGGA(num))])
+
+class RscDisplayInventory {
+ class controls {
+ class CA_ContainerBackground: RscText {
+ //crate: GroundLoad adjust size
+ x = X_PART(1);
+ y = Y_PART(1);
+ w = W_PART(12);
+ h = H_PART(22.5);
+ };
+ class CA_PlayerBackground: RscText {
+ //center player's container: decrease height because of progressbar height decrease
+ x = X_PART(14.6);
+ y = Y_PART(2);
+ w = W_PART(24.4);
+ h = H_PART(21.5);
+ };
+ class TitleBackground: RscText {
+ x = X_PART(14.6);
+ y = Y_PART(1);
+ w = W_PART(24.4);
+ h = H_PART(1);
+ };
+ class PlayersName: RscText {
+ x = X_PART(15.6);
+ y = Y_PART(1);
+ w = W_PART(19.8);
+ h = H_PART(1);
+ };
+ class RankBackground: RscText {
+ x = X_PART(15.1);
+ y = Y_PART(1.25);
+ w = W_PART(0.6);
+ h = H_PART(0.6);
+ };
+ class RankPicture: RscPicture {
+ x = X_PART(15.1);
+ y = Y_PART(1.25);
+ w = W_PART(0.6);
+ h = H_PART(0.6);
+ };
+ class ButtonBack: RscActiveText {
+ x = X_PART(38);
+ y = Y_PART(1);
+ w = W_PART(1);
+ h = H_PART(1);
+ };
+ class BackgroundSlotPrimary: RscPicture {
+ x = X_PART(26.6);
+ y = Y_PART(6);
+ w = W_PART(11.9);
+ h = H_PART(3);
+ };
+ class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotSecondary: BackgroundSlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(11.5);
+ w = W_PART(11.9);
+ h = H_PART(3);
+ };
+ class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotHandgun: BackgroundSlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(17);
+ w = W_PART(11.9);
+ h = H_PART(3);
+ };
+ class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotHandgunOptics: BackgroundSlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class BackgroundSlotHeadgear: BackgroundSlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class BackgroundSlotGoggles: BackgroundSlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class BackgroundSlotHMD: BackgroundSlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class BackgroundSlotBinoculars: BackgroundSlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class BackgroundSlotMap: BackgroundSlotPrimary {
+ x = X_PART(15.1);
+ y = Y_PART(20.1);
+ w = W_PART(2.12);
+ h = H_PART(2);
+ };
+ class BackgroundSlotGPS: BackgroundSlotPrimary {
+ x = X_PART(17.32);
+ y = Y_PART(20.1);
+ w = W_PART(2.12);
+ h = H_PART(2);
+ };
+ class BackgroundSlotCompass: BackgroundSlotPrimary {
+ x = X_PART(21.76);
+ y = Y_PART(20.1);
+ w = W_PART(2.12);
+ h = H_PART(2);
+ };
+ class BackgroundSlotRadio: BackgroundSlotPrimary {
+ x = X_PART(19.54);
+ y = Y_PART(20.1);
+ w = W_PART(2.12);
+ h = H_PART(2);
+ };
+ class BackgroundSlotWatch: BackgroundSlotPrimary {
+ x = X_PART(23.98);
+ y = Y_PART(20.1);
+ w = W_PART(2.12);
+ h = H_PART(2);
+ };
+ class ExternalContainerBackground: RscPicture {
+ x = X_PART(1.5);
+ y = Y_PART(3.7);
+ w = W_PART(11);
+ h = H_PART(18.4);
+ };
+ class PlayerContainerBackground: ExternalContainerBackground {
+ x = X_PART(15.1);
+ y = Y_PART(6);
+ w = W_PART(11);
+ h = H_PART(14);
+ };
+ class GroundTab: RscActiveText {
+ x = X_PART(1.5);
+ y = Y_PART(1.5);
+ w = W_PART(5.5);
+ h = H_PART(1);
+ };
+ class SoldierTab: GroundTab {
+ x = X_PART(7);
+ y = Y_PART(1.5);
+ w = W_PART(5.5);
+ h = H_PART(1);
+ };
+ class GroundContainer: RscListBox {
+ x = X_PART(1.5);
+ y = Y_PART(3.7);
+ w = W_PART(11);
+ h = H_PART(18.4);
+ };
+ class GroundFilter: RscCombo {
+ x = X_PART(1.5);
+ y = Y_PART(2.6);
+ w = W_PART(11);
+ h = H_PART(1);
+ };
+ class GroundLoad: RscProgress {
+ //crate: GroundLoad adjust size
+ x = X_PART(1.5);
+ y = Y_PART(22.5);
+ w = W_PART(11);
+ h = H_PART(0.5);
+ };
+ class SlotPrimary: GroundTab {
+ x = X_PART(26.6);
+ y = Y_PART(6);
+ w = W_PART(11.9);
+ h = H_PART(3);
+ };
+ class SlotPrimaryMuzzle: SlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotPrimaryGrip: SlotPrimary {
+ w = 0;
+ h = 0;
+ x = X_PART(39);
+ y = Y_PART(9);
+ };
+ class SlotPrimaryFlashlight: SlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotPrimaryOptics: SlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotPrimaryMagazine: SlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(9.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotSecondary: SlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(11.5);
+ w = W_PART(11.9);
+ h = H_PART(3);
+ };
+ class SlotSecondaryMuzzle: SlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotSecondaryGrip: SlotPrimary {
+ w = 0;
+ h = 0;
+ x = X_PART(39);
+ y = Y_PART(14.5);
+ };
+ class SlotSecondaryFlashlight: SlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotSecondaryOptics: SlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotSecondaryMagazine: SlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(14.6);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotHandgun: SlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(17);
+ w = W_PART(11.9);
+ h = H_PART(3);
+ };
+ class SlotHandgunMuzzle: SlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotHandgunGrip: SlotPrimary {
+ w = 0;
+ h = 0;
+ x = X_PART(39);
+ y = Y_PART(20);
+ };
+ class SlotHandgunFlashlight: SlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotHandgunOptics: SlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotHandgunMagazine: SlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(20.1);
+ w = W_PART(2.9);
+ h = H_PART(2);
+ };
+ class SlotHeadgear: SlotPrimary {
+ x = X_PART(26.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class SlotGoggles: SlotPrimary {
+ x = X_PART(29.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class SlotHMD: SlotPrimary {
+ x = X_PART(32.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class SlotBinoculars: SlotPrimary {
+ x = X_PART(35.6);
+ y = Y_PART(2.5);
+ w = W_PART(2.9);
+ h = H_PART(2.9);
+ };
+ class SlotMap: SlotPrimary {
+ x = X_PART(15.16);
+ y = Y_PART(20.1);
+ w = W_PART(2);
+ h = H_PART(2);
+ };
+ class SlotGPS: SlotPrimary {
+ x = X_PART(17.38);
+ y = Y_PART(20.1);
+ w = W_PART(2);
+ h = H_PART(2);
+ };
+ class SlotCompass: SlotPrimary {
+ x = X_PART(21.82);
+ y = Y_PART(20.1);
+ w = W_PART(2);
+ h = H_PART(2);
+ };
+ class SlotRadio: SlotPrimary {
+ x = X_PART(19.6);
+ y = Y_PART(20.1);
+ w = W_PART(2);
+ h = H_PART(2);
+ };
+ class SlotWatch: SlotPrimary {
+ x = X_PART(24.04);
+ y = Y_PART(20.1);
+ w = W_PART(2);
+ h = H_PART(2);
+ };
+ class UniformTab: GroundTab {
+ x = X_PART(15.1);
+ y = Y_PART(2.5);
+ w = W_PART(3.5);
+ h = H_PART(3);
+ };
+ class UniformSlot: SlotPrimary {
+ x = X_PART(15.35);
+ y = Y_PART(2.5);
+ w = W_PART(3);
+ h = H_PART(3);
+ };
+ class UniformLoad: GroundLoad {
+ x = X_PART(15.1);
+ y = Y_PART(5.5);
+ w = W_PART(3.5);
+ h = H_PART(0.5);
+ };
+ class UniformContainer: GroundContainer {
+ x = X_PART(15.1);
+ y = Y_PART(6);
+ w = W_PART(11);
+ h = H_PART(14);
+ };
+ class VestTab: UniformTab {
+ x = X_PART(18.85);
+ y = Y_PART(2.5);
+ w = W_PART(3.5);
+ h = H_PART(3);
+ };
+ class VestSlot: SlotPrimary {
+ x = X_PART(19.1);
+ y = Y_PART(2.5);
+ w = W_PART(3);
+ h = H_PART(3);
+ };
+ class VestLoad: GroundLoad {
+ x = X_PART(18.85);
+ y = Y_PART(5.5);
+ w = W_PART(3.5);
+ h = H_PART(0.5);
+ };
+ class BackpackTab: UniformTab {
+ x = X_PART(22.6);
+ y = Y_PART(2.5);
+ w = W_PART(3.5);
+ h = H_PART(3);
+ };
+ class BackpackSlot: SlotPrimary {
+ x = X_PART(22.85);
+ y = Y_PART(2.5);
+ w = W_PART(3);
+ h = H_PART(3);
+ };
+ class BackpackLoad: GroundLoad {
+ x = X_PART(22.6);
+ y = Y_PART(5.5);
+ w = W_PART(3.5);
+ h = H_PART(0.5);
+ };
+ class TotalLoad: GroundLoad {
+ //center: progressbar height decrease
+ x = X_PART(15.1);
+ y = Y_PART(22.5);
+ w = W_PART(23.4);
+ h = H_PART(0.5);
+ };
+ class ContainerMarker: GroundTab {
+ x = X_PART(0);
+ y = Y_PART(24);
+ w = W_PART(1);
+ h = H_PART(1);
+ };
+ class GroundMarker: ContainerMarker {
+ x = X_PART(1.5);
+ y = Y_PART(24);
+ w = W_PART(1);
+ h = H_PART(1);
+ };
+ class SoldierMarker: ContainerMarker {
+ x = X_PART(3);
+ y = Y_PART(24);
+ w = W_PART(1);
+ h = H_PART(1);
+ };
+ };
+};
diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp
index e933cc40a4..c7b6649be6 100644
--- a/addons/inventory/config.cpp
+++ b/addons/inventory/config.cpp
@@ -12,503 +12,16 @@ class CfgPatches {
};
};
+#include "RscDisplayInventory.hpp"
-class RscText;
-class RscPicture;
-class RscListBox;
-class RscProgress;
-class RscStructuredText;
-class RscActiveText;
-class RscCombo;
-class RscControlsGroupNoScrollbars;
-
-/*
-Adjust the scaling of the inventory screen
- - changes it from scaling based on user's interface size to a static size
- - text size and row height size are uneffected
- - also tweaks the height of the two ProgressBars which looked odd scaled up so much
-*/
-
-class RscDisplayInventory {
- class controls {
- class CA_ContainerBackground: RscText {
- //crate: GroundLoad adjust size
- x = "1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "12 * (safeZoneH / 40)";
- h = "22.5 * ((safeZoneH / 1.2) / 25)";
- };
- class CA_PlayerBackground: RscText {
- //center player's container: decrease height because of progressbar height decrease
- x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "24.4 * (safeZoneH / 40)";
- h = "21.5 * ((safeZoneH / 1.2) / 25)";
- };
- class TitleBackground: RscText {
- x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "24.4 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class PlayersName: RscText {
- text = "Player name:";
- x = "15.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "19.8 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class RankBackground: RscText {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "0.6 * (safeZoneH / 40)";
- h = "0.6 * ((safeZoneH / 1.2) / 25)";
- };
- class RankPicture: RscPicture {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "0.6 * (safeZoneH / 40)";
- h = "0.6 * ((safeZoneH / 1.2) / 25)";
- };
- class ButtonBack: RscActiveText {
- x = "38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "1 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotPrimary: RscPicture {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11.9 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotSecondary: BackgroundSlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11.9 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHandgun: BackgroundSlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11.9 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHandgunOptics: BackgroundSlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHeadgear: BackgroundSlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotGoggles: BackgroundSlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotHMD: BackgroundSlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotBinoculars: BackgroundSlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotMap: BackgroundSlotPrimary {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.12 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotGPS: BackgroundSlotPrimary {
- x = "17.32 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.12 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotCompass: BackgroundSlotPrimary {
- x = "21.76 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.12 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotRadio: BackgroundSlotPrimary {
- x = "19.54 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.12 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class BackgroundSlotWatch: BackgroundSlotPrimary {
- x = "23.98 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.12 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class ExternalContainerBackground: RscPicture {
- x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11 * (safeZoneH / 40)";
- h = "18.4 * ((safeZoneH / 1.2) / 25)";
- };
- class PlayerContainerBackground: ExternalContainerBackground {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11 * (safeZoneH / 40)";
- h = "14 * ((safeZoneH / 1.2) / 25)";
- };
- class GroundTab: RscActiveText {
- x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "5.5 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class SoldierTab: GroundTab {
- x = "7 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "5.5 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class GroundContainer: RscListBox {
- x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11 * (safeZoneH / 40)";
- h = "18.4 * ((safeZoneH / 1.2) / 25)";
- };
- class GroundFilter: RscCombo {
- x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class GroundLoad: RscProgress {
- //crate: GroundLoad adjust size
- x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11 * (safeZoneH / 40)";
- h = "0.5 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotPrimary: GroundTab {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11.9 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotPrimaryMuzzle: SlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotPrimaryGrip: SlotPrimary {
- w = 0;
- h = 0;
- x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- };
- class SlotPrimaryFlashlight: SlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotPrimaryOptics: SlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotPrimaryMagazine: SlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotSecondary: SlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11.9 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotSecondaryMuzzle: SlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotSecondaryGrip: SlotPrimary {
- w = 0;
- h = 0;
- x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- };
- class SlotSecondaryFlashlight: SlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotSecondaryOptics: SlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotSecondaryMagazine: SlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHandgun: SlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11.9 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHandgunMuzzle: SlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHandgunGrip: SlotPrimary {
- w = 0;
- h = 0;
- x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- };
- class SlotHandgunFlashlight: SlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHandgunOptics: SlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHandgunMagazine: SlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHeadgear: SlotPrimary {
- x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotGoggles: SlotPrimary {
- x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotHMD: SlotPrimary {
- x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotBinoculars: SlotPrimary {
- x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2.9 * (safeZoneH / 40)";
- h = "2.9 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotMap: SlotPrimary {
- x = "15.16 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotGPS: SlotPrimary {
- x = "17.38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotCompass: SlotPrimary {
- x = "21.82 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotRadio: SlotPrimary {
- x = "19.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class SlotWatch: SlotPrimary {
- x = "24.04 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "2 * (safeZoneH / 40)";
- h = "2 * ((safeZoneH / 1.2) / 25)";
- };
- class UniformTab: GroundTab {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3.5 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class UniformSlot: SlotPrimary {
- x = "15.35 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class UniformLoad: GroundLoad {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3.5 * (safeZoneH / 40)";
- h = "0.5 * ((safeZoneH / 1.2) / 25)";
- };
- class UniformContainer: GroundContainer {
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "11 * (safeZoneH / 40)";
- h = "14 * ((safeZoneH / 1.2) / 25)";
- };
- class VestTab: UniformTab {
- x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3.5 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class VestSlot: SlotPrimary {
- x = "19.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class VestLoad: GroundLoad {
- x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3.5 * (safeZoneH / 40)";
- h = "0.5 * ((safeZoneH / 1.2) / 25)";
- };
- class BackpackTab: UniformTab {
- x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3.5 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class BackpackSlot: SlotPrimary {
- x = "22.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3 * (safeZoneH / 40)";
- h = "3 * ((safeZoneH / 1.2) / 25)";
- };
- class BackpackLoad: GroundLoad {
- x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "3.5 * (safeZoneH / 40)";
- h = "0.5 * ((safeZoneH / 1.2) / 25)";
- };
- class TotalLoad: GroundLoad {
- //center: progressbar height decrease
- x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "23.4 * (safeZoneH / 40)";
- h = "0.5 * ((safeZoneH / 1.2) / 25)";
- };
- class ContainerMarker: GroundTab {
- x = "0 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "1 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class GroundMarker: ContainerMarker {
- x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "1 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
- class SoldierMarker: ContainerMarker {
- x = "3 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
- y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
- w = "1 * (safeZoneH / 40)";
- h = "1 * ((safeZoneH / 1.2) / 25)";
- };
+class ACE_Settings {
+ class GVAR(inventoryDisplaySize) {
+ value = 0;
+ typeName = "SCALAR";
+ isClientSetable = 1;
+ displayName = "$STR_ACE_Inventory_SettingName";
+ description = "$STR_ACE_Inventory_SettingDescription";
+ values[] = {"Normal (Default Size)", "Medium", "Bigger"};
};
};
+
diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml
new file mode 100644
index 0000000000..9ca01373d1
--- /dev/null
+++ b/addons/inventory/stringtable.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+ Make Inventory Display Bigger
+
+
+ Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed.
+
+
+
\ No newline at end of file
diff --git a/addons/kestrel/CfgVehicles.hpp b/addons/kestrel/CfgVehicles.hpp
index 906e3a9e22..31aea38bda 100644
--- a/addons/kestrel/CfgVehicles.hpp
+++ b/addons/kestrel/CfgVehicles.hpp
@@ -1,9 +1,3 @@
-
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
-}
-
class CfgVehicles {
class Man;
class CAManBase: Man {
diff --git a/addons/kestrel/config.cpp b/addons/kestrel/config.cpp
index 61735f1697..b79dcd5825 100644
--- a/addons/kestrel/config.cpp
+++ b/addons/kestrel/config.cpp
@@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {"ACE_Kestrel"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common","ace_interaction"};
- author[] = {"Falke","commy2","KoffeinFlummi","CAA-Picard"};
+ author[] = {"Falke","commy2","KoffeinFlummi","esteldunedain"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
diff --git a/addons/laserpointer/CfgVehicles.hpp b/addons/laserpointer/CfgVehicles.hpp
index c98d0626c2..8c81837fe2 100644
--- a/addons/laserpointer/CfgVehicles.hpp
+++ b/addons/laserpointer/CfgVehicles.hpp
@@ -1,9 +1,3 @@
-
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
-}
-
class CfgVehicles {
class NATO_Box_Base;
class Box_NATO_Support_F: NATO_Box_Base {
diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp
index 32357b31ef..b97587dac6 100644
--- a/addons/laserpointer/config.cpp
+++ b/addons/laserpointer/config.cpp
@@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
units[] = {};
- weapons[] = {"AGM_acc_pointer_red","AGM_acc_pointer_green"};
+ weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2"};
diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf
index 626e0e3abc..969607f987 100644
--- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf
+++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf
@@ -1,4 +1,4 @@
-// by commy2 and CAA-Picard
+// by commy2 and esteldunedain
#include "script_component.hpp"
EXPLODE_3_PVT(_this,_unit,_range,_isGreen);
diff --git a/addons/lockbackpacks/$PBOPREFIX$ b/addons/lockbackpacks/$PBOPREFIX$
deleted file mode 100644
index 012a3f3cd5..0000000000
--- a/addons/lockbackpacks/$PBOPREFIX$
+++ /dev/null
@@ -1 +0,0 @@
-z\ace\addons\lockbackpacks
\ No newline at end of file
diff --git a/addons/lockbackpacks/CfgVehicles.hpp b/addons/lockbackpacks/CfgVehicles.hpp
deleted file mode 100644
index 5517d81525..0000000000
--- a/addons/lockbackpacks/CfgVehicles.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-
-class CfgVehicles {
- class Man;
- class CAManBase: Man {
- class ACE_SelfActions {
- class ACE_Equipment {
- class ACE_LockBackpack {
- displayName = "$STR_ACE_LockBackpacks_LockBackpack";
- condition = QUOTE([backpackContainer _player] call FUNC(isBackpack) && {!((backpackContainer _player) getVariable [ARR_2('ACE_LockedInventory', false)])});
- statement = QUOTE((backpackContainer _player) setVariable [ARR_3('ACE_LockedInventory', true, true)];);
- showDisabled = 0;
- priority = 2.5;
- icon = ""; // @todo
- hotkey = "L";
- enableInside = 1;
- };
-
- class ACE_UnlockBackpack {
- displayName = "$STR_ACE_LockBackpacks_UnlockBackpack";
- condition = QUOTE([backpackContainer _player] call FUNC(isBackpack) && {(backpackContainer _player) getVariable [ARR_2('ACE_LockedInventory', false)]});
- statement = QUOTE((backpackContainer _player) setVariable [ARR_3('ACE_LockedInventory', false, true)];);
- showDisabled = 0;
- priority = 2.5;
- icon = ""; // @todo
- hotkey = "L";
- enableInside = 1;
- };
- };
- };
- };
-};
diff --git a/addons/lockbackpacks/functions/fnc_onOpenInventory.sqf b/addons/lockbackpacks/functions/fnc_onOpenInventory.sqf
deleted file mode 100644
index 9305bf3de7..0000000000
--- a/addons/lockbackpacks/functions/fnc_onOpenInventory.sqf
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Author: bux, commy2
- *
- * Handle the open inventory event. Don't open the inventory if it's locked and display message.
- *
- * Argument:
- * Input from "InventoryOpened" eventhandler
- *
- * Return value:
- * Don't open the inventory dialog? (Bool)
- */
-#include "script_component.hpp"
-
-private ["_target", "_isBackpack", "_isLocked", "_return"];
-
-_target = _this select 1;
-
-_isBackpack = [_target] call FUNC(isBackpack);
-_isLocked = _target getVariable ["ACE_LockedInventory", false];
-
-_return = false;
-if (_isBackpack) then {
- // target is a backpack
- private "_unit";
- _unit = [_target] call FUNC(getBackpackAssignedUnit);
-
- if (!alive _unit || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {};
-
- if (_isLocked) then {
- // target is a locked backpack
- [format [localize "STR_ACE_LockBackpacks_BackpackLocked", [_unit] call EFUNC(common,getName)]] call EFUNC(common,displayTextStructured);
- _return = true;
- } else {
- // target is a not-locked backpack
- if (_unit getVariable ["ACE_LockedInventory", false]) then {
- [localize "STR_ACE_LockBackpacks_InventoryLocked"] call EFUNC(common,displayTextStructured);
- _return = true;
- };
- };
-} else {
- // target is not a backpack
- if (_isLocked) then {
- [localize "STR_ACE_LockBackpacks_InventoryLocked"] call EFUNC(common,displayTextStructured);
- _return = true;
- };
-};
-_return
diff --git a/addons/lockbackpacks/functions/script_component.hpp b/addons/lockbackpacks/functions/script_component.hpp
deleted file mode 100644
index 1ad43dc2cc..0000000000
--- a/addons/lockbackpacks/functions/script_component.hpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "\z\ace\addons\lockbackpacks\script_component.hpp"
\ No newline at end of file
diff --git a/addons/lockbackpacks/script_component.hpp b/addons/lockbackpacks/script_component.hpp
deleted file mode 100644
index 4275a6e7fd..0000000000
--- a/addons/lockbackpacks/script_component.hpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#define COMPONENT lockbackpacks
-#include "\z\ace\addons\main\script_mod.hpp"
-
-#ifdef DEBUG_ENABLED_LOCKBACKPACKS
- #define DEBUG_MODE_FULL
-#endif
-
-#ifdef DEBUG_ENABLED_LOCKBACKPACKS
- #define DEBUG_SETTINGS DEBUG_ENABLED_LOCKBACKPACKS
-#endif
-
-#include "\z\ace\addons\main\script_macros.hpp"
\ No newline at end of file
diff --git a/addons/lockbackpacks/stringtable.xml b/addons/lockbackpacks/stringtable.xml
deleted file mode 100644
index 85cd7f77d3..0000000000
--- a/addons/lockbackpacks/stringtable.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
- Take (Ventral)
- Aufnehmen (Am Bauch)
- Coger (Mochila delantera)
- ZaÅ‚Ă³Å¼ (brzuch)
- VzĂt (ventrĂ¡lnĂ)
- Prendre (Ventral)
- Đ’Đ·ÑÑ‚ÑŒ Ñ€ÑĐºĐ·Đ°Đº (Đ¿ĐµÑ€ĐµĐ´Đ½Đ¸Đ¹)
- FelvĂ©tel (elÅ‘re)
- Pegar (Mochila Ventral)
- Prendi
-
-
- Take Off Backpack
- Rucksack ablegen
- Dejar mochila
- Zdejmij (brzuch)
- Odložit batoh
- Enlever (Ventral)
- Đ¡Đ½ÑÑ‚ÑŒ Ñ€ÑĐºĐ·Đ°Đº (Đ¿ĐµÑ€ĐµĐ´Đ½Đ¸Đ¹)
- TĂ¡ska levĂ©tele
- Retirar Mochila
- Togliere zaino
-
-
- Lock Backpack
- Rucksack verschlieĂŸen
- Verrouiller le sac Ă dos
- Bloquear mochila
- Zamknout batoh
- Zablokuj plecak
- TĂ¡ska zĂ¡rolĂ¡sa
- Đ—Đ°Đ¿ĐµÑ€ĐµÑ‚ÑŒ Ñ€ÑĐºĐ·Đ°Đº
-
-
- Unlock Backpack
- Rucksack aufschlieĂŸen
- DĂ©verouiller le sac Ă dos
- Desbloquear mochila
- Odemknout batoh
- Odblokuj plecak
- TĂ¡ska nyitĂ¡sa
- ĐÑ‚Đ¿ĐµÑ€ĐµÑ‚ÑŒ Ñ€ÑĐºĐ·Đ°Đº
-
-
- Backpack of %1 is locked
- Der Rucksack von %1 ist verschlossen
- Le sac à dos de %1 est verroullé
- La mochila de %1 estĂ¡ bloqueada
- %1 mĂ¡ zamÄenĂ½ batoh
- Plecak %1 jest zablokowany
- %1 tĂ¡skĂ¡ja zĂ¡rolva
- Đ ÑĐºĐ·Đ°Đº %1 Đ·Đ°Đ¿ĐµÑ€Ñ‚
-
-
- Inventory is locked
- Das Inventar ist verschlossen
- L'inventaire est verrouillé
- Inventario bloqueado
- InventĂ¡Å™ je zamÄenĂ½
- Ekwipunek jest zablokowany
- FelszerelĂ©s zĂ¡rolt
- Đ˜Đ½Đ²ĐµĐ½Ñ‚Đ°Ñ€ÑŒ Đ·Đ°Đ¿ĐµÑ€Ñ‚
-
-
-
\ No newline at end of file
diff --git a/addons/logistics_wirecutter/CfgEventHandlers.hpp b/addons/logistics_wirecutter/CfgEventHandlers.hpp
index f0a9f14d91..79c3aaa959 100644
--- a/addons/logistics_wirecutter/CfgEventHandlers.hpp
+++ b/addons/logistics_wirecutter/CfgEventHandlers.hpp
@@ -4,3 +4,8 @@ class Extended_PreInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
+ };
+};
diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp
deleted file mode 100644
index 8a16d1b828..0000000000
--- a/addons/logistics_wirecutter/CfgVehicles.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-class CfgVehicles {
- class Man;
- class CAManBase: Man {
- class ACE_SelfActions {
- class ACE_Equipment {
- class GVAR(CutFence) {
- displayName = "$STR_ACE_logistics_wirecutter_CutFence";
- condition = QUOTE([_player] call FUNC(canCutFence));
- statement = QUOTE([_player] call FUNC(cutDownFence));
- exceptions[] = {};
- showDisabled = 1;
- priority = 0;
- icon = PATHTOF(UI\wirecutter_ca.paa);
- hotkey = "C";
- };
- };
- };
- };
-};
\ No newline at end of file
diff --git a/addons/logistics_wirecutter/XEH_clientInit.sqf b/addons/logistics_wirecutter/XEH_clientInit.sqf
new file mode 100644
index 0000000000..c46cab29f1
--- /dev/null
+++ b/addons/logistics_wirecutter/XEH_clientInit.sqf
@@ -0,0 +1,5 @@
+#include "script_component.hpp"
+
+if (!hasInterface) exitWith {};
+
+["interactMenuOpened", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler);
diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf
index 7588a109e6..44eb941c16 100644
--- a/addons/logistics_wirecutter/XEH_preInit.sqf
+++ b/addons/logistics_wirecutter/XEH_preInit.sqf
@@ -2,11 +2,11 @@
ADDON = false;
-PREP(canCutFence);
PREP(cutDownFence);
PREP(cutDownFenceAbort);
PREP(cutDownFenceCallback);
PREP(getNearestFence);
+PREP(interactEH);
PREP(isFence);
ADDON = true;
diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp
index 7f292132fa..27d4467ccf 100644
--- a/addons/logistics_wirecutter/config.cpp
+++ b/addons/logistics_wirecutter/config.cpp
@@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
- requiredAddons[] = {"ace_common", "ace_interaction"};
+ requiredAddons[] = {"ace_interact_menu"};
author[] = {"gpgpgpgp", "PabstMirror"};
authorUrl = "";
VERSION_CONFIG;
@@ -13,6 +13,5 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
-#include "CfgVehicles.hpp"
#include "CfgSounds.hpp"
#include "CfgWeapons.hpp"
diff --git a/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf b/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf
deleted file mode 100644
index f57a970d58..0000000000
--- a/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf
+++ /dev/null
@@ -1,18 +0,0 @@
-/* fnc_canCutFence.sqf
-*
-* Author: PabstMirror
-*
-* Condition check if player is able to cut a fence.
-* Checks for "ACE_wirecutter" item and if there is a nearby fence.
-*
-* Argument:
-* 0: OBJECT - Unit to check condition for (player)
-*
-* Return value:
-* BOOL
-*/
-
-#include "script_component.hpp"
-PARAMS_1(_unit);
-
-("ACE_wirecutter" in (items _unit)) && {!(isNull ([_unit] call FUNC(getNearestFence)))}
diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf
index 0a42d5d56b..ee4c512cd2 100644
--- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf
+++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf
@@ -1,20 +1,31 @@
-// by gpgpgpgp, edited by commy2
+/*
+ * Author: gpgpgpgp, edited by commy2, PabstMirror
+ * Starts cutting down a fence
+ *
+ * Arguments:
+ * 0: Unit
+ * 1: Fence
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [player, berlinWall] call ace_logistics_wirecutter_fnc_cutDownFence
+ *
+ * Public: No
+ */
#include "script_component.hpp"
-PARAMS_1(_unit);
+private ["_timeToCut"];
+
+PARAMS_2(_unit,_fenceObject);
if (_unit != ACE_player) exitWith {};
-_fenceObject = [ACE_player] call FUNC(getNearestFence);
-if (isNull _fenceObject) exitWith {};
-
-_timeToCut = 5;
-if !([ACE_player] call EFUNC(common,isEngineer)) then {
- _timeToCut = _timeToCut + 5;
-};
+_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {5} else {10};
[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
-if (_timeToCut > 4.5) then {
+if (_timeToCut > 5) then {
playSound "ACE_wirecutter_sound_long";
} else {
playSound "ACE_wirecutter_sound";
diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf
index d17038af7c..20cb092131 100644
--- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf
+++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf
@@ -1,4 +1,18 @@
-// by commy2
+/*
+ * Author: commy2
+ * Stops cutting down fence (reset animation)
+ *
+ * Arguments:
+ * Nothing
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort
+ *
+ * Public: No
+ */
#include "script_component.hpp"
[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf
index 57c0289461..77bc4f2ba6 100644
--- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf
+++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf
@@ -1,7 +1,22 @@
+/*
+ * Author: PabstMirror
+ * Once progressbar is done: Fence is cutdown
+ *
+ * Arguments:
+ * 0: Fence Object
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback
+ *
+ * Public: No
+ */
#include "script_component.hpp"
PARAMS_1(_fenceObject);
_fenceObject setdamage 1;
-[localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured);
+// [localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured);
[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf
index 5004315fcd..c9e59b41a0 100644
--- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf
+++ b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf
@@ -1,15 +1,18 @@
-/* fnc_getNearestFence.sqf
-*
-* Author: PabstMirror
-*
-* Gets nearest fence within 5 meters to the unit.
-*
-* Argument:
-* 0: OBJECT - Unit to search for fence objects arround
-*
-* Return value:
-* OBJECT - Nearest object that is a fence, objNull if none found.
-*/
+/*
+ * Author: PabstMirror
+ * Gets nearest fence object (not actully used, left for utility)
+ *
+ * Arguments:
+ * 0: Unit
+ *
+ * Return Value:
+ * The return value
+ *
+ * Example:
+ * [player] call ace_logistics_wirecutter_fnc_getNearestFence
+ *
+ * Public: Yes
+ */
#include "script_component.hpp"
private "_nearestFence";
@@ -20,6 +23,6 @@ _nearestFence = objNull;
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
_nearestFence = _x;
};
-} forEach nearestObjects [_unit, [], 5];
+} forEach nearestObjects [_unit, [], 15];
_nearestFence
diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf
new file mode 100644
index 0000000000..6012b1e0e2
--- /dev/null
+++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf
@@ -0,0 +1,68 @@
+/*
+ * Author: PabstMirror
+ * When interact_menu starts rendering (from "interact_keyDown" event)
+ *
+ * Arguments:
+ * Interact Menu Type (0 - world, 1 - self)
+ *
+ * Return Value:
+ * Nothing
+ *
+ * Example:
+ * [0] call ace_logistics_wirecutter_fnc_interactEH
+ *
+ * Public: Yes
+ */
+#include "script_component.hpp"
+
+PARAMS_1(_interactionType);
+
+//Ignore self-interaction menu
+if (_interactionType != 0) exitWith {};
+
+//for performance only do stuff it they have a wirecutter item
+//(if they somehow get one durring keydown they'll just have to reopen)
+if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
+
+[{
+ private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper"];
+ PARAMS_2(_args,_pfID);
+ EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped);
+
+ if (!EGVAR(interact_menu,keyDown)) then {
+ {deleteVehicle _x;} forEach _addedHelpers;
+ [_pfID] call CBA_fnc_removePerFrameHandler;
+ } else {
+ // Prevent Rare Error when ending mission with interact key down:
+ if (isNull ace_player) exitWith {};
+
+ //If player moved >5 meters from last pos, then rescan
+ if (((getPosASL ace_player) distance _setPosition) > 5) then {
+
+ _fncStatement = {
+ _attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
+ [ace_player, _attachedFence] call FUNC(cutDownFence);
+ };
+ _fncCondition = {
+ _attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
+ ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))})
+ };
+
+ {
+ if (!(_x in _fencesHelped)) then {
+ if ([_x] call FUNC(isFence)) then {
+ _fencesHelped pushBack _x;
+ _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x);
+ [_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction);
+ _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
+ _helper hideObject true;
+ _helper setVariable [QGVAR(attachedFence), _x];
+ _addedHelpers pushBack _helper;
+ };
+ };
+ } forEach nearestObjects [ace_player, [], 15];
+
+ _args set [0, (getPosASL ace_player)];
+ };
+ };
+}, 0.1, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], []]] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf
index 2c00cec92b..aee9a22ef9 100644
--- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf
+++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf
@@ -1,16 +1,19 @@
-/* fnc_isFence.sqf
-*
-* Author: PabstMirror
-*
-* Checks if object is a fence. Should work on any fence type, even (typeof == "").
-* Call is fairly expensive because of all of the string checking.
-*
-* Argument:
-* 0: OBJECT - Ojbect to test
-*
-* Return value:
-* BOOL
-*/
+/*
+ * Author: PabstMirror
+ * Checks if object is a fence. Should work on any fence type, even (typeof == "").
+ * Call is fairly expensive because of all of the string checking.
+ *
+ * Arguments:
+ * 0: An Object To Test
+ *
+ * Return Value:
+ * Is it a fence
+ *
+ * Example:
+ * [aFence] call ace_logistics_wirecutter_fnc_isFence
+ *
+ * Public: No
+ */
#include "script_component.hpp"
//find is case sensitive, so keep everything lowercase
@@ -27,14 +30,14 @@ _typeOf = toLower (typeOf _object);
_returnValue = false;
if (_typeOf != "") then {
- _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES);
+ _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES);
} else {
- _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
- {
- if ((_typeOf find _x) != -1) then {
- _returnValue = true;
- };
- } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS);
+ _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
+ {
+ if ((_typeOf find _x) != -1) then {
+ _returnValue = true;
+ };
+ } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS);
};
_returnValue
diff --git a/addons/magazinerepack/CfgVehicles.hpp b/addons/magazinerepack/CfgVehicles.hpp
index acd1c76c3d..eba2edac68 100644
--- a/addons/magazinerepack/CfgVehicles.hpp
+++ b/addons/magazinerepack/CfgVehicles.hpp
@@ -5,12 +5,12 @@ class CfgVehicles {
class ACE_RepackMagazines {
displayName = "$STR_ACE_MagazineRepack_RepackMagazines";
condition = QUOTE(true);
+ exceptions[] = {"isNotInside"};
statement = QUOTE([_player] call FUNC(openSelectMagazineUI));
showDisabled = 0;
priority = -2;
icon = QUOTE(PATHTOF(UI\repack_ca.paa));
hotkey = "R";
- enableInside = 1;
};
};
};
diff --git a/addons/magazinerepack/config.cpp b/addons/magazinerepack/config.cpp
index 514a74350a..7011d28c0c 100644
--- a/addons/magazinerepack/config.cpp
+++ b/addons/magazinerepack/config.cpp
@@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
- author[] = {"commy2","CAA-Picard"};
+ author[] = {"commy2","esteldunedain"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
diff --git a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf
index e96e84e9a1..fc183faa5b 100644
--- a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf
+++ b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf
@@ -54,6 +54,5 @@ _actions,
{ [_this] call FUNC(startRepackingMagazine); },
{
call EFUNC(interaction,hideMenu); //ToDo: Self Interaction Integration
- if !(profileNamespace getVariable [QGVAR(AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
] call EFUNC(interaction,openSelectMenu);
diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml
index 937cfcbf9a..401d3beaf7 100644
--- a/addons/magazinerepack/stringtable.xml
+++ b/addons/magazinerepack/stringtable.xml
@@ -3,16 +3,16 @@
- Repack Magazines
- Magazine umpacken
- Reorganizar cargadores
- RĂ©organiser chargeurs
- Przepakuj magazynki
- PÅ™epĂ¡skovat ZĂ¡sobnĂky
- Ricarica Caricatori
- Reorganizar Carregadores
- ĂjratĂ¡razĂ¡s
- ĐŸĐµÑ€ĐµĐ¿Đ°ĐºĐ¾Đ²Đ°Ñ‚ÑŒ Đ¼Đ°Đ³Đ°Đ·Đ¸Đ½Ñ‹
+ Repack<br/>Magazines
+ Magazine<br/>umpacken
+ Reorganizar<br/>cargadores
+ RĂ©organiser<br/>chargeurs
+ Przepakuj<br/>magazynki
+ PÅ™epĂ¡skovat<br/>ZĂ¡sobnĂky
+ Ricarica<br/>Caricatori
+ Reorganizar<br/>Carregadores
+ ĂjratĂ¡razĂ¡s<<br/>Hungarian>
+ ĐŸĐµÑ€ĐµĐ¿Đ°ĐºĐ¾Đ²Đ°Ñ‚ÑŒ<br/>Đ¼Đ°Đ³Đ°Đ·Đ¸Đ½Ñ‹