Merge remote-tracking branch 'origin/master' into zeusModuleUiExample

This commit is contained in:
SilentSpike 2016-06-11 21:02:16 +01:00
commit 242876fa83
1283 changed files with 84865 additions and 84028 deletions

View File

@ -1,7 +1,7 @@
root = true root = true
[*] [*]
end_of_line = crlf end_of_line = lf
insert_final_newline = true insert_final_newline = true
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
@ -10,4 +10,3 @@ trim_trailing_whitespace = true
[*.md] [*.md]
trim_trailing_whitespace = false trim_trailing_whitespace = false

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
* text=auto
*.png binary
*.jpg binary
*.paa binary

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
release/* release/*
tools/temp
*.cache *.cache
*.pbo *.pbo
texHeaders.bin texHeaders.bin

View File

@ -3,7 +3,7 @@ class CfgVehicles {
class GVAR(ModuleSettings): ACE_Module { class GVAR(ModuleSettings): ACE_Module {
scope = 2; scope = 2;
displayName = CSTRING(DisplayName); displayName = CSTRING(DisplayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); icon = QPATHTOF(UI\Icon_Module_Wind_ca.paa);
category = "ACE"; category = "ACE";
function = QUOTE(DFUNC(initModuleSettings)); function = QUOTE(DFUNC(initModuleSettings));
functionPriority = 1; functionPriority = 1;

View File

@ -5,7 +5,7 @@
GVAR(currentbulletID) = -1; GVAR(currentbulletID) = -1;
GVAR(Protractor) = false; GVAR(Protractor) = false;
GVAR(ProtractorStart) = ACE_time; GVAR(ProtractorStart) = CBA_missionTime;
GVAR(allBullets) = []; GVAR(allBullets) = [];
GVAR(currentGrid) = 0; GVAR(currentGrid) = 0;
@ -24,7 +24,7 @@ if (!GVAR(extensionAvailable)) exitWith {
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
["SettingsInitialized", { ["ace_settingsInitialized", {
//If not enabled, dont't add PFEH //If not enabled, dont't add PFEH
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
@ -32,8 +32,8 @@ if (!hasInterface) exitWith {};
[] call FUNC(initializeTerrainExtension); [] call FUNC(initializeTerrainExtension);
// Register fire event handler // Register fire event handler
["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler); ["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
["firedPlayerNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler); ["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
//Add warnings for missing compat PBOs (only if AB is on) //Add warnings for missing compat PBOs (only if AB is on)
{ {
@ -50,7 +50,7 @@ if (!hasInterface) exitWith {};
["iansky_opt","ace_compat_sma3_iansky"], ["iansky_opt","ace_compat_sma3_iansky"],
["R3F_Armes","ace_compat_r3f"] ["R3F_Armes","ace_compat_r3f"]
]; ];
}] call EFUNC(common,addEventHandler); }] call CBA_fnc_addEventHandler;
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
call FUNC(diagnoseWeapons); call FUNC(diagnoseWeapons);

View File

@ -6,8 +6,9 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_ballistics", "ace_weather"}; requiredAddons[] = {"ace_ballistics", "ace_weather"};
author[] = {"Ruthberg"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://github.com/ulteq"; authors[] = {"Ruthberg"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };

View File

@ -43,13 +43,13 @@ GVAR(Protractor) = true;
__ctrl1 ctrlSetScale 1; __ctrl1 ctrlSetScale 1;
__ctrl1 ctrlCommit 0; __ctrl1 ctrlCommit 0;
__ctrl1 ctrlSetText QUOTE(PATHTOF(UI\protractor.paa)); __ctrl1 ctrlSetText QPATHTOF(UI\protractor.paa);
__ctrl1 ctrlSetTextColor [1, 1, 1, 1]; __ctrl1 ctrlSetTextColor [1, 1, 1, 1];
__ctrl2 ctrlSetScale 1; __ctrl2 ctrlSetScale 1;
__ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3]; __ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3];
__ctrl2 ctrlCommit 0; __ctrl2 ctrlCommit 0;
__ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa)); __ctrl2 ctrlSetText QPATHTOF(UI\protractor_marker.paa);
__ctrl2 ctrlSetTextColor [1, 1, 1, 1]; __ctrl2 ctrlSetTextColor [1, 1, 1, 1];
}, 0.1, []] call CBA_fnc_addPerFrameHandler; }, 0.1, []] call CBA_fnc_addPerFrameHandler;

View File

@ -12,7 +12,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private _aceTimeSecond = floor ACE_time; private _aceTimeSecond = floor CBA_missionTime;
{ {
private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"]; private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"];
@ -31,7 +31,7 @@ private _aceTimeSecond = floor ACE_time;
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
}; };
call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]); call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, CBA_missionTime - _aceTimeSecond]);
}; };
nil nil
} count +GVAR(allBullets); } count +GVAR(allBullets);

View File

@ -110,8 +110,8 @@ if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) th
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
_aceTimeSecond = floor ACE_time; _aceTimeSecond = floor CBA_missionTime;
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, ACE_time - _aceTimeSecond]; "ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, CBA_missionTime - _aceTimeSecond];
GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]; GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];

View File

@ -18,7 +18,7 @@ if (!GVAR(extensionAvailable)) exitWith {};
private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"]; private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"];
_initStartTime = ACE_time; _initStartTime = CBA_missionTime;
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
@ -38,7 +38,7 @@ GVAR(currentGrid) = 0;
if (GVAR(currentGrid) >= _gridCells) exitWith { if (GVAR(currentGrid) >= _gridCells) exitWith {
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(CBA_missionTime - _initStartTime)];
#endif #endif
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -6,8 +6,9 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"KoffeinFlummi","commy2"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://github.com/KoffeinFlummi/"; authors[] = {"KoffeinFlummi","commy2"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };

View File

@ -145,7 +145,7 @@ class RscInGameUI
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = PATHTOF(data\Helo_LaserON.paa); text = QPATHTOF(data\Helo_LaserON.paa);
x = "20.45 * (0.01875 * SafezoneH)"; x = "20.45 * (0.01875 * SafezoneH)";
y = "14.1 * (0.025 * SafezoneH)"; y = "14.1 * (0.025 * SafezoneH)";
w = "12.5 * (0.01875 * SafezoneH)"; w = "12.5 * (0.01875 * SafezoneH)";
@ -335,7 +335,7 @@ class RscInGameUI
shadow = 0; shadow = 0;
align = "right"; align = "right";
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = PATHTOF(data\Helo_LaserON.paa); text = QPATHTOF(data\Helo_LaserON.paa);
x = "20.45 * (0.01875 * SafezoneH)"; x = "20.45 * (0.01875 * SafezoneH)";
y = "14.1 * (0.025 * SafezoneH)"; y = "14.1 * (0.025 * SafezoneH)";
w = "12.5 * (0.01875 * SafezoneH)"; w = "12.5 * (0.01875 * SafezoneH)";

View File

@ -6,8 +6,9 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://github.com/KoffeinFlummi/"; authors[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };

View File

@ -20,4 +20,3 @@ envelope[] = {0,0,0.75,2.4,3.6,3.8,3.7,3.2,2.2,1.7,0.9};
thrustCoef[] = {1,1.2,1.3,1.25,1.06,1.01,1,0.92,0.75,0.65,0.5,0.25,0}; thrustCoef[] = {1,1.2,1.3,1.25,1.06,1.01,1,0.92,0.75,0.65,0.5,0.25,0};
acceleration = 265; acceleration = 265;
landingSpeed = 220; landingSpeed = 220;
gunAimDown = 0.087266463;

View File

@ -6,8 +6,8 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"}; requiredAddons[] = {"ace_main"};
author[] = {"Bohemia Interactive"}; author = "Bohemia Interactive";
authorUrl = "http://ace3mod.com"; url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };

View File

@ -9,7 +9,7 @@ class CfgVehicles {
statement = QUOTE(call FUNC(create_dialog)); statement = QUOTE(call FUNC(create_dialog));
showDisabled = 0; showDisabled = 0;
priority = 2; priority = 2;
icon = PATHTOF(UI\ATRAG_Icon.paa); icon = QPATHTOF(UI\ATRAG_Icon.paa);
exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"};
}; };
}; };

View File

@ -8,8 +8,8 @@ class CfgWeapons {
scope = 2; scope = 2;
displayName = CSTRING(Name); displayName = CSTRING(Name);
descriptionShort = CSTRING(Description); descriptionShort = CSTRING(Description);
model = PATHTOF(data\tdsrecon.p3d); model = QPATHTOF(data\tdsrecon.p3d);
picture = PATHTOF(UI\ATRAG_Icon.paa); picture = QPATHTOF(UI\ATRAG_Icon.paa);
icon = "iconObject_circle"; icon = "iconObject_circle";
mapSize = 0.034; mapSize = 0.034;

View File

@ -49,4 +49,4 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) ==
[] call FUNC(init); [] call FUNC(init);
[] call FUNC(restore_user_data); [] call FUNC(restore_user_data);
["RangerfinderData", {_this call FUNC(sord)}] call EFUNC(common,addEventHandler); [QEGVAR(vector,rangefinderData), {_this call FUNC(sord)}] call CBA_fnc_addEventHandler;

View File

@ -6,7 +6,9 @@ class CfgPatches {
weapons[] = {"ACE_ATragMX"}; weapons[] = {"ACE_ATragMX"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_common", "ACE_weather"}; requiredAddons[] = {"ACE_common", "ACE_weather"};
author = "Ruthberg"; author = ECSTRING(common,ACETeam);
authors[] = {"Ruthberg"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
@ -15,3 +17,7 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "RscTitles.hpp" #include "RscTitles.hpp"
class ACE_newEvents {
RangerfinderData = QEGVAR(vector,rangefinderData);
};

View File

@ -56,7 +56,7 @@ GVAR(DialogPFH) = [{
if (!GVAR(active)) exitWith { if (!GVAR(active)) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
__ctrlBackground ctrlSetText format [QUOTE(PATHTOF(UI\ATRAG_%1.paa)), ["N", "D"] select (call EFUNC(common,ambientBrightness))]; __ctrlBackground ctrlSetText format [QPATHTOF(UI\ATRAG_%1.paa), ["N", "D"] select (call EFUNC(common,ambientBrightness))];
}, 60, []] call CBA_fnc_addPerFrameHandler; }, 60, []] call CBA_fnc_addPerFrameHandler;
true true

View File

@ -30,7 +30,7 @@ if !(ctrlVisible 9000) then {
if (!(GVAR(speedAssistTimer))) exitWith { if (!(GVAR(speedAssistTimer))) exitWith {
GVAR(speedAssistTimer) = true; GVAR(speedAssistTimer) = true;
ctrlSetText [8006, Str(Round((ACE_time - _startTime) * 10) / 10)]; ctrlSetText [8006, Str(Round((CBA_missionTime - _startTime) * 10) / 10)];
[] call FUNC(calculate_target_speed_assist); [] call FUNC(calculate_target_speed_assist);
@ -40,7 +40,7 @@ if !(ctrlVisible 9000) then {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
ctrlSetText [9001, Str(Round((ACE_time - _startTime) * 10) / 10)]; ctrlSetText [9001, Str(Round((CBA_missionTime - _startTime) * 10) / 10)];
}, 0.1, [ACE_time]] call CBA_fnc_addPerFrameHandler; }, 0.1, [CBA_missionTime]] call CBA_fnc_addPerFrameHandler;
}; };

View File

@ -33,4 +33,4 @@ _closeCode = {
closeDialog 0; closeDialog 0;
}; };
}; };
[(localize LSTRING(Name)), QUOTE(PATHTOF(UI\ATRAG_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); [(localize LSTRING(Name)), QPATHTOF(UI\ATRAG_Icon.paa), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew);

View File

@ -3,17 +3,17 @@ class CfgMagazines {
class CA_Magazine; class CA_Magazine;
class B_IR_Grenade: CA_Magazine { class B_IR_Grenade: CA_Magazine {
ACE_Attachable = "B_IRStrobe"; ACE_Attachable = "B_IRStrobe";
model = QUOTE(PATHTOF(data\ace_IRStrobe.p3d)); model = QPATHTOF(data\ace_IRStrobe.p3d);
}; };
class O_IR_Grenade: B_IR_Grenade { class O_IR_Grenade: B_IR_Grenade {
ACE_Attachable = "O_IRStrobe"; ACE_Attachable = "O_IRStrobe";
model = QUOTE(PATHTOF(data\ace_IRStrobe.p3d)); model = QPATHTOF(data\ace_IRStrobe.p3d);
}; };
class I_IR_Grenade: B_IR_Grenade { class I_IR_Grenade: B_IR_Grenade {
ACE_Attachable = "I_IRStrobe"; ACE_Attachable = "I_IRStrobe";
model = QUOTE(PATHTOF(data\ace_IRStrobe.p3d)); model = QPATHTOF(data\ace_IRStrobe.p3d);
}; };
class SmokeShell; class SmokeShell;

View File

@ -9,7 +9,7 @@
exceptions[] = {}; \ exceptions[] = {}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \ icon = QPATHTOF(UI\attach_ca.paa); \
distance = 4.5; \ distance = 4.5; \
}; \ }; \
class GVAR(DetachVehicle) { \ class GVAR(DetachVehicle) { \
@ -19,7 +19,7 @@
exceptions[] = {}; \ exceptions[] = {}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0.1; \ priority = 0.1; \
icon = PATHTOF(UI\detach_ca.paa); \ icon = QPATHTOF(UI\detach_ca.paa); \
distance = 4.5; \ distance = 4.5; \
}; \ }; \
}; \ }; \
@ -60,7 +60,7 @@ class CfgVehicles {
exceptions[] = {"isNotDragging"}; exceptions[] = {"isNotDragging"};
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\attach_ca.paa); icon = QPATHTOF(UI\attach_ca.paa);
}; };
class GVAR(Detach) { class GVAR(Detach) {
displayName = CSTRING(Detach); displayName = CSTRING(Detach);
@ -69,7 +69,7 @@ class CfgVehicles {
exceptions[] = {"isNotDragging"}; exceptions[] = {"isNotDragging"};
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\detach_ca.paa); icon = QPATHTOF(UI\detach_ca.paa);
}; };
}; };
}; };

View File

@ -8,8 +8,8 @@ class CfgWeapons {
scope = 2; scope = 2;
displayName = CSTRING(IrStrobe_Name); displayName = CSTRING(IrStrobe_Name);
descriptionShort = CSTRING(IrStrobe_Description); descriptionShort = CSTRING(IrStrobe_Description);
model = QUOTE(PATHTOF(data\ace_IRStrobe.p3d)); model = QPATHTOF(data\ace_IRStrobe.p3d);
picture = PATHTOF(UI\irstrobe_item.paa); picture = QPATHTOF(UI\irstrobe_item.paa);
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 1; mass = 1;

View File

@ -3,4 +3,4 @@
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
//If attach placing, stop when opening menu: //If attach placing, stop when opening menu:
["interactMenuOpened", {GVAR(placeAction) = 0;}] call EFUNC(common,addEventHandler); ["ace_interactMenuOpened", {GVAR(placeAction) = 0;}] call CBA_fnc_addEventHandler;

View File

@ -6,8 +6,9 @@ class CfgPatches {
weapons[] = {"ACE_IR_Strobe_Item"}; weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"}; requiredAddons[] = {"ace_interaction"};
author[] = {"KoffeinFlummi","eRazeri","esteldunedain"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://github.com/KoffeinFlummi/"; authors[] = {"KoffeinFlummi","eRazeri","esteldunedain"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
@ -17,3 +18,7 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "GUI_VirtualAmmo.hpp" #include "GUI_VirtualAmmo.hpp"
class ACE_newEvents {
interactMenuOpened = "ace_interactMenuOpened";
};

View File

@ -40,7 +40,7 @@ _onAtachText = format [localize LSTRING(Item_Attached), _onAtachText];
if (_unit == _attachToVehicle) then { //Self Attachment if (_unit == _attachToVehicle) then { //Self Attachment
_attachedItem = _itemVehClass createVehicle [0,0,0]; _attachedItem = _itemVehClass createVehicle [0,0,0];
_attachedItem attachTo [_unit, [-0.05, 0, 0.12], "rightshoulder"]; _attachedItem attachTo [_unit, [0.05, -0.09, 0.1], "leftshoulder"];
if (!_silentScripted) then { if (!_silentScripted) then {
_unit removeItem _itemClassname; // Remove item _unit removeItem _itemClassname; // Remove item
[_onAtachText] call EFUNC(common,displayTextStructured); [_onAtachText] call EFUNC(common,displayTextStructured);
@ -51,7 +51,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
[_unit, "forceWalk", "ACE_Attach", true] call EFUNC(common,statusEffect_set); [_unit, "forceWalk", "ACE_Attach", true] call EFUNC(common,statusEffect_set);
[{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call EFUNC(common,execNextFrame); [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame;
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)];
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}]; _actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}];

View File

@ -57,7 +57,7 @@ if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then
detach _attachedObject; detach _attachedObject;
_attachedObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]); _attachedObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]);
// Delete attached item after 0.5 seconds // Delete attached item after 0.5 seconds
[{deleteVehicle (_this select 0)}, [_attachedObject], 2] call EFUNC(common,waitAndExecute); [{deleteVehicle (_this select 0)}, [_attachedObject], 2] call CBA_fnc_waitAndExecute;
} else { } else {
// Delete attached item // Delete attached item
deleteVehicle _attachedObject; deleteVehicle _attachedObject;

View File

@ -31,7 +31,7 @@ _actions = [];
if (getText (_item >> "ACE_Attachable") != "") then { if (getText (_item >> "ACE_Attachable") != "") then {
_displayName = getText(_item >> "displayName"); _displayName = getText(_item >> "displayName");
_picture = getText(_item >> "picture"); _picture = getText(_item >> "picture");
_action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target]; _actions pushBack [_action, [], _target];
}; };
}; };
@ -44,7 +44,7 @@ _actions = [];
if (getText (_item >> "ACE_Attachable") != "") then { if (getText (_item >> "ACE_Attachable") != "") then {
_displayName = getText(_item >> "displayName"); _displayName = getText(_item >> "displayName");
_picture = getText(_item >> "picture"); _picture = getText(_item >> "picture");
_action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target]; _actions pushBack [_action, [], _target];
}; };
}; };

View File

@ -36,7 +36,7 @@ if (!isNull _xObject) then {
params ["_detachedLight"]; params ["_detachedLight"];
TRACE_1("delayed delete",_detachedLight); TRACE_1("delayed delete",_detachedLight);
deleteVehicle _detachedLight; deleteVehicle _detachedLight;
}, [_xObject], 2] call EFUNC(common,waitAndExecute); }, [_xObject], 2] call CBA_fnc_waitAndExecute;
(_attachedList select 0) set [0, objNull]; (_attachedList select 0) set [0, objNull];
}; };

View File

@ -32,7 +32,7 @@ if ((count _attachedList) == 0) exitWith {};
//If it's a vehicle, also delete the attached //If it's a vehicle, also delete the attached
if (!(_deadUnit isKindOf "CAManBase")) then { if (!(_deadUnit isKindOf "CAManBase")) then {
_xObject setPos ((getPos _deadUnit) vectorAdd [0, 0, -1000]); _xObject setPos ((getPos _deadUnit) vectorAdd [0, 0, -1000]);
[{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute); [{deleteVehicle (_this select 0)}, [_xObject], 2] call CBA_fnc_waitAndExecute;
}; };
} forEach _attachedList; } forEach _attachedList;

View File

@ -1,3 +1,3 @@
#include "script_component.hpp" #include "script_component.hpp"
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler); ["ace_backpackOpened", {_this call FUNC(backpackOpened)}] call CBA_fnc_addEventHandler;

View File

@ -6,10 +6,15 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"bux","commy2"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://github.com/commy2/"; authors[] = {"bux","commy2"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
class ACE_newEvents {
backpackOpened = "ace_backpackOpened";
};

View File

@ -24,7 +24,7 @@ private _target = objectParent _backpack;
if (isNull _target) exitWith {false}; if (isNull _target) exitWith {false};
// raise event on target unit // raise event on target unit
["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent); ["ace_backpackOpened", [_target, _backpack], _target] call CBA_fnc_targetEvent;
// return false to open inventory as usual // return false to open inventory as usual
false false

View File

@ -6,7 +6,9 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"commy2","Ruthberg"}; author = ECSTRING(common,ACETeam);
authors[] = {"commy2","Ruthberg"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };

View File

@ -11,5 +11,5 @@ if (local _wall) then {
_paper attachTo [_wall, [0,-0.02,0.6]]; _paper attachTo [_wall, [0,-0.02,0.6]];
_paper setDir getDir _wall; _paper setDir getDir _wall;
_paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))]; _paper setObjectTextureGlobal [0, QPATHTOF(textures\target_ca.paa)];
}; };

View File

@ -10,7 +10,7 @@ class CfgVehicles {
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
exceptions[] = {}; exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); icon = QPATHTOF(UI\handcuff_ca.paa);
}; };
class ACE_MainActions { class ACE_MainActions {
@ -21,7 +21,7 @@ class CfgVehicles {
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {}; exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); icon = QPATHTOF(UI\handcuff_ca.paa);
}; };
class ACE_EscortCaptive { class ACE_EscortCaptive {
displayName = CSTRING(EscortCaptive); displayName = CSTRING(EscortCaptive);
@ -30,7 +30,7 @@ class CfgVehicles {
statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive)); statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive));
exceptions[] = {}; exceptions[] = {};
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QPATHTOF(UI\captive_ca.paa);
priority = 2.3; priority = 2.3;
}; };
class ACE_StopEscorting { class ACE_StopEscorting {
@ -40,7 +40,7 @@ class CfgVehicles {
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive)); statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
exceptions[] = {"isNotEscorting"}; exceptions[] = {"isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QPATHTOF(UI\captive_ca.paa);
priority = 2.3; priority = 2.3;
}; };
class ACE_LoadCaptive { class ACE_LoadCaptive {
@ -50,7 +50,7 @@ class CfgVehicles {
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive)); statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
exceptions[] = {"isNotEscorting"}; exceptions[] = {"isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QPATHTOF(UI\captive_ca.paa);
priority = 2.2; priority = 2.2;
}; };
class GVAR(UnloadCaptive) { class GVAR(UnloadCaptive) {
@ -79,7 +79,7 @@ class CfgVehicles {
exceptions[] = {}; exceptions[] = {};
showDisabled = 0; showDisabled = 0;
priority = 0; priority = 0;
icon = QUOTE(PATHTOF(UI\Surrender_ca.paa)); icon = QPATHTOF(UI\Surrender_ca.paa);
}; };
class ACE_StopSurrenderingSelf { class ACE_StopSurrenderingSelf {
displayName = CSTRING(StopSurrendering); displayName = CSTRING(StopSurrendering);
@ -88,7 +88,7 @@ class CfgVehicles {
exceptions[] = {"isNotSurrendering"}; exceptions[] = {"isNotSurrendering"};
showDisabled = 0; showDisabled = 0;
priority = 0; priority = 0;
icon = QUOTE(PATHTOF(UI\Surrender_ca.paa)); icon = QPATHTOF(UI\Surrender_ca.paa);
}; };
}; };
}; };
@ -154,7 +154,7 @@ class CfgVehicles {
scope = 2; //show in editor scope = 2; //show in editor
isGlobal = 0; //run on server isGlobal = 0; //run on server
isTriggerActivated = 1; //Wait for triggers isTriggerActivated = 1; //Wait for triggers
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa)); icon = QPATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa);
functionPriority = 0; functionPriority = 0;
class Arguments {}; class Arguments {};
class ModuleDescription: ModuleDescription { class ModuleDescription: ModuleDescription {
@ -170,7 +170,7 @@ class CfgVehicles {
scope = 2; //show in editor scope = 2; //show in editor
isGlobal = 0; //run on server isGlobal = 0; //run on server
isTriggerActivated = 1; //Wait for triggers isTriggerActivated = 1; //Wait for triggers
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Handcuffed_ca.paa)); icon = QPATHTOF(UI\Icon_Module_Make_Unit_Handcuffed_ca.paa);
functionPriority = 0; functionPriority = 0;
class Arguments {}; class Arguments {};
class ModuleDescription: ModuleDescription { class ModuleDescription: ModuleDescription {
@ -186,7 +186,7 @@ class CfgVehicles {
displayName = CSTRING(ModuleSettings_DisplayName); displayName = CSTRING(ModuleSettings_DisplayName);
function = QFUNC(moduleSettings); function = QFUNC(moduleSettings);
scope = 2; scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa)); icon = QPATHTOF(UI\Icon_Module_settings_ca.paa);
isGlobal = 1; isGlobal = 1;
isSingular = 1; isSingular = 1;
class Arguments { class Arguments {

View File

@ -5,8 +5,8 @@ class CfgWeapons {
class ACE_CableTie: ACE_ItemCore { class ACE_CableTie: ACE_ItemCore {
displayName = CSTRING(CableTie); displayName = CSTRING(CableTie);
descriptionShort = CSTRING(CableTieDescription); descriptionShort = CSTRING(CableTieDescription);
model = QUOTE(PATHTOF(models\ace_cabletie.p3d)); model = QPATHTOF(models\ace_cabletie.p3d);
picture = QUOTE(PATHTOF(UI\ace_cabletie_ca.paa)); picture = QPATHTOF(UI\ace_cabletie_ca.paa);
scope = 2; scope = 2;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 1; mass = 1;

View File

@ -1,11 +1,11 @@
#include "script_component.hpp" #include "script_component.hpp"
["SettingsInitialized", { ["ace_settingsInitialized", {
// Hold on a little bit longer to ensure anims will work // Hold on a little bit longer to ensure anims will work
[{ [{
GVAR(captivityEnabled) = true; GVAR(captivityEnabled) = true;
}, [], 0.05] call EFUNC(common,waitAndExecute); }, [], 0.05] call CBA_fnc_waitAndExecute;
}] call EFUNC(common,addEventHandler); }] call CBA_fnc_addEventHandler;
//Handles when someone starts escorting and then disconnects, leaving the captive attached //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 //This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
@ -24,15 +24,15 @@ if (isServer) then {
}]; }];
}; };
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); [QGVAR(moveInCaptive), {_this call FUNC(vehicleCaptiveMoveIn)}] call CBA_fnc_addEventHandler;
["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); [QGVAR(moveOutCaptive), {_this call FUNC(vehicleCaptiveMoveOut)}] call CBA_fnc_addEventHandler;
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler); [QGVAR(setHandcuffed), {_this call FUNC(setHandcuffed)}] call CBA_fnc_addEventHandler;
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler); [QGVAR(setSurrendered), {_this call FUNC(setSurrendered)}] call CBA_fnc_addEventHandler;
//Medical Integration Events //Medical Integration Events
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler); ["ace_unconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call CBA_fnc_addEventHandler;
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};

View File

@ -6,8 +6,9 @@ class CfgPatches {
weapons[] = {"ACE_CableTie"}; weapons[] = {"ACE_CableTie"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_Interaction"}; requiredAddons[] = {"ACE_Interaction"};
author[] = {"commy2", "KoffeinFlummi"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://github.com/commy2/"; authors[] = {"commy2", "KoffeinFlummi"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
@ -18,3 +19,11 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "CfgEden.hpp" #include "CfgEden.hpp"
class ACE_newEvents {
SetSurrendered = QGVAR(setSurrendered);
SetHandcuffed = QGVAR(setHandcuffed);
MoveOutCaptive = QGVAR(moveOutCaptive);
MoveInCaptive = QGVAR(moveInCaptive);
CaptiveStatusChanged = "ace_captiveStatusChanged";
};

View File

@ -21,6 +21,6 @@ params ["_unit", "_target"];
playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10]; playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10];
["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent); [QGVAR(setHandcuffed), [_target, true], [_target]] call CBA_fnc_targetEvent;
_unit removeItem "ACE_CableTie"; _unit removeItem "ACE_CableTie";

View File

@ -47,4 +47,4 @@ if (isNull _vehicle) then {
if (isNull _vehicle) exitWith {ERROR("");}; if (isNull _vehicle) exitWith {ERROR("");};
_unit setVariable [QGVAR(isEscorting), false, true]; _unit setVariable [QGVAR(isEscorting), false, true];
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent); [QGVAR(moveInCaptive), [_target, _vehicle], [_target]] call CBA_fnc_targetEvent;

View File

@ -17,4 +17,4 @@
params ["_unit", "_target"]; params ["_unit", "_target"];
["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); [QGVAR(setHandcuffed), [_target, false], [_target]] call CBA_fnc_targetEvent;

View File

@ -18,4 +18,4 @@
params ["_unit", "_target"]; params ["_unit", "_target"];
["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); [QGVAR(moveOutCaptive), [_target], [_target]] call CBA_fnc_targetEvent;

View File

@ -1,6 +1,6 @@
/* /*
* Author: commy2, PabstMirror * Author: commy2, PabstMirror
* Handles the "medical_onUnconscious" event * Handles the "ace_unconscious" event
* *
* Arguments: * Arguments:
* 0: Unit <OBJECT> * 0: Unit <OBJECT>

View File

@ -30,9 +30,9 @@ if (!isServer) exitWith {};
params ["_units"]; params ["_units"];
{ {
TRACE_2("event",_x,local _x); TRACE_2("event",_x,local _x);
["SetHandcuffed", [_x], [_x, true]] call EFUNC(common,targetEvent); [QGVAR(setHandcuffed), [_x, true], [_x]] call CBA_fnc_targetEvent;
} forEach _units; } forEach _units;
}, [_units], 0.05] call EFUNC(common,waitAndExecute); }, [_units], 0.05] call CBA_fnc_waitAndExecute;
if (!isNull _logic) then { if (!isNull _logic) then {
deleteVehicle _logic; deleteVehicle _logic;

View File

@ -30,9 +30,9 @@ if (!isServer) exitWith {};
params ["_units"]; params ["_units"];
{ {
TRACE_2("event",_x,local _x); TRACE_2("event",_x,local _x);
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); [QGVAR(setSurrendered), [_x, true], [_x]] call CBA_fnc_targetEvent;
} forEach _units; } forEach _units;
}, [_units], 0.05] call EFUNC(common,waitAndExecute); }, [_units], 0.05] call CBA_fnc_waitAndExecute;
if (!isNull _logic) then { if (!isNull _logic) then {
deleteVehicle _logic; deleteVehicle _logic;

View File

@ -27,7 +27,7 @@ if !(missionNamespace getVariable [QGVAR(captivityEnabled), false]) exitWith {
// It's to soon to call this function, delay it // It's to soon to call this function, delay it
if (EGVAR(common,settingsInitFinished)) then { if (EGVAR(common,settingsInitFinished)) then {
// Settings are already initialized, but the small wait isn't over // Settings are already initialized, but the small wait isn't over
[DFUNC(setHandCuffed), _this, 0.05] call EFUNC(common,waitAndExecute); [DFUNC(setHandCuffed), _this, 0.05] call CBA_fnc_waitAndExecute;
} else { } else {
// Settings are not initialized yet // Settings are not initialized yet
[DFUNC(setHandCuffed), _this] call EFUNC(common,runAfterSettingsInit); [DFUNC(setHandCuffed), _this] call EFUNC(common,runAfterSettingsInit);
@ -98,7 +98,7 @@ if (_state) then {
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID); TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
}, [_unit], 0.01] call EFUNC(common,waitAndExecute); }, [_unit], 0.01] call CBA_fnc_waitAndExecute;
} else { } else {
_unit setVariable [QGVAR(isHandcuffed), false, true]; _unit setVariable [QGVAR(isHandcuffed), false, true];
[_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set);
@ -124,4 +124,4 @@ if (_state) then {
}; };
//Global Event after changes: //Global Event after changes:
["CaptiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call EFUNC(common,globalEvent); ["ace_captiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call CBA_fnc_globalEvent;

View File

@ -27,7 +27,7 @@ if !(missionNamespace getVariable [QGVAR(captivityEnabled), false]) exitWith {
// It's to soon to call this function, delay it // It's to soon to call this function, delay it
if (EGVAR(common,settingsInitFinished)) then { if (EGVAR(common,settingsInitFinished)) then {
// Settings are already initialized, but the small wait isn't over // Settings are already initialized, but the small wait isn't over
[DFUNC(setSurrendered), _this, 0.05] call EFUNC(common,waitAndExecute); [DFUNC(setSurrendered), _this, 0.05] call CBA_fnc_waitAndExecute;
} else { } else {
// Settings are not initialized yet // Settings are not initialized yet
[DFUNC(setSurrendered), _this] call EFUNC(common,runAfterSettingsInit); [DFUNC(setSurrendered), _this] call EFUNC(common,runAfterSettingsInit);
@ -73,7 +73,7 @@ if (_state) then {
}]; }];
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
}; };
}, [_unit], 0.01] call EFUNC(common,waitAndExecute); }, [_unit], 0.01] call CBA_fnc_waitAndExecute;
} else { } else {
_unit setVariable [QGVAR(isSurrendering), false, true]; _unit setVariable [QGVAR(isSurrendering), false, true];
[_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set);
@ -103,7 +103,7 @@ if (_state) then {
params ["_args", "_pfID"]; params ["_args", "_pfID"];
_args params ["_unit", "_maxTime"]; _args params ["_unit", "_maxTime"];
//If waited long enough or they re-surrendered or they are unconscious, exit loop //If waited long enough or they re-surrendered or they are unconscious, exit loop
if ((ACE_time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith { if ((CBA_missionTime > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler; [_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) //Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition)
@ -112,9 +112,9 @@ if (_state) then {
//Break out of hands up animation loop //Break out of hands up animation loop
[_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
}; };
}, 0, [_unit, (ACE_time + 20)]] call CBA_fnc_addPerFrameHandler; }, 0, [_unit, (CBA_missionTime + 20)]] call CBA_fnc_addPerFrameHandler;
}; };
}; };
//Global Event after changes: //Global Event after changes:
["CaptiveStatusChanged", [_unit, _state, "SetSurrendered"]] call EFUNC(common,globalEvent); ["ace_captiveStatusChanged", [_unit, _state, "SetSurrendered"]] call CBA_fnc_globalEvent;

View File

@ -10,7 +10,7 @@ class CfgVehicles {
class ACE_moduleCargoSettings: ACE_Module { class ACE_moduleCargoSettings: ACE_Module {
scope = 2; scope = 2;
displayName = CSTRING(SettingsModule_DisplayName); displayName = CSTRING(SettingsModule_DisplayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_Cargo_ca.paa)); icon = QPATHTOF(UI\Icon_Module_Cargo_ca.paa);
category = "ACE_Logistics"; category = "ACE_Logistics";
function = QFUNC(moduleSettings); function = QFUNC(moduleSettings);
functionPriority = 1; functionPriority = 1;
@ -36,7 +36,7 @@ class CfgVehicles {
class GVAR(makeLoadable): ACE_Module { class GVAR(makeLoadable): ACE_Module {
scope = 2; scope = 2;
displayName = CSTRING(makeLoadable_displayName); displayName = CSTRING(makeLoadable_displayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_makeLoadable_ca.paa)); icon = QPATHTOF(UI\Icon_Module_makeLoadable_ca.paa);
category = "ACE_Logistics"; category = "ACE_Logistics";
function = QFUNC(moduleMakeLoadable); function = QFUNC(moduleMakeLoadable);
isGlobal = 1; isGlobal = 1;
@ -314,14 +314,15 @@ class CfgVehicles {
GVAR(space) = 20; GVAR(space) = 20;
GVAR(hasCargo) = 1; GVAR(hasCargo) = 1;
}; };
class Land_Pod_Heli_Transport_04_medevac_F: Pod_Heli_Transport_04_base_F {
GVAR(space) = 8;
GVAR(hasCargo) = 1;
};
class Land_Pod_Heli_Transport_04_repair_F: Pod_Heli_Transport_04_base_F { class Land_Pod_Heli_Transport_04_repair_F: Pod_Heli_Transport_04_base_F {
GVAR(space) = 12; GVAR(space) = 12;
GVAR(hasCargo) = 1; GVAR(hasCargo) = 1;
}; };
class Pod_Heli_Transport_04_crewed_base_F;
class Land_Pod_Heli_Transport_04_medevac_F: Pod_Heli_Transport_04_crewed_base_F {
GVAR(space) = 8;
GVAR(hasCargo) = 1;
};
class StaticMortar; class StaticMortar;
class Mortar_01_base_F: StaticMortar { class Mortar_01_base_F: StaticMortar {

View File

@ -1,8 +1,8 @@
#include "script_component.hpp" #include "script_component.hpp"
["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); ["ace_addCargoByClass", {_this call FUNC(addCargoItem)}] call CBA_fnc_addEventHandler;
["LoadCargo", { ["ace_loadCargo", {
params ["_item", "_vehicle"]; params ["_item", "_vehicle"];
TRACE_2("LoadCargo EH",_item,_vehicle); TRACE_2("LoadCargo EH",_item,_vehicle);
@ -13,15 +13,15 @@
private _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); private _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); [[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);
if (_loaded) then { if (_loaded) then {
// Invoke listenable event // Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); ["ace_cargoLoaded", [_item, _vehicle]] call CBA_fnc_globalEvent;
}; };
}] call EFUNC(common,addEventHandler); }] call CBA_fnc_addEventHandler;
["UnloadCargo", { ["ace_unloadCargo", {
params ["_item", "_vehicle", ["_unloader", objNull]]; params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader); TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader);
@ -34,19 +34,19 @@
private _itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); private _itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); [[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);
if (_unloaded) then { if (_unloaded) then {
// Invoke listenable event // Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); ["ace_cargoUnloaded", [_item, _vehicle]] call CBA_fnc_globalEvent;
}; };
// TOOO maybe drag/carry the unloaded item? // TOOO maybe drag/carry the unloaded item?
}] call EFUNC(common,addEventHandler); }] call CBA_fnc_addEventHandler;
["ServerUnloadCargo", { [QGVAR(serverUnload), {
params ["_item", "_emptyPosAGL"]; params ["_item", "_emptyPosAGL"];
_item hideObjectGlobal false; _item hideObjectGlobal false;
_item setPosASL (AGLtoASL _emptyPosAGL); _item setPosASL (AGLtoASL _emptyPosAGL);
}] call EFUNC(common,addEventHandler); }] call CBA_fnc_addEventHandler;

View File

@ -6,8 +6,9 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"}; requiredAddons[] = {"ace_interaction"};
author[] = {"commy2", "Glowbal"}; author = ECSTRING(common,ACETeam);
authorUrl = "https://ace3mod.com/"; authors[] = {"commy2", "Glowbal"};
url = ECSTRING(main,URL);
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
@ -16,3 +17,13 @@ class CfgPatches {
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "menu.hpp" #include "menu.hpp"
class ACE_newEvents {
LoadCargo = "ace_loadCargo";
cargoUnloaded = "ace_cargoUnloaded";
cargoLoaded = "ace_cargoLoaded";
AddCargoByClass = "ace_addCargoByClass";
ServerUnloadCargo = QGVAR(serverUnload);
UnloadCargo = "ace_unloadCargo";
cargoAddedByClass = "ace_cargoAddedByClass";
};

View File

@ -26,4 +26,4 @@ for "_i" from 1 to _amount do {
}; };
// Invoke listenable event // Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); ["ace_cargoAddedByClass", [_itemClass, _vehicle, _amount]] call CBA_fnc_globalEvent;

View File

@ -39,7 +39,7 @@ private _statement = {
[_player, _target] call FUNC(startLoadIn); [_player, _target] call FUNC(startLoadIn);
}; };
private _text = localize LSTRING(loadObject); private _text = localize LSTRING(loadObject);
private _icon = QUOTE(PATHTOF(UI\Icon_load.paa)); private _icon = QPATHTOF(UI\Icon_load.paa);
private _action = [QGVAR(load), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); private _action = [QGVAR(load), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);

View File

@ -29,7 +29,7 @@ if (isServer) then {
_cargoClassname = getText (_x >> "type"); _cargoClassname = getText (_x >> "type");
_cargoCount = getNumber (_x >> "amount"); _cargoCount = getNumber (_x >> "amount");
TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount); TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount);
["AddCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call EFUNC(common,localEvent); ["ace_addCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call CBA_fnc_localEvent;
}; };
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
}; };

View File

@ -35,7 +35,7 @@ _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
if (_item isEqualType objNull) then { if (_item isEqualType objNull) then {
detach _item; detach _item;
_item attachTo [_vehicle,[0,0,-100]]; _item attachTo [_vehicle,[0,0,-100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); [QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent;
}; };
true true

View File

@ -40,7 +40,7 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
[ [
5 * _size, 5 * _size,
[_object,_vehicle], [_object,_vehicle],
{["LoadCargo", _this select 0] call EFUNC(common,localEvent)}, {["ace_loadCargo", _this select 0] call CBA_fnc_localEvent},
{}, {},
localize LSTRING(LoadingItem) localize LSTRING(LoadingItem)
] call EFUNC(common,progressBar); ] call EFUNC(common,progressBar);
@ -48,7 +48,7 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
} else { } else {
private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName"); private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); [[LSTRING(LoadingFailed), _displayName], 3.0] call EFUNC(common,displayTextStructured);
}; };
_return _return

View File

@ -37,7 +37,7 @@ if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then
[ [
5 * _size, 5 * _size,
[_item, GVAR(interactionVehicle), ACE_player], [_item, GVAR(interactionVehicle), ACE_player],
{["UnloadCargo", _this select 0] call EFUNC(common,localEvent)}, {["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent},
{}, {},
localize LSTRING(UnloadingItem), localize LSTRING(UnloadingItem),
{true}, {true},
@ -47,5 +47,5 @@ if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); [[LSTRING(UnloadingFailed), _displayName], 3.0] call EFUNC(common,displayTextStructured);
}; };

View File

@ -29,7 +29,7 @@ if ((count _emptyPosAGL) != 3) exitWith {
TRACE_4("Could not find unload pos",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle); TRACE_4("Could not find unload pos",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle);
if ((!isNull _unloader) && {_unloader == ACE_player}) then { if ((!isNull _unloader) && {_unloader == ACE_player}) then {
//display text saying there are no safe places to exit the vehicle //display text saying there are no safe places to exit the vehicle
["displayTextStructured", [localize ELSTRING(common,NoRoomToUnload)]] call EFUNC(common,localEvent); [localize ELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured);
}; };
false false
}; };
@ -52,7 +52,7 @@ if (_item isEqualType objNull) then {
detach _item; detach _item;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly // hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// do both on server to ensure they are executed in the correct order // do both on server to ensure they are executed in the correct order
["ServerUnloadCargo", [_item, _emptyPosAGL]] call EFUNC(common,serverEvent); [QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
} else { } else {
private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, ""]; private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, ""];
_newItem setPosASL (AGLtoASL _emptyPosAGL); _newItem setPosASL (AGLtoASL _emptyPosAGL);

View File

@ -176,6 +176,7 @@
<Spanish>Hacer objeto cargable</Spanish> <Spanish>Hacer objeto cargable</Spanish>
<French>Rendre l'objet chargeable</French> <French>Rendre l'objet chargeable</French>
<Czech>Vytvořit objekt nakladatelným</Czech> <Czech>Vytvořit objekt nakladatelným</Czech>
<Portuguese>Fazer objeto carregável</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Cargo_makeLoadable_description"> <Key ID="STR_ACE_Cargo_makeLoadable_description">
<English>Sets the synced object as loadable by the cargo system.</English> <English>Sets the synced object as loadable by the cargo system.</English>
@ -185,6 +186,7 @@
<Spanish>Sincronizar un objecto para hacerlo cargable.</Spanish> <Spanish>Sincronizar un objecto para hacerlo cargable.</Spanish>
<French>Rend l'objet synchronisé comme chargeable par le système de cargaison.</French> <French>Rend l'objet synchronisé comme chargeable par le système de cargaison.</French>
<Czech>Nastaví synchronizované objekty nakladatelnými za pomocí Nákladního systému.</Czech> <Czech>Nastaví synchronizované objekty nakladatelnými za pomocí Nákladního systému.</Czech>
<Portuguese>Seta o objeto sincronizado como carregável</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Cargo_makeLoadable_setSize_displayName"> <Key ID="STR_ACE_Cargo_makeLoadable_setSize_displayName">
<English>Object's Size</English> <English>Object's Size</English>
@ -194,6 +196,7 @@
<Spanish>Tamaño del objeto</Spanish> <Spanish>Tamaño del objeto</Spanish>
<French>Taille de l'objet</French> <French>Taille de l'objet</French>
<Czech>Velikost objektu</Czech> <Czech>Velikost objektu</Czech>
<Portuguese>Tamanho do objeto</Portuguese>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -33,7 +33,7 @@ class Extended_InitPost_EventHandlers {
}; };
class CAManBase { class CAManBase {
class GVAR(setName) { class GVAR(setName) {
init = QUOTE(if (local (_this select 0)) then {[ARR_2(FUNC(setName),_this)] call FUNC(execNextFrame)};); init = QUOTE(if (local (_this select 0)) then {[ARR_2(FUNC(setName),_this)] call CBA_fnc_execNextFrame};);
}; };
class GVAR(muteUnit) { class GVAR(muteUnit) {
init = QUOTE(_this call FUNC(muteUnitHandleInitPost)); init = QUOTE(_this call FUNC(muteUnitHandleInitPost));

View File

@ -3,13 +3,13 @@ class CfgUnitInsignia {
class ACE_insignia_logo { class ACE_insignia_logo {
displayName = "ACE3"; displayName = "ACE3";
author = CSTRING(ACETeam); author = CSTRING(ACETeam);
texture = PATHTOF(data\Insignia_ace3logo_ca.paa); texture = QPATHTOF(data\Insignia_ace3logo_ca.paa);
textureVehicle = ""; textureVehicle = "";
}; };
class ACE_insignia_banana { class ACE_insignia_banana {
displayName = "ABE3"; displayName = "ABE3";
author = CSTRING(ACETeam); author = CSTRING(ACETeam);
texture = PATHTOF(data\insignia_banana_ca.paa); texture = QPATHTOF(data\insignia_banana_ca.paa);
textureVehicle = ""; textureVehicle = "";
}; };
}; };

View File

@ -36,7 +36,7 @@ class CfgVehicles {
scope = 2; scope = 2;
isGlobal = 1; isGlobal = 1;
isSingular = 1; isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa)); icon = QPATHTOF(UI\Icon_Module_CheckPBO_ca.paa);
class Arguments { class Arguments {
class Action { class Action {
displayName = CSTRING(CheckPBO_Action_DisplayName); displayName = CSTRING(CheckPBO_Action_DisplayName);
@ -82,7 +82,7 @@ class CfgVehicles {
displayName = CSTRING(LSDVehicles_DisplayName); displayName = CSTRING(LSDVehicles_DisplayName);
function = "ACE_Common_fnc_moduleLSDVehicles"; function = "ACE_Common_fnc_moduleLSDVehicles";
scope = 2; scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa)); icon = QPATHTOF(UI\Icon_Module_LSD_ca.paa);
isGlobal = 1; isGlobal = 1;
class Arguments {}; class Arguments {};
class ModuleDescription: ModuleDescription { class ModuleDescription: ModuleDescription {
@ -132,7 +132,7 @@ class CfgVehicles {
class ACE_Headbug_Fix: Bicycle { class ACE_Headbug_Fix: Bicycle {
scope = 1; scope = 1;
side = 3; side = 3;
model = PATHTOF(data\ACE_HeadBanger.p3d); model = QPATHTOF(data\ACE_HeadBanger.p3d);
//model = QPATHTO_M(ACE_HeadBanger.p3d); //model = QPATHTO_M(ACE_HeadBanger.p3d);
author = CSTRING(ACETeam); author = CSTRING(ACETeam);
displayName = " "; displayName = " ";

View File

@ -34,8 +34,8 @@ class CfgWeapons {
scope = 2; scope = 2;
displayName = CSTRING(bananaDisplayName); displayName = CSTRING(bananaDisplayName);
descriptionShort = CSTRING(bananaDescr); descriptionShort = CSTRING(bananaDescr);
model = PATHTOF(data\banana.p3d); model = QPATHTOF(data\banana.p3d);
picture = PATHTOF(data\icon_banana_ca.paa); picture = QPATHTOF(data\icon_banana_ca.paa);
icon = "iconObject_circle"; icon = "iconObject_circle";
mapSize = 0.034; mapSize = 0.034;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {

View File

@ -1,114 +1,118 @@
class RscInGameUI { class RscInGameUI {
class RscUnitInfo { class RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoNoHUD { class RscUnitInfoNoHUD {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoSoldier: RscUnitInfo { class RscUnitInfoSoldier: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoTank: RscUnitInfo { class RscUnitInfoTank: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoAirNoWeapon: RscUnitInfo { class RscUnitInfoAirNoWeapon: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoAir: RscUnitInfoAirNoWeapon { class RscUnitInfoAir: RscUnitInfoAirNoWeapon {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfo_AH64D_gunner { class RscUnitInfo_AH64D_gunner {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoUAV { class RscUnitInfoUAV {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgUAV', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'UAV')])] call FUNC(localEvent);); onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgUAV', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'UAV')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoSubmarine: RscUnitInfo { class RscUnitInfoSubmarine: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoShip: RscUnitInfo { class RscUnitInfoShip: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponEmpty { class RscWeaponEmpty {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeFinder { class RscWeaponRangeFinder {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeArtillery { class RscWeaponRangeArtillery {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent);); onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeArtilleryAuto { class RscWeaponRangeArtilleryAuto {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent);); onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeFinderPAS13 { class RscWeaponRangeFinderPAS13 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscOptics_LaserDesignator { class RscOptics_LaserDesignator {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeFinderMAAWS { class RscWeaponRangeFinderMAAWS {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeFinderAbramsCom { class RscWeaponRangeFinderAbramsCom {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeFinderAbramsGun { class RscWeaponRangeFinderAbramsGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscWeaponRangeFinderStrykerMGSGun { class RscWeaponRangeFinderStrykerMGSGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscOptics_strider_commander { class RscOptics_strider_commander {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscOptics_titan { class RscOptics_titan {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscOptics_punisher { class RscOptics_punisher {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscOptics_SDV_periscope { class RscOptics_SDV_periscope {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscUnitInfoParachute: RscUnitInfo { class RscUnitInfoParachute: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call CBA_fnc_localEvent;);
}; };
class RscUnitVehicle { class RscUnitVehicle {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscOptics_LaserDesignator_02 { class RscOptics_LaserDesignator_02 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
}; };
class RscStaminaBar { class RscStaminaBar {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]);
}; };
class RscStanceInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Stance')])] call CBA_fnc_localEvent;);
};
}; };

View File

@ -24,6 +24,7 @@ PREP(debugModule);
PREP(defineVariable); PREP(defineVariable);
PREP(deviceKeyFindValidIndex); PREP(deviceKeyFindValidIndex);
PREP(deviceKeyRegisterNew); PREP(deviceKeyRegisterNew);
PREP(deprecateComponent);
PREP(disableAI); PREP(disableAI);
PREP(disableUserInput); PREP(disableUserInput);
PREP(displayIcon); PREP(displayIcon);
@ -235,7 +236,6 @@ PREP(dumpPerformanceCounters);
PREP(dumpArray); PREP(dumpArray);
PREP(globalEvent); PREP(globalEvent);
PREP(_handleNetEvent);
PREP(addEventHandler); PREP(addEventHandler);
PREP(objectEvent); PREP(objectEvent);
PREP(targetEvent); PREP(targetEvent);
@ -277,5 +277,3 @@ PREP(hashListCreateHash);
PREP(hashListSelect); PREP(hashListSelect);
PREP(hashListSet); PREP(hashListSet);
PREP(hashListPush); PREP(hashListPush);
PREP(timePFH);

View File

@ -3,47 +3,6 @@
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
//////////////////////////////////////////////////
// PFHs
//////////////////////////////////////////////////
//Singe PFEH to handle execNextFrame, waitAndExec and waitUntilAndExec:
[{
BEGIN_COUNTER(waitAndExec);
//Handle the waitAndExec array:
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
private _entry = GVAR(waitAndExecArray) deleteAt 0;
(_entry select 2) call (_entry select 1);
};
//Handle the execNextFrame array:
{
(_x select 0) call (_x select 1);
false
} count GVAR(nextFrameBufferA);
//Swap double-buffer:
GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB);
GVAR(nextFrameBufferB) = [];
GVAR(nextFrameNo) = diag_frameno + 1;
//Handle the waitUntilAndExec array:
{
// if condition is satisifed call statement
if ((_x select 2) call (_x select 0)) then {
// make sure to delete the correct handle when multiple conditions are met in one frame
GVAR(waitUntilAndExecArray) deleteAt (GVAR(waitUntilAndExecArray) find _x);
(_x select 2) call (_x select 1);
};
nil
} count +GVAR(waitUntilAndExecArray);
END_COUNTER(waitAndExec);
}, 0, []] call CBA_fnc_addPerFrameHandler;
////////////////////////////////////////////////// //////////////////////////////////////////////////
// Get Map Data // Get Map Data
////////////////////////////////////////////////// //////////////////////////////////////////////////
@ -59,29 +18,29 @@
////////////////////////////////////////////////// //////////////////////////////////////////////////
//Status Effect EHs: //Status Effect EHs:
["setStatusEffect", {_this call FUNC(statusEffect_set)}] call FUNC(addEventHandler); [QGVAR(setStatusEffect), {_this call FUNC(statusEffect_set)}] call CBA_fnc_addEventHandler;
["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_dragging"]] call FUNC(statusEffect_addType); ["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_dragging"]] call FUNC(statusEffect_addType);
["blockSprint", false, []] call FUNC(statusEffect_addType); ["blockSprint", false, []] call FUNC(statusEffect_addType);
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), QEGVAR(medical,unconscious)]] call FUNC(statusEffect_addType); ["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType);
["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType); ["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType);
["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType); ["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType);
["forceWalk", { [QGVAR(forceWalk), {
params ["_object", "_set"]; params ["_object", "_set"];
TRACE_2("forceWalk EH",_object,_set); TRACE_2("forceWalk EH",_object,_set);
_object forceWalk (_set > 0); _object forceWalk (_set > 0);
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
["blockSprint", { //Name reversed from `allowSprint` because we want NOR logic [QGVAR(blockSprint), { //Name reversed from `allowSprint` because we want NOR logic
params ["_object", "_set"]; params ["_object", "_set"];
TRACE_2("blockSprint EH",_object,_set); TRACE_2("blockSprint EH",_object,_set);
_object allowSprint (_set == 0); _object allowSprint (_set == 0);
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
["setCaptive", { [QGVAR(setCaptive), {
params ["_object", "_set"]; params ["_object", "_set"];
TRACE_2("setCaptive EH",_object,_set); TRACE_2("setCaptive EH",_object,_set);
_object setCaptive (_set > 0); _object setCaptive (_set > 0);
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
["blockDamage", { //Name reversed from `allowDamage` because we want NOR logic [QGVAR(blockDamage), { //Name reversed from `allowDamage` because we want NOR logic
params ["_object", "_set"]; params ["_object", "_set"];
if ((_object isKindOf "CAManBase") && {(["ace_medical"] call FUNC(isModLoaded))}) then { if ((_object isKindOf "CAManBase") && {(["ace_medical"] call FUNC(isModLoaded))}) then {
TRACE_2("blockDamage EH (using medical)",_object,_set); TRACE_2("blockDamage EH (using medical)",_object,_set);
@ -90,12 +49,12 @@
TRACE_2("blockDamage EH (using allowDamage)",_object,_set); TRACE_2("blockDamage EH (using allowDamage)",_object,_set);
_object allowDamage (_set == 0); _object allowDamage (_set == 0);
}; };
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
["blockEngine", { [QGVAR(blockEngine), {
params ["_vehicle", "_set"]; params ["_vehicle", "_set"];
_vehicle setVariable [QGVAR(blockEngine), _set > 0, true]; _vehicle setVariable [QGVAR(blockEngine), _set > 0, true];
_vehicle engineOn false; _vehicle engineOn false;
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit //Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
//This variable is used for isPlayer checks //This variable is used for isPlayer checks
@ -116,7 +75,7 @@ if (isServer) then {
}; };
// Listens for global "SettingChanged" events, to update the force status locally // Listens for global "SettingChanged" events, to update the force status locally
["SettingChanged", { ["ace_settingChanged", {
params ["_name", "_value", "_force"]; params ["_name", "_value", "_force"];
if (_force) then { if (_force) then {
@ -126,46 +85,54 @@ if (isServer) then {
_settingData set [6, _force]; _settingData set [6, _force];
}; };
}] call FUNC(addEventhandler); }] call CBA_fnc_addEventHandler;
// Event to log Fix Headbug output // Event to log Fix Headbug output
["HeadbugFixUsed", { [QGVAR(headbugFixUsed), {
params ["_profileName", "_animation"]; params ["_profileName", "_animation"];
ACE_LOGINFO_2("Headbug Used: Name: %1, Animation: %2",_profileName,_animation); ACE_LOGINFO_2("Headbug Used: Name: %1, Animation: %2",_profileName,_animation);
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
["fixCollision", FUNC(fixCollision)] call FUNC(addEventhandler); [QGVAR(fixCollision), FUNC(fixCollision)] call CBA_fnc_addEventHandler;
["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler); [QGVAR(fixFloating), FUNC(fixFloating)] call CBA_fnc_addEventHandler;
["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); [QGVAR(fixPosition), FUNC(fixPosition)] call CBA_fnc_addEventHandler;
["loadPersonEvent", FUNC(loadPersonLocal)] call FUNC(addEventhandler); ["ace_loadPersonEvent", FUNC(loadPersonLocal)] call CBA_fnc_addEventHandler;
["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler); ["ace_unloadPersonEvent", FUNC(unloadPersonLocal)] call CBA_fnc_addEventHandler;
["lockVehicle", { [QGVAR(lockVehicle), {
_this setVariable [QGVAR(lockStatus), locked _this]; _this setVariable [QGVAR(lockStatus), locked _this];
_this lock 2; _this lock 2;
}] call FUNC(addEventhandler); }] call CBA_fnc_addEventHandler;
["unlockVehicle", { [QGVAR(unlockVehicle), {
_this lock (_this getVariable [QGVAR(lockStatus), locked _this]); _this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
}] call FUNC(addEventhandler); }] call CBA_fnc_addEventHandler;
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); [QGVAR(setDir), {(_this select 0) setDir (_this select 1)}] call CBA_fnc_addEventHandler;
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); [QGVAR(setFuel), {(_this select 0) setFuel (_this select 1)}] call CBA_fnc_addEventHandler;
["engineOn", {(_this select 0) engineOn (_this select 1)}] call FUNC(addEventhandler); [QGVAR(engineOn), {(_this select 0) engineOn (_this select 1)}] call CBA_fnc_addEventHandler;
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); [QGVAR(setSpeaker), {(_this select 0) setSpeaker (_this select 1)}] call CBA_fnc_addEventHandler;
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler); [QGVAR(selectLeader), {(_this select 0) selectLeader (_this select 1)}] call CBA_fnc_addEventHandler;
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler); [QGVAR(setVelocity), {(_this select 0) setVelocity (_this select 1)}] call CBA_fnc_addEventHandler;
["playMove", {(_this select 0) playMove (_this select 1)}] call FUNC(addEventHandler); [QGVAR(playMove), {(_this select 0) playMove (_this select 1)}] call CBA_fnc_addEventHandler;
["playMoveNow", {(_this select 0) playMoveNow (_this select 1)}] call FUNC(addEventHandler); [QGVAR(playMoveNow), {(_this select 0) playMoveNow (_this select 1)}] call CBA_fnc_addEventHandler;
["switchMove", {(_this select 0) switchMove (_this select 1)}] call FUNC(addEventHandler); [QGVAR(switchMove), {(_this select 0) switchMove (_this select 1)}] call CBA_fnc_addEventHandler;
["setVectorDirAndUp", {(_this select 0) setVectorDirAndUp (_this select 1)}] call FUNC(addEventHandler); [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler;
["setVanillaHitPointDamage", {(_this select 0) setHitPointDamage (_this select 1)}] call FUNC(addEventHandler); [QGVAR(setVanillaHitPointDamage), {(_this select 0) setHitPointDamage (_this select 1)}] call CBA_fnc_addEventHandler;
// Request framework
[QGVAR(requestCallback), FUNC(requestCallback)] call CBA_fnc_addEventHandler;
[QGVAR(receiveRequest), FUNC(receiveRequest)] call CBA_fnc_addEventHandler;
[QGVAR(systemChatGlobal), {systemChat _this}] call CBA_fnc_addEventHandler;
if (isServer) then { if (isServer) then {
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler); [QGVAR(hideObjectGlobal), {(_this select 0) hideObjectGlobal (_this select 1)}] call CBA_fnc_addEventHandler;
["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler); [QGVAR(enableSimulationGlobal), {(_this select 0) enableSimulationGlobal (_this select 1)}] call CBA_fnc_addEventHandler;
["ace_setOwner", {(_this select 0) setOwner (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(serverLog), FUNC(serverLog)] call CBA_fnc_addEventHandler;
}; };
@ -173,23 +140,19 @@ if (isServer) then {
// Set up remote execution // Set up remote execution
////////////////////////////////////////////////// //////////////////////////////////////////////////
// ACE events
"ACEg" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
"ACEc" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
// Synced ACE events // Synced ACE events
// Handle JIP scenario // Handle JIP scenario
if (!isServer) then { if (!isServer) then {
["PlayerJip", { ["ace_playerJIP", {
ACE_LOGINFO("JIP event synchronization initialized"); ACE_LOGINFO("JIP event synchronization initialized");
["SEH_all", [player]] call FUNC(serverEvent); ["ACEa", [player]] call CBA_fnc_serverEvent;
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
} else { } else {
["SEH_all", FUNC(_handleRequestAllSyncedEvents)] call FUNC(addEventHandler); ["ACEa", FUNC(_handleRequestAllSyncedEvents)] call CBA_fnc_addEventHandler;
}; };
["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); ["ACEe", FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler;
["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); ["ACEs", FUNC(_handleRequestSyncedEvent)] call CBA_fnc_addEventHandler;
if (isServer) then { if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
@ -222,16 +185,16 @@ call FUNC(checkFiles);
////////////////////////////////////////////////// //////////////////////////////////////////////////
// Set up SettingsInitialized eventhandler // Set up ace_settingsInitialized eventhandler
////////////////////////////////////////////////// //////////////////////////////////////////////////
["SettingsInitialized", { ["ace_settingsInitialized", {
[ [
GVAR(checkPBOsAction), GVAR(checkPBOsAction),
GVAR(checkPBOsCheckAll), GVAR(checkPBOsCheckAll),
GVAR(checkPBOsWhitelist) GVAR(checkPBOsWhitelist)
] call FUNC(checkPBOs) ] call FUNC(checkPBOs)
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;
// Create a pfh to wait until all postinits are ready and settings are initialized // Create a pfh to wait until all postinits are ready and settings are initialized
[{ [{
@ -258,7 +221,7 @@ call FUNC(checkFiles);
[] call FUNC(readSettingsFromParamsArray); [] call FUNC(readSettingsFromParamsArray);
}; };
// Event so that ACE_Modules have their settings loaded: // Event so that ACE_Modules have their settings loaded:
["InitSettingsFromModules", []] call FUNC(localEvent); [QGVAR(initSettingsFromModules), []] call CBA_fnc_localEvent;
if (isServer) then { if (isServer) then {
// Publish all settings data after all configs and modules are read // Publish all settings data after all configs and modules are read
@ -274,7 +237,7 @@ call FUNC(checkFiles);
ACE_LOGINFO("Settings initialized."); ACE_LOGINFO("Settings initialized.");
//Event that settings are safe to use: //Event that settings are safe to use:
["SettingsInitialized", []] call FUNC(localEvent); ["ace_settingsInitialized", []] call CBA_fnc_localEvent;
//Set init finished and run all delayed functions: //Set init finished and run all delayed functions:
GVAR(settingsInitFinished) = true; GVAR(settingsInitFinished) = true;
@ -307,12 +270,21 @@ call FUNC(assignedItemFix);
enableCamShake true; enableCamShake true;
//FUNC(showHud) needs to be refreshed if it was set during mission init
["ace_infoDisplayChanged", {
GVAR(showHudHash) params ["", "_masks"];
if (!(_masks isEqualTo [])) then {
[] call FUNC(showHud);
};
}] call CBA_fnc_addEventHandler;
////////////////////////////////////////////////// //////////////////////////////////////////////////
// Eventhandler to set player names // Eventhandler to set player names
////////////////////////////////////////////////// //////////////////////////////////////////////////
// Set the name for the current player // Set the name for the current player
["playerChanged", { ["ace_playerChanged", {
params ["_newPlayer","_oldPlayer"]; params ["_newPlayer","_oldPlayer"];
if (alive _newPlayer) then { if (alive _newPlayer) then {
@ -322,7 +294,7 @@ enableCamShake true;
if (alive _oldPlayer) then { if (alive _oldPlayer) then {
[_oldPlayer] call FUNC(setName); [_oldPlayer] call FUNC(setName);
}; };
}] call FUNC(addEventhandler); }] call CBA_fnc_addEventHandler;
////////////////////////////////////////////////// //////////////////////////////////////////////////
@ -334,6 +306,7 @@ GVAR(OldPlayerVehicle) = vehicle objNull;
GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex); GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex);
GVAR(OldPlayerWeapon) = currentWeapon objNull; GVAR(OldPlayerWeapon) = currentWeapon objNull;
GVAR(OldPlayerInventory) = []; GVAR(OldPlayerInventory) = [];
GVAR(OldPlayerInventoryNoAmmo) = [];
GVAR(OldPlayerVisionMode) = currentVisionMode objNull; GVAR(OldPlayerVisionMode) = currentVisionMode objNull;
GVAR(OldCameraView) = ""; GVAR(OldCameraView) = "";
GVAR(OldVisibleMap) = false; GVAR(OldVisibleMap) = false;
@ -353,7 +326,7 @@ GVAR(OldIsCamera) = false;
uiNamespace setVariable ["ACE_player", _data]; uiNamespace setVariable ["ACE_player", _data];
// Raise ACE event locally // Raise ACE event locally
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent); ["ace_playerChanged", [ACE_player, _oldPlayer]] call CBA_fnc_localEvent;
}; };
// "playerVehicleChanged" event // "playerVehicleChanged" event
@ -361,7 +334,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerVehicle)) then { if !(_data isEqualTo GVAR(OldPlayerVehicle)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldPlayerVehicle) = _data; GVAR(OldPlayerVehicle) = _data;
["playerVehicleChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_playerVehicleChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
// "playerTurretChanged" event // "playerTurretChanged" event
@ -369,7 +342,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerTurret)) then { if !(_data isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldPlayerTurret) = _data; GVAR(OldPlayerTurret) = _data;
["playerTurretChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_playerTurretChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
// "playerWeaponChanged" event // "playerWeaponChanged" event
@ -377,7 +350,7 @@ GVAR(OldIsCamera) = false;
if (_data != GVAR(OldPlayerWeapon)) then { if (_data != GVAR(OldPlayerWeapon)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldPlayerWeapon) = _data; GVAR(OldPlayerWeapon) = _data;
["playerWeaponChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_playerWeaponChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
// "playerInventoryChanged" event // "playerInventoryChanged" event
@ -385,7 +358,32 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerInventory)) then { if !(_data isEqualTo GVAR(OldPlayerInventory)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldPlayerInventory) = _data; GVAR(OldPlayerInventory) = _data;
["playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear) ]] call FUNC(localEvent);
// we don't want to trigger this just because your ammo counter decreased.
_data = + GVAR(OldPlayerInventory);
private _weaponInfo = _data param [0, []];
if !(_weaponInfo isEqualTo []) then {
_weaponInfo set [4, primaryWeaponMagazine ACE_player];
_weaponInfo deleteAt 5;
};
_weaponInfo = _data param [1, []];
if !(_weaponInfo isEqualTo []) then {
_weaponInfo set [4, secondaryWeaponMagazine ACE_player];
_weaponInfo deleteAt 5;
};
_weaponInfo = _data param [2, []];
if !(_weaponInfo isEqualTo []) then {
_weaponInfo set [4, handgunMagazine ACE_player];
_weaponInfo deleteAt 5;
};
if !(_data isEqualTo GVAR(OldPlayerInventoryNoAmmo)) then {
GVAR(OldPlayerInventoryNoAmmo) = _data;
["ace_playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear)]] call CBA_fnc_localEvent;
};
}; };
// "playerVisionModeChanged" event // "playerVisionModeChanged" event
@ -393,7 +391,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerVisionMode)) then { if !(_data isEqualTo GVAR(OldPlayerVisionMode)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldPlayerVisionMode) = _data; GVAR(OldPlayerVisionMode) = _data;
["playerVisionModeChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_playerVisionModeChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
// "cameraViewChanged" event // "cameraViewChanged" event
@ -401,7 +399,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldCameraView)) then { if !(_data isEqualTo GVAR(OldCameraView)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldCameraView) = _data; GVAR(OldCameraView) = _data;
["cameraViewChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_cameraViewChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
// "visibleMapChanged" event // "visibleMapChanged" event
@ -409,7 +407,7 @@ GVAR(OldIsCamera) = false;
if (!_data isEqualTo GVAR(OldVisibleMap)) then { if (!_data isEqualTo GVAR(OldVisibleMap)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldVisibleMap) = _data; GVAR(OldVisibleMap) = _data;
["visibleMapChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_visibleMapChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
// "activeCameraChanged" event // "activeCameraChanged" event
@ -417,7 +415,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldIsCamera)) then { if !(_data isEqualTo GVAR(OldIsCamera)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldIsCamera) = _data; GVAR(OldIsCamera) = _data;
["activeCameraChanged", [ACE_player, _data]] call FUNC(localEvent); ["ace_activeCameraChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
}; };
END_COUNTER(stateChecker); END_COUNTER(stateChecker);
@ -428,18 +426,18 @@ GVAR(OldIsCamera) = false;
// Eventhandlers for player controlled machines // Eventhandlers for player controlled machines
////////////////////////////////////////////////// //////////////////////////////////////////////////
["displayTextStructured", {_this call FUNC(displayTextStructured)}] call FUNC(addEventhandler); [QGVAR(displayTextStructured), {_this call FUNC(displayTextStructured)}] call CBA_fnc_addEventHandler;
["displayTextPicture", {_this call FUNC(displayTextPicture)}] call FUNC(addEventhandler); [QGVAR(displayTextPicture), {_this call FUNC(displayTextPicture)}] call CBA_fnc_addEventHandler;
["medical_onUnconscious", { ["ace_unconscious", {
params ["_unit", "_isUnconscious"]; params ["_unit", "_isUnconscious"];
if (local _unit && {!_isUnconscious}) then { if (local _unit && {!_isUnconscious}) then {
[_unit, false, QFUNC(loadPerson), west /* dummy side */] call FUNC(switchToGroupSide); [_unit, false, QFUNC(loadPerson), west /* dummy side */] call FUNC(switchToGroupSide);
}; };
}] call FUNC(addEventhandler); }] call CBA_fnc_addEventHandler;
["useItem", DFUNC(useItem)] call FUNC(addEventHandler); ["ace_useItem", DFUNC(useItem)] call CBA_fnc_addEventHandler;
////////////////////////////////////////////////// //////////////////////////////////////////////////
@ -477,7 +475,7 @@ if (didJip) then {
// We are jipping! Get ready and wait, and throw the event // We are jipping! Get ready and wait, and throw the event
[{ [{
if(!isNull player && GVAR(settingsInitFinished)) then { if(!isNull player && GVAR(settingsInitFinished)) then {
["PlayerJip", [player]] call FUNC(localEvent); ["ace_playerJIP", [player]] call CBA_fnc_localEvent;
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
}, 0, []] call CBA_fnc_addPerFrameHandler; }, 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -5,10 +5,6 @@ ADDON = false;
#include "XEH_PREP.hpp" #include "XEH_PREP.hpp"
//ACE events global variables
GVAR(eventsLocation) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
GVAR(eventsLocation) setText QGVAR(eventsLocation);
// backwards comp // backwards comp
DFUNC(canUseWeapon) = { DFUNC(canUseWeapon) = {
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon"); ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");
@ -23,13 +19,6 @@ DFUNC(selectWeaponMode) = {
GVAR(syncedEvents) = HASH_CREATE; GVAR(syncedEvents) = HASH_CREATE;
GVAR(showHudHash) = [] call FUNC(hashCreate); GVAR(showHudHash) = [] call FUNC(hashCreate);
//GVARS for execNextFrame and waitAndExec and waitUntilAndExecute
GVAR(waitAndExecArray) = [];
GVAR(nextFrameNo) = diag_frameno;
GVAR(nextFrameBufferA) = [];
GVAR(nextFrameBufferB) = [];
GVAR(waitUntilAndExecArray) = [];
GVAR(settingsInitFinished) = false; GVAR(settingsInitFinished) = false;
GVAR(runAtSettingsInitialized) = []; GVAR(runAtSettingsInitialized) = [];
@ -46,6 +35,8 @@ if (isServer) then {
GVAR(statusEffect_Names) = []; GVAR(statusEffect_Names) = [];
GVAR(statusEffect_isGlobal) = []; GVAR(statusEffect_isGlobal) = [];
GVAR(setHearingCapabilityMap) = [];
////////////////////////////////////////////////// //////////////////////////////////////////////////
// Set up PlayerChanged eventhandler for pre init (EH is installed in postInit) // Set up PlayerChanged eventhandler for pre init (EH is installed in postInit)
////////////////////////////////////////////////// //////////////////////////////////////////////////
@ -53,20 +44,6 @@ GVAR(statusEffect_isGlobal) = [];
ACE_player = objNull; ACE_player = objNull;
uiNamespace setVariable ["ACE_player", objNull]; uiNamespace setVariable ["ACE_player", objNull];
//////////////////////////////////////////////////
// Time handling
//////////////////////////////////////////////////
ACE_time = diag_tickTime;
ACE_realTime = diag_tickTime;
ACE_virtualTime = diag_tickTime;
ACE_diagTime = diag_tickTime;
ACE_gameTime = time;
ACE_pausedTime = 0;
ACE_virtualPausedTime = 0;
[FUNC(timePFH), 0, []] call CBA_fnc_addPerFrameHandler;
// Init toHex // Init toHex
[0] call FUNC(toHex); [0] call FUNC(toHex);

View File

@ -6,12 +6,77 @@ class CfgPatches {
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main","ace_modules"}; requiredAddons[] = {"ace_main","ace_modules"};
author[] = {"KoffeinFlummi"}; author = CSTRING(ACETeam);
authorUrl = "https://github.com/KoffeinFlummi/"; authors[] = {"KoffeinFlummi"};
url = ECSTRING(main,URL);
VERSION_CONFIG_COMMON; VERSION_CONFIG_COMMON;
}; };
}; };
// This class will be deprecated in version 3.8.0
class ACE_newEvents {
// Status effect events
forceWalk = QGVAR(forceWalk);
blockSprint = QGVAR(blockSprint);
setCaptive = QGVAR(setCaptive);
blockDamage = QGVAR(blockDamage);
blockEngine = QGVAR(blockEngine);
// Public listenable events
PlayerJip = "ace_playerJIP";
activeCameraChanged = "ace_activeCameraChanged";
visibleMapChanged = "ace_visibleMapChanged";
cameraViewChanged = "ace_cameraViewChanged";
playerVisionModeChanged = "ace_playerVisionModeChanged";
playerInventoryChanged = "ace_playerInventoryChanged";
playerWeaponChanged = "ace_playerWeaponChanged";
playerTurretChanged = "ace_playerTurretChanged";
playerVehicleChanged = "ace_playerVehicleChanged";
playerChanged = "ace_playerChanged";
SettingsInitialized = "ace_settingsInitialized";
SettingChanged = "ace_settingChanged";
firedNonPlayerVehicle = "ace_firedNonPlayerVehicle";
firedPlayerVehicleNonLocal = "ace_firedPlayerVehicleNonLocal";
firedPlayerVehicle = "ace_firedPlayerVehicle";
firedNonPlayer = "ace_firedNonPlayer";
firedPlayerNonLocal = "ace_firedPlayerNonLocal";
firedPlayer = "ace_firedPlayer";
unloadPersonEvent = "ace_unloadPersonEvent";
loadPersonEvent = "ace_loadPersonEvent";
useItem = "ace_useItem";
infoDisplayChanged = "ace_infoDisplayChanged";
// Internal callable events
setStatusEffect = QGVAR(setStatusEffect);
HeadbugFixUsed = QGVAR(headbugFixUsed);
InitSettingsFromModules = QGVAR(initSettingsFromModules);
enableSimulationGlobal = QGVAR(enableSimulationGlobal);
hideObjectGlobal = QGVAR(hideObjectGlobal);
fixPosition = QGVAR(fixPosition);
fixFloating = QGVAR(fixFloating);
fixCollision = QGVAR(fixCollision);
unlockVehicle = QGVAR(unlockVehicle);
lockVehicle = QGVAR(lockVehicle);
displayTextPicture = QGVAR(displayTextPicture);
displayTextStructured = QGVAR(displayTextStructured);
setVanillaHitPointDamage = QGVAR(setVanillaHitPointDamage);
setVectorDirAndUp = QGVAR(setVectorDirAndUp);
switchMove = QGVAR(switchMove);
playMoveNow = QGVAR(playMoveNow);
playMove = QGVAR(playMove);
setVelocity = QGVAR(setVelocity);
selectLeader = QGVAR(selectLeader);
setSpeaker = QGVAR(setSpeaker);
engineOn = QGVAR(engineOn);
setFuel = QGVAR(setFuel);
setDir = QGVAR(setDir);
// Events framework
SEH_s = "ACEs";
SEH = "ACEe";
SEH_all = "ACEa";
};
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgLocationTypes.hpp" #include "CfgLocationTypes.hpp"

View File

@ -1,81 +0,0 @@
/*
* Author: jaynus
* Internal net event handler.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_eventType", "_event"];
if (_eventType == "ACEg") then {
_event params ["_eventName", "_eventArgs"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (!isNil "_eventFunctions") then {
#ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Net Event %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
{
if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Net Event %1 ID: %2",_eventName,_forEachIndex));
#ifdef DEBUG_EVENTS_CALLSTACK
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
#endif
};
} forEach _eventFunctions;
};
};
if (_eventType == "ACEc") then {
if (isServer) then {
_event params ["_eventName", "_eventTargets", "_eventArgs"];
private _sentEvents = [];
if (!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets];
};
//If not multiplayer, and there are targets, then just run localy
if (!isMultiplayer && {count _eventTargets > 0}) exitWith {
ACEg = [_eventName, _eventArgs];
["ACEg", ACEg] call FUNC(_handleNetEvent);
};
private _serverFlagged = false;
{
private _owner = _x;
if (IS_OBJECT(_x)) then {
_owner = owner _x;
};
if !(_owner in _sentEvents) then {
_sentEvents pushBack _owner;
ACEg = [_eventName, _eventArgs];
if (isDedicated || {_x != ACE_player}) then {
if (isDedicated && {local _x} && {!_serverFlagged}) then {
_serverFlagged = true;
["ACEg", ACEg] call FUNC(_handleNetEvent);
} else {
_owner publicVariableClient "ACEg";
};
} else {
["ACEg", ACEg] call FUNC(_handleNetEvent);
};
};
false
} count _eventTargets;
};
};

View File

@ -18,7 +18,7 @@ params ["_client"];
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x); private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"]; _eventEntry params ["", "_eventLog"];
["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); ["ACEs", [_x, _eventLog], _client] call CBA_fnc_targetEvent;
false false
} count (GVAR(syncedEvents) select 0); } count (GVAR(syncedEvents) select 0);

View File

@ -30,7 +30,7 @@ if (isServer) then {
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventEntry params ["", "_eventLog"]; _eventEntry params ["", "_eventLog"];
["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent); ["ACEs", [_eventName, _eventLog], _client] call CBA_fnc_targetEvent;
} else { } else {
params ["_eventName", "_eventLog"]; params ["_eventName", "_eventLog"];

View File

@ -29,7 +29,7 @@ if (isServer) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name); _internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"]; _internalData params ["", "_eventLog"];
_eventLog pushBack [ACE_diagTime, _args, _ttl]; _eventLog pushBack [diag_tickTime, _args, _ttl];
}; };
}; };

View File

@ -1,25 +1,14 @@
/* #define DEBUG_MODE_FULL
* Author: Nou
* Add an event handler.
*
* Arguments:
* 0: Event name <STRING>
* 1: Event code <CODE>
*
* Return Value:
* Event handler ID number (for use with fnc_removeEventHandler) <NUMBER>
*
* Public: Yes
*/
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventCode"]; params ["_eventName", "_eventCode"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
if (isNil "_eventFunctions") then { TRACE_2("Switching Names",_eventName,_newName);
_eventFunctions = []; _eventName = _newName;
GVAR(eventsLocation) setVariable [_eventName, _eventFunctions];
}; };
_eventFunctions pushBack _eventCode // Return event function count [_eventName, _eventCode] call CBA_fnc_addEventHandler;
ACE_DEPRECATED("ace_common_fnc_addEventHandler","3.8.0","CBA_fnc_addEventHandler");

View File

@ -37,4 +37,4 @@ missionNamespace setVariable [_name, _value];
GVAR(settings) pushBack _this; GVAR(settings) pushBack _this;
// Raise event locally // Raise event locally
["SettingChanged", [_name, _value]] call FUNC(localEvent); ["ace_settingChanged", [_name, _value]] call CBA_fnc_localEvent;

View File

@ -24,7 +24,7 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
false false
}; };
private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler;
private _data = [_handler, [], _ttl, _eventId]; private _data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data); HASH_SET(GVAR(syncedEvents),_name,_data);

View File

@ -28,7 +28,7 @@ GVAR(AssignedItemsShownItems) = [
ACE_isGPSEnabled ACE_isGPSEnabled
]; ];
["playerInventoryChanged", { ["ace_playerInventoryChanged", {
params ["_unit"]; params ["_unit"];
private _assignedItems = getUnitLoadout _unit param [9, ["","","","","",""]]; // ["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch","NVGoggles"] private _assignedItems = getUnitLoadout _unit param [9, ["","","","","",""]]; // ["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch","NVGoggles"]
@ -48,4 +48,4 @@ GVAR(AssignedItemsShownItems) = [
showWatch _showWatch; showWatch _showWatch;
showRadio _showRadio; showRadio _showRadio;
showGPS (_showGPS || {cameraOn == getConnectedUAV _unit}); //If player is activly controling a UAV, showGPS controls showing the map (m key) showGPS (_showGPS || {cameraOn == getConnectedUAV _unit}); //If player is activly controling a UAV, showGPS controls showing the map (m key)
}] call FUNC(addEventHandler); }] call CBA_fnc_addEventHandler;

View File

@ -15,18 +15,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params [["_unit", objNull, [objNull]]]; ACE_DEPRECATED("ace_common_fnc_binocularMagazine","3.8.0","CBA_fnc_binocularMagazine");
private _binocular = binocular _unit; _this call CBA_fnc_binocularMagazine
scopeName "main";
{
if ((_x select 0) isEqualTo _binocular) then {
// note: if there is no magazine, _x(4,0) will be nil, which skips the breakOut.
(_x select 4 select 0) breakOut "main";
};
false
} count weaponsitems _unit;
""

View File

@ -19,8 +19,8 @@
params ["_params", "_function", "_namespace", "_uid", "_duration", "_event"]; params ["_params", "_function", "_namespace", "_uid", "_duration", "_event"];
if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then { if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then {
_namespace setVariable [_uid, [ACE_diagTime + _duration, _params call _function]]; _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
// Does the cache needs to be cleared on an event? // Does the cache needs to be cleared on an event?
if (!isNil "_event") then { if (!isNil "_event") then {
@ -46,7 +46,7 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then {
} forEach _cacheList; } forEach _cacheList;
// Empty the list // Empty the list
missionNamespace setVariable [_varName, []]; missionNamespace setVariable [_varName, []];
}] call FUNC(addEventhandler); }] call CBA_fnc_addEventHandler;
}; };
// Add this cache to the list of the event // Add this cache to the list of the event

View File

@ -61,7 +61,8 @@ if (!isServer) then {
_error = _error + "Newer version; "; _error = _error + "Newer version; ";
}; };
//[_error, "{systemChat _this}"] call FUNC(execRemoteFnc); //[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
ACE_LOGERROR(_error); ACE_LOGERROR(_error);
if (_mode < 2) then { if (_mode < 2) then {
@ -79,7 +80,7 @@ if (!isServer) then {
params ["_rscLayer"]; params ["_rscLayer"];
TRACE_2("Hiding Error message after 10 seconds",time,_rscLayer); TRACE_2("Hiding Error message after 10 seconds",time,_rscLayer);
_rscLayer cutFadeOut 0.2; _rscLayer cutFadeOut 0.2;
}, [_rscLayer], 10] call FUNC(waitAndExecute); }, [_rscLayer], 10] call CBA_fnc_waitAndExecute;
}; };
}; };
@ -89,7 +90,7 @@ if (!isServer) then {
TRACE_2("Player is alive, showing msg and exiting",time,_text); TRACE_2("Player is alive, showing msg and exiting",time,_text);
_text = composeText [parseText format ["<t align='center'>%1</t>", _text]]; _text = composeText [parseText format ["<t align='center'>%1</t>", _text]];
["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); ["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
}, [_text]] call FUNC(waitUntilAndExecute); }, [_text]] call CBA_fnc_waitUntilAndExecute;
}; };
}; };

View File

@ -28,9 +28,9 @@ _target setVariable [QGVAR(owner), _unit, true];
// lock target object // lock target object
if (_lockTarget) then { if (_lockTarget) then {
if (!isNull _unit) then { if (!isNull _unit) then {
["lockVehicle", _target, _target] call FUNC(targetEvent); [QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent;
} else { } else {
["unlockVehicle", _target, _target] call FUNC(targetEvent); [QGVAR(unlockVehicle), _target, _target] call CBA_fnc_targetEvent;
}; };
}; };

View File

@ -0,0 +1,63 @@
/*
* Author: Glowbal
* Mark a component as deprecated and switches it to a new component if that is available
*
* Arguments:
* 0: Component <Array>
* 1: New component <Array>
* 2: Version when the compent will be removed <String>
*
* Return Value:
* Replaced by new component <Boolean>
*
* Public: No
*
* Example:
* [["ace_sitting", "ace_sitting_enabled"], ["acex_sitting", "acex_sitting_enabled"], "3.7.0"] call ace_common_fnc_deprecateComponent;
*/
#include "script_component.hpp"
params ["_oldComponent", "_newComponent", "_version"];
_oldComponent params ["_oldComponentName", "_oldSettingName"];
_newComponent params ["_newComponentName", "_newSettingName"];
private _isReplacementAvailable = isClass (configFile >> "CfgPatches" >> _newComponentName);
private _isDeprecatedLoaded = missionNamespace getvariable [_oldSettingName, false];
private _isReplacementLoaded = missionNamespace getvariable [_newSettingName, false];
if (_isDeprecatedLoaded && {_isReplacementAvailable} && {!_isReplacementLoaded}) then {
[_newSettingName, true, true, true] call FUNC(setSetting);
};
if (_isDeprecatedLoaded && {!_isReplacementLoaded}) then {
private _componentVersion = getText (configFile >> "CfgPatches" >> _oldComponentName >> "version");
((_componentVersion splitString ".") apply {parseNumber _x}) params ["_componentMajor", "_componentMinor", "_componentPatch"];
((_version splitString ".") apply {parseNumber _x}) params ["_major", "_minor", "_patch"];
switch (true) do {
case (_componentMajor >= _major && {_componentMinor >= _minor} && {_componentPatch >= _patch}): { // Removed from this version
private _message = format[
"Component %1 is deprecated. It has been replaced by %2. The component %1 is no longer usable on this version. ", _oldComponentName, _newComponentName, _version];
systemChat format["ACE [ERROR] - %1", _message];
ACE_LOGERROR(_message);
};
case (_componentMajor >= _major && {_componentMinor >= _minor-1}): { // Removed the next this version
private _message = format[
"Component %1 is deprecated. It is replaced by %2. Please disable %1 and make use of %2. "
+ "The component (%1) will no longer be available from version %3 and later.", _oldComponentName, _newComponentName, _version];
systemChat format["ACE [WARNING] - %1", _message];
ACE_LOGWARNING(_message);
};
case (_componentMajor == _major && {_componentMinor >= _minor - 2}): { // we are in a version leading up to removal
private _message = format[
"Component %1 is deprecated. It is replaced by %2. Please disable %1 and make use of %2. "
+ "The component (%1) will no longer be available from version %3 and later.", _oldComponentName, _newComponentName, _version];
ACE_LOGWARNING(_message);
};
default {
};
};
};
_isReplacementAvailable;

View File

@ -13,7 +13,7 @@
* None * None
* *
* Example: * Example:
* [(localize "STR_ACE_microdagr_itemName"), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditionCode, _toggleCode, _closeCode] call ace_common_fnc_deviceKeyRegisterNew * [(localize "STR_ACE_microdagr_itemName"), QPATHTOF(images\microDAGR_item.paa), _conditionCode, _toggleCode, _closeCode] call ace_common_fnc_deviceKeyRegisterNew
* *
* Public: No * Public: No
*/ */

View File

@ -14,7 +14,7 @@
* None * None
* *
* Example: * Example:
* ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon; * ["myID", true, QPATHTOF(data\icon_group.paa), [1,1,1,1], 0] call ace_gui_fnc_displayIcon;
* *
* Public: Yes * Public: Yes
*/ */
@ -89,11 +89,11 @@ private _refresh = {
if (_show) then { if (_show) then {
if ({_x select 0 == _iconId} count _list == 0) then { if ({_x select 0 == _iconId} count _list == 0) then {
_list pushBack [_iconId, _icon, _color, ACE_time]; _list pushBack [_iconId, _icon, _color, CBA_missionTime];
} else { } else {
{ {
if (_x select 0 == _iconId) exitWith { if (_x select 0 == _iconId) exitWith {
_list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]]; _list set [_forEachIndex, [_iconId, _icon, _color, CBA_missionTime]];
}; };
} forEach _list; } forEach _list;
}; };
@ -104,7 +104,7 @@ if (_show) then {
if (_timeAlive >= 0) then { if (_timeAlive >= 0) then {
[{ [{
[_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon);
}, [_iconId], _timeAlive, _timeAlive] call FUNC(waitAndExecute); }, [_iconId], _timeAlive, _timeAlive] call CBA_fnc_waitAndExecute;
}; };
} else { } else {

View File

@ -25,7 +25,7 @@ if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
GVAR(lastHint) params ["_lastHintTime", "_lastHintPriority"]; GVAR(lastHint) params ["_lastHintTime", "_lastHintPriority"];
private _time = ACE_time; private _time = CBA_missionTime;
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
hintSilent _text; hintSilent _text;
@ -33,5 +33,5 @@ if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
GVAR(lastHint) set [0, _time]; GVAR(lastHint) set [0, _time];
GVAR(lastHint) set [1, _priority]; GVAR(lastHint) set [1, _priority];
[{if ((_this select 0) == GVAR(lastHint) select 0) then {hintSilent ""};}, [_time], _delay, 0] call FUNC(waitAndExecute); [{if ((_this select 0) == GVAR(lastHint) select 0) then {hintSilent ""};}, [_time], _delay, 0] call CBA_fnc_waitAndExecute;
}; };

View File

@ -5,17 +5,22 @@
* Arguments: * Arguments:
* 0: Text <ANY> * 0: Text <ANY>
* 1: Image <STRING> * 1: Image <STRING>
* 2: Image color (default: [0, 0, 0, 0]) <ARRAY> * 2: Image color <ARRAY> (default: [1, 1, 1])
* 3: Target Unit. Will only display if target is the player controlled object (default: ACE_player) <OBJECT> * 3: Target Unit. Will only display if target is the player controlled object <OBJECT> (default: ACE_player)
* 4: Size <NUMBER> (default: 2)
* *
* Return Value: * Return Value:
* None * None
* *
* Example:
* ["text", "image", [1, 1, 1], ACE_player, 2] call ace_common_fnc_displayTextPicture
* ["text", "image", nil, nil, 3] call ace_common_fnc_displayTextPicture
*
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_text", "_image", ["_imageColor", [1,1,1]], ["_target", ACE_player]]; params [["_text", ""], ["_image", "", [""]], ["_imageColor", [1,1,1], [[]]], ["_target", ACE_player, [objNull]], ["_size", 2, [0]]];
if (_target != ACE_player) exitWith {}; if (_target != ACE_player) exitWith {};
@ -41,4 +46,4 @@ if (typeName _text != "TEXT") then {
_text = composeText [parseText format ["<img size='2' align='center' color='%2' image='%1'/>", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text]; _text = composeText [parseText format ["<img size='2' align='center' color='%2' image='%1'/>", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
[_text, 2] call FUNC(displayTextStructured); [_text, _size] call FUNC(displayTextStructured);

View File

@ -4,17 +4,20 @@
* *
* Arguments: * Arguments:
* 0: Text <ANY> * 0: Text <ANY>
* 1: Size of the textbox (default: 1.5) <NUMBER> * 1: Size of the textbox <NUMBER> (default: 1.5)
* 2: Target Unit. Will only display if target is the player controlled object (default: ACE_player) <OBJECT> * 2: Target Unit. Will only display if target is the player controlled object <OBJECT> (default: ACE_player)
* *
* Return Value: * Return Value:
* None * None
* *
* Example:
*
*
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_text", ["_size", 1.5], ["_target", ACE_player]]; params [["_text", ""], ["_size", 1.5, [0]], ["_target", ACE_player, [objNull]]];
if (_target != ACE_player) exitWith {}; if (_target != ACE_player) exitWith {};

View File

@ -41,34 +41,34 @@ TRACE_2("",local _unit,vehicle _unit);
switch (_priority) do { switch (_priority) do {
case 0: { case 0: {
if (_unit == vehicle _unit) then { if (_unit == vehicle _unit) then {
["playMove", _unit, [_unit, _animation]] call FUNC(objectEvent); [QGVAR(playMove), [_unit, _animation], _unit] call CBA_fnc_targetEvent;
} else { } else {
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
["playMove", [_unit, _animation]] call FUNC(globalEvent); [QGVAR(playMove), [_unit, _animation]] call CBA_fnc_globalEvent;
}; };
}; };
case 1: { case 1: {
if (_unit == vehicle _unit) then { if (_unit == vehicle _unit) then {
["playMoveNow", _unit, [_unit, _animation]] call FUNC(objectEvent); [QGVAR(playMoveNow), [_unit, _animation], _unit] call CBA_fnc_targetEvent;
} else { } else {
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
["playMoveNow", [_unit, _animation]] call FUNC(globalEvent); [QGVAR(playMoveNow), [_unit, _animation]] call CBA_fnc_globalEvent;
}; };
}; };
case 2: { case 2: {
// try playMoveNow first // try playMoveNow first
if (_unit == vehicle _unit) then { if (_unit == vehicle _unit) then {
["playMoveNow", _unit, [_unit, _animation]] call FUNC(objectEvent); [QGVAR(playMoveNow), [_unit, _animation], _unit] call CBA_fnc_targetEvent;
} else { } else {
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
["playMoveNow", [_unit, _animation]] call FUNC(globalEvent); [QGVAR(playMoveNow), [_unit, _animation]] call CBA_fnc_globalEvent;
}; };
// if animation doesn't respond, do switchMove // if animation doesn't respond, do switchMove
if (animationState _unit != _animation) then { if (animationState _unit != _animation) then {
TRACE_1("did not respond to playMoveNow",animationState _unit); TRACE_1("did not respond to playMoveNow",animationState _unit);
// Execute on all machines. SwitchMove has local effects. // Execute on all machines. SwitchMove has local effects.
["switchMove", [_unit, _animation]] call FUNC(globalEvent); [QGVAR(switchMove), [_unit, _animation]] call CBA_fnc_globalEvent;
}; };
}; };
default {}; default {};

View File

@ -13,10 +13,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_func", "_params"]; ACE_DEPRECATED("ace_common_fnc_execNextFrame","3.8.0","CBA_fnc_execNextFrame");
if (diag_frameno != GVAR(nextFrameNo)) then { _this call CBA_fnc_execNextFrame;
GVAR(nextFrameBufferA) pushBack [_params, _func];
} else {
GVAR(nextFrameBufferB) pushBack [_params, _func];
};

View File

@ -26,12 +26,12 @@ TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile
if (_unit isKindOf "CAManBase") then { if (_unit isKindOf "CAManBase") then {
// The unit it on foot // The unit it on foot
if (_unit == ACE_player) then { if (_unit == ACE_player) then {
["firedPlayer", _this] call FUNC(localEvent); ["ace_firedPlayer", _this] call CBA_fnc_localEvent;
} else { } else {
if ([_unit] call EFUNC(common,isPlayer)) then { if ([_unit] call EFUNC(common,isPlayer)) then {
["firedPlayerNonLocal", _this] call FUNC(localEvent); ["ace_firedPlayerNonLocal", _this] call CBA_fnc_localEvent;
} else { } else {
["firedNonPlayer", _this] call FUNC(localEvent); ["ace_firedNonPlayer", _this] call CBA_fnc_localEvent;
}; };
}; };
} else { } else {
@ -55,12 +55,12 @@ if (_unit isKindOf "CAManBase") then {
}; };
if (_gunner == ACE_player) then { if (_gunner == ACE_player) then {
["firedPlayerVehicle", _this] call FUNC(localEvent); ["ace_firedPlayerVehicle", _this] call CBA_fnc_localEvent;
} else { } else {
if ([_gunner] call EFUNC(common,isPlayer)) then { if ([_gunner] call EFUNC(common,isPlayer)) then {
["firedPlayerVehicleNonLocal", _this] call FUNC(localEvent); ["ace_firedPlayerVehicleNonLocal", _this] call CBA_fnc_localEvent;
} else { } else {
["firedNonPlayerVehicle", _this] call FUNC(localEvent); ["ace_firedNonPlayerVehicle", _this] call CBA_fnc_localEvent;
}; };
}; };
}; };

View File

@ -19,4 +19,4 @@ if (!local _this) exitWith {};
[_this, "blockDamage", "fixCollision", true] call FUNC(statusEffect_set); [_this, "blockDamage", "fixCollision", true] call FUNC(statusEffect_set);
// re-allow damage after 2 seconds // re-allow damage after 2 seconds
[{[_this, "blockDamage", "fixCollision", false] call FUNC(statusEffect_set);}, _this, 2] call EFUNC(common,waitAndExecute); [{[_this, "blockDamage", "fixCollision", false] call FUNC(statusEffect_set);}, _this, 2] call CBA_fnc_waitAndExecute;

View File

@ -21,7 +21,7 @@ if (!local _object) exitWith {};
if (_object isKindOf "CAManBase") exitWith {}; if (_object isKindOf "CAManBase") exitWith {};
//We need to manually set allowDamage to true for setHitIndex to function //We need to manually set allowDamage to true for setHitIndex to function
["blockDamage", [_object, 0]] call FUNC(localEvent); [QGVAR(blockDamage), [_object, 0]] call CBA_fnc_localEvent;
// save and restore hitpoints, see below why // save and restore hitpoints, see below why
private _hitPointDamages = getAllHitPointsDamage _object; private _hitPointDamages = getAllHitPointsDamage _object;
@ -41,4 +41,4 @@ _object setDamage damage _object;
//manually re-enable allowDamage to previous setting (ref statusEffect_funcs) //manually re-enable allowDamage to previous setting (ref statusEffect_funcs)
private _effectVarName = format [QGVAR(effect_%1), "blockDamage"]; private _effectVarName = format [QGVAR(effect_%1), "blockDamage"];
private _effectNumber = _object getVariable [_effectVarName, 0]; private _effectNumber = _object getVariable [_effectVarName, 0];
["blockDamage", [_object, _effectNumber]] call FUNC(localEvent); [QGVAR(blockDamage), [_object, _effectNumber]] call CBA_fnc_localEvent;

View File

@ -64,5 +64,5 @@ if (isNull _unit) exitWith {[
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit, handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
assignedItems _unit, assignedItems _unit,
binocular _unit, binocular _unit,
[_unit] call FUNC(binocularMagazine) [_unit] call CBA_fnc_binocularMagazine
] ]

View File

@ -12,12 +12,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_item"]; ACE_DEPRECATED("ace_common_fnc_getConfigType","3.8.0","CBA_fnc_getItemConfig");
if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"}; configName (configHierarchy (_item call CBA_fnc_getItemConfig) param [1, configNull])
if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"};
if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"};
""

View File

@ -12,10 +12,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_object"]; ACE_DEPRECATED("ace_common_fnc_getConfigTypeObject","3.8.0","CBA_fnc_getObjectConfig");
if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"}; configName (configHierarchy (_item call CBA_fnc_getObjectConfig) param [1, configNull])
if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"};
""

View File

@ -15,9 +15,11 @@
params ["_item"]; params ["_item"];
private _cfgType = [_item] call FUNC(getConfigType); private _config = _item call CBA_fnc_getItemConfig;
if (_cfgType == "") exitWith {["", ""]}; if (isNull _config) exitWith {["", ""]};
private _cfgType = configName ((configHierarchy _config) param [1, configNull]);
if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]}; if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]};

View File

@ -14,19 +14,4 @@
params [["_vehicle", objNull, [objNull]]]; params [["_vehicle", objNull, [objNull]]];
private _turrets = allTurrets [_vehicle, true]; fullCrew [_vehicle, "commander", true] apply {_x select 3} param [0, []] // return
private _turret = [];
{
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
if (getNumber (_config >> "primaryObserver") == 1) exitWith {
_turret = _x;
};
false
} count _turrets;
_turret

View File

@ -14,19 +14,6 @@
params [["_vehicle", objNull, [objNull]]]; params [["_vehicle", objNull, [objNull]]];
private _turrets = allTurrets [_vehicle, true]; fullCrew [_vehicle, "turret", true] apply {_x select 3} select {
getNumber ([_vehicle, _x] call CBA_fnc_getTurret >> "isCopilot") == 1
private _turret = []; } param [0, []] // return
{
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith {
_turret = _x;
};
false
} count _turrets;
_turret

View File

@ -14,19 +14,4 @@
params [["_vehicle", objNull, [objNull]]]; params [["_vehicle", objNull, [objNull]]];
private _turrets = allTurrets [_vehicle, true]; fullCrew [_vehicle, "gunner", true] apply {_x select 3} param [0, []] // return
private _turret = [];
{
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
if (getNumber (_config >> "primaryGunner") == 1) exitWith {
_turret = _x;
};
false
} count _turrets;
_turret

Some files were not shown because too many files have changed in this diff Show More