Merge branch 'master' into explosiveInteraction

This commit is contained in:
Garth L-H de Wet 2015-03-09 20:07:42 +02:00
commit ece4c8e0bc
426 changed files with 6595 additions and 11564 deletions

View File

@ -15,7 +15,7 @@
</p>
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a> | <a href="#">BIF thread</a></strong></sup></p>
**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM**, **CSE** and **RHS** to improve the realism and authenticity of Arma 3.
**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project).
@ -32,7 +32,7 @@ More information on the purpose of the different components of ACE and which one
* Realistic ballistics including wind and humidity
* Backblast simulation
* Weapon resting and bipod deployment
* A fire control system for armored vehicles and helicopters
* A fire control system for armored vehicles and helicopters
***and more...***
For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki).

Binary file not shown.

View File

@ -217,9 +217,8 @@ class CfgVehicles {
};*/
};
class I_Heli_Transport_02_F: Heli_Transport_02_base_F {};
class I_Heli_light_03_base_F: Helicopter_Base_F {
class Heli_light_03_base_F: Helicopter_Base_F {};
class I_Heli_light_03_base_F: Heli_light_03_base_F {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@ -242,15 +241,15 @@ class CfgVehicles {
};
};
class I_Heli_light_03_F: I_Heli_light_03_base_F {
class I_Heli_light_03_F: Heli_light_03_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {};
class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {};
class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {};
class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {};
class Plane_CAS_01_base_F: Plane_Base_F {
lockDetectionSystem = 12;
@ -303,7 +302,8 @@ class CfgVehicles {
};*/
};
class B_Heli_Transport_03_base_F: Helicopter_Base_H {
class Heli_Transport_03_base_F: Helicopter_Base_H {};
class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@ -317,7 +317,7 @@ class CfgVehicles {
};
};
class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {
class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F {
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;

View File

@ -2,9 +2,6 @@
#define MACRO_ATTACHTOVEHICLE \
class ACE_Actions { \
class ACE_MainActions { \
selection = ""; \
distance = 5; \
condition = "true"; \
class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \

View File

@ -62,6 +62,5 @@ _attachables = items _unit;
},
{
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -2,34 +2,26 @@ class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_Actions {
class ACE_RightHandActions {
class ACE_ApplyHandcuffs {
displayName = "$STR_ACE_Captives_SetCaptive";
selection = "righthand";
displayName = "Right hand";
distance = 5;
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)) || ([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)));
class ACE_ApplyHandcuffs {
displayName = "$STR_ACE_Captives_SetCaptive";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
exceptions[] = {};
showDisabled = 0;
priority = 2.4;
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "C";
};
class ACE_RemoveHandcuffs {
displayName = "$STR_ACE_Captives_ReleaseCaptive";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {};
showDisabled = 0;
priority = 2.4;
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "R";
};
distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
};
class ACE_RemoveHandcuffs {
displayName = "$STR_ACE_Captives_ReleaseCaptive";
selection = "righthand";
distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
};
class ACE_MainActions {
class ACE_EscortCaptive {
displayName = "$STR_ACE_Captives_EscortCaptive";

View File

@ -15,6 +15,7 @@ PREP(addSetting);
PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
PREP(ASLToPosition);
PREP(beingCarried);
PREP(binarizeNumber);
PREP(blurScreen);
@ -135,6 +136,7 @@ PREP(onLoadRscDisplayChannel);
PREP(owned);
PREP(player);
PREP(playerSide);
PREP(positionToASL);
PREP(progressBar);
PREP(queueAnimation);
PREP(readSettingFromModule);
@ -145,6 +147,7 @@ PREP(removeCameraEventHandler);
PREP(removeCustomEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeSpecificMagazine);
PREP(requestCallback);
PREP(resetAllDefaults);
PREP(restoreVariablesJIP);

View File

@ -0,0 +1,21 @@
/*
* Author: CAA-Picard
* Converts ASL to Arma "Position"
*
* Arguments:
* 0: position x <Number>
* 1: position y <Number>
* 2: position z <Number>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (surfaceIsWater _this) then {
_this
} else {
ASLtoATL _this
};

View File

@ -0,0 +1,21 @@
/*
* Author: CAA-Picard
* Converts Arma "Position" to ASL
*
* Arguments:
* 0: position x <Number>
* 1: position y <Number>
* 2: position z <Number>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (surfaceIsWater _this) then {
_this
} else {
ATLtoASL _this
};

View File

@ -0,0 +1,69 @@
/*
* Author: CAA-Picard
* Removes a magazine from the unit that has an specific ammo count
*
* Argument:
* 0: Player <OBJECT>
* 1: Magazine <STRING>
* 2: Ammo count <NUMBER>
*
* Return value:
* None
*/
#include "script_component.hpp"
EXPLODE_3_PVT(_this,_player,_magazineType,_ammoCount);
private ["_magazines","_index","_isRemoved"];
_isRemoved = false;
// Check uniform
_magazines = [magazinesAmmoCargo uniformContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
_index = _magazines find [_magazineType,_ammoCount];
if (_index > -1) exitWith {
{
_player removeItemFromUniform (_x select 0);
} forEach _magazines;
{
if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
_isRemoved = true;
} else {
(uniformContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
};
} forEach _magazines;
};
// Check vest
_magazines = [magazinesAmmoCargo vestContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
_index = _magazines find [_magazineType,_ammoCount];
if (_index > -1) exitWith {
{
_player removeItemFromVest (_x select 0);
} forEach _magazines;
{
if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
_isRemoved = true;
} else {
(vestContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
};
} forEach _magazines;
};
// Check backpack
_magazines = [magazinesAmmoCargo backpackContainer _player, {_this select 0 == _magazineType}] call FUNC(filter);
_index = _magazines find [_magazineType,_ammoCount];
if (_index > -1) exitWith {
{
_player removeItemFromBackpack (_x select 0);
} forEach _magazines;
{
if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then {
_isRemoved = true;
} else {
(backpackContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1];
};
} forEach _magazines;
};

View File

@ -16,7 +16,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 4;
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
subMenu[] = {"ACE_Explosives", 1};
hotkey = "X";
//Sub-menu items
class ACE_Detonate {

View File

@ -51,8 +51,5 @@ _actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosive
},
{
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then {
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
};
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -43,9 +43,6 @@ if (count _detonators == 0) then {
},
{
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then {
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
};
}
] call EFUNC(interaction,openSelectMenu);
};

View File

@ -28,7 +28,7 @@ class CfgVehicles {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
@ -42,7 +42,7 @@ class CfgVehicles {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
@ -492,13 +492,13 @@ class CfgVehicles {
};*/
};
class I_Heli_light_03_base_F: Helicopter_Base_F {
class Heli_light_03_base_F;
class I_Heli_light_03_base_F: Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class I_Heli_light_03_F: I_Heli_light_03_base_F {
class I_Heli_light_03_F: Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/

View File

@ -12,7 +12,7 @@
#include "script_component.hpp"
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"];
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"];
_vehicle = _this select 0;
_weapon = _this select 1;
@ -30,7 +30,7 @@ if !([_gunner] call EFUNC(common,isPlayer)) exitWith {};
private ["_FCSMagazines", "_FCSElevation", "_offset"];
_FCSMagazines = _vehicle getVariable format ["%1_%2", QGVAR(Magazines), _turret];
_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []];
_FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
if !(_magazine in _FCSMagazines) exitWith {};
@ -43,8 +43,12 @@ _offset = 0;
};
} forEach _FCSMagazines;
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection);
// Correct velocity for weapons that have initVelocity
// @todo: Take into account negative initVelocities
_velocityCorrection = (vectorMagnitude velocity _projectile) -
getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection);
// Air burst missile
// handle locally only

View File

@ -1,81 +1,63 @@
// by commy2
["ACE3",
localize "STR_ACE_FCS_LaseTarget",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
// prevent holding down
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
GVAR(isDownStateKey1) = true;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
// Return false so it doesn't block the rest weapon action
false
},
[15, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown);
// Return false so it doesn't block the rest weapon action
false
},
{
// prevent holding down
GVAR(isDownStateKey1) = false;
["ACE3",
localize "STR_ACE_FCS_LaseTarget",
{
// prevent holding down
GVAR(isDownStateKey1) = false;
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
false
},
[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp);
false
},
[15, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
["ACE3",
localize "STR_ACE_FCS_AdjustRangeUp",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
true
},
{false},
[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange);
true
},
[201, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
["ACE3",
localize "STR_ACE_FCS_AdjustRangeDown",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
true
},
[209, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange);
true
},
{false},
[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key

View File

@ -17,17 +17,19 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
["ACE3", localize "STR_ACE_Goggles_WipeGlasses",
["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses",
{
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
call FUNC(clearGlasses);
true
};
false
}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
call FUNC(clearGlasses);
true
};
false
},
{false},
[20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind);
if isNil(QGVAR(UsePP)) then {
GVAR(UsePP) = true;
GVAR(UsePP) = true;
};
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
@ -47,78 +49,78 @@ GVAR(RainActive) = false;
GVAR(RainLastLevel) = 0;
FUNC(CheckGlasses) = {
if (GVAR(Current) != (goggles ace_player)) then {
GVAR(Current) = (goggles ace_player);
["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
};
if (GVAR(Current) != (goggles ace_player)) then {
GVAR(Current) = (goggles ace_player);
["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
};
};
player addEventHandler ["Explosion", {
if (alive ace_player) then {
call FUNC(ApplyDirtEffect);
if (GETBROKEN) exitWith {};
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
_effects = GETGLASSES(ace_player);
_effects set [BROKEN, true];
SETGLASSES(ace_player,_effects);
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
if (call FUNC(ExternalCamera)) exitWith {};
if (isNull(GLASSDISPLAY)) then {
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
};
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
if (alive ace_player) then {
call FUNC(ApplyDirtEffect);
if (GETBROKEN) exitWith {};
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
_effects = GETGLASSES(ace_player);
_effects set [BROKEN, true];
SETGLASSES(ace_player,_effects);
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
if (call FUNC(ExternalCamera)) exitWith {};
if (isNull(GLASSDISPLAY)) then {
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
};
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
};
["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
};
["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
};
}];
player addEventHandler ["Killed",{
GVAR(PostProcessEyes) ppEffectEnable false;
SETGLASSES(ace_player,GLASSESDEFAULT);
call FUNC(removeGlassesEffect);
GVAR(EffectsActive)=false;
ace_player setVariable ["ACE_EyesDamaged", false];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
if (GVAR(DustHandler) != -1) then {
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
GVAR(PostProcessEyes) ppEffectEnable false;
SETGLASSES(ace_player,GLASSESDEFAULT);
call FUNC(removeGlassesEffect);
GVAR(EffectsActive)=false;
ace_player setVariable ["ACE_EyesDamaged", false];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
if (GVAR(DustHandler) != -1) then {
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
}];
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
["GlassesChanged",{
SETGLASSES(ace_player,GLASSESDEFAULT);
SETGLASSES(ace_player,GLASSESDEFAULT);
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
if ([ace_player] call FUNC(isGogglesVisible)) then {
[_this select 0] call FUNC(applyGlassesEffect);
} else {
call FUNC(removeGlassesEffect);
};
if ([ace_player] call FUNC(isGogglesVisible)) then {
[_this select 0] call FUNC(applyGlassesEffect);
} else {
call FUNC(removeGlassesEffect);
};
}] call EFUNC(common,addEventHandler);
["GlassesCracked",{
if (_this select 0 != ace_player) exitWith {};
ace_player setVariable ["ACE_EyesDamaged", true];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 0;
GVAR(PostProcessEyes) ppEffectEnable true;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 5;
if (_this select 0 != ace_player) exitWith {};
ace_player setVariable ["ACE_EyesDamaged", true];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 0;
GVAR(PostProcessEyes) ppEffectEnable true;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectEnable false;
ace_player setVariable ["ACE_EyesDamaged", false];
GVAR(EyesDamageScript) = -1;
}, [], 5, 1] call EFUNC(common,waitAndExecute);
}, [], 25, 5] call EFUNC(common,waitAndExecute);
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 5;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectEnable false;
ace_player setVariable ["ACE_EyesDamaged", false];
GVAR(EyesDamageScript) = -1;
}, [], 5, 1] call EFUNC(common,waitAndExecute);
}, [], 25, 5] call EFUNC(common,waitAndExecute);
}] call EFUNC(common,addEventHandler);
call FUNC(checkGlasses);
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;

View File

@ -10,19 +10,16 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
// Add keybinds
["ACE3",
localize "STR_ACE_Grenades_SwitchGrenadeMode",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
// Statement
[] call FUNC(nextMode);
},
[9, [false, false, false]], //8 key
false,
"keydown"
] call cba_fnc_registerKeybind;
// Statement
[] call FUNC(nextMode);
},
{false},
[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key

View File

@ -0,0 +1,47 @@
class GVAR(cursorMenu) {
idd = 91919;
movingEnable = false;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgCursorMenu)),_this select 0)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),true)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),false)]);
objects[] = {};
/*class controlsBackground {
class Background {
idc = 91920;
moving = 0;
font = "TahomaB";
text = "";
sizeEx = 0;
lineSpacing = 0;
access = 0;
type = 0;
style = 0;
size = 1;
colorBackground[] = {0, 0, 0, 0.5};
colorText[] = {0, 0, 0, 0};
x = "safezoneX";
y = "safezoneY";
w = "safezoneW";
h = "safezoneH";
};
};*/
class controls {
class Canvas {
idc = 91921;
moving = 0;
font = "TahomaB";
text = "";
sizeEx = 0;
lineSpacing = 0;
access = 0;
type = 0;
style = 0;
size = 1;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {0, 0, 0, 0};
x = "safezoneX";
y = "safezoneY";
w = "safezoneW";
h = "safezoneH";
};
};
};

View File

@ -6,30 +6,12 @@ _fnc = {
};
addMissionEventHandler ["Draw3D", _fnc];
["ACE3",
"Interact Key",
["ACE3", QGVAR(InteractKey), "Interact Key",
{_this call FUNC(keyDown)},
[219, [false, false, false]],
false,
"keydown"] call cba_fnc_registerKeybind;
["ACE3",
"Interact Key",
{_this call FUNC(keyUp)},
[219, [false, false, false]],
false,
"keyUp"] call cba_fnc_registerKeybind;
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
["ACE3",
"Self Actions Key",
["ACE3", QGVAR(SelfInteractKey), "Self Actions Key",
{_this call FUNC(keyDownSelfAction)},
[219, [false, true, false]],
false,
"keydown"] call cba_fnc_registerKeybind;
["ACE3",
"Self Actions Key",
{_this call FUNC(keyUpSelfAction)},
[219, [false, true, false]],
false,
"keyUp"] call cba_fnc_registerKeybind;
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg

View File

@ -5,6 +5,7 @@ ADDON = false;
PREP(addAction);
PREP(compileMenu);
PREP(compileMenuSelfAction);
PREP(collectActiveActionTree);
PREP(keyDown);
PREP(keyDownSelfAction);
PREP(keyUp);
@ -12,10 +13,8 @@ PREP(keyUpSelfAction);
PREP(removeAction);
PREP(render);
PREP(renderIcon);
PREP(renderBaseMenu);
PREP(renderMenu);
PREP(rotateVectLine);
PREP(rotateVectLineGetMap);
PREP(updateVecLineMap);
GVAR(keyDown) = false;
GVAR(keyDownSelfAction) = false;
@ -29,7 +28,6 @@ GVAR(actionSelected) = false;
GVAR(selectedTarget) = objNull;
GVAR(menuDepthPath) = [];
GVAR(vecLineMap) = [];
GVAR(lastPos) = [0,0,0];
GVAR(currentOptions) = [];
@ -42,6 +40,4 @@ GVAR(startHoverTime) = diag_tickTime;
GVAR(iconCtrls) = [];
GVAR(iconCount) = 0;
GVAR(uidCounter) = 0;
ADDON = true;

View File

@ -13,3 +13,14 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "CursorMenus.hpp"
class ACE_Settings {
class GVAR(AlwaysUseCursorSelfInteraction) {
value = 0;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction";
};
};

View File

@ -36,17 +36,18 @@ if((count _actions) == 0) then {
private "_entry";
_entry = [
_displayName,
_icon,
_position,
_statement,
_condition,
_distance,
[],
GVAR(uidCounter),
+ _fullPath
[
_displayName,
_icon,
_position,
_statement,
_condition,
_distance,
[false,false,false],
+ _fullPath
],
[]
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;

View File

@ -0,0 +1,72 @@
/*
* Author: CAA-Picard
* Collect a entire tree of active actions
*
* Argument:
* 0: Object <OBJECT>
* 1: Original action tree <ARRAY>
*
* Return value:
* Active children <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_object,_origAction);
EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren);
private ["_resultingAction","_target","_player","_activeChildren","_action","_actionData","_x"];
_target = _object;
_player = ACE_player;
// Return nothing if the action itself is not active
if !([_target, ACE_player] call (_origActionData select 4)) exitWith {
[]
};
_activeChildren = [];
// Collect children class actions
{
_action = [_object, _x] call FUNC(collectActiveActionTree);
if ((count _action) > 0) then {
_activeChildren pushBack _action;
};
} forEach _origActionChildren;
// Collect children object actions
{
_action = _x;
_actionData = _action select 0;
// Check if the action is children of the original action
if ((count (_actionData select 7)) == (count (_origActionData select 7) + 1)) then {
// Compare parent path to see if it's a suitable child
private "_isChild";
_isChild = true;
{
if !(_x isEqualTo ((_actionData select 7) select _forEachIndex)) exitWith {
_isChild = false;
};
} forEach (_origActionData select 7);
if (_isChild) then {
_action = [_object, _action] call FUNC(collectActiveActionTree);
if ((count _action) > 0) then {
_activeChildren pushBack _action;
};
};
};
} forEach GVAR(objectActions);
// If the original action has no statement, and no children, don't display it
if ((count _activeChildren) == 0 && ((_origActionData select 3) isEqualTo {})) exitWith {
// @todo: Account for showDisabled?
[]
};
[_origActionData, _activeChildren]

View File

@ -45,8 +45,9 @@ _recurseFnc = {
// Add canInteract (including exceptions) and canInteractWith to condition
_condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")];
_showDisabled = getNumber (_entryCfg >> "showDisabled");
_enableInside = getNumber (_entryCfg >> "enableInside");
_showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
_enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
_canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
_fullPath = (+ _parentPath);
_fullPath pushBack (configName _entryCfg);
@ -55,18 +56,18 @@ _recurseFnc = {
_children = [_entryCfg, _fullPath] call _recurseFnc;
_entry = [
_displayName,
_icon,
_selection,
_statement,
_condition,
_distance,
_children,
GVAR(uidCounter),
_fullPath
[
_displayName,
_icon,
_selection,
_statement,
_condition,
_distance,
[_showDisabled,_enableInside,_canCollapse],
_fullPath
],
_children
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
};
};
@ -81,15 +82,17 @@ missionNamespace setVariable [_actionsVarName, [_actionsCfg, []] call _recurseFn
/*
[
[
"My Action",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
[0,0,0],
{ (_this select 0) setVelocity [0,0,10]; },
{ true },
1,
[],
uid,
["MainActions","TeamManagement","MyAction"]
[
"My Action",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
[0,0,0],
{ (_this select 0) setVelocity [0,0,10]; },
{ true },
1,
[false,false,false]
["ACE_MainActions","TeamManagement","MyAction"]
],
[children actions]
]
]
*/

View File

@ -42,8 +42,9 @@ _recurseFnc = {
// Add canInteract (including exceptions) and canInteractWith to condition
_condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")];
_showDisabled = getNumber (_entryCfg >> "showDisabled");
_enableInside = getNumber (_entryCfg >> "enableInside");
_showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
_enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
_canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
_fullPath = (+ _parentPath);
_fullPath pushBack (configName _entryCfg);
@ -52,18 +53,18 @@ _recurseFnc = {
_children = [_entryCfg, _fullPath] call _recurseFnc;
_entry = [
_displayName,
_icon,
[0,0,0],
_statement,
_condition,
10, //distace
_children,
GVAR(uidCounter),
_fullPath
[
_displayName,
_icon,
[0,0,0],
_statement,
_condition,
10, //distace
[_showDisabled,_enableInside,_canCollapse],
_fullPath
],
_children
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
};
};
@ -74,18 +75,20 @@ private "_actionsCfg";
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
// Create a master action to base on self action
_actions = [[
"Self Actions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
"Spine3",
{ true },
{ true },
10,
[_actionsCfg, ["SelfActions"]] call _recurseFnc,
GVAR(uidCounter),
["SelfActions"]
]
_actions = [
[
[
"Self Actions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
"Spine3",
{ true },
{ true },
10,
[false,true,false],
["ACE_SelfActions"]
],
[_actionsCfg, ["ACE_SelfActions"]] call _recurseFnc
]
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
missionNamespace setVariable [_actionsVarName, _actions];

View File

@ -13,6 +13,10 @@
#include "script_component.hpp"
if(!GVAR(keyDown)) then {
// Only interact with others if on foot
if (vehicle ACE_player != ACE_player) exitWith {};
GVAR(keyDown) = true;
GVAR(keyDownTime) = diag_tickTime;
};

View File

@ -17,6 +17,23 @@ if(!GVAR(keyDownSelfAction)) then {
GVAR(keyDown) = false;
GVAR(keyDownTime) = diag_tickTime;
GVAR(selfMenuOffset) = [sin getDir ACE_player, cos getDir ACE_player, 0] vectorMultiply 2;
GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || visibleMap;
if (GVAR(useCursorMenu)) then {
closeDialog 0;
createDialog QGVAR(cursorMenu);
// The dialog sets:
// uiNamespace getVariable QGVAR(dlgCursorMenu);
// uiNamespace getVariable QGVAR(cursorMenuOpened);
ctrlEnable [91921, true];
((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", {
GVAR(cursorPos) = [_this select 1, _this select 2, 0];
}];
setMousePosition [0.5, 0.5];
};
GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff
((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL));
};
true

View File

@ -22,5 +22,4 @@ if(GVAR(actionSelected)) then {
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
GVAR(vecLineMap) = [];
true

View File

@ -12,6 +12,10 @@
*/
#include "script_component.hpp"
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
closeDialog 0;
};
GVAR(keyDownSelfAction) = false;
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
@ -22,5 +26,4 @@ if(GVAR(actionSelected)) then {
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
GVAR(vecLineMap) = [];
true

View File

@ -24,7 +24,7 @@ _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
_actions = _object getVariable [_varName, []];
{
if ((_x select 8) isEqualTo _fullPath) exitWith {
if (((_x select 0) select 7) isEqualTo _fullPath) exitWith {
_actions deleteAt _forEachIndex;
};
} forEach _actions;

View File

@ -17,92 +17,101 @@ _foundTarget = false;
_cursorPos1 = positionCameraToWorld [0, 0, 0];
_cursorPos2 = positionCameraToWorld [0, 0, 2];
GVAR(selfMenuScale) = (((worldToScreen (positionCameraToWorld [1,0,2])) select 0) -
((worldToScreen (positionCameraToWorld [0,0,2])) select 0)) / 0.6;
//systemChat format ["selfMenuScale: %1", GVAR(selfMenuScale)];
GVAR(currentOptions) = [];
private ["_actionsVarName","_classActions","_objectActions","_target","_player","_actionItem","_active"];
private ["_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active"];
_player = ACE_player;
if (GVAR(keyDown)) then {
[] call FUNC(updateVecLineMap);
// Render all nearby interaction menus
#define MAXINTERACTOBJECTS 3
private ["_numInteractObjects","_numInteractions"];
_numInteractObjects = 0;
_nearestObjects = nearestObjects [(getPos ACE_player), ["All"], 15];
{
_target = _x;
_player = ACE_player;
// Iterate through object actions, find base level actions and render them if appropiate
_actionsVarName = format [QGVAR(Act_%1), typeOf _target];
GVAR(objectActions) = _target getVariable [QGVAR(actions), []];
{
_actionItem = _x;
// Only render them directly if they are base level actions
if (count (_actionItem select 8) == 1) then {
_active = [_target, ACE_player] call (_actionItem select 4);
_numInteractions = 0;
// Prevent interacting with yourself or your own vehicle
if (_target != ACE_player && {_target != vehicle ACE_player}) then {
if (_active) then {
[_target, _actionItem, 0, [180, 360]] call FUNC(renderMenu);
// Iterate through object actions, find base level actions and render them if appropiate
_actionsVarName = format [QGVAR(Act_%1), typeOf _target];
GVAR(objectActions) = _target getVariable [QGVAR(actions), []];
{
_action = _x;
// Only render them directly if they are base level actions
if (count ((_action select 0) select 7) == 1) then {
// Try to render the menu
if ([_target, _action] call FUNC(renderBaseMenu)) then {
_numInteractions = _numInteractions + 1;
};
};
} forEach GVAR(objectActions);
// Iterate through base level class actions and render them if appropiate
_classActions = missionNamespace getVariable [_actionsVarName, []];
{
_action = _x;
// Try to render the menu
if ([_target, _action] call FUNC(renderBaseMenu)) then {
_numInteractions = _numInteractions + 1;
};
} forEach _classActions;
// Limit the amount of objects the player can interact with
if (_numInteractions > 0) then {
_numInteractObjects = _numInteractObjects + 1;
};
} forEach GVAR(objectActions);
// Iterate through base level class actions and render them if appropiate
_classActions = missionNamespace getVariable [_actionsVarName, []];
{
_actionItem = _x;
_active = [_target, ACE_player] call (_actionItem select 4);
if (_active) then {
[_target, _actionItem, 0, [180, 360]] call FUNC(renderMenu);
};
} forEach _classActions;
};
if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {};
} forEach _nearestObjects;
} else {
if (GVAR(keyDownSelfAction)) then {
[] call FUNC(updateVecLineMap);
// Render only the self action menu
_target = vehicle ACE_player;
_player = ACE_player;
// Iterate through object actions, find base level actions and render them if appropiate
_actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target];
GVAR(objectActions) = _target getVariable [QGVAR(selfActions), []];
/*
{
_actionItem = _x;
_action = _x;
// Only render them directly if they are base level actions
if (count (_actionItem select 8) == 1) then {
_active = [_target, ACE_player] call (_actionItem select 4);
if (_active) then {
[_target, _actionItem, 0, [180, 360]] call FUNC(renderMenu);
};
if (count (_action select 7) == 1) then {
[_target, _action, 0, [180, 360]] call FUNC(renderMenu);
};
} forEach GVAR(objectActions);
*/
// Iterate through base level class actions and render them if appropiate
_actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target];
_classActions = missionNamespace getVariable [_actionsVarName, []];
{
_actionItem = _x;
_active = [_target, ACE_player] call (_actionItem select 4);
_action = _x;
if (_active) then {
_pos = (ACE_player modelToWorld (ACE_player selectionPosition "spine3")) vectorAdd GVAR(selfMenuOffset) vectorAdd [0,0,0.25];
[ACE_player, _actionItem, 0, [180, 360], _pos] call FUNC(renderMenu);
};
_pos = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition);
[_target, _action, _pos] call FUNC(renderBaseMenu);
} forEach _classActions;
};
};
if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa", [1,0,0,1], _cursorPos2, 1, 1, 0, "", 0.5, 0.025, "TahomaB"];
// Draw the red selector only when there's no cursor
if !(uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa", [1,0,0,1], _cursorPos2, 1, 1, 0, "", 0.5, 0.025, "TahomaB"];
};
_cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
_cursorScreenPos = worldToScreen _cursorPos2;
_closestDistance = 1000000;
_closestSelection = -1;
{
@ -134,9 +143,10 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
_foundTarget = true;
GVAR(actionSelected) = true;
GVAR(selectedTarget) = (_closest select 0) select 0;
GVAR(selectedAction) = ((_closest select 0) select 1) select 3;
GVAR(selectedAction) = (((_closest select 0) select 1) select 0) select 3;
_misMatch = false;
_hoverPath = (_closest select 2);
if((count GVAR(lastPath)) != (count _hoverPath)) then {
_misMatch = true;
} else {
@ -163,9 +173,6 @@ if(!_foundTarget && GVAR(actionSelected)) then {
GVAR(actionSelected) = false;
GVAR(expanded) = false;
GVAR(lastPath) = [];
if(!GVAR(keyDown)) then {
GVAR(vecLineMap) = [];
};
};
for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do {
ctrlDelete (GVAR(iconCtrls) select _i);

View File

@ -0,0 +1,71 @@
/*
* Author: NouberNou and CAA-Picard
* Render the interaction menu for a base action
*
* Argument:
* 0: Object <OBJECT>
* 1: Action data <ARRAY>
* 2: 3D position <ARRAY> (Optional)
*
* Return value:
* Was the menu rendered <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
private ["_distance","_pos","_weaponDir","_ref","_cameraPos","_sPos","_activeActionTree"];
EXPLODE_2_PVT(_this,_object,_baseAction);
EXPLODE_1_PVT(_baseAction,_actionData);
_distance = _actionData select 5;
// Obtain a 3D position for the action
if((count _this) > 2) then {
_pos = _this select 2;
} else {
if(typeName (_actionData select 2) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 2);
} else {
if ((_actionData select 2) == "weapon") then {
// Craft a suitable position for weapon interaction
_weaponDir = _object weaponDirection currentWeapon _object;
_ref = _weaponDir call EFUNC(common,createOrthonormalReference);
_pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1);
} else {
_pos = _object modelToWorld (_object selectionPosition (_actionData select 2));
};
};
// Compensate for movement during the frame to get rid of jittering
_pos = _pos vectorAdd ((visiblePositionASL _object) vectorDiff (getPosASL _object));
};
_cameraToActionVec = (_pos call EFUNC(common,positionToASL)) vectorDiff ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL));
GVAR(refSystem) = _cameraToActionVec call EFUNC(common,createOrthonormalReference);
// For non-self actions, exit if the action is too far away
if (GVAR(keyDown) &&
{(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false};
// Exit if the action is behind you
_sPos = worldToScreen _pos;
if(count _sPos == 0) exitWith {false};
// Exit if the action is off screen
if ((_sPos select 0) < safeZoneXAbs || (_sPos select 0) > safeZoneXAbs + safeZoneWAbs) exitWith {false};
if ((_sPos select 1) < safeZoneY || (_sPos select 1) > safeZoneY + safeZoneH) exitWith {false};
// Collect active tree
// @todo: cache activeActionTree?
_activeActionTree = ([_object, _baseAction] call FUNC(collectActiveActionTree));
// Check if there's something left for rendering
if (count _activeActionTree == 0) exitWith {false};
//EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren);
[_object, _activeActionTree, _pos, [180,360]] call FUNC(renderMenu);
true

View File

@ -31,7 +31,9 @@ _sPos = worldToScreen _pos;
if(count _sPos > 0) then {
if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
GVAR(iconCtrls) pushBack ((findDisplay 46) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
_displayNum = [46,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
//systemChat format ["Displaynum: %1", _displayNum];
GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
};
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
GVAR(iconCount) = GVAR(iconCount) + 1;
@ -42,6 +44,6 @@ if(count _sPos > 0) then {
_ctrl ctrlSetStructuredText (parseText _text);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.2*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.035*SafeZoneW];
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
// _ctrl ctrlSetBackgroundColor [1,0,0,1];
//_ctrl ctrlSetBackgroundColor [1,0,0,1];
_ctrl ctrlCommit 0;
};

View File

@ -1,13 +1,12 @@
/*
* Author: NouberNou and CAA-Picard
* Render a interaction menu and it's children recursively
* Render an interaction menu and it's children recursively
*
* Argument:
* 0: Object <OBJECT>
* 1: Action data <ARRAY>
* 2: ?
* 2: 3D position <ARRAY>
* 3: Angle range available for rendering <ARRAY>
* 4: 3D position <ARRAY> (Optional)
*
* Return value:
* None
@ -16,40 +15,18 @@
*/
#include "script_component.hpp"
private ["_distance", "_uid", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"];
private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"];
EXPLODE_4_PVT(_this,_object,_actionData,_dummy,_angles);
EXPLODE_4_PVT(_this,_object,_action,_pos,_angles);
EXPLODE_2_PVT(_action,_actionData,_activeChildren);
EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan);
_uid = _actionData select 7;
_distance = _actionData select 5;
// Obtain a 3D position for the action
if((count _this) > 4) then {
_pos = _this select 4;
} else {
if(typeName (_actionData select 2) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 2);
} else {
_pos = _object modelToWorld (_object selectionPosition (_actionData select 2));
};
};
_cursorScreenPos = (positionCameraToWorld [0, 0, 0]);
// Exit if the action is too far away
if(_cursorScreenPos distance _pos >= _distance) exitWith {};
// Exit if the action is behind you
if(_cursorScreenPos select 2 < 0) exitWith {};
_menuDepth = (count GVAR(menuDepthPath)) - 1;
// Store path to action
_path = [_object];
_path = _path + (_actionData select 8);
_path = [_object] + (_actionData select 7);
// Check if the menu is on the selected path
private "_menuInSelectedPath";
_menuInSelectedPath = true;
{
if (_forEachIndex >= (count GVAR(menuDepthPath))) exitWith {
@ -63,8 +40,12 @@ _menuInSelectedPath = true;
// Render icon
// ARGB Color (First Hex Pair is transparancy)
_color = "#FFFFFFFF";
if(_menuDepth > 0 && !_menuInSelectedPath) then {
_color = format ["#%1FFFFFF", [255 * ((((count _path) - 2)/_menuDepth) max 0.25)] call EFUNC(common,toHex)];
if(!_menuInSelectedPath) then { //_menuDepth > 0 &&
if (_menuDepth > 0) then {
_color = format ["#%1FFFFFF", [255 * ((((count _path) - 2)/_menuDepth) max 0.25)] call EFUNC(common,toHex)];
} else {
_color = format ["#%1FFFFFF", [255 * 0.75] call EFUNC(common,toHex)];
};
};
[_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
@ -72,46 +53,7 @@ if(_menuDepth > 0 && !_menuInSelectedPath) then {
GVAR(currentOptions) pushBack [_this, _pos, _path];
// Exit without rendering children if it isn't
if !(_menuInSelectedPath) exitWith {};
// Collect all active children actions
private "_activeChildren";
_activeChildren = [];
// Collect children class actions
{
_target = _object;
_player = ACE_player;
_active = [_object, ACE_player] call (_x select 4);
if(_active) then {
_activeChildren pushBack _x;
};
} forEach (_actionData select 6);
// Collect children object actions
{
_actionItem = _x;
// Check if the action is children of the selected menu
if ((count (_actionItem select 8)) == (count _path)) then {
// Compare parent path to see if it's a suitable child
private "_isChild";
_isChild = true;
for "_i" from 0 to (count (_actionItem select 8)) - 2 do {
if !(((_actionItem select 8) select _i) isEqualTo (_path select (_i + 1))) exitWith {
_isChild = false;
};
};
if (_isChild) exitWith {
_target = _object;
_player = ACE_player;
_active = [_target, ACE_player] call (_actionItem select 4);
if (_active) then {
_activeChildren pushBack _actionItem;
};
};
};
} forEach GVAR(objectActions);
if !(_menuInSelectedPath) exitWith {true};
private ["_angleSpan","_angle"];
_angleSpan = _maxAngleSpan min (55 * ((count _activeChildren) - 1));
@ -120,18 +62,19 @@ if (_angleSpan >= 305) then {
};
_angle = _centerAngle - _angleSpan / 2;
{
_target = _object;
_player = ACE_player;
_offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine);
_mod = 0.15 max (0.15 * (_cursorScreenPos distance _pos));
_newPos = _pos vectorAdd (_offset vectorMultiply _mod);
_mod = (0.15 max (0.15 * ((positionCameraToWorld [0, 0, 0]) distance _pos))) / GVAR(selfMenuScale);
// drawLine3D [_pos, _newPos, [1,0,0,0.5]];
_offset = ((GVAR(refSystem) select 1) vectorMultiply (-_mod * cos _angle)) vectorAdd
((GVAR(refSystem) select 2) vectorMultiply (-_mod * sin _angle));
_newPos = ((_pos call EFUNC(common,positionToASL)) vectorAdd _offset) call EFUNC(common,ASLToPosition);
[_object, _x, _forEachIndex, [_angle, 140], _newPos] call FUNC(renderMenu);
//drawLine3D [_pos, _newPos, [1,0,0,0.5]];
[_object, _x, _newPos, [_angle, 140]] call FUNC(renderMenu);
if (_angleSpan == 360) then {
_angle = _angle + _angleSpan / (count _activeChildren);
@ -139,3 +82,5 @@ _angle = _centerAngle - _angleSpan / 2;
_angle = _angle + _angleSpan / (((count _activeChildren)-1) max 1);
};
} forEach _activeChildren;
true

View File

@ -1,52 +0,0 @@
/*
* Author: NouberNou
* Rotate a vector line (?)
*
* Argument:
* 0: Map <ARRAY>
* 1: Theta <ARRAY>
*
* Return value:
* 0: ?? <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
private ["_theta", "_p", "_map", "_p1", "_p2", "_q1", "_q2", "_u", "_d"];
_map = _this select 0;
_theta = _this select 1;
_p = _map select 0;
_p1 = _map select 1;
_p2 = _map select 2;
_q1 = +(_map select 3);
_q2 = +(_map select 4);
_u = _map select 5;
_d = _map select 6;
/* Step 4 */
_q2 set[0, (_q1 select 0) * cos(_theta) - (_q1 select 1) * sin(_theta)];
_q2 set[1, (_q1 select 0) * sin(_theta) + (_q1 select 1) * cos(_theta)];
_q2 set[2, (_q1 select 2)];
/* Inverse of step 3 */
_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)];
_q1 set[1, (_q2 select 1)];
_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
/* Inverse of step 2 */
if (_d != 0) then {
_q2 set[0, (_q1 select 0)];
_q2 set[1, (_q1 select 1) * (_u select 2) / _d + (_q1 select 2) * (_u select 1) / _d];
_q2 set[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
} else {
_q2 = _q1;
};
/* Inverse of step 1 */
_q1 set[0, (_q2 select 0) + (_p1 select 0)];
_q1 set[1, (_q2 select 1) + (_p1 select 1)];
_q1 set[2, (_q2 select 2) + (_p1 select 2)];
_q1;

View File

@ -1,52 +0,0 @@
/*
* Author: NouberNou
* ?
*
* Argument:
* 0: p0 <ARRAY>
* 1: p1 <ARRAY>
* 2: p2 <ARRAY>
*
* Return value:
* Map <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
private ["_p", "_p1", "_p2", "_q1", "_q2", "_u", "_d"];
_p = _this select 0;
_p1 = _this select 1;
_p2 = _this select 2;
_q1 = [];
_q2 = [];
_u = [];
/* Step 1 */
_q1 set[0, (_p select 0) - (_p1 select 0)];
_q1 set[1, (_p select 1) - (_p1 select 1)];
_q1 set[2, (_p select 2) - (_p1 select 2)];
_u set[0, (_p2 select 0) - (_p1 select 0)];
_u set[1, (_p2 select 1) - (_p1 select 1)];
_u set[2, (_p2 select 2) - (_p1 select 2)];
_u = _u call BIS_fnc_unitVector;
_d = sqrt((_u select 1)*(_u select 1) + (_u select 2)*(_u select 2));
/* Step 2 */
if (_d != 0) then {
_q2 set[0, (_q1 select 0)];
_q2 set[1, (_q1 select 1) * (_u select 2) / _d - (_q1 select 2) * (_u select 1) / _d];
_q2 set[2, (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
} else {
_q2 = _q1;
};
/* Step 3 */
_q1 set[0, (_q2 select 0) * _d - (_q2 select 2) * (_u select 0)];
_q1 set[1, (_q2 select 1)];
_q1 set[2, (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
[_p, _p1, _p2, _q1, _q2, _u, _d]

View File

@ -1,13 +0,0 @@
#include "script_component.hpp";
if((count GVAR(vecLineMap)) == 0 || ((count GVAR(menuDepthPath)) > 0 && (getPosASL player) distance GVAR(lastPos) > 0.01)) then {
GVAR(lastPos) = getPosASL player;
_cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY;
_p1 = [0,0,0];
_p2 = +_cursorVec;
_p = (_cursorVec call CBA_fnc_vect2polar);
_v = [(_p select 0), (_p select 1), (_p select 2)+90] call CBA_fnc_polar2vect;
_cp = [_cursorVec, _v] call BIS_fnc_crossProduct;
GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap);
};

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Interact_Menu">
<Key ID="STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction">
<English>Always display cursor for self interaction</English>
</Key>
</Project>

View File

@ -32,7 +32,7 @@ class CfgVehicles {
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
distance = 4;
distance = 5;
condition = QUOTE(true);
statement = "";
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
@ -40,7 +40,7 @@ class CfgVehicles {
class ACE_TeamManagement {
displayName = "$STR_ACE_Interaction_TeamManagement";
distance = 4;
distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)});
statement = "";
showDisabled = 0;
@ -51,7 +51,7 @@ class CfgVehicles {
class ACE_JoinTeamRed {
displayName = "$STR_ACE_Interaction_JoinTeamRed";
distance = 4;
distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam));
showDisabled = 1;
@ -62,7 +62,7 @@ class CfgVehicles {
};
class ACE_JoinTeamGreen {
displayName = "$STR_ACE_Interaction_JoinTeamGreen";
distance = 4;
distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam));
showDisabled = 1;
@ -73,7 +73,7 @@ class CfgVehicles {
};
class ACE_JoinTeamBlue {
displayName = "$STR_ACE_Interaction_JoinTeamBlue";
distance = 4;
distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam));
showDisabled = 1;
@ -84,7 +84,7 @@ class CfgVehicles {
};
class ACE_JoinTeamYellow {
displayName = "$STR_ACE_Interaction_JoinTeamYellow";
distance = 4;
distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player});
statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam));
showDisabled = 1;
@ -96,7 +96,7 @@ class CfgVehicles {
class ACE_LeaveTeam {
displayName = "$STR_ACE_Interaction_LeaveTeam";
distance = 4;
distance = 5;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'});
statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam));
showDisabled = 1;
@ -109,7 +109,7 @@ class CfgVehicles {
class ACE_JoinGroup {
displayName = "$STR_ACE_Interaction_JoinGroup";
distance = 4;
distance = 5;
condition = QUOTE(side group _player == side group _target && {group _player != group _target});
statement = QUOTE([_player] joinSilent group _target;);
showDisabled = 0;
@ -121,23 +121,23 @@ class CfgVehicles {
class ACE_GetDown {
displayName = "$STR_ACE_Interaction_GetDown";
distance = 4;
condition = QUOTE([_target] call DFUNC(canInteractWith));
distance = 5;
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
statement = QUOTE([_target] call DFUNC(getDown));
showDisabled = 0;
priority = 2.2;
};
class ACE_SendAway {
displayName = "$STR_ACE_Interaction_SendAway";
distance = 4;
condition = QUOTE([_target] call DFUNC(canInteractWith));
distance = 5;
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
statement = QUOTE([_target] call DFUNC(sendAway));
showDisabled = 0;
priority = 2.0;
};
class ACE_Pardon {
displayName = "$STR_ACE_Interaction_Pardon";
distance = 4;
distance = 5;
condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target});
statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc));
showDisabled = 0;
@ -145,6 +145,48 @@ class CfgVehicles {
enableInside = 1;
};
};
class ACE_Head {
displayName = "$STR_ACE_Interaction_Head";
selection = "pilot";
distance = 2.0;
condition = "";
statement = "";
};
class ACE_ArmLeft {
displayName = "$STR_ACE_Interaction_ArmLeft";
selection = "LeftForeArm";
distance = 2.0;
condition = "";
statement = "";
};
class ACE_ArmRight {
displayName = "$STR_ACE_Interaction_ArmRight";
selection = "RightForeArm";
distance = 2.0;
condition = "";
statement = "";
};
class ACE_LegLeft {
displayName = "$STR_ACE_Interaction_LegLeft";
selection = "LKnee";
distance = 2.0;
condition = "";
statement = "";
};
class ACE_LegRight {
displayName = "$STR_ACE_Interaction_LegRight";
selection = "RKnee";
distance = 2.0;
condition = "";
statement = "";
};
class ACE_Weapon {
displayName = "$STR_ACE_Interaction_Weapon";
selection = "weapon";
distance = 2.0;
condition = "";
statement = "";
};
class ACE_TapShoulderRight {
displayName = "$STR_ACE_Interaction_TapShoulder";
@ -152,10 +194,6 @@ class CfgVehicles {
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder));
showDisabled = 0;
priority = 2.8;
hotkey = "Q";
enableInside = 1;
};
class ACE_TapShoulderLeft {
displayName = "$STR_ACE_Interaction_TapShoulder";
@ -163,10 +201,6 @@ class CfgVehicles {
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder));
showDisabled = 0;
priority = 2.8;
hotkey = "Q";
enableInside = 1;
};
};
@ -178,7 +212,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 3.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
subMenu[] = {"ACE_TeamManagement", 1};
enableInside = 1;
hotkey = "M";
@ -256,30 +289,12 @@ class CfgVehicles {
};
};
/* DANCE ANIMATION DOESN'T WORK :(
class ACE_Dance {
displayName = "$STR_ACE_Interaction_Dance";
condition = "isClass (configFile >> 'CfgPatches' >> 'ACE_Movement') and !ACE_Dancing";
statement = "ACE_Dancing = true; [-2, {_this switchMove 'TestDance';}, player] call CBA_fnc_globalExecute;";
showDisabled = 0;
priority = -1.2;
};
class ACE_StopDancing {
displayName = "$STR_ACE_Interaction_StopDancing";
condition = "ACE_Dancing";
statement = "ACE_Dancing = false; [-2, {_this switchMove '';}, player] call CBA_fnc_globalExecute;";
showDisabled = 0;
priority = -1.2;
};
*/
class ACE_Gestures {
displayName = "$STR_ACE_Interaction_Gestures";
condition = "canStand _target";
statement = "";
showDisabled = 1;
priority = 3.5;
subMenu[] = {"ACE_Gestures", 1};
icon = PATHTOF(UI\gestures_ca.paa);
hotkey = "G";
@ -386,67 +401,105 @@ class CfgVehicles {
showDisabled = 1;
priority = 4.5;
icon = ""; // @todo
subMenu[] = {"ACE_Equipment", 1};
enableInside = 1;
hotkey = "E";
class ACE_Dummy {
displayName = "";
condition = QUOTE(false);
statement = "";
showDisabled = 1;
priority = -99;
icon = PATHTOEF(common,UI\blank_CO.paa);
enableInside = 1;
};
};
};
};
class LandVehicle;
class Car: LandVehicle {
class ACE_Actions {};
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
condition = "true";
};
};
class ACE_SelfActions {};
};
class Tank: LandVehicle {
class ACE_Actions {};
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
condition = "true";
};
};
class ACE_SelfActions {};
};
class Air;
class Helicopter: Air {
class ACE_Actions {};
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
condition = "true";
};
};
class ACE_SelfActions {};
};
class Plane: Air {
class ACE_Actions {};
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
condition = "true";
};
};
class ACE_SelfActions {};
};
class Ship;
class Ship_F: Ship {
class ACE_Actions {
class ACE_Push {
displayName = "$STR_ACE_Interaction_Push";
distance = 4;
condition = QUOTE(getMass _target < 1000 && {alive _target});
statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push););
showDisabled = 0;
priority = -1;
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "";
distance = 10;
condition = "true";
class ACE_Push {
displayName = "$STR_ACE_Interaction_Push";
distance = 6;
condition = QUOTE(getMass _target < 1000 && {alive _target});
statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push););
showDisabled = 0;
priority = -1;
};
};
};
class ACE_SelfActions {};
};
class StaticWeapon: LandVehicle {
class ACE_Actions {};
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "gunnerview";
distance = 2;
condition = "true";
};
};
class ACE_SelfActions {};
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
class ACE_Actions {};
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "gunnerview";
distance = 2;
condition = "true";
};
};
class ACE_SelfActions {};
};
};
};

View File

@ -43,370 +43,6 @@ class ACE_Interaction_Button_Base {
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
};
#define ICON_BORDER 0.05
// Old command rose
class ACE_Interaction_Dialog {
idd = 1713999;
enableSimulation = 1;
movingEnable = 0;
onLoad = "_dlgInteractionDialog = _this select 0; for '_a' from 10 to 19 do {(_dlgInteractionDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['ACE_Interaction_Dialog', _dlgInteractionDialog];";
objects[] = {};
class controls {
class Interaction_BackgroundMain: ACE_Interaction_Button_Base {
type = 0;
style = 2;
idc = 2;
colorBackground[] = {0,0,0,0.5};
colorBackgroundDisabled[] = {0,0,0,0.5};
x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY";
w = "1.8 / 16 * safezoneW";
h = "0.55 / 9 * safezoneH";
};
class Interaction_ButtonMain: ACE_Interaction_Button_Base {
action = "-1 call ACE_Interaction_fnc_onClick;";
style = 2;
tooltip = "";
text = "Interaction Menu";
idc = 3;
sizeEx = "0.6 / 40 / (getResolution select 5)";
colorBackground[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0};
colorBackgroundActive[] = {1,1,1,0.2};
colorFocused[] = {0,0,0,0};
x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY";
w = "1.8 / 16 * safezoneW";
h = "0.55 / 9 * safezoneH";
};
class Interaction_Background0: ACE_Interaction_Button_Base {
type = 0;
style = 2;
idc = 40;
colorBackground[] = {0,0,0,0.5};
colorBackgroundDisabled[] = {0,0,0,0.5};
x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background1: Interaction_Background0 {
idc = 41;
x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background2: Interaction_Background0 {
idc = 42;
x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background3: Interaction_Background0 {
idc = 43;
x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background4: Interaction_Background0 {
idc = 44;
x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background5: Interaction_Background0 {
idc = 45;
x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background6: Interaction_Background0 {
idc = 46;
x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background7: Interaction_Background0 {
idc = 47;
x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background8: Interaction_Background0 {
idc = 48;
x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Background9: Interaction_Background0 {
idc = 49;
x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Icon0: ACE_Interaction_Button_Base {
tooltip = "";
text = "";
idc = 20;
type = 0;
style = 48;
colorBackground[] = {0,0,0,0};
x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 - 2.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon1: Interaction_Icon0 {
idc = 21;
x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon2: Interaction_Icon0 {
idc = 22;
x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon3: Interaction_Icon0 {
idc = 23;
x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon4: Interaction_Icon0 {
idc = 24;
x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon5 : Interaction_Icon0 {
idc = 25;
x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 + 2.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon6: Interaction_Icon0 {
idc = 26;
x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon7: Interaction_Icon0 {
idc = 27;
x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon8: Interaction_Icon0 {
idc = 28;
x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Icon9: Interaction_Icon0 {
idc = 29;
x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX;
y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY;
w = (0.3-ICON_BORDER) / 16 * safezoneW;
h = (0.3-ICON_BORDER) / 9 * safezoneH;
};
class Interaction_Shortcut0: ACE_Interaction_Button_Base {
tooltip = "";
text = "";
idc = 30;
style = 2;
colorBackground[] = {0,0,0,0};
x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut1: Interaction_Shortcut0 {
idc = 31;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut2: Interaction_Shortcut0 {
idc = 32;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut3: Interaction_Shortcut0 {
idc = 33;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut4: Interaction_Shortcut0 {
idc = 34;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut5 : Interaction_Shortcut0 {
idc = 35;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut6: Interaction_Shortcut0 {
idc = 36;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut7: Interaction_Shortcut0 {
idc = 37;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut8: Interaction_Shortcut0 {
idc = 38;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Shortcut9: Interaction_Shortcut0 {
idc = 39;
type = 0;
x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
w = "0.3 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button0: ACE_Interaction_Button_Base {
action = "0 call ACE_Interaction_fnc_onClick;";
style = 2;
tooltip = "";
text = "";
idc = 10;
colorBackground[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0};
colorBackgroundActive[] = {1,1,1,0.2};
colorFocused[] = {0,0,0,0};
x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button1: Interaction_Button0 {
action = "1 call ACE_Interaction_fnc_onClick;";
idc = 11;
x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button2: Interaction_Button0 {
action = "2 call ACE_Interaction_fnc_onClick;";
idc = 12;
x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button3: Interaction_Button0 {
action = "3 call ACE_Interaction_fnc_onClick;";
idc = 13;
x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button4: Interaction_Button0 {
action = "4 call ACE_Interaction_fnc_onClick;";
idc = 14;
x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button5: Interaction_Button0 {
action = "5 call ACE_Interaction_fnc_onClick;";
idc = 15;
x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button6: Interaction_Button0 {
action = "6 call ACE_Interaction_fnc_onClick;";
idc = 16;
x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button7: Interaction_Button0 {
action = "7 call ACE_Interaction_fnc_onClick;";
idc = 17;
x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button8: Interaction_Button0 {
action = "8 call ACE_Interaction_fnc_onClick;";
idc = 18;
x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
class Interaction_Button9: Interaction_Button0 {
action = "9 call ACE_Interaction_fnc_onClick;";
idc = 19;
x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX";
y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY";
w = "2.0 / 16 * safezoneW";
h = "0.3 / 9 * safezoneH";
};
};
};
class RscListbox;
class IGUIBack;
class RscText;
@ -518,75 +154,6 @@ class RscInteractionText: RscText{
h = 1.5 * GUI_GRID_H;
};
class RscTitles {
class ACE_FlowMenu {
idd = 9920;
enableSimulation = 1;
movingEnable = 0;
fadeIn=0.5;
fadeOut=0.5;
duration = 10e10;
onLoad = "uiNamespace setVariable ['ACE_Flow_Display', _this select 0];";
class controls {
class RearIcon: RscInteractionIcon{
idc = 999;
text = PATHTOF(UI\CenterIcon_ca.paa);
x = 17.9 * GUI_GRID_W;
y = 10 * GUI_GRID_H;
w = 3.7 * GUI_GRID_H;
h = 5.75 * GUI_GRID_H;
};
class TopIcon: RscInteractionIcon{
idc = 1200;
h = 1 * GUI_GRID_H;
y = 9 * GUI_GRID_H;
};
class FirstIcon: RscInteractionIcon{
idc = 1201;
y = 10.25 * GUI_GRID_H;
h = 1.5 * GUI_GRID_H;
};
class SelectedItemIcon: RscInteractionIcon{
idc = 1202;
y = 12 * GUI_GRID_H;
};
class ThirdIcon: RscInteractionIcon{
idc = 1203;
y = 14.25 * GUI_GRID_H;
h = 1.5 * GUI_GRID_H;
};
class BottomIcon: TopIcon{
idc = 1204;
y = 16 * GUI_GRID_H;
};
class ItemName: RscText{
idc = 1000;
style = 0x01;
x = 5.25 * GUI_GRID_W;
y = 12.15 * GUI_GRID_H;
w = 13 * GUI_GRID_W;
h = 1.5 * GUI_GRID_H;
colorBackground[] = {0.3, 0.3, 0.3, 0.8};
};
class BackIcon: RscInteractionIcon{
idc = 1210;
text = PATHTOF(UI\backArrow_ca.paa);
x = 18.25 * GUI_GRID_W;
y = 12.69 * GUI_GRID_H;
w = 0.5 * GUI_GRID_W;
h = 0.5 * GUI_GRID_H;
};
class ItemDetails: RscStructuredText{
idc = 1100;
style = 0x0c;
x = 23.5 * GUI_GRID_W;
y = 11 * GUI_GRID_H;
w = 13 * GUI_GRID_W;
h = 3.9 * GUI_GRID_H;
colorBackground[] = {0, 0, 0, 0.4};
};
};
};
class GVAR(InteractionHelper) {
idd = 9930;
enableSimulation = 1;

View File

@ -16,92 +16,89 @@ GVAR(isOpeningDoor) = false;
// Add keybinds
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!GVAR(isOpeningDoor) &&
{[2] call FUNC(getDoor) select 1 != ''}
) exitWith {false};
["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!GVAR(isOpeningDoor) &&
{[2] call FUNC(getDoor) select 1 != ''}
) exitWith {false};
// Statement
call EFUNC(interaction,openDoor);
true
},
[57, [false, true, false]],
false,
"keydown"
// Statement
call EFUNC(interaction,openDoor);
true
},
{},
[57, [false, true, false]], false] call cba_fnc_addKeybind;
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(isOpeningDoor)) exitWith {false};
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(isOpeningDoor)) exitWith {false};
localize "STR_ACE_Interaction_TapShoulder",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]],
false,
"keyup"
// Statement
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
[20, [true, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_TapShoulder",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
[20, [true, false, false]],
false,
"keydown"
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
ACE_Modifier = 0;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keyup"
// Statement
ACE_Modifier = 0;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;

View File

@ -2,49 +2,30 @@
ADDON = false;
PREP(addInteraction);
PREP(addInteractionSelf);
PREP(addSelectableItem);
PREP(addToTooltip);
PREP(applyButtons);
PREP(canInteractWith);
PREP(canInteractWithCivilian);
PREP(canTapShoulder);
PREP(getActions);
PREP(getActions2);
PREP(getDoor);
PREP(getDoorAnimations);
PREP(getDown);
PREP(getSelectedButton);
PREP(hideMenu);
PREP(hideMouseHint);
PREP(initialiseInteraction);
PREP(isInRange);
PREP(joinTeam);
PREP(menuKeyInput);
PREP(moduleInteraction);
PREP(moveDown);
PREP(onButtonDown);
PREP(onButtonDownSelf);
PREP(onButtonUp);
PREP(onClick);
PREP(onSelectMenuDblClick);
PREP(openDoor);
PREP(openMenu);
PREP(openMenuSelectUI);
PREP(openMenuSelf);
PREP(openSelectMenu);
PREP(openSubMenu);
PREP(openSubMenuSelf);
PREP(prepareSelectMenu);
PREP(push);
PREP(removeInteraction);
PREP(removeInteractionSelf);
PREP(removeTag);
PREP(sendAway);
PREP(showMenu);
PREP(showMouseHint);
PREP(sortOptionsByPriority);
PREP(tapShoulder);
PREP(updateTooltipPosition);
ADDON = true;

View File

@ -19,24 +19,6 @@ class CfgPatches {
#include <Menu_Config.hpp>
class ACE_Settings {
class GVAR(FlowMenu) {
value = 0;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Interaction_FlowMenu";
};
class GVAR(AutoCloseMenu) {
value = 0;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Interaction_AutoCloseMenu";
};
class GVAR(AutoCenterCursor) {
value = 1;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Interaction_AutoCenterCursor";
};
class GVAR(EnableTeamManagement) {
value = 1;
typeName = "BOOL";

View File

@ -29,13 +29,8 @@ if (_picture == "" || _picture == "PictureThing") then {
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
};
if ((profileNamespace getVariable [QGVAR(FlowMenu), false])) then {
//[_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]
_container pushBack [_displayName, nil, {true},0,[], _picture, "", {true}, [], 4, "", _data];
}else{
_index = lbAdd [_container, _displayName];
lbSetData [_container, _index, str _data];
lbSetPicture [_container, _index, _picture];
};
_index = lbAdd [_container, _displayName];
lbSetData [_container, _index, str _data];
lbSetPicture [_container, _index, _picture];
_container

View File

@ -1,154 +0,0 @@
/*
Author:
commy2
Garth de Wet (LH)
Description:
Parameters:
0: OBJECT - target
1: ARRAY - Parents of the target object
2: ARRAY - Actions
3: ARRAY - Patches
4: CONFIG - Parent config (ConfigFile >> "CfgVehicles"/MissionConfigFile >> "CfgVehicles")
5: BOOL - Is mission config file?
6: STRING - Classname ("ACE_Actions"/"ACE_SelfActions")
7: STRING - Sub-class
Returns:
Nothing
Example:
[player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_Actions"] call ACE_Interaction_fnc_GetActions;
[player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_SelfActions"] call ACE_Interaction_fnc_GetActions;
*/
#include "script_component.hpp"
#define DEFAULT_ICON QUOTE(PATHTOF(UI\dot_ca.paa))
private ["_target", "_parents", "_actions", "_patches", "_baseConfig", "_actionType", "_i","_index", "_missionConfig", "_stdConfig"];
_target = _this select 0;
_parents = _this select 1;
_actions = _this select 2;
_patches = _this select 3;
_baseConfig = _this select 4;
_missionConfig = _this select 5;
_actionType = _this select 6;
_subClass = _this select 7;
_stdConfig = (configFile >> "CfgVehicles" >> typeOf _target >> _actionType);
if (_subClass != "") then {
_stdConfig = _stdConfig >> _subClass;
};
_count = count _parents;
for "_i" from 0 to (_count - 1) do {
_config = _baseConfig >> _parents select _i >> _actionType;
if (_subClass != "") then {
_config = _config >> _subClass;
};
_count = count _config;
if (_count > 0) then {
for "_index" from 0 to (_count - 1) do {
private ["_action", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority", "_tooltip", "_hotkey",
"_subMenu", "_conditionShow", "_exceptions", "_icon", "_actionToCache", "_cacheActions", "_cache", "_indexCache", "_configName"];
_action = if (_missionConfig) then {_config select _index} else {_stdConfig >> configName (_config select _index)};
_cache = missionNamespace getVariable [QGVAR(MenuCache), [[], [], []]];
if (count _action > 0) then {
_configName = configName _action;
_cacheConfigs = _cache select 0;
_cacheActions = _cache select 1;
_cacheIndices = _cache select 2;
_indexCache = _cacheConfigs find _action;
if (_indexCache == -1) then {
_displayName = getText (_action >> "displayName");
_distance = getNumber (_action >> "distance");
_priority = getNumber (_action >> "priority");
_subMenu = getArray (_action >> "subMenu");
_tooltip = getText (_action >> "tooltip");
_hotkey = getText (_action >> "hotkey");
_enableInside = getNumber (_action >> "enableInside");
// Condition
_condition = getText (_action >> "condition");
if (_condition == "") then {_condition = "true"};
_condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, GVAR(Target))] call EFUNC(common,canInteractWith)} ), getArray (_action >> "exceptions")];
if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"};
_condition = compile _condition;
// Condition to show the action
_conditionShow = getText (_action >> "conditionShow");
_conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow};
_showDisabled = getNumber (_action >> "showDisabled") == 1;
if (isText (_action >> "conditionShow")) then {
_showDisabled = [_object, _player] call _conditionShow;
};
// Exceptions to the general conditions that have to be true
_exceptions = getArray (_action >> "exceptions");
// statement
_statement = getText (_action >> "statement");
_statement = compile _statement;
if (profileNamespace getVariable [QGVAR(FlowMenu), false]) then {
_statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then {
compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1];
} else {
compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement"));
};
};
// icon
_icon = getText (_action >> "Icon");
if (_icon == "") then {
_icon = DEFAULT_ICON;
};
_actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey];
if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call _condition}} && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then {
_actions pushBack _actionToCache;
_patches pushBack _configName;
};
_indexCache = _cacheActions find _actionToCache;
if (_indexCache == -1) then {
_indexCache = count _cacheActions;
_cacheActions pushBack _actionToCache;
};
_cacheConfigs pushBack _action;
_cacheIndices pushBack _indexCache;
_cache = [_cacheConfigs, _cacheActions, _cacheIndices];
["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log);
} else {
["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log);
_cachedAction = _cacheActions select (_cacheIndices select _indexCache);
_showDisabled = getNumber (_action >> "showDisabled") == 1;
if (isText (_action >> "conditionShow")) then {
_showDisabled = [_object, _player] call (_cachedAction select 7);
};
if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call (_cachedAction select 2)}} && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then {
_actions pushBack _cachedAction;
_patches pushBack _configName;
};
};
};
GVAR(MenuCache) = _cache;
};
};
};
[_actions, _patches]

View File

@ -1,57 +0,0 @@
/*
* Author: commy2
*
* Add an ACE action to an object. Note: This function is global.
*
* Argument:
* 0: Object the action should be assigned to (Object)
* 1: Name of the action shown in the menu (String)
* 2: Distance the player can be away from the object (Number)
* 3: Condition (Code or String)
* 4: Statement (Code or String)
* 5: Show the action even if the conditon is not met (Bool or Number)
* 6: Priority (Number, optional default: 0)
*
* Return value:
* ID of the action (used to remove it later).
*/
#include "script_component.hpp"
private ["_object", "_displayName", "_distance", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"];
_object = _this select 0;
_displayName = _this select 1;
_distance = _this select 2;
_condition = _this select 3;
_statement = _this select 4;
_showDisabled = _this select 5;
_priority = _this select 6;
if (typeName _condition == "STRING") then {
_condition = compile _condition;
};
if (typeName _statement == "STRING") then {
_statement = compile _statement;
};
if (typeName _showDisabled == "SCALAR") then {
_showDisabled = _showDisabled > 0;
};
if (isNil "_priority") then {
_priority = 0;
};
_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]];
_id = (_actionsVar select 0) + 1;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_actionIDs pushBack _id;
_actions pushBack [_displayName, _distance, _condition, _statement, _showDisabled, _priority];
_object setVariable [QGVAR(Interactions), [_id, _actionIDs, _actions], true];
_id

View File

@ -1,55 +0,0 @@
/*
* Author: commy2
*
* Add an ACE self action to the player. Execute this on the local machine of the player.
*
* Argument:
* 0: Name of the action shown in the menu (String)
* 1: Condition (Code or String)
* 2: Statement (Code or String)
* 3: Show the action even if the conditon is not met (Bool or Number)
* 4: Priority (Number, optional default: 0)
*
* Return value:
* ID of the action (used to remove it later).
*/
#include "script_component.hpp"
private ["_displayName", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"];
_displayName = _this select 0;
_condition = _this select 1;
_statement = _this select 2;
_showDisabled = _this select 3;
_priority = _this select 4;
if (typeName _condition == "STRING") then {
_condition = compile _condition;
};
if (typeName _statement == "STRING") then {
_statement = compile _statement;
};
if (typeName _showDisabled == "SCALAR") then {
_showDisabled = _showDisabled > 0;
};
if (isNil "_priority") then {
_priority = 0;
};
_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]];
_id = (_actionsVar select 0) + 1;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_actionIDs pushBack _id;
_actions pushBack [_displayName, _condition, _statement, _showDisabled, _priority];
ACE_player setVariable [QGVAR(InteractionsSelf), [_id, _actionIDs, _actions], false];
_id

View File

@ -1,5 +0,0 @@
// by commy2
#include "script_component.hpp"
GVAR(CurrentTooltip) pushBack (_this select 0);

View File

@ -2,13 +2,10 @@
#include "script_component.hpp"
private ["_unit", "_isCivilian"];
_unit = _this select 0;
_isCivilian = _this select 1;
EXPLODE_2_PVT(_this,_unit,_isCivilian);
if (isNil "_isCivilian") then {_isCivilian = true};
alive _unit
&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian
//&& {count (weapons _unit) == 0}
//&& {count (weapons _unit) == 0}

View File

@ -1,121 +0,0 @@
// commy2
#include "script_component.hpp"
private ["_object", "_config", "_type", "_actions", "_configs"];
_object = _this select 0;
_config = _this select 1; // configFile, missionConfigFile
_type = _this select 2; // "ACE_CfgInteractions", "ACE_CfgInteractionsSelf"
_actions = _this select 3; // [];
_configs = "_object isKindOf configName _x" configClasses (_config >> _type);
// cache
private ["_cache", "_cacheConfigs", "_cacheActions", "_cacheIndices"];
_cache = uiNamespace getVariable [QGVAR(MenuCache), [[], [], []]];
_cacheConfigs = _cache select 0;
_cacheActions = _cache select 1;
_cacheIndices = _cache select 2;
// get interactions
{
private "_configActions";
_configActions = "true" configClasses (_config >> _type >> configName _x);
{
private ["_action", "_configName", "_indexCache"];
_action = _x;
_configName = configName _action;
_indexCache = _cacheConfigs find _action;
if (_indexCache == -1) then {
private ["_displayName", "_distance", "_priority", "_subMenu", "_tooltip", "_hotkey", "_enableInside", "_condition", "_conditionShow", "_showDisabled", "_exceptions", "_statement", "_icon"];
_displayName = getText (_action >> "displayName");
_distance = getNumber (_action >> "distance");
_priority = getNumber (_action >> "priority");
_subMenu = getArray (_action >> "subMenu");
_tooltip = getText (_action >> "tooltip");
_hotkey = getText (_action >> "hotkey");
_enableInside = getNumber (_action >> "enableInside");
// Condition
_condition = getText (_action >> "condition");
if (_condition == "") then {_condition = "true"};
_condition = _condition + format [QUOTE(&& {%1 call EFUNC(common,canInteract)} && {[ARR_2(ACE_player, GVAR(Target))] call FUNC(canInteractWith)}), getArray (_action >> "exceptions")];
if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"};
_condition = compile _condition;
// Condition to show the action
_conditionShow = getText (_action >> "conditionShow");
_conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow};
_showDisabled = getNumber (_action >> "showDisabled") == 1;
if (isText (_action >> "conditionShow")) then {
_showDisabled = [_object, _player] call _conditionShow;
};
// Exceptions to the general conditions that have to be true
_exceptions = getArray (_action >> "exceptions");
// statement
_statement = getText (_action >> "statement");
_statement = compile _statement;
if (GVAR(FlowMenu)) then {
_statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then {
compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1];
} else {
compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement"));
};
};
// icon
_icon = getText (_action >> "Icon");
if (_icon == "") then {
_icon = DEFAULT_ICON;
};
private "_actionToCache";
_actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey];
if ((_showDisabled || {[_object, _player] call _condition}) && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then {
_actions pushBack _actionToCache;
};
_indexCache = _cacheActions find _actionToCache;
if (_indexCache == -1) then {
_indexCache = count _cacheActions;
_cacheActions pushBack _actionToCache;
};
_cacheConfigs pushBack _action;
_cacheIndices pushBack _indexCache;
_cache = [_cacheConfigs, _cacheActions, _cacheIndices];
["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(common,log);
} else {
["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(common,log);
private ["_cachedAction", "_showDisabled"];
_cachedAction = _cacheActions select (_cacheIndices select _indexCache);
_showDisabled = getNumber (_action >> "showDisabled") == 1;
if (isText (_action >> "conditionShow")) then {
_showDisabled = [_object, _player] call (_cachedAction select 7);
};
if ((_showDisabled || {[_object, _player] call (_cachedAction select 2)}) && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then {
_actions pushBack _cachedAction;
};
};
} forEach _configActions; //Actions of this CfgVehicles class
} forEach _configs; //CfgVehicles class
uiNamespace setVariable [QGVAR(MenuCache), _cache];
_actions

View File

@ -1,167 +0,0 @@
/*
Author:
commy2
Garth de Wet (LH)
Description:
Initialises the interaction click handlers.
Parameters:
0 : CODE - code to call when right clicking/center button
1 : BOOLEAN - Submenu
2 : BOOLEAN - Flow Menu
3 : BOOLEAN - Self interaction
4 : OBJECT - Target
Returns:
Nothing
Example:
[{"Default" call FUNC(openMenu);}, true, (profileNamespace getVariable [QGVAR(FlowMenu), false]), GVAR(Target)] call FUNC(initialiseInteraction);
*/
#include "script_component.hpp"
private ["_subMenu", "_selfMenu", "_target"];
GVAR(MainButton) = _this select 0;
_subMenu = _this select 1;
_selfMenu = _this select 3;
_target = _this select 4;
_player = ACE_player;
_vehicle = vehicle _player;
//_object = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
if !([_target, 5] call FUNC(isInRange)) exitWith {};
GVAR(Shortcuts) = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
// Flow menu
if (_this select 2) then {
(QGVAR(FlowMenu) call BIS_fnc_rscLayer) cutRsc [QGVAR(FlowMenu), "PLAIN",0.5, false];
ACE_Interaction_SelectedButton = 0;
(findDisplay 1713999) closeDisplay 1;
if (_player getVariable ["ACE_AcceptAction", -1] == -1) then {
[{if(isNil {GVAR(MainButton)} || {!(profileNamespace getVariable [QGVAR(FlowMenu), false])})exitWith{false};(-(_this select 0) / 1.2) call FUNC(MoveDown);true}] call EFUNC(common,addScrollWheelEventHandler);
_player setVariable ["ACE_AcceptAction", [_player, "DefaultAction", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {_action = GVAR(Buttons) select ACE_Interaction_SelectedButton;_target = GVAR(Target);_player = ACE_player;_vehicle = vehicle _player;if ([_target, _player] call (_action select 2)) then {call FUNC(hideMenu);if(count _action == 12) then{(_action select 11) call (_action select 1);}else{[_target, _player] call (_action select 1);};};}] call EFUNC(common,addActionEventHandler)];
_player setVariable ["ACE_AcceptAction", [_player, "menuBack", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {call GVAR(MainButton);}] call EFUNC(common,addActionEventHandler)];
};
0 call FUNC(moveDown);
[localize "STR_ACE_Interaction_MakeSelection", if (_subMenu)then{localize "STR_ACE_Interaction_Back"}else{""}, localize "STR_ACE_Interaction_ScrollHint"] call FUNC(showMouseHint);
((uiNamespace getVariable QGVAR(Flow_Display)) displayCtrl (1210)) ctrlShow _subMenu;
}else{ // Rose
if (!isNull(uiNamespace getVariable QGVAR(Flow_Display))) then {
(uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0;
call FUNC(hideMouseHint);
};
if (!_subMenu || {isNull (findDisplay 1713999)}) then {
(findDisplay 1713999) closeDisplay 1;
(findDisplay 46) createDisplay QGVAR(Dialog);
// Add eventhandlers
/*(findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))];
(findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))];*/
(findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call FUNC(menuKeyInput))];
};
disableSerialization;
_dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog);
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3;
if (GVAR(AutoCenterCursor)) then {setMousePosition [0.5, 0.5]};
if !(_subMenu) then {
_ctrlInteractionDialog ctrlSetText ([_target] call EFUNC(common,getName));
} else {
_ctrlInteractionDialog ctrlSetText localize "STR_ACE_Interaction_Back";
};
_buttons = GVAR(Buttons);
_count = count _buttons;
for "_i" from 0 to 9 do {
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _i);
_ctrlInteractionDialog ctrlShow true;
_ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _i);
_ctrlInteractionDialogShortcut = _dlgInteractionDialog displayCtrl (30 + _i);
//_ctrlInteractionDialogBackground = _dlgInteractionDialog displayCtrl (40 + _i);
if (_i < _count) then {
_action = _buttons select _i;
_ctrlInteractionDialog ctrlSetText (_action select 0);
_ctrlInteractionDialog ctrlEnable ([_target, _player] call (_action select 2));
_ctrlInteractionDialog ctrlSetTooltip (_action select 6);
_ctrlInteractionDialogIcon ctrlSetText (_action select 5);
_ctrlInteractionDialogShortcut ctrlSetText (_action select 10);
//_ctrlInteractionDialogBackground ctrlShow true;
GVAR(Shortcuts) set [_i, [_action select 10] call EFUNC(common,letterToCode)];
} else {
_ctrlInteractionDialog ctrlSetText "";
_ctrlInteractionDialog ctrlEnable false;
_ctrlInteractionDialog ctrlSetTooltip "";
_ctrlInteractionDialogIcon ctrlSetText "";
_ctrlInteractionDialogShortcut ctrlSetText "";
//_ctrlInteractionDialogBackground ctrlShow false;
};
};
// Update Buttons
terminate (missionNamespace getVariable [QGVAR(updateMenuHandle), scriptNull]);
GVAR(updateMenuHandle) = 0 spawn {
disableSerialization;
_dlgMenu = uiNamespace getVariable [QGVAR(Dialog), displayNull];
_ctrlTooltip = _dlgMenu displayCtrl 40;
_player = ACE_player;
_vehicle = vehicle _player;
_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
waitUntil {
if !([_target, 5] call FUNC(isInRange)) exitWith {
(findDisplay 1713999) closeDisplay 1
};
GVAR(Tooltips) = [[], [], [], [], [], [], [], [], [], []];
{
_ctrlText = _dlgMenu displayCtrl (10 + _forEachIndex);
_ctrlIcon = _dlgMenu displayCtrl (20 + _forEachIndex);
_condition = _x select 2;
_conditionShow = _x select 7;
_distance = _x select 9;
GVAR(CurrentTooltip) = [];
_enable = (_distance == 0 || {[_target, _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow};
if (isNil "_enable") then {_enable = false};
GVAR(Tooltips) set [_forEachIndex, GVAR(CurrentTooltip)];
// apply conditional tooltips
/*if (_forEachIndex == call ACE_Interaction_fnc_getSelectedButton) then {
_tooltip = _x select 6;
_showTooltip = _tooltip != "";
_tooltip = text _tooltip;
{
_showTooltip = true;
_tooltip = composeText [_tooltip, lineBreak, _x];
} forEach (GVAR(Tooltips) select _forEachIndex);
_ctrlTooltip ctrlSetStructuredText _tooltip;
_ctrlTooltip ctrlShow _showTooltip;
};*/
_ctrlText ctrlEnable _enable;
_ctrlIcon ctrlEnable _enable;
} forEach GVAR(Buttons);
sleep 0.5;
isNull (findDisplay 1713999)
};
};
};

View File

@ -1,17 +0,0 @@
// by commy2
#include "script_component.hpp"
private "_key";
_key = _this select 1;
if (_key in [28, 57, 156, 200, 208, 203, 205, 201, 209]) exitWith {true};
_index = GVAR(Shortcuts) find _key;
if (_index != -1 && {ctrlEnabled (findDisplay 1713999 displayCtrl (_index + 10))}) exitWith {
_index call FUNC(onClick);
true
};
false

View File

@ -1,18 +0,0 @@
// by commy2
#include "script_component.hpp"
if (dialog) exitWith {
closeDialog 0;
};
if (isNull (findDisplay 1713999)) then {
if (ACE_player == vehicle ACE_player) then {"" call FUNC(openMenu)} else {[ACE_player, vehicle ACE_player] call FUNC(openMenuSelectUI)};
setMousePosition [0.5, 0.5];
} else {
(findDisplay 1713999) closeDisplay 1;
};
// Raise custom event. @todo: remove
[_player, "interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,callCustomEventHandlers);
// Raise ACE localEvent
["interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,localEvent);

View File

@ -1,18 +0,0 @@
// by commy2
#include "script_component.hpp"
if (dialog) exitWith {
closeDialog 0;
};
if (isNull (findDisplay 1713999)) then {
"" call FUNC(openMenuSelf);
setMousePosition [0.5, 0.5];
} else {
(findDisplay 1713999) closeDisplay 1;
};
// Raise custom event. @todo: remove
[_player, "interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,callCustomEventHandlers);
// Raise ACE localEvent
["interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,localEvent);

View File

@ -1,7 +0,0 @@
// by commy2
#include "script_component.hpp"
private "_target";
_target = [cursorTarget, GVAR(Target)] select (_this == "Default");
[0, _target, ""] call FUNC(showMenu);

View File

@ -1,4 +0,0 @@
// by commy2
#include "script_component.hpp"
[1, ACE_player, ""] call FUNC(showMenu);

View File

@ -1,4 +0,0 @@
// by commy2
#include "script_component.hpp"
[2, GVAR(Target), _this select 0] call FUNC(showMenu);

View File

@ -1,4 +0,0 @@
// by commy2
#include "script_component.hpp"
[3, ACE_player, _this select 0] call FUNC(showMenu);

View File

@ -18,18 +18,15 @@
private ["_buttonAction", "_header", "_buttonText", "_cancelButton"];
closeDialog 0;
if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) exitWith {
_header = _this select 0;
_buttonText = _this select 1;
if (isNil "_buttonText" or {_buttonText == ""}) then {
_buttonText = localize "STR_ACE_Interaction_MakeSelection";
};
createDialog "RscACE_SelectAnItem";
ctrlSetText [8860, _buttonText];
ctrlSetText [8870, _header];
lbClear 8866;
8866
_header = _this select 0;
_buttonText = _this select 1;
if (isNil "_buttonText" or {_buttonText == ""}) then {
_buttonText = localize "STR_ACE_Interaction_MakeSelection";
};
[]
createDialog "RscACE_SelectAnItem";
ctrlSetText [8860, _buttonText];
ctrlSetText [8870, _header];
lbClear 8866;
8866

View File

@ -1,36 +0,0 @@
/*
* Author: commy2
*
* Remove an ACE action from an object. Note: This function is global.
*
* Argument:
* 0: Object (Object)
* 1: ID of the action (Number)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_object", "_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"];
_object = _this select 0;
_id = _this select 1;
_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]];
_currentID = _actionsVar select 0;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs set [_id, -1];
_actionIDs = _actionIDs - [-1];
_actions set [_id, []];
_actions = _actions - [[]];
_object setVariable [QGVAR(Interactions), [_currentID, _actionIDs, _actions], true];

View File

@ -1,35 +0,0 @@
/*
* Author: commy2
*
* Remove an ACE self action from the player.
*
* Argument:
* 0: ID of the action (Number)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"];
_id = _this select 0;
_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]];
_currentID = _actionsVar select 0;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs set [_id, -1];
_actionIDs = _actionIDs - [-1];
_actions set [_id, []];
_actions = _actions - [[]];
ACE_player setVariable [QGVAR(InteractionsSelf), [_currentID, _actionIDs, _actions], false];

View File

@ -1,118 +0,0 @@
/*
Author:
commy2
Garth de Wet (LH)
aeroson
Description:
Parameters:
0: NUMBER - Menu type (0 - interaction, 1 - self-interaction, 2 - sub-interaction, 3 - sub-self-interaction)
1: OBJECT - Target object
2: STRING - Sub-Menu ClassName
Returns:
Nothing
Example:
[0, GVAR(Target)] call FUNC(showMenu);
[1, player] call FUNC(showMenu);
[2, GVAR(Target), "ACE_Explosives"] call FUNC(showMenu);
[3, player, "ACE_Explosives"] call FUNC(showMenu);
*/
#include "script_component.hpp"
private ["_player", "_vehicle", "_mainButtonAction", "_object", "_index", "_actions", "_result", "_menuType"];
#define DEFAULT_ICON QUOTE(PATHOF(UI\dot_ca.paa))
#define DEFAULT_DISTANCE 4 // seems to be 4
_player = ACE_player;
_vehicle = vehicle _player;
GVAR(MenuType) = _this select 0; // 0 Interaction, 1 Self Interaction
_mainButtonAction = [
{call FUNC(hideMenu)},
{call FUNC(hideMenu)},
{"Default" call FUNC(openMenu)},
{"Default" call FUNC(openMenuSelf)}
] select GVAR(MenuType);
_menuType = GVAR(MenuType) % 2;
uiNamespace setVariable [QGVAR(CursorPosition), [controlNull, 0.5, 0.5, -1]];
GVAR(Target) = _this select 1;
_object = GVAR(Target);
if (_menuType == 0 && {(isNull (_object) || {!([_object, 4] call FUNC(isInRange))})}) exitWith {};
if !([_player, _object] call EFUNC(common,canInteractWith)) exitWith {};
// add actions or self actions of GVAR(Target)
_parents = [configFile >> "CfgVehicles" >> typeOf _object, true] call BIS_fnc_returnParents;
_result = [_object, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions);
_actions = ([_object, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0);
// add self actions of vehicle _player
if (_menuType == 1 && {_player != _vehicle}) then {
_parents = [configFile >> "CfgVehicles" >> typeOf _vehicle, true] call BIS_fnc_returnParents;
_result = [_vehicle, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions);
_actions = _actions + (([_vehicle, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0));
};
// custom defined actions, stored in variable instead of cfg like above
if (GVAR(MenuType) < 2) then {
private ["_customActions", "_customAction", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority"];
// add interactions or self interactions of GVAR(Target)
_customActions = (_object getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2;
// add self interactions of vehicle _player
if (_menuType == 1 && {_player != _vehicle}) then {
_customActions = _customActions + ((_vehicle getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2);
};
if(_menuType==0) then {
private ["_distance"];
for "_index" from 0 to (count _customActions - 1) do {
_customAction = _customActions select _index;
_displayName = _customAction select 0;
_distance = _customAction select 1;
_condition = _customAction select 2;
_statement = _customAction select 3;
_showDisabled = _customAction select 4;
_priority = _customAction select 5;
if ((_showDisabled || {[_object, _player] call _condition}) && {[_object, _distance] call FUNC(isInRange) || {_distance == 0}}) then {
_actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], _distance, ""];
};
};
} else { // self interactions do not have distance
for "_index" from 0 to (count _customActions - 1) do {
_customAction = _customActions select _index;
_displayName = _customAction select 0;
_condition = _customAction select 1;
_statement = _customAction select 2;
_showDisabled = _customAction select 3;
_priority = _customAction select 4;
if (_showDisabled || {[_object, _player] call _condition}) then {
_actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], DEFAULT_DISTANCE, ""];
};
};
};
};
if (count _actions == 0) exitWith {};
_actions call FUNC(sortOptionsByPriority);
GVAR(Buttons) = _actions;
[_mainButtonAction, (_this select 2) != "", (profileNamespace getVariable [QGVAR(FlowMenu), false]), _menuType == 1, _object] call FUNC(initialiseInteraction);

View File

@ -5,6 +5,24 @@
<Key ID="STR_ACE_Interaction_MainAction">
<English>Interactions &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_Head">
<English>Head &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_ArmLeft">
<English>Left Arm &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_ArmRight">
<English>Right Arm &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_LegLeft">
<English>Left Leg &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_LegRight">
<English>Right Leg &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_Weapon">
<English>Weapon &gt;&gt;</English>
</Key>
<Key ID="STR_ACE_Interaction_InteractionMenu">
<English>Interaction Menu</English>
<German>Interaktionsmenü</German>
@ -569,18 +587,6 @@
<Italian>Perdona</Italian>
<Hungarian>Megbocsátás</Hungarian>
</Key>
<Key ID="STR_ACE_Interaction_FlowMenu">
<English>Flow Menu</English>
<German>Mausradmenü</German>
<Polish>Flow Menu</Polish>
<Spanish>Menú desplegable</Spanish>
<French>Menu Déroulant</French>
<Czech>Flow Menu</Czech>
<Russian>Выпадающее меню</Russian>
<Portuguese>Flow Menu</Portuguese>
<Italian>Menù a Scorrimento</Italian>
<Hungarian>Legördülő menü</Hungarian>
</Key>
<Key ID="STR_ACE_Interaction_ScrollHint">
<English>Scroll</English>
<German>Scrollen</German>
@ -616,25 +622,6 @@
<Polish>Poza zasięgiem</Polish>
<Czech>Mimo dosah</Czech>
</Key>
<Key ID="STR_ACE_Interaction_AutoCloseMenu">
<English>Close Menu on Key Release</English>
<German>Menü nach Loslassen schließen</German>
<Polish>Zamknij menu automatycznie</Polish>
<French>Fermer le menu en relâchant la touche</French>
<Spanish>Cerrar menú al soltar la tecla</Spanish>
<Hungarian>Menü bezárása a billentyű elengedésekor</Hungarian>
<Russian>Закрывать меню при отжатии клавиши</Russian>
<Czech>Menu interakce (Na držení)</Czech>
</Key>
<Key ID="STR_ACE_Interaction_AutoCenterCursor">
<English>Auto Center Cursor</English>
<German>Mauszeiger automatisch zentrieren</German>
<Spanish>Auto-centrar cursor</Spanish>
<Polish>Automatycznie centruj kursor </Polish>
<Czech>Vycentrování kurzoru</Czech>
<Hungarian>Egér auto-centrírozása</Hungarian>
<Russian>Автоцентрирование курсора</Russian>
</Key>
<Key ID="STR_ACE_Interaction_Equipment">
<English>Equipment &gt;&gt;</English>
<German>Ausrüstung &gt;&gt;</German>

View File

@ -54,6 +54,5 @@ _actions,
{ [_this] call FUNC(startRepackingMagazine); },
{
call EFUNC(interaction,hideMenu); //ToDo: Self Interaction Integration
if !(profileNamespace getVariable [QGVAR(AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -0,0 +1,13 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_FiredBIS_EventHandlers {
class AllVehicles {
class ADDON {
firedBIS = QUOTE(_this call FUNC(forceMagazineMuzzleVelocity));
};
};
};

View File

@ -22,6 +22,7 @@ class CfgMagazines {
descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription";
picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa";
initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
};
class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag {
@ -57,6 +58,7 @@ class CfgMagazines {
displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort";
descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription";
initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
};
class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green {
@ -88,6 +90,7 @@ class CfgMagazines {
displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort";
descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription";
initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa";
};
@ -127,6 +130,7 @@ class CfgMagazines {
displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort";
descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription";
initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
};
class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag {

View File

@ -1,5 +1,5 @@
class SlotInfo;
class MuzzleSlot;
class CfgWeapons {
@ -20,7 +20,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_H"};
};
};
@ -59,7 +59,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_H"};
};
};
@ -74,7 +74,7 @@ class CfgWeapons {
class EBR_base_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_B"};
};
};
@ -82,7 +82,7 @@ class CfgWeapons {
class DMR_01_base_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_B"};
};
};
@ -90,7 +90,7 @@ class CfgWeapons {
class LMG_Mk200_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_H"};
};
};
@ -98,7 +98,7 @@ class CfgWeapons {
class LMG_Zafir_F: Rifle_Long_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_B"};
};
};
@ -115,7 +115,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_L"};
};
};
@ -129,7 +129,7 @@ class CfgWeapons {
};
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_L"};
};
};
@ -148,7 +148,7 @@ class CfgWeapons {
class pdw2000_base_F: Rifle_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
};
@ -156,7 +156,7 @@ class CfgWeapons {
class SMG_01_Base: Rifle_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_01"};
};
};
@ -164,7 +164,7 @@ class CfgWeapons {
class SMG_02_base_F: Rifle_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
};
@ -180,7 +180,7 @@ class CfgWeapons {
class hgun_P07_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
@ -189,7 +189,7 @@ class CfgWeapons {
class hgun_Rook40_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
compatibleItems[] += {"ACE_muzzle_mzls_smg_02"};
};
@ -198,7 +198,7 @@ class CfgWeapons {
class hgun_ACPC2_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_01"};
};
};
@ -206,7 +206,7 @@ class CfgWeapons {
class hgun_Pistol_heavy_01_F: Pistol_Base_F {
class WeaponSlotsInfo: WeaponSlotsInfo {
class MuzzleSlot: SlotInfo {
class MuzzleSlot: MuzzleSlot {
compatibleItems[] += {"ACE_muzzle_mzls_smg_01"};
};
};

View File

@ -0,0 +1,7 @@
#include "script_component.hpp"
ADDON = false;
PREP(forceMagazineMuzzleVelocity);
ADDON = true;

View File

@ -12,6 +12,8 @@ class CfgPatches {
};
};
#include "CfgEventHandlers.hpp"
#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"

View File

@ -0,0 +1,41 @@
/*
* Author: commy2
*
* DESCRIPTION.
*
* Arguments:
* firedBIS
*
* Return Value:
* None
*/
#include "script_component.hpp"
private ["_weapon", "_magazine", "_projectile"];
_weapon = _this select 1;
_magazine = _this select 5;
_projectile = _this select 6;
if (getNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(forceMagazineMuzzleVelocity)) != 1) exitWith {
//hint str (speed _projectile / 3.6);
};
private ["_initSpeedWeapon", "_initSpeedMagazine"];
_initSpeedWeapon = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
_initSpeedMagazine = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
//systemChat format ["W: %1m/s, M: %2m/s", _initSpeedWeapon, _initSpeedMagazine];
// force magazine initSpeed
private ["_credit", "_debit"];
_credit = vectorMagnitude velocity _projectile;
_debit = _credit + (_initSpeedMagazine - _initSpeedWeapon);
_projectile setVelocity ((velocity _projectile) vectorMultiply (_debit / _credit));
//hint str (speed _projectile / 3.6);

View File

@ -0,0 +1 @@
#include "\z\ace\addons\magazines\script_component.hpp"

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,6 @@ class CfgVehicles {
exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)};
showDisabled = 0;
priority = 100;
subMenu[] = {"ACE_MapTools", 1};
enableInside = 1;
class ACE_MapToolsHide {

View File

@ -1 +1 @@
z\ace\Addons\medical
z\ace\addons\medical

View File

@ -0,0 +1,724 @@
class ACE_Medical_Actions {
class Basic {
// @todo: localization
class Bandage {
displayName = "Bandage";
displayNameProgress = "Bandaging ...";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 5;
treatmentTimeSelfCoef = 1;
items[] = {{QGVAR(fieldDressing), QGVAR(packingBandage), QGVAR(elasticBandage), QGVAR(quikClot)}};
itemConsumed = 1;
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bandage));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationCaller = "AinvPknlMstpSnonWnonDnon_medic4";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
};
class Morphine: Bandage {
displayName = "Morphine";
displayNameProgress = "Injecting Morphine ...";
treatmentTime = 2;
items[] = {QGVAR(morphine)};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
class Epipen: Bandage {
displayName = "Epinephrine";
displayNameProgress = "Injecting Epinephrine ...";
requiredMedic = 1;
treatmentTime = 3;
items[] = {QGVAR(epipen)};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
class Bloodbag: Bandage {
displayName = "Blood Bag";
displayNameProgress = "Transfusing Blood ...";
requiredMedic = 1;
treatmentTime = 20;
items[] = {{QGVAR(bloodIV), QGVAR(bloodIV_500), QGVAR(bloodIV_250)}};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
};
class Advanced {
// cse_surgical_kit cse_bandage_basic cse_packing_bandage cse_bandageElastic cse_tourniquet cse_splint cse_morphine cse_atropine cse_epinephrine cse_plasma_iv cse_plasma_iv_500 cse_plasma_iv250 cse_blood_iv cse_blood_iv_500 cse_blood_iv_250 cse_saline_iv cse_saline_iv_500 cse_saline_iv_250 cse_quikclot cse_nasopharyngeal_tube cse_opa cse_liquidSkin cse_chestseal cse_personal_aid_kit
class FieldDressing {
// Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All.
treatmentLocations[] = {"All"};
// What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor
requiredMedic = 0;
// The time it takes for a treatment action to complete. Time is in seconds.
treatmentTime = 5;
// Item required for the action. Leave empty for no item required.
items[] = {QGVAR(fieldDressing)};
// Callbacks
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationCaller = ""; // TODO
itemConsumed = 1;
};
class PackingBandage: fieldDressing {
items[] = {QGVAR(packingBandage)};
};
class ElasticBandage: fieldDressing {
items[] = {QGVAR(elasticBandage)};
};
class QuikClot: fieldDressing {
items[] = {QGVAR(quikClot)};
};
class Tourniquet: fieldDressing {
items[] = {QGVAR(tourniquet)};
treatmentTime = 6;
callbackSuccess = QUOTE(DFUNC(treatmentTourniquet));
};
class Morphine: fieldDressing {
items[] = {QGVAR(morphine)};
treatmentTime = 3;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication));
};
class Atropine: fieldDressing {
items[] = {QGVAR(atropine)};
};
class Epinephrine: fieldDressing {
items[] = {QGVAR(epinephrine)};
};
class BloodIV: fieldDressing {
items[] = {QGVAR(bloodIV)};
requiredMedic = 1;
treatmentTime = 7;
callbackSuccess = QUOTE(DFUNC(treatmentIV));
};
class BloodIV_500: BloodIV {
items[] = {QGVAR(bloodIV_500)};
};
class BloodIV_250: BloodIV {
items[] = {QGVAR(bloodIV_250)};
};
class PlasmaIV: BloodIV {
items[] = {QGVAR(plasmaIV)};
};
class PlasmaIV_500: PlasmaIV {
items[] = {QGVAR(plasmaIV_500)};
};
class PlasmaIV_250: PlasmaIV {
items[] = {QGVAR(plasmaIV_250)};
};
class SalineIV: BloodIV {
items[] = {QGVAR(salineIV)};
};
class SalineIV_500: SalineIV {
items[] = {QGVAR(salineIV_500)};
};
class SalineIV_250: SalineIV {
items[] = {QGVAR(salineIV_250)};
};
class SurgicalKit: fieldDressing {
items[] = {QGVAR(surgicalKit)};
treatmentLocations[] = {"MedicalFacility", "MedicalVehicle"};
requiredMedic = 2;
treatmentTime = 15;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit));
itemConsumed = 0;
};
class PersonalAidKit: fieldDressing {
items[] = {QGVAR(personalAidKit)};
treatmentLocations[] = {"All"};
requiredMedic = 1;
treatmentTime = 15;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
itemConsumed = 0;
};
class CheckPulse: fieldDressing {
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 2;
items[] = {};
callbackSuccess = QUOTE(DFUNC(actionCheckPulse));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationCaller = ""; // TODO
itemConsumed = 0;
};
class CheckBloodPressure: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
};
class CheckResponse: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckResponse));
};
class RemoveTourniquet: CheckPulse {
treatmentTime = 2.5;
callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet));
};
class CPR: fieldDressing {
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 25;
items[] = {};
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationCaller = ""; // TODO
itemConsumed = 0;
};
};
};
class ACE_Medical_Advanced {
// Defines all the possible injury types for advanced medical
class Injuries {
// All the possible wounds
class wounds {
// Source: Scarle
// Also called scrapes, they occur when the skin is rubbed away by friction against another rough surface (e.g. rope burns and skinned knees).
class Abrasion {
name = "Scrape";
selections[] = {"All"};
bleedingRate = 0.0001;
pain = 0.1;
causes[] = {"falling", "ropeburn", "vehiclecrash"};
minDamage = 0.01;
class Minor {
minDamage = 0.01;
bleedingRate = 0.0001;
};
class Medium {
minDamage = 0.2;
bleedingRate = 0.00015;
};
class Large {
minDamage = 0.3;
bleedingRate = 0.0002;
};
};
// Occur when an entire structure or part of it is forcibly pulled away, such as the loss of a permanent tooth or an ear lobe. Explosions, gunshots, and animal bites may cause avulsions.
class Avulsions {
name = "Avulsion";
selections[] = {"All"};
bleedingRate = 0.01;
pain = 1;
causes[] = {"explosive", "vehiclecrash", "grenade", "shell", "bullet", "backblast", "bite"};
minDamage = 0.2;
class Minor {
minDamage = 0.2;
bleedingRate = 0.01;
};
class Medium {
minDamage = 0.3;
bleedingRate = 0.02;
};
class Large {
minDamage = 0.5;
bleedingRate = 0.05;
};
};
// Also called bruises, these are the result of a forceful trauma that injures an internal structure without breaking the skin. Blows to the chest, abdomen, or head with a blunt instrument (e.g. a football or a fist) can cause contusions.
class Contusion {
name = "Bruise";
selections[] = {"All"};
bleedingRate = 0.0;
pain = 1;
causes[] = {"bullet", "backblast", "punch","vehiclecrash","falling"};
minDamage = 0.01;
class Minor {
minDamage = 0.01;
};
class Medium {
minDamage = 0.1;
};
class Large {
minDamage = 0.3;
};
};
// Occur when a heavy object falls onto a person, splitting the skin and shattering or tearing underlying structures.
class CrushWound {
name = "Crushed tissue";
selections[] = {"All"};
bleedingRate = 0.01;
pain = 1;
causes[] = {"falling", "vehiclecrash", "punch"};
minDamage = 0.1;
class Minor {
minDamage = 0.1;
bleedingRate = 0.005;
};
class Medium {
minDamage = 0.4;
bleedingRate = 0.007;
};
class Large {
minDamage = 0.6;
bleedingRate = 0.0095;
};
};
// Slicing wounds made with a sharp instrument, leaving even edges. They may be as minimal as a paper cut or as significant as a surgical incision.
class Cut {
name = "Cut";
selections[] = {"All"};
bleedingRate = 0.01;
pain = 1;
causes[] = {"vehiclecrash", "grenade", "explosive", "shell", "backblast", "stab"};
minDamage = 0.1;
class Minor {
minDamage = 0.1;
bleedingRate = 0.005;
};
class Medium {
minDamage = 0.3;
bleedingRate = 0.02;
};
class Large {
minDamage = 0.65;
bleedingRate = 0.05;
};
};
// Also called tears, these are separating wounds that produce ragged edges. They are produced by a tremendous force against the body, either from an internal source as in childbirth, or from an external source like a punch.
class Laceration {
name = "Tear";
selections[] = {"All"};
bleedingRate = 0.01;
pain = 1;
causes[] = {"vehiclecrash", "punch"};
minDamage = 0.01;
class Minor {
minDamage = 0.1;
bleedingRate = 0.005;
};
class Medium {
minDamage = 0.5;
bleedingRate = 0.01;
};
class Large {
minDamage = 0.7;
bleedingRate = 0.03;
};
};
// Also called velocity wounds, they are caused by an object entering the body at a high speed, typically a bullet or small peices of shrapnel.
class velocityWound {
name = "Velocity Wound";
selections[] = {"All"};
bleedingRate = 0.01;
pain = 1;
causes[] = {"bullet", "grenade","explosive", "shell"};
minDamage = 0.15;
class Minor {
minDamage = 0.15;
bleedingRate = 0.025;
};
class Medium {
minDamage = 0.3;
bleedingRate = 0.05;
};
class Large {
minDamage = 0.75;
bleedingRate = 0.1;
};
};
// Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass.
class punctureWound {
name = "Puncture Wound";
selections[] = {"All"};
bleedingRate = 0.01;
pain = 1;
causes[] = {"stab", "grenade"};
minDamage = 0.01;
class Minor {
minDamage = 0.01;
bleedingRate = 0.01;
};
class Medium {
minDamage = 0.5;
bleedingRate = 0.03;
};
class Large {
minDamage = 0.65;
bleedingRate = 0.08;
};
};
};
class fractures {
class Femur {
name = "Broken Femur";
selections[] = {"Head", "Torso"};
pain = 20;
causes[] = {"Bullet", "VehicleCrash", "Backblast", "Explosive", "Shell", "Grenade"};
minDamage = 0.5;
};
};
class damageTypes {
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
class bullet {
// above damage, amount. Put the highest threshold to the left and lower the threshold with the elements to the right of it.
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
};
class grenade {
thresholds[] = {{0.1, 3}, {0, 1}};
selectionSpecific = 0;
};
class explosive {
thresholds[] = {{1, 6}, {0.1, 4}, {0, 1}};
selectionSpecific = 0;
};
class shell {
thresholds[] = {{1, 7}, {0.1, 5}, {0, 1}};
selectionSpecific = 0;
};
class vehiclecrash {
thresholds[] = {{0.25, 5}};
selectionSpecific = 0;
};
class backblast {
thresholds[] = {{0.25, 5}};
selectionSpecific = 0;
};
class stab {
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
};
class punch {
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
};
class falling {
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
};
class ropeburn {
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
};
};
};
class Treatment {
class Bandaging {
class FieldDressing {
// How effect is the bandage for treating one wounds type injury
effectiveness = 1;
// What is the chance and delays (in seconds) of the treated default injury reopening
reopeningChance = 0.1;
reopeningMinDelay = 120;
reopeningMaxDelay = 200;
class Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class Avulsions: Abrasion {
effectiveness = 0.3;
reopeningChance = 0.5;
reopeningMinDelay = 120;
reopeningMaxDelay = 200;
};
class Contusion: Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class CrushWound: Abrasion {
effectiveness = 0.6;
reopeningChance = 0.2;
reopeningMinDelay = 120;
reopeningMaxDelay = 200;
};
class Cut: Abrasion {
effectiveness = 0.4;
reopeningChance = 0.5;
reopeningMinDelay = 220;
reopeningMaxDelay = 260;
};
class Laceration: Abrasion {
effectiveness = 0.7;
reopeningChance = 0.3;
reopeningMinDelay = 120;
reopeningMaxDelay = 260;
};
class velocityWound: Abrasion {
effectiveness = 0.3;
reopeningChance = 0.8;
reopeningMinDelay = 20;
reopeningMaxDelay = 300;
};
class punctureWound: Abrasion {
effectiveness = 0.5;
reopeningChance = 0.8;
reopeningMinDelay = 20;
reopeningMaxDelay = 300;
};
};
class PackingBandage: fieldDressing {
class Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class Avulsions: Abrasion {
effectiveness = 1;
reopeningChance = 0.3;
reopeningMinDelay = 120;
reopeningMaxDelay = 200;
};
class Contusion: Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class CrushWound: Abrasion {
effectiveness = 0.6;
reopeningChance = 0.2;
reopeningMinDelay = 120;
reopeningMaxDelay = 200;
};
class Cut: Abrasion {
effectiveness = 0.2;
reopeningChance = 0.6;
reopeningMinDelay = 30;
reopeningMaxDelay = 260;
};
class Laceration: Abrasion {
effectiveness = 0.3;
reopeningChance = 0.3;
reopeningMinDelay = 120;
reopeningMaxDelay = 260;
};
class velocityWound: Abrasion {
effectiveness = 1;
reopeningChance = 0.5;
reopeningMinDelay = 20;
reopeningMaxDelay = 300;
};
class punctureWound: Abrasion {
effectiveness = 0.3;
reopeningChance = 0.5;
reopeningMinDelay = 20;
reopeningMaxDelay = 300;
};
};
class ElasticBandage: fieldDressing {
class Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class Avulsions: Abrasion {
effectiveness = 0.3;
reopeningChance = 0.4;
reopeningMinDelay = 120;
reopeningMaxDelay = 200;
};
class Contusion: Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class CrushWound: Abrasion {
effectiveness = 1;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class Cut: Abrasion {
effectiveness = 1;
reopeningChance = 0.2;
reopeningMinDelay = 10;
reopeningMaxDelay = 400;
};
class Laceration: Abrasion {
effectiveness = 1;
reopeningChance = 0.3;
reopeningMinDelay = 120;
reopeningMaxDelay = 260;
};
class velocityWound: Abrasion {
effectiveness = 0.5;
reopeningChance = 0.5;
reopeningMinDelay = 20;
reopeningMaxDelay = 300;
};
class punctureWound: Abrasion {
effectiveness = 0.85;
reopeningChance = 0.5;
reopeningMinDelay = 20;
reopeningMaxDelay = 300;
};
};
class QuikClot: fieldDressing {
class Abrasion {
effectiveness = 0.7;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class Avulsions: Abrasion {
effectiveness = 0.2;
reopeningChance = 0.1;
reopeningMinDelay = 300;
reopeningMaxDelay = 350;
};
class Contusion: Abrasion {
effectiveness = 0.7;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class CrushWound: Abrasion {
effectiveness = 0.7;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class Cut: Abrasion {
effectiveness = 0.7;
reopeningChance = 0.2;
reopeningMinDelay = 100;
reopeningMaxDelay = 400;
};
class Laceration: Abrasion {
effectiveness = 0.7;
reopeningChance = 0;
reopeningMinDelay = 0;
reopeningMaxDelay = 0;
};
class velocityWound: Abrasion {
effectiveness = 0.7;
reopeningChance = 0.1;
reopeningMinDelay = 200;
reopeningMaxDelay = 300;
};
class punctureWound: Abrasion {
effectiveness = 0.5;
reopeningChance = 0.1;
reopeningMinDelay = 200;
reopeningMaxDelay = 300;
};
};
};
class Medication {
// How much does the pain get reduced?
painReduce = 0;
// How much will the heart rate be increased when the HR is low (below 55)? {minIncrease, maxIncrease, seconds}
hrIncreaseLow[] = {0, 0, 0};
hrIncreaseNormal[] = {0, 0, 0};
hrIncreaseHigh[] = {0, 0, 0};
// Callback once the heart rate values have been added.
hrCallback = "";
// How long until this medication has disappeared
timeInSystem = 120;
// How many of this type of medication can be in the system before the patient overdoses?
maxDose = 4;
// Function to execute upon overdose. Arguments passed to call back are 0: unit <OBJECT>, 1: medicationClassName <STRING>
onOverDose = "";
// The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. For liquids, it corresponds to the informal concept of "thickness". This value will increase/decrease the viscoty of the blood with the percentage given. Where 100 = max. Using the minus will decrease viscosity
viscosityChange = 0;
// specific details for the ACE_Morphine treatment action
class Morphine {
painReduce = 0.7;
hrIncreaseLow[] = {-10, -30, 35};
hrIncreaseNormal[] = {-10, -50, 40};
hrIncreaseHigh[] = {-10, -40, 50};
timeInSystem = 500;
maxDose = 4;
inCompatableMedication[] = {};
viscosityChange = 10;
};
class Epinephrine {
painReduce = 0;
hrIncreaseLow[] = {10, 20, 30};
hrIncreaseNormal[] = {10, 50, 20};
hrIncreaseHigh[] = {10, 40, 10};
timeInSystem = 120;
maxDose = 10;
inCompatableMedication[] = {};
};
class Atropine {
painReduce = 0;
hrIncreaseLow[] = {20, 30, 15};
hrIncreaseNormal[] = {-10, -50, 20};
hrIncreaseHigh[] = {-10, -40, 10};
timeInSystem = 120;
maxDose = 6;
inCompatableMedication[] = {};
};
class PainKillers {
painReduce = 0.7;
timeInSystem = 120;
maxDose = 10;
inCompatableMedication[] = {};
viscosityChange = 5;
};
};
class IV {
// volume is in millileters
volume = 1000;
ratio[] = {};
type = "Blood";
class BloodIV {
volume = 1000;
ratio[] = {"Plasma", 1};
};
class BloodIV_500: BloodIV {
volume = 500;
};
class BloodIV_250: BloodIV {
volume = 250;
};
class PlasmaIV: BloodIV {
volume = 1000;
ratio[] = {"Blood", 1};
type = "Plasma";
};
class PlasmaIV_500: PlasmaIV {
volume = 500;
};
class PlasmaIV_250: PlasmaIV {
volume = 250;
};
class SalineIV: BloodIV {
volume = 1000;
type = "Saline";
ratio[] = {};
};
class SalineIV_500: SalineIV {
volume = 500;
};
class SalineIV_250: SalineIV {
volume = 250;
};
};
};
};

View File

@ -1,3 +1,4 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
@ -6,30 +7,22 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_Killed_Eventhandlers {
class CaManBase {
class Extended_Init_EventHandlers {
class CAManBase {
class ADDON {
Killed = QUOTE(_this call FUNC(eh_killed));
init = QUOTE(call COMPILE_FILE(XEH_init));
};
};
};
class Extended_Local_Eventhandlers {
class CaManBase {
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
Local = QUOTE(_this call FUNC(eh_local));
};
};
};
class Extended_Init_Eventhandlers {
class CaManBase {
class ADDON {
init = QUOTE(_this call FUNC(onInitForUnit););
respawn = QUOTE(call COMPILE_FILE(XEH_respawn));
};
};
};

View File

@ -1,7 +0,0 @@
class CfgFactionClasses
{
class NO_CATEGORY;
class ACE_medical: NO_CATEGORY {
displayName = "ACE Medical";
};
};

View File

@ -1,38 +0,0 @@
class CfgHints
{
class Combat_Space_Enhancement
{
displayName = "Combat Space Enhancement";
class ACE_Module
{
displayName = "Combat Medical System";
displayNameShort = "Combat Medical System";
description = "Combat Medical System is an advanced medical system for players and AI.";
tip = "";
arguments[] = {};
image = "";
noImage = true;
};
class Assessment
{
displayName = "Patient Assessment";
displayNameShort = "Patient Assessment";
description = "It is essential when treating a casualty that you fully assess each of the areas of the casualty to determine not only the injuries but the priority of each in severity. <br> You cna assess a patient by clicking on the Assessment ICON <br> Use Check Pulse, check Blood Pressure and Check Response to get an overview.";
tip = "Medics will get a faster and more accurate result when assessing patients.";
arguments[] = {};
image = "";
noImage = true;
};
class Bleeding
{
displayName = "Bandaging a wound";
displayNameShort = "Bandaging a wound";
description = "For casualties the first priority is to stop the bleeding. You will want to bandage the largest wounds first, before attending to the smaller ones. <br>You can apply a tourniquet on the limbs to stem the bleeding faster, but remember to remove it!";
tip = "Select a wound in the injury list to bandage that one first!";
arguments[] = {};
image = "";
noImage = true;
};
};
};

View File

@ -1,45 +1,37 @@
class CfgSounds
{
class GVAR(heartbeat_fast_1)
{
name = QGVAR(heartbeat_fast_1);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_1.wav)),"db-1",1};
class CfgSounds {
class ACE_heartbeat_fast_1 {
name = "ACE_heartbeat_fast_1";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_1.wav)), "db+1", 1};
titles[] = {};
};
class GVAR(heartbeat_fast_2)
{
name = QGVAR(heartbeat_fast_2);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_2.wav)),"db-1",1};
class ACE_heartbeat_fast_2 {
name = "ACE_heartbeat_fast_2";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_2.wav)), "db+1", 1};
titles[] = {};
};
class GVAR(heartbeat_fast_3)
{
name = QGVAR(heartbeat_fast_3);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_3.wav)),"db-1",1};
class ACE_heartbeat_fast_3 {
name = "ACE_heartbeat_fast_3";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_3.wav)), "db+1", 1};
titles[] = {};
};
class GVAR(heartbeat_norm_1)
{
name = QGVAR(heartbeat_norm_1);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\norm_1.wav)),"db-1",1};
class ACE_heartbeat_norm_1 {
name = "ACE_heartbeat_norm_1";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\norm_1.wav)), "db+1", 1};
titles[] = {};
};
class GVAR(heartbeat_norm_2)
{
name = QGVAR(heartbeat_norm_2);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\norm_2.wav)),"db-1",1};
class ACE_heartbeat_norm_2 {
name = "ACE_heartbeat_norm_2";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\norm_2.wav)), "db+1", 1};
titles[] = {};
};
class GVAR(heartbeat_slow_1)
{
name = QGVAR(heartbeat_slow_1);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\slow_1.wav)),"db-1",1};
class ACE_heartbeat_slow_1 {
name = "ACE_heartbeat_slow_1";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\slow_1.wav)), "db+1", 1};
titles[] = {};
};
class GVAR(heartbeat_slow_2)
{
name = QGVAR(heartbeat_slow_2);
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\slow_2.wav)),"db-1",1};
class ACE_heartbeat_slow_2 {
name = "ACE_heartbeat_slow_2";
sound[] = {QUOTE(PATHTOF(sounds\heart_beats\slow_2.wav)), "db+1", 1};
titles[] = {};
};
};
};

View File

@ -1,817 +1,5 @@
class CfgVehicles
{
class Logic;
class Module_F: Logic {
class ArgumentsBaseUnits {
};
};
class ACE_moduleCombatMedicalSystem: Module_F {
scope = 2;
displayName = "Combat Medical System [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(FUNC(initalizeModuleCMS));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "Glowbal";
class Arguments {
class advancedLevel {
displayName = "Advanced Level";
description = "How advanced can the medical system be?";
typeName = "NUMBER";
class values {
class basic {
name = "Basic. Only bleeding and pain.";
value = 0;
default = 1;
};
class normal {
name = "Normal. Bleeding, Pain, Blood pressure and heart rate";
value = 1;
};
class full {
name = "Full. Everything enabled.";
value = 2;
};
};
};
class openingOfWounds {
displayName = "Advanced Wounds";
description = "When set to true, bandaged wounds could on occasion re-open, resulting in new open wounds that need to be bandaged.";
typeName = "BOOL";
defaultValue = 1;
};
class mediACEtting {
displayName = "Advanced Medic roles";
description = "Medics only are able to view the detailed information";
typeName = "BOOL";
defaultValue = 1;
};
class difficultySetting {
displayName = "Survival Difficulty";
description = "Select the aggressiveness of the medical simulation";
typeName = "NUMBER";
class values {
class recruit {
name = "Recruit";
value = 0.5;
};
class regular {
name = "Regular";
value = 1;
default = 1;
};
class veteran {
name = "Veteran";
value = 1.2;
};
class expert {
name = "Expert";
value = 1.5;
};
};
};
class enableFor {
displayName = "Enabled for";
description = "Select what units CMS will be enabled for";
typeName = "NUMBER";
class values {
class playableUnits {
name = "Players only";
value = 0;
default = 1;
};
class playableUnitsAndAI {
name = "Players and AI";
value = 1;
};
};
};
class enableAirway {
displayName = "Enable Airway";
description = "Should CMS Airway system be enabled?";
typeName = "NUMBER";
class values {
class enable {
name = "Yes";
value = 1;
};
class disable {
name = "No";
value = 0;
default = 1;
};
};
};
class vehCrashes {
displayName = "Vehicle Crashes";
description = "Enable injuries on vehicle crashes";
typeName = "BOOL";
defaultValue = 1;
};
class aidKitUponUsage {
displayName = "Disposable Aid kit";
description = "Is a personal aid kit disposable?";
typeName = "BOOL";
defaultValue = false;
};
class aidKitMedicsOnly {
displayName = "Medics only";
description = "Are aid kits restricted to medics only?";
typeName = "BOOL";
defaultValue = false;
};
class aidKitRestrictions {
displayName = "Aid kit";
description = "When can an Aid kit be used?";
typeName = "NUMBER";
class values {
class medFacility {
name = "Medical Facility";
value = 0;
default = 1;
};
class medFAcilityNoBleeding {
name = "Medical Facility & No bleeding";
value = 1;
};
class Everywhere {
name = "Everywhere";
value = 2;
};
class EverywhereNoBleeding {
name = "Everywhere & No Bleeding";
value = 3;
};
};
};
class bandageTime {
displayName = "Bandage Time";
description = "Time it takes for a bandage action to be completed";
typeName = "NUMBER";
defaultValue = 5;
};
class stitchingAllow {
displayName = "Can Stitch";
description = "What units can use stitching?";
typeName = "NUMBER";
defaultValue = 0;
class values {
class medicsOnly {
name = "Medics Only";
value = 0;
default = 1;
};
class everyone {
name = "Everyone";
value = 1;
};
class noOne {
name = "No units";
value = -1;
};
};
};
};
class ModuleDescription {
description = "Provides a more realistic medical system for both players and AI."; // Short description, will be formatted as structured text
sync[] = {};
};
};
class ACE_moduleDamageSettings: Module_F {
scope = 2;
displayName = "Damage Settings [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleDamageSettings));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "Glowbal";
class Arguments {
class damageThresholdAI {
displayName = "Damage Threshold AI";
description = "How much damage does it take for an AI to be killed?";
typeName = "NUMBER";
defaultValue = 1;
};
class damageThresholdPlayers {
displayName = "Damage Threshold Players";
description = "How much damage does it take for a player to be killed?";
typeName = "NUMBER";
defaultValue = 1;
};
};
class ModuleDescription {
description = "Custom damage threshold module";
sync[] = {};
};
};
class ACE_moduleAssignMedicRoles: Module_F {
scope = 2;
displayName = "Set Medic Class [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleAssignMedicRoles));
functionPriority = 10;
isGlobal = 2;
isTriggerActivated = 0;
isDisposable = 0;
author = "Glowbal";
class Arguments {
class EnableList {
displayName = "List";
description = "List of unit names that will be classified as medic, separated by commas.";
defaultValue = "";
};
class class {
displayName = "Is Medic";
description = "Medics allow for more advanced treatment in case of Advanced Medic roles enabled";
typeName = "BOOL";
defaultValue = true;
};
};
class ModuleDescription {
description = "Assigns the ACE medic class to a unit"; // Short description, will be formatted as structured text
sync[] = {};
};
};
class ACE_moduleAssignMedicalVehicle: Module_F {
scope = 2;
displayName = "set Medical Vehicle [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleAssignMedicalVehicle));
functionPriority = 10;
isGlobal = 2;
isTriggerActivated = 0;
isDisposable = 0;
author = "Glowbal";
class Arguments {
class EnableList {
displayName = "List";
description = "List of object names that will be classified as medical vehicle, separated by commas.";
defaultValue = "";
};
class enabled {
displayName = "Is Medical Vehicle";
description = "Whatever or not the objects in the list will be a medical vehicle.";
typeName = "BOOL";
defaultValue = true;
};
};
class ModuleDescription {
description = "Assigns the ACE medical vehicle class to a vehicle.";
sync[] = {};
};
};
class ACE_moduleAssignMedicalFacility: Module_F {
scope = 2;
displayName = "Set Medical Facility [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleAssignMedicalFacility));
functionPriority = 10;
isGlobal = 2;
isTriggerActivated = 0;
isDisposable = 0;
author = "Glowbal";
class Arguments {
class class {
displayName = "Is Medical Facility";
description = "Registers an object as a medical facility for CMS";
typeName = "BOOL";
};
};
class ModuleDescription {
description = "Defines an object as a medical facility for CMS. This allows for more advanced treatments. Can be used on buildings and vehicles. ";
sync[] = {};
};
};
class ACE_moduleAssignMedicalEquipment: Module_F {
scope = 2;
displayName = "Assign Medical Equipment [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleAssignMedicalEquipment));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "Glowbal";
class Arguments {
class equipment {
displayName = "Assign Equipment";
description = "Assign Medical equipment to all players";
typeName = "NUMBER";
defaultValue = 0;
class values {
class AllPlayers {
name = "All Players";
value = 0;
default = 1;
};
class MedicsOnly {
name = "Medics only";
value = 1;
};
};
};
};
class ModuleDescription {
description = "Assigns medical equipment to units";
sync[] = {};
};
};
class MapBoard_altis_F;
class ACE_bodyBag: MapBoard_altis_F {
scope = 1;
side = -1;
model = QUOTE(PATHTOF(equipment\bodybag.p3d));
icon = "";
displayName = $STR_ACE_MAG_BODYBAG_DISPLAY;
};
class Item_Base_F;
class ACE_bandage_basicItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_BANDAGE_BASIC_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_bandage_basic
{
name = "ACE_bandage_basic";
count = 1;
};
};
};
class ACE_packing_bandageItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_PACKING_BANDAGE_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_packing_bandage
{
name = "ACE_packing_bandage";
count = 1;
};
};
};
class ACE_bandageElasticItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_BANDAGE_ELASTIC_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_bandageElastic
{
name = "ACE_bandageElastic";
count = 1;
};
};
};
class ACE_tourniquetItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_TOURNIQUET_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_tourniquet
{
name = "ACE_tourniquet";
count = 1;
};
};
};
class ACE_splintItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_SPLINT_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_splint
{
name = "ACE_splint";
count = 1;
};
};
};
class ACE_morphineItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_MORPHINE_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_morphine
{
name = "ACE_morphine";
count = 1;
};
};
};
class ACE_atropineItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_ATROPINE_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_atropine
{
name = "ACE_atropine";
count = 1;
};
};
};
class ACE_epinephrineItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_EPINEPHRINE_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_epinephrine
{
name = "ACE_epinephrine";
count = 1;
};
};
};
class ACE_plasma_ivItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_PLASMA_IV;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_plasma_iv
{
name = "ACE_plasma_iv";
count = 1;
};
};
};
class ACE_plasma_iv_500Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_PLASMA_IV_500;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_plasma_iv_500
{
name = "ACE_plasma_iv_500";
count = 1;
};
};
};
class ACE_plasma_iv_250Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_PLASMA_IV_250;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_plasma_iv_250
{
name = "ACE_plasma_iv_250";
count = 1;
};
};
};
class ACE_blood_ivItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_BLOOD_IV;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_blood_iv
{
name = "ACE_blood_iv";
count = 1;
};
};
};
class ACE_blood_iv_500Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_BLOOD_IV_500;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_blood_iv_500
{
name = "ACE_blood_iv_500";
count = 1;
};
};
};
class ACE_blood_iv_250Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_BLOOD_IV_250;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_blood_iv_250
{
name = "ACE_blood_iv_250";
count = 1;
};
};
};
class ACE_saline_ivItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_SALINE_IV;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_saline_iv
{
name = "ACE_saline_iv";
count = 1;
};
};
};
class ACE_saline_iv_500Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_SALINE_IV_500;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_saline_iv_500
{
name = "ACE_saline_iv_500";
count = 1;
};
};
};
class ACE_saline_iv_250Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_SALINE_IV_250;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_saline_iv_250
{
name = "ACE_saline_iv_250";
count = 1;
};
};
};
class ACE_quikclotItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_QUIKCLOT_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_quikclot
{
name = "ACE_quikclot";
count = 1;
};
};
};
class ACE_nasopharyngeal_tubeItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_NPA_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_nasopharyngeal_tube
{
name = "ACE_nasopharyngeal_tube";
count = 1;
};
};
};
class ACE_opaItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_OPA_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_opa
{
name = "ACE_opa";
count = 1;
};
};
};
class ACE_liquidSkinItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_LIQUID_SKIN_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_liquidSkin
{
name = "ACE_liquidSkin";
count = 1;
};
};
};
class ACE_chestsealItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_CHEST_SEAL_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_chestseal
{
name = "ACE_chestseal";
count = 1;
};
};
};
class ACE_personal_aid_kitItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_AID_KIT_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_personal_aid_kit
{
name = "ACE_personal_aid_kit";
count = 1;
};
};
};
class ACE_bodyBagItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = $STR_ACE_MAG_BODYBAG_DISPLAY;
author = "Glowbal";
vehicleClass = "Items";
class TransportItems
{
class ACE_itemBodyBag
{
name = "ACE_itemBodyBag";
count = 1;
};
};
};
class NATO_Box_Base;
class ACE_medical_supply_crate_cms : NATO_Box_Base {
scope = 2;
accuracy = 1000;
displayName = "Medical Supply Crate [ACE]";
model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F";
author = "Glowbal";
class TransportItems {
class ACE_bandage_basic {
name = "ACE_bandage_basic";
count = 25;
};
class ACE_packing_bandage {
name = "ACE_packing_bandage";
count = 25;
};
class ACE_tourniquet {
name = "ACE_tourniquet";
count = 25;
};
class ACE_splint {
name = "ACE_splint";
count = 25;
};
class ACE_plasma_iv {
name = "ACE_plasma_iv";
count = 25;
};
class ACE_plasma_iv_500 {
name = "ACE_plasma_iv_500";
count = 25;
};
class ACE_plasma_iv_250 {
name = "ACE_plasma_iv_250";
count = 25;
};
class ACE_blood_iv {
name = "ACE_blood_iv";
count = 25;
};
class ACE_blood_iv_500 {
name = "ACE_blood_iv_500";
count = 25;
};
class ACE_blood_iv_250 {
name = "ACE_blood_iv_250";
count = 25;
};
class ACE_saline_iv {
name = "ACE_saline_iv";
count = 25;
};
class ACE_saline_iv_500 {
name = "ACE_saline_iv_500";
count = 25;
};
class ACE_saline_iv_250 {
name = "ACE_saline_iv_250";
count = 25;
};
class ACE_morphine {
name = "ACE_morphine";
count = 25;
};
class ACE_epinephrine {
name = "ACE_epinephrine";
count = 25;
};
class ACE_atropine {
name = "ACE_atropine";
count = 25;
};
class ACE_quikclot {
name = "ACE_quikclot";
count = 25;
};
class ACE_nasopharyngeal_tube {
name = "ACE_nasopharyngeal_tube";
count = 25;
};
class ACE_bandageElastic {
name = "ACE_bandageElastic";
count = 25;
};
class ACE_liquidSkin {
name = "ACE_liquidSkin";
count = 25;
};
class ACE_chestseal {
name = "ACE_chestseal";
count = 25;
};
class ACE_personal_aid_kit {
name = "ACE_personal_aid_kit";
count = 25;
};
class ACE_surgical_kit {
name = "ACE_surgical_kit";
count = 25;
};
class ACE_itemBodyBag {
name = "ACE_itemBodyBag";
count = 5;
};
};
};
class CfgVehicles {
#define ARM_LEG_ARMOR_DEFAULT 2
#define ARM_LEG_ARMOR_BETTER 3
#define ARM_LEG_ARMOR_CSAT 4
@ -870,6 +58,81 @@ class CfgVehicles
name = "leg_r";
};
};
class ACE_Actions {
class ACE_Head {
class Bandage_Head {
displayName = "Bandage Head";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
enableInside = 1;
};
};
class ACE_MainActions {
class Bandage_Torso {
displayName = "Bandage Torso";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
enableInside = 1;
};
};
class ACE_ArmLeft {
class Bandage_LeftArm {
displayName = "Bandage Left Arm";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
enableInside = 1;
};
};
class ACE_ArmRight {
class Bandage_RightArm {
displayName = "Bandage Right Arm";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
enableInside = 1;
};
};
class ACE_LegLeft {
class Bandage_LeftLeg {
displayName = "Bandage Left Leg";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
enableInside = 1;
};
};
class ACE_LegRight {
class Bandage_RightLeg {
displayName = "Bandage Right Leg";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreat));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "B";
enableInside = 1;
};
};
};
};
class SoldierWB: CAManBase {};
@ -877,6 +140,7 @@ class CfgVehicles
class SoldierGB: CAManBase {};
class B_Soldier_base_F: SoldierWB {};
class B_Soldier_04_f: B_Soldier_base_F {
class HitPoints: HitPoints {
class HitHead: HitHead {};

View File

@ -1,317 +1,263 @@
class CfgWeapons {
class ItemCore;
class InventoryItem_Base_F;
class ACE_bandage_basic: ItemCore
{
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_BANDAGE_BASIC_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\field_dressing.paa));
model = QUOTE(PATHTOF(equipment\bandages\fielddressing.p3d));
descriptionShort = $STR_ACE_MAG_BANDAGE_BASIC_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_BANDAGE_BASIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=0.5;
type=201;
};
class ItemCore;
class InventoryItem_Base_F;
class InventoryFirstAidKitItem_Base_F;
class MedikitItem;
// ITEMS
class FirstAidKit: ItemCore {
type = 0;
class ItemInfo: InventoryFirstAidKitItem_Base_F {
mass = 4;
type = 201;
};
class ACE_packing_bandage: ItemCore
{
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_PACKING_BANDAGE_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\packing_bandage.paa));
model = QUOTE(PATHTOF(equipment\bandages\packingbandage.p3d));
descriptionShort = $STR_ACE_MAG_PACKING_BANDAGE_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_PACKING_BANDAGE_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
};
};
class Medikit: ItemCore {
type = 0;
class ItemInfo: MedikitItem {
mass = 60;
type = 201;
};
class ACE_bandageElastic: ItemCore {
};
// @todo localize
class ACE_ItemCore;
class GVAR(fieldDressing): ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_BANDAGE_ELASTIC_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\bandageElastic.paa));
model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d";
descriptionShort = $STR_ACE_MAG_BANDAGE_ELASTIC_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_BANDAGE_ELASTIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
picture = QUOTE(PATHTOF(ui\items\fieldDressing.paa));
displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY;
descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_tourniquet: ItemCore
{
class GVAR(packingBandage): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_TOURNIQUET_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\tourniquet.paa));
model = QUOTE(PATHTOF(equipment\Tourniquet.p3d));
descriptionShort = $STR_ACE_MAG_TOURNIQUET_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_TOURNIQUET_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
displayName = $STR_ACE_MEDICAL_PACKING_BANDAGE_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\packingBandage.paa));
model = QUOTE(PATHTOF(data\packingbandage.p3d));
descriptionShort = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_splint: ItemCore
{
class GVAR(elasticBandage): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_SPLINT_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\splint.paa));
descriptionUse = $STR_ACE_MAG_SPLINT_DESC_USE;
descriptionShort = $STR_ACE_MAG_SPLINT_DESC_SHORT;
class ItemInfo: InventoryItem_Base_F
{
displayName = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\elasticBandage.paa));
model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d";
descriptionShort = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_morphine: ItemCore
{
class GVAR(tourniquet): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_MORPHINE_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\morphine.paa));
model = QUOTE(PATHTOF(equipment\Morphinpen.p3d));
descriptionShort = $STR_ACE_MAG_MORPHINE_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_MORPHINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
displayName = $STR_ACE_MEDICAL_TOURNIQUET_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\tourniquet.paa));
model = QUOTE(PATHTOF(data\tourniquet.p3d));
descriptionShort = $STR_ACE_MEDICAL_TOURNIQUET_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_atropine: ItemCore {
class GVAR(morphine): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_ATROPINE_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\atropine.paa));
model = QUOTE(PATHTOF(equipment\Atropin-pen.p3d));
descriptionShort = $STR_ACE_MAG_ATROPINE_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_ATROPINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
displayName = $STR_ACE_MEDICAL_MORPHINE_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\morphine.paa));
model = QUOTE(PATHTOF(data\morphine.p3d));
descriptionShort = $STR_ACE_MEDICAL_MORPHINE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_epinephrine: ItemCore {
class GVAR(atropine): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_EPINEPHRINE_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\epinephrine.paa));
model = QUOTE(PATHTOF(equipment\Epipen.p3d));
descriptionShort = $STR_ACE_MAG_EPINEPHRINE_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_EPINEPHRINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
displayName = $STR_ACE_MEDICAL_ATROPINE_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\atropine.paa));
model = QUOTE(PATHTOF(data\atropine.p3d));
descriptionShort = $STR_ACE_MEDICAL_ATROPINE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_plasma_iv: ItemCore {
class GVAR(epinephrine): ItemCore {
scope = 2;
value = 1;
count = 1;
displayName = $STR_ACE_MAG_PLASMA_IV;
picture = QUOTE(PATHTOF(equipment\img\plasma_iv.paa));
descriptionShort = $STR_ACE_MAG_PLASMA_IV_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_PLASMA_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
type = 16;
displayName = $STR_ACE_MEDICAL_EPINEPHRINE_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\epinephrine.paa));
model = QUOTE(PATHTOF(data\epinephrine.p3d));
descriptionShort = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass=1;
type=201;
};
};
class ACE_plasma_iv_500: ACE_plasma_iv {
displayName = $STR_ACE_MAG_PLASMA_IV_500;
class GVAR(plasmaIV): ItemCore {
scope = 2;
value = 1;
count = 1;
displayName = $STR_ACE_MEDICAL_PLASMA_IV;
picture = QUOTE(PATHTOF(ui\items\plasmaIV.paa));
descriptionShort = $STR_ACE_MEDICAL_PLASMA_IV_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 10;
type = 201;
};
};
class ACE_plasma_iv_250: ACE_plasma_iv_500 {
displayName = $STR_ACE_MAG_PLASMA_IV_250;
class GVAR(plasmaIV_500): GVAR(plasmaIV) {
displayName = $STR_ACE_MEDICAL_PLASMA_IV_500;
class ItemInfo: InventoryItem_Base_F {
mass = 5;
type = 201;
};
};
class ACE_blood_iv: ItemCore {
class GVAR(plasmaIV_250): GVAR(plasmaIV) {
displayName = $STR_ACE_MEDICAL_PLASMA_IV_250;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class GVAR(bloodIV): ItemCore {
scope = 2;
value = 1;
count = 1;
model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d";
displayName = $STR_ACE_MAG_BLOOD_IV;
picture = QUOTE(PATHTOF(equipment\img\bloodbag.paa));
descriptionShort = $STR_ACE_MAG_BLOOD_IV_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_BLOOD_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
displayName = $STR_ACE_MEDICAL_BLOOD_IV;
picture = QUOTE(PATHTOF(ui\items\bloodIV.paa));
descriptionShort = $STR_ACE_MEDICAL_BLOOD_IV_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 10;
type = 201;
};
};
class ACE_blood_iv_500: ACE_blood_iv {
displayName = $STR_ACE_MAG_BLOOD_IV_500;
class GVAR(bloodIV_500): GVAR(bloodIV) {
displayName = $STR_ACE_MEDICAL_BLOOD_IV_500;
class ItemInfo: InventoryItem_Base_F {
mass = 5;
type = 201;
};
};
class ACE_blood_iv_250: ACE_blood_iv_500 {
displayName = $STR_ACE_MAG_BLOOD_IV_250;
class GVAR(bloodIV_250): GVAR(bloodIV) {
displayName = $STR_ACE_MEDICAL_BLOOD_IV_250;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_saline_iv: ItemCore {
class GVAR(salineIV): ItemCore {
scope = 2;
value = 1;
count = 1;
displayName = $STR_ACE_MAG_SALINE_IV;
picture = QUOTE(PATHTOF(equipment\img\saline_iv.paa));
descriptionShort = $STR_ACE_MAG_SALINE_IV_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_SALINE_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
displayName = $STR_ACE_MEDICAL_SALINE_IV;
picture = QUOTE(PATHTOF(ui\items\salineIV.paa));
descriptionShort = $STR_ACE_MEDICAL_SALINE_IV_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 10;
type = 201;
};
};
class ACE_saline_iv_500: ACE_saline_iv {
displayName = $STR_ACE_MAG_SALINE_IV_500;
class GVAR(salineIV_500): GVAR(salineIV) {
displayName = $STR_ACE_MEDICAL_SALINE_IV_500;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_saline_iv_250: ACE_saline_iv_500 {
displayName = $STR_ACE_MAG_SALINE_IV_250;
class GVAR(salineIV_250): GVAR(salineIV) {
displayName = $STR_ACE_MEDICAL_SALINE_IV_250;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_quikclot: ItemCore {
class GVAR(quikclot): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_QUIKCLOT_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\quickclot.paa));
descriptionShort = $STR_ACE_MAG_QUIKCLOT_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_QUIKCLOT_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
displayName = $STR_ACE_MEDICAL_QUIKCLOT_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\quickclot.paa));
descriptionShort = $STR_ACE_MEDICAL_QUIKCLOT_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type = 201;
};
};
class ACE_nasopharyngeal_tube: ItemCore {
class GVAR(personalAidKit): ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_NPA_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\nasopharyngeal_tube.paa));
descriptionUse = $STR_ACE_MAG_NPA_DESC_USE;
descriptionShort = $STR_ACE_MAG_NPA_DESC_SHORT;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY;
//picture = QUOTE(PATHTOF(ui\items\personal_aid_kit.paa));
//model = QUOTE(PATHTOF(equipment\Personal-aidkits\MTP.p3d));
descriptionShort = $STR_ACE_MEDICAL_AID_KIT_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 2;
type = 201;
};
};
class ACE_opa: ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_OPA_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\nasopharyngeal_tube.paa));
descriptionShort = $STR_ACE_MAG_OPA_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_OPA_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
};
};
class ACE_liquidSkin: ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_LIQUID_SKIN_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\liquidSkin.paa));
model = QUOTE(PATHTOF(equipment\skinliquid.p3d));
descriptionShort = $STR_ACE_MAG_LIQUID_SKIN_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_LIQUID_SKIN_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
};
};
class ACE_chestseal: ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_CHEST_SEAL_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\chestseal.paa));
descriptionShort = $STR_ACE_MAG_CHEST_SEAL_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_CHEST_SEAL_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
};
};
class ACE_personal_aid_kit: ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MAG_AID_KIT_DISPLAY;
picture = QUOTE(PATHTOF(equipment\img\personal_aid_kit.paa));
model = QUOTE(PATHTOF(equipment\Personal-aidkits\MTP.p3d));
descriptionShort = $STR_ACE_MAG_AID_KIT_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_AID_KIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class ACE_surgical_kit: ItemCore
{
class GVAR(surgicalKit): ItemCore {
scope=2;
displayName= $STR_ACE_MAG_SURGICALKIT_DISPLAY;
model = QUOTE(PATHTOF(equipment\surgical_kit.p3d));
picture = QUOTE(PATHTOF(equipment\img\surgical_kit.paa));
descriptionShort = $STR_ACE_MAG_SURGICALKIT_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_SURGICALKIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass= 5;
type=201;
displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY;
model = QUOTE(PATHTOF(data\surgical_kit.p3d));
//picture = QUOTE(PATHTOF(data\surgical_kit.paa));
descriptionShort = $STR_ACE_MEDICAL_SURGICALKIT_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 5;
type = 201;
};
};
class ACE_itemBodyBag: ItemCore
{
class GVAR(bodyBag): ItemCore {
scope=2;
displayName= $STR_ACE_MAG_BODYBAG_DISPLAY;
model = QUOTE(PATHTOF(equipment\bodybagItem.p3d));
picture = QUOTE(PATHTOF(equipment\img\bodybag.paa));
descriptionShort = $STR_ACE_MAG_BODYBAG_DESC_SHORT;
descriptionUse = $STR_ACE_MAG_BODYBAG_DESC_USE;
class ItemInfo: InventoryItem_Base_F
{
mass= 15;
type=201;
displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY;
model = QUOTE(PATHTOF(data\bodybagItem.p3d));
picture = QUOTE(PATHTOF(ui\items\bodybag.paa));
descriptionShort = $STR_ACE_MEDICAL_BODYBAG_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 15;
type = 201;
};
};
};

View File

@ -8,3 +8,4 @@ Provides a basic and advanced medical system.
The people responsible for merging changes to this component or answering potential questions.
- [Glowbal](https://github.com/Glowbal)
- [KoffeinFlummi](https://github.com/KoffeinFlummi)

View File

@ -0,0 +1,10 @@
#include "script_component.hpp"
private ["_unit"];
_unit = _this select 0;
if !(local _unit) exitWith {};
_unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];
[_unit] call FUNC(init);

View File

@ -1,245 +1,233 @@
/**
* XEH_postInit.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
// ACE Medical System Visual Loop
#include "script_component.hpp"
#include "variable_defines.sqf"
GVAR(injuredUnitCollection) = [];
[{
{
if (!alive _x || !local _x) then {
GVAR(injuredUnitCollection) set [ _forEachIndex, ObjNull];
} else {
[_x] call FUNC(handleUnitVitals);
if (!hasInterface) exitwith{};
private "_pain";
_pain = _X getvariable [QGVAR(amountOfPain), 0];
if (_pain > 5 && (random(1) > 0.5)) then {
_x setvariable [QGVAR(amountOfPain), _pain + 0.002];
};
if (_pain > 45) then {
if (random(1) > 0.6) then {
[_X] call FUNC(setUnconsciousState);
};
//[_X] call FUNC(playInjuredSound);
};
};
}foreach GVAR(injuredUnitCollection);
GVAR(injuredUnitCollection) = GVAR(injuredUnitCollection) - [ObjNull];
}, 1, [] ] call CBA_fnc_addPerFrameHandler;
GVAR(heartBeatSounds_Fast) = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "ACE_heartbeat_fast_3"];
GVAR(heartBeatSounds_Normal) = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"];
GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
[
{(([_this select 0,QGVAR(bloodVolume)] call EFUNC(common,getDefinedVariable)) < 65)},
{(([_this select 0,QGVAR(amountOfPain)] call EFUNC(common,getDefinedVariable)) > 48)},
{(((_this select 0) call FUNC(getBloodLoss)) > 0.25)},
{((_this select 0) getvariable ["ACE_inReviveState", false])}
] call FUNC(registerUnconsciousCondition);
call FUNC(handleDisplayEffects);
// Assigning all eventhandlers
["Medical_treatmentCompleted", FUNC(onTreatmentCompleted)] call ace_common_fnc_addEventHandler;
["onStartMovingUnit", FUNC(onStartMovingUnit)] call ace_common_fnc_addEventHandler;
["onUnconscious", FUNC(onUnconscious)] call ace_common_fnc_addEventHandler;
["carryObjectDropped", FUNC(onCarryObjectDropped)] call ace_common_fnc_addEventHandler;
["medical_propagateWound", FUNC(onPropagateWound)] call ace_common_fnc_addEventHandler;
["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler;
if (isNil QGVAR(ENABLE_REVIVE)) then {
GVAR(ENABLE_REVIVE) = 0;
// Initialize all effects
_fnc_createEffect = {
private ["_type", "_layer", "_default"];
_type = _this select 0;
_layer = _this select 1;
_default = _this select 2;
_effect = ppEffectCreate [_type, _layer];
_effect ppEffectForceInNVG true;
_effect ppEffectAdjust _default;
_effect ppEffectCommit 0;
_effect
};
GVAR(effectUnconsciousCC) = [
"ColorCorrections",
4201,
[1,1,0, [0,0,0,1], [0,0,0,0], [1,1,1,1], [0.4,0.4,0,0,0,0.1,0.3]]
] call _fnc_createEffect;
// Keybindings
GVAR(keyPressed) = false;
GVAR(effectUnconsciousRB) = [
"RadialBlur",
4202,
[0.01,0.01,0,0]
] call _fnc_createEffect;
["ACE3",
localize "STR_ACE_OPEN_CMS_MENU_DESC",
{ if (!GVAR(keyPressed)) then {
GVAR(keyPressed) = true;
GVAR(timeMenuOpened) = time;
[] call FUNC(openMenu);
GVAR(effectBlindingCC) = [
"ColorCorrections",
4203,
[1,1,0, [1,1,1,0], [0,0,0,1], [0,0,0,0]]
] call _fnc_createEffect;
true;
} else {
false;
GVAR(effectBloodVolumeCC) = [
"ColorCorrections",
4204,
[1,1,0, [0,0,0,0], [1,1,1,1], [0.2,0.2,0.2,0]]
] call _fnc_createEffect;
GVAR(effectPainCA) = [
"chromAberration",
4205,
[0, 0, false]
] call _fnc_createEffect;
GVAR(effectPainCC) = [
"ColorCorrections",
4206,
[1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1.3,1.3,0,0,0,0.2,2]]
] call _fnc_createEffect;
// Initialize Other Variables
GVAR(effectBlind) = false;
GVAR(effectTimeBlood) = time;
// MAIN EFFECTS LOOP
[{
// Zeus interface is open or player is dead; disable everything
if (!(isNull (findDisplay 312)) or !(alive ACE_player)) exitWith {
GVAR(effectUnconsciousCC) ppEffectEnable false;
GVAR(effectUnconsciousRB) ppEffectEnable false;
GVAR(effectBlindingCC) ppEffectEnable false;
GVAR(effectBloodVolumeCC) ppEffectEnable false;
GVAR(effectPainCA) ppEffectEnable false;
GVAR(effectPainCC) ppEffectEnable false;
["unconscious", false] call EFUNC(common,setDisableUserInputStatus);
};
// Unconsciousness effect
if (ACE_player getVariable [QGVAR(isUnconscious), false]) then {
GVAR(effectUnconsciousCC) ppEffectEnable true;
GVAR(effectUnconsciousRB) ppEffectEnable true;
GVAR(effectBlind) = true;
["unconscious", true] call EFUNC(common,setDisableUserInputStatus);
} else {
GVAR(effectUnconsciousCC) ppEffectEnable false;
GVAR(effectUnconsciousRB) ppEffectEnable false;
["unconscious", false] call EFUNC(common,setDisableUserInputStatus);
if (GVAR(effectBlind)) then {
_strength = 0.78 * (call EFUNC(common,ambientBrightness));
GVAR(effectBlindingCC) ppEffectEnable true;
GVAR(effectBlindingCC) ppEffectAdjust [1,1,_strength, [1,1,1,0], [0,0,0,1], [0,0,0,0]];
GVAR(effectBlindingCC) ppEffectCommit 0;
[{
GVAR(effectBlindingCC) ppEffectAdjust [1,1,0, [1,1,1,0], [0,0,0,1], [0,0,0,0]];
GVAR(effectBlindingCC) ppEffectCommit ((_this select 0) * 2);
}, [_strength], 0.01, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectBlindingCC) ppEffectEnable false;
}, [], (_strength * 2) + 0.5, 0] call EFUNC(common,waitAndExecute);
GVAR(effectBlind) = false;
};
},
[ 0, [false, false, false]],
false,
"keydown"] call cba_fnc_registerKeybind;
};
["ACE3",
localize "STR_ACE_OPEN_CMS_MENU_DESC",
{
GVAR(keyPressed) = false;
if (time - GVAR(timeMenuOpened) >= (0.25*accTime)) then {
disableSerialization;
_display = uiNamespace getVariable QGVAR(medicalMenu);
if (!isnil "_display") then {
closeDialog 314412;
// Bleeding Indicator
if (damage ACE_player > 0.1 and GVAR(effectTimeBlood) + 6 < time) then {
GVAR(effectTimeBlood) = time;
[500 * damage ACE_player] call BIS_fnc_bloodEffect;
};
// Blood Volume Effect
_blood = (ACE_player getVariable [QGVAR(bloodVolume), 100]) / 100;
if (_blood > 0.99) then {
GVAR(effectBloodVolumeCC) ppEffectEnable false;
} else {
GVAR(effectBloodVolumeCC) ppEffectEnable true;
GVAR(effectBloodVolumeCC) ppEffectAdjust [1,1,0, [0,0,0,0], [1,1,1,_blood], [0.2,0.2,0.2,0]];
GVAR(effectBloodVolumeCC) ppEffectCommit 0;
};
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
GVAR(lastHeartBeat) = time;
GVAR(lastHeartBeatSound) = time;
// @todo, remove once parameters are set up
if (isNil QGVAR(level)) then {
GVAR(level) = 0;
};
// HEARTRATE BASED EFFECTS
[{
_heartRate = ACE_player getVariable [QGVAR(heartRate), 70];
if (GVAR(level) == 0) then {
_heartRate = 60 + 40 * (ACE_player getVariable [QGVAR(pain), 0]);
};
if (_heartRate <= 0) exitwith {};
_interval = 60 / (_heartRate min 50);
if (time > GVAR(lastHeartBeat) + _interval) then {
GVAR(lastHeartBeat) = time;
// Pain effect
_strength = ACE_player getVariable [QGVAR(pain), 0];
// _strength = _strength * (ACE_player getVariable [QGVAR(coefPain), GVAR(coefPain)]); @todo
GVAR(alternativePainEffect) = false; // @todo
if (GVAR(alternativePainEffect)) then {
GVAR(effectPainCC) ppEffectEnable false;
if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then {
_strength = _strength * 0.15;
GVAR(effectPainCA) ppEffectEnable true;
GVAR(effectPainCA) ppEffectAdjust [_strength, _strength, false];
GVAR(effectPainCA) ppEffectCommit 0.01;
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit 0.01;
}, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute);
} else {
GVAR(effectPainCA) ppEffectEnable false;
};
} else {
GVAR(effectPainCA) ppEffectEnable false;
if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then {
_strength = _strength * 0.6;
GVAR(effectPainCC) ppEffectEnable true;
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit 0.01;
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit 0.01;
}, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute);
} else {
GVAR(effectPainCC) ppEffectEnable false;
};
};
false;
},
[ 0, [false, false, false]],
false,
"keyUp"] call cba_fnc_registerKeybind;
// Adding the treatment options for all available medical equipment.
// Advanced Treatment options
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_BLOODIV_1000ml","STR_ACE_ACTION_BLOODIV_1000ML_TOOLTIP",'ACE_blood_iv');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_BLOODIV_500ml","STR_ACE_ACTION_BLOODIV_500ML_TOOLTIP",'ACE_blood_iv_500');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_BLOODIV_250ml","STR_ACE_ACTION_BLOODIV_250ML_TOOLTIP",'ACE_blood_iv_250');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_PLASMAIV_1000ml","STR_ACE_ACTION_PLASMAIV_1000ML_TOOLTIP",'ACE_plasma_iv');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_PLASMAIV_500ml","STR_ACE_ACTION_PLASMAIV_500ML_TOOLTIP",'ACE_plasma_iv_500');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_PLASMAIV_250ml","STR_ACE_ACTION_PLASMAIV_250ML_TOOLTIP",'ACE_plasma_iv_250');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_SALINEIV_1000ml","STR_ACE_ACTION_SALINEIV_1000ML_TOOLTIP",'ACE_saline_iv');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_SALINEIV_500ml","STR_ACE_ACTION_SALINEIV_500ML_TOOLTIP",'ACE_saline_iv_500');
ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_SALINEIV_250ml","STR_ACE_ACTION_SALINEIV_250ML_TOOLTIP",'ACE_saline_iv_250');
["STR_ACE_ACTION_PERSONAL_AID_KIT","STR_ACE_ACTION_PERSONAL_AID_KIT_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
if !([_this select 0,_this select 1, 'ACE_personal_aid_kit'] call FUNC(hasEquipment)) exitwith {
false;
};
_inMedFacility = ([_caller] call FUNC(inMedicalFacility));
_hasOpenWounds = ([_target] call FUNC(hasOpenWounds));
if ((GVAR(setting_aidKitRestrictions) == 0 && _inMedFacility) ||
(GVAR(setting_aidKitRestrictions) == 1 && _inMedFacility && (!_hasOpenWounds)) ||
(GVAR(setting_aidKitRestrictions) == 2) ||
(GVAR(setting_aidKitRestrictions) == 3 && (!_hasOpenWounds))) exitwith {
((GVAR(setting_aidKitMedicsOnly) && [_caller] call FUNC(isMedic) || !GVAR(setting_aidKitMedicsOnly)));
if (GVAR(level) > 0 && {_heartRate > 0}) then {
_minTime = 60 / _heartRate;
if (time - GVAR(lastHeartBeatSound) > _minTime) then {
GVAR(lastHeartBeatSound) = time;
// Heart rate sound effect
if (_heartRate < 60) then {
_sound = GVAR(heartBeatSounds_Normal) select (random((count GVAR(heartBeatSounds_Normal)) -1));
playSound _sound;
} else {
if (_heartRate > 150) then {
playSound "ACE_heartbeat_fast_2";
};
};
};
};
false;
},TREATMENT_ADVANCED('ACE_personal_aid_kit'),'advanced'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_PERFORM_CPR","STR_ACE_ACTION_PERFORM_CPR_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
}, 0, []] call CBA_fnc_addPerFrameHandler;
(!(_caller getvariable[QGVAR(isProvidingCPR), false]) && ((_target getvariable [QGVAR(inCardiacArrest),false]) || !([_target] call EFUNC(common,isAwake))))
},TREATMENT_ADVANCED('ACE_CPR'),'advanced'] call FUNC(addTreatmentOption);
// broadcast injuries to JIP clients in a MP session
if (isMultiplayer && !isDedicated) then {
[QGVAR(onPlayerConnected), "onPlayerConnected", {
if (isNil QGVAR(InjuredCollection)) then {
GVAR(InjuredCollection) = [];
};
["STR_ACE_ACTION_STOP_CPR","STR_ACE_ACTION_STOP_CPR_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
(_caller getvariable[QGVAR(isProvidingCPR), false])
},{((_this select 0) setvariable[QGVAR(isProvidingCPR), nil, true])},'advanced'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_STITCHING","STR_ACE_ACTION_STITCHING_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
((GVAR(setting_allowStitching) == 0 && [_Caller] call FUNC(isMedic)) || GVAR(setting_allowStitching) == 1)
},TREATMENT_ADVANCED('ACE_surgical_kit'),'advanced'] call FUNC(addTreatmentOption);
// Airway Management
["STR_ACE_ACTION_APPLY_NPA","STR_ACE_ACTION_APPLY_NPA_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
if !([_this select 0,_this select 1, 'ACE_nasopharyngeal_tube'] call FUNC(hasEquipment)) exitwith {
false;
};
(!([_target, QGVAR(airwayTreated)] call EFUNC(common,getDefinedVariable)) && !([_target] call EFUNC(common,isAwake)))
},TREATMENT_AIRWAY('ACE_nasopharyngeal_tube'),'advanced'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_REMOVE_NPA","STR_ACE_ACTION_REMOVE_NPA_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
([_target, QGVAR(airwayTreated)] call EFUNC(common,getDefinedVariable));
}, {GVAR(INTERACTION_TARGET) setvariable [QGVAR(airwayTreated), nil, true]; (_this select 0) addItem 'ACE_nasopharyngeal_tube';},'airway'] call FUNC(addTreatmentOption);
// Bandaging
ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_BANDAGE_BASIC","STR_ACE_ACTION_BANDAGE_BASIC_TOOLTIP",'ACE_bandage_basic');
ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_QUIKCLOT","STR_ACE_ACTION_QUIKCLOT_TOOLTIP",'ACE_quikclot');
ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_BANDAGE_ELASTIC","STR_ACE_ACTION_BANDAGE_ELASTIC_TOOLTIP",'ACE_bandageElastic');
ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_PACKING_BANDAGE","STR_ACE_ACTION_PACKING_BANDAGE_TOOLTIP",'ACE_packing_bandage');
["STR_ACE_ACTION_REMOVE_TOURNIQUET","STR_ACE_ACTION_REMOVE_TOURNIQUET_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
([_target, call FUNC(getSelectedBodyPart)] call FUNC(hasTourniquetAppliedTo));
},{[_this select 0,_this select 1,call FUNC(getSelectedBodyPart)] call FUNC(actionRemoveTourniquet)},'bandage'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_APPLY_TOURNIQUET","STR_ACE_ACTION_APPLY_TOURNIQUET_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
(!([_target, call FUNC(getSelectedBodyPart)] call FUNC(hasTourniquetAppliedTo)) && ([_caller,_target,'ACE_tourniquet'] call FUNC(hasEquipment)));
},TREATMENT_BANDAGE('ACE_tourniquet'),'bandage'] call FUNC(addTreatmentOption);
// Medication
ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_MORPHINE","STR_ACE_ACTION_MORPHINE_TOOLTIP",'ACE_morphine');
ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_ATROPINE","STR_ACE_ACTION_ATROPINE_TOOLTIP",'ACE_atropine');
ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_EPINEPHRINE","STR_ACE_ACTION_EPINEPHRINE_TOOLTIP",'ACE_epinephrine');
// Examine
["STR_ACE_ACTION_CHECK_PULSE","STR_ACE_ACTION_CHECK_PULSE_TOOLTIP",{
true;
},{[_this select 0,_this select 1] call FUNC(actionCheckPulse)},'examine'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_CHECK_BP","STR_ACE_ACTION_CHECK_BP_TOOLTIP",{
true;
},{[_this select 0,_this select 1] call FUNC(actionCheckBloodPressure);},'examine'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_CHECK_RESPONSE","STR_ACE_ACTION_CHECK_RESPONSE_TOOLTIP",{
true;
},{[_this select 0,_this select 1] call FUNC(actionCheckResponse)},'examine'] call FUNC(addTreatmentOption);
// Drag/Movement
["STR_ACE_ACTION_DRAG_PATIENT","STR_ACE_ACTION_DRAG_PATIENT_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
(isNull ([_caller] call EFUNC(common,getCarriedObj)) && isNull ([_target] call EFUNC(common,getCarriedObj)) && (_caller != _target) && (vehicle _target == _target));
}, {[_this select 0,_this select 1] call FUNC(actionDragUnit)},'drag'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_CARRY_PATIENT","STR_ACE_ACTION_CARRY_PATIENT_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
(isNull ([_caller] call EFUNC(common,getCarriedObj)) && isNull ([_target] call EFUNC(common,getCarriedObj)) && (_caller != _target) && (vehicle _target == _target));
}, {[_this select 0,_this select 1] call FUNC(actionCarryUnit)},'drag'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_BODYBAG","STR_ACE_ACTION_BODYBAG_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
(isNull ([_caller] call EFUNC(common,getCarriedObj)) && isNull ([_target] call EFUNC(common,getCarriedObj)) && (_caller != _target) && (vehicle _target == _target) && ([_caller, _target] call FUNC(canPutInBodyBag)));
}, {[_this select 0,_this select 1] call FUNC(actionPlaceInBodyBag)},'drag'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_DROP_PATIENT","STR_ACE_ACTION_DROP_PATIENT_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
(!(isNull ([_caller] call EFUNC(common,getCarriedObj))) && ([_caller] call FUNC(isMovingUnit)));
}, {[_this select 0,_this select 1] call FUNC(actionDropUnit)},'drag'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_LOAD_PATIENT","STR_ACE_ACTION_LOAD_PATIENT_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
((vehicle _target == _target));
}, {[_this select 0,_this select 1] call FUNC(actionLoadUnit)},'drag'] call FUNC(addTreatmentOption);
["STR_ACE_ACTION_UNLOAD_PATIENT","STR_ACE_ACTION_UNLOAD_PATIENT_TOOLTIP",{
_caller = _this select 0;
_target = _this select 1;
((vehicle _target != _target));
}, {[_this select 0,_this select 1] call FUNC(actionUnloadUnit)},'drag'] call FUNC(addTreatmentOption);
{
_unit = _x;
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
["medical_propagateWound", [_id], [_unit, _x]] call EFUNC(common,targetEvent);
}foreach _openWounds;
}foreach GVAR(InjuredCollection);
}, []] call BIS_fnc_addStackedEventHandler;
};

View File

@ -1,171 +1,83 @@
/**
* XEH_preInit);
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
ADDON = false;
PREP(actionCarryUnit);
PREP(ActioncheckBloodPressure);
PREP(ActionCheckBloodPressureLocal);
PREP(ActionCheckPulse);
PREP(actionCheckBloodPressure);
PREP(actionCheckBloodPressureLocal);
PREP(actionCheckPulse);
PREP(actionCheckPulseLocal);
PREP(actionCheckResponse);
PREP(actionDragUnit);
PREP(actionDropUnit);
PREP(actionLoadUnit);
PREP(actionPlaceInBodyBag);
PREP(actionRemoveTourniquet);
PREP(actionLoadUnit);
PREP(actionUnloadUnit);
PREP(addActivityToLog);
PREP(addHeartRateAdjustment);
PREP(addOpenWounds);
PREP(addToInjuredCollection);
PREP(addToQuickViewLog);
PREP(addToTriageList);
PREP(addTreatmentOption);
PREP(addToLog);
PREP(addToTriageCard);
PREP(addUnconsciousCondition);
PREP(canAccessMedicalEquipment);
PREP(canPutInBodyBag);
PREP(canTreat);
PREP(determineIfFatal);
PREP(determineIfUnconscious);
PREP(fromNumberToBodyPart);
PREP(effectPain);
PREP(effectBleeding);
PREP(effectBlackOut);
PREP(getActivityLog);
PREP(getBloodLoss);
PREP(getBloodPressure);
PREP(getBloodVolumeChange);
PREP(getBodyPartNumber);
PREP(getCardiacOutput);
PREP(getCurrentSelectedInjuryData);
PREP(getHeartRateChange);
PREP(getNewDamageBodyPart);
PREP(getQuickViewLog);
PREP(getSelectedBodyPart);
PREP(getTreatmentOptions);
PREP(getTriageList);
PREP(getTriageStatus);
PREP(getTypeOfDamage);
// Handling events & actions
PREP(handleBandageOpening);
PREP(getUnconsciousCondition);
PREP(handleDamage);
PREP(handleDisplayEffects);
PREP(handleHeal);
PREP(handleReactionHit);
PREP(handleTreatment);
PREP(handleTreatment_Action_AdvancedLocal);
PREP(handleTreatment_Action_AirwayLocal);
PREP(handleTreatment_Action_BandageLocal);
PREP(handleTreatment_Action_CPR);
PREP(handleTreatment_Action_CPRLocal);
PREP(handleTreatment_Action_fullHeal);
PREP(handleTreatment_Action_fullHealLocal);
PREP(handleTreatment_Action_MedicationLocal);
PREP(handleTreatment_Action_Stitching);
PREP(handleTreatment_Action_tourniquet);
PREP(handleTreatment_Action_tourniquetLocal);
PREP(handleTreatment_Category_Advanced);
PREP(handleTreatment_Category_Airway);
PREP(handleTreatment_Category_Bandaging);
PREP(handleTreatment_Category_Medication);
PREP(handleUI_DisplayOptions);
PREP(handleUI_dropDownTriageCard);
PREP(handleDamage_advanced);
PREP(handleDamage_advancedSetDamage);
PREP(handleDamage_airway);
PREP(handleDamage_basic);
PREP(handleDamage_caching);
PREP(handleDamage_fractures);
PREP(handleDamage_internalInjuries);
PREP(handleDamage_wounds);
PREP(handleUnitVitals);
PREP(handleDropUnit);
PREP(hasEquipment);
PREP(hasItem);
PREP(hasItems);
PREP(hasMedicalEnabled);
PREP(hasOpenWounds);
PREP(hasTourniquetAppliedTo);
PREP(increasePain);
PREP(initalizeModuleCMS);
PREP(inMedicalFacility);
PREP(init);
PREP(isInMedicalFacility);
PREP(isMedic);
PREP(isMedicalVehicle);
PREP(isSetTreatmentMutex);
PREP(isMovingUnit);
PREP(moduleAssignMedicalEquipment);
PREP(moduleAssignMedicalFacility);
PREP(moduleAssignMedicalVehicle);
PREP(moduleAssignMedicRoles);
PREP(moduleDamageSettings);
PREP(onInitForUnit);
PREP(onInjury_assignAirwayStatus);
PREP(onInjury_assignFractures);
PREP(onInjury_assignOpenWounds);
PREP(onKilled);
PREP(onLocal);
PREP(onMenuOpen);
PREP(onTreatmentCompleted);
PREP(onUnconscious);
PREP(onStartMovingUnit);
PREP(onCarryObjectDropped);
PREP(onDamage);
PREP(openMenu);
PREP(onMedicationUsage);
PREP(onWoundUpdateRequest);
PREP(onPropagateWound);
PREP(parseConfigForInjuries);
PREP(playInjuredSound);
PREP(reactionToDamage);
PREP(selectionNameToNumber);
PREP(setCardiacArrest);
PREP(setDamageBodyPart);
PREP(setDead);
PREP(setMedicRole);
PREP(setTriageStatus);
PREP(treatmentMutex);
PREP(setHitPointDamage);
PREP(setUnconscious);
PREP(treatment);
PREP(treatment_failure);
PREP(treatment_success);
PREP(treatmentAdvanced_bandage);
PREP(treatmentAdvanced_bandageLocal);
PREP(treatmentAdvanced_CPR);
PREP(treatmentAdvanced_CPRLocal);
PREP(treatmentAdvanced_fullHeal);
PREP(treatmentAdvanced_fullHealLocal);
PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentBasic_bandage);
PREP(treatmentBasic_bloodbag);
PREP(treatmentBasic_epipen);
PREP(treatmentBasic_morphine);
PREP(treatmentIV);
PREP(treatmentIVLocal);
PREP(treatmentTourniquet);
PREP(treatmentTourniquetLocal);
PREP(useItem);
PREP(useItems);
PREP(displayPatientInformation);
PREP(updateActivityLog);
PREP(updateBodyImg);
PREP(updateIcons);
PREP(updateUIInfo);
PREP(useEquipment);
PREP(cacheHandledamageCall);
PREP(checkDamage);
PREP(setUnconsciousState);
PREP(isUnconscious);
PREP(getUnconsciousCondition);
PREP(registerUnconsciousCondition);
PREP(cleanUpCopyOfBody);
PREP(makeCopyOfBody);
PREP(canGoUnconsciousState);
PREP(setDead);
PREP(moduleBasicRevive);
PREP(setWeaponsCorrectUnconscious);
PREP(setCaptiveSwitch);
// initalize all module parameters.
GVAR(setting_allowInstantDead) = true;
GVAR(setting_AdvancedLevel) = 0;
GVAR(setting_advancedWoundsSetting) = false;
GVAR(setting_advancedMedicRoles) = false;
GVAR(setting_medicalDifficulty) = 1;
GVAR(setting_enableBandagingAid) = true;
GVAR(setting_allowAIFullHeal) = false;
GVAR(setting_enableForUnits) = 1;
GVAR(setting_allowAirwayInjuries) = false;
GVAR(setting_aidKitRestrictions) = 0;
GVAR(setting_removeAidKitOnUse) = true;
GVAR(setting_aidKitMedicsOnly) = false;
GVAR(setting_bandageWaitingTime) = 5;
GVAR(setting_allowVehicleCrashInjuries) = true;
GVAR(setting_allowStitching) = 0;
GVAR(injuredUnitCollection) = [];
call FUNC(parseConfigForInjuries);
ADDON = true;

View File

@ -0,0 +1,10 @@
#include "script_component.hpp"
private ["_unit"];
_unit = _this select 0;
if !(local _unit) exitWith {};
diag_log "running respawn";
[_unit] call FUNC(init);

View File

@ -1,31 +1,20 @@
#include "script_component.hpp"
class CfgPatches
{
class ADDON
{
units[] = {"ACE_medical_supply_crate_cms", "ACE_bandage_basicItem","ACE_packing_bandageItem","ACE_bandageElasticItem","ACE_tourniquetItem","ACE_splintItem","ACE_morphineItem","ACE_atropineItem","ACE_epinephrineItem","ACE_plasma_ivItem","ACE_plasma_iv_500Item","ACE_plasma_iv250Item","ACE_blood_ivItem","ACE_blood_iv_500Item","ACE_blood_iv_250Item","ACE_saline_ivItem","ACE_saline_iv_500Item","ACE_saline_iv_250Item","ACE_quikclotItem","ACE_nasopharyngeal_tubeItem","ACE_opaItem","ACE_liquidSkinItem","ACE_chestsealItem","ACE_personal_aid_kitItem"};
weapons[] = {"ACE_surgical_kit"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_common"};
version = VERSION;
author[] = {$STR_ACE_Common_ACETeam, "Glowbal"};
authorUrl = "http://csemod.com";
};
};
class CfgAddons {
class PreloadAddons {
class ADDON {
list[] = {QUOTE(ADDON)};
};
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {ace_common, ace_interaction};
author[] = {"Glowbal", "KoffienFlummi"};
authorUrl = "";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgFactionClasses.hpp"
#include "CfgWeapons.hpp"
#include "CfgSounds.hpp"
#include "CfgVehicles.hpp"
#include "ui\define.hpp"
#include "ui\menu.hpp"
#include "ui\RscTitles.hpp"
#include "CfgWeapons.hpp"
#include "CFgSounds.hpp"
#include "ACE_Medical_Treatments.hpp"
#include "UI\RscTitles.hpp"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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