mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into multipleDevices
Conflicts: addons/common/stringtable.xml
This commit is contained in:
commit
fd8d68c451
@ -73,6 +73,7 @@ Raspu86
|
||||
Riccardo Petricca <petriccarcc@gmail.com>
|
||||
Robert Boklahánics <bokirobi@gmail.com>
|
||||
ramius86 <pasini86@hotmail.com>
|
||||
SilentSpike <SilentSpike100@gmail.com>
|
||||
simon84 <badguy360th@gmail.com>
|
||||
Sniperwolf572 <tenga6@gmail.com>
|
||||
Tachi <zaveruha007@gmail.com>
|
||||
@ -93,4 +94,6 @@ VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
|
||||
Bla1337
|
||||
nikolauska <nikolauska1@gmail.com>
|
||||
adam3adam <br.ada@seznam.cz>
|
||||
Professor <lukas.trneny@wo.cz>
|
||||
Professor <lukas.trneny@wo.cz>
|
||||
Winter <simon@agius-muscat.net>
|
||||
Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ace_fcs.dll
BIN
ace_fcs.dll
Binary file not shown.
1
addons/advanced_ballistics/$PBOPREFIX$
Normal file
1
addons/advanced_ballistics/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\advanced_ballistics
|
@ -2,7 +2,7 @@ class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class GVAR(ModuleSettings): ACE_Module {
|
||||
scope = 2;
|
||||
displayName = "Advanced Ballistics";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_DisplayName";
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));
|
||||
category = "ACE";
|
||||
function = QUOTE(DFUNC(initModuleSettings));
|
||||
@ -12,26 +12,26 @@ class CfgVehicles {
|
||||
author = "Ruthberg";
|
||||
class Arguments {
|
||||
class enabled {
|
||||
displayName = "Advanced Ballistics";
|
||||
description = "Enables advanced ballistics";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_enabled_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_enabled_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class alwaysSimulateForSnipers {
|
||||
displayName = "Always Enabled For Snipers";
|
||||
description = "Always enables advanced ballistics when high power optics are used";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_alwaysSimulateForSnipers_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_alwaysSimulateForSnipers_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class disabledInFullAutoMode {
|
||||
displayName = "Disabled In FullAuto Mode";
|
||||
description = "Disables the advanced ballistics during full auto fire";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_disabledInFullAutoMod_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_disabledInFullAutoMod_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class onlyActiveForLocalPlayers {
|
||||
displayName = "Disabled For Non Local Players";
|
||||
description = "Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer)";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_onlyActiveForLocalPlayers_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_onlyActiveForLocalPlayers_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
@ -44,35 +44,38 @@ class CfgVehicles {
|
||||
};
|
||||
*/
|
||||
class ammoTemperatureEnabled {
|
||||
displayName = "Enable Ammo Temperature Simulation";
|
||||
description = "Muzzle velocity varies with ammo temperature";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_ammoTemperatureEnabled_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_ammoTemperatureEnabled_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class barrelLengthInfluenceEnabled {
|
||||
displayName = "Enable Barrel Length Simulation";
|
||||
description = "Muzzle velocity varies with barrel length";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_barrelLengthInfluenceEnabled_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_barrelLengthInfluenceEnabled_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class bulletTraceEnabled {
|
||||
displayName = "Enable Bullet Trace Effect";
|
||||
description = "Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics)";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_bulletTraceEnabled_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_bulletTraceEnabled_Description";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class simulationInterval {
|
||||
displayName = "Simulation Interval";
|
||||
description = "Defines the interval between every calculation step";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_simulationInterval_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_simulationInterval_Description";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 0.0;
|
||||
};
|
||||
class simulationRadius {
|
||||
displayName = "Simulation Radius";
|
||||
description = "Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles";
|
||||
displayName = "$STR_ACE_AdvancedBallistics_simulationRadius_DisplayName";
|
||||
description = "$STR_ACE_AdvancedBallistics_simulationRadius_Description";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 3000;
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = "$STR_ACE_AdvancedBallistics_Description";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -4,24 +4,11 @@
|
||||
|
||||
GVAR(currentbulletID) = -1;
|
||||
|
||||
GVAR(bulletDatabase) = [];
|
||||
GVAR(bulletDatabaseStartTime) = [];
|
||||
GVAR(bulletDatabaseSpeed) = [];
|
||||
GVAR(bulletDatabaseFrames) = [];
|
||||
GVAR(bulletDatabaseLastFrame) = [];
|
||||
GVAR(bulletDatabaseHDeflect) = [];
|
||||
GVAR(bulletDatabaseSpinDrift) = [];
|
||||
GVAR(bulletDatabaseOccupiedIndices) = [];
|
||||
GVAR(bulletDatabaseFreeIndices) = [];
|
||||
|
||||
GVAR(WindInfo) = false;
|
||||
GVAR(WindInfoStart) = time;
|
||||
|
||||
GVAR(Protractor) = false;
|
||||
GVAR(ProtractorStart) = time;
|
||||
|
||||
GVAR(currentGrid) = 0;
|
||||
GVAR(INIT_MESSAGE_ENABLED) = false;
|
||||
GVAR(initMessageEnabled) = false;
|
||||
|
||||
GVAR(extensionAvailable) = true;
|
||||
/* @TODO: Remove this until versioning is in sync with cmake/build versioning
|
||||
|
@ -6,12 +6,12 @@ PREP(calculateAmmoTemperatureVelocityShift);
|
||||
PREP(calculateAtmosphericCorrection);
|
||||
PREP(calculateBarrelLengthVelocityShift);
|
||||
PREP(calculateRetardation);
|
||||
PREP(calculateRoughnessLength);
|
||||
PREP(calculateStabilityFactor);
|
||||
PREP(calculateWindSpeed);
|
||||
PREP(displayProtractor);
|
||||
PREP(handleFired);
|
||||
PREP(initializeTerrainExtension);
|
||||
PREP(initModuleSettings);
|
||||
PREP(readAmmoDataFromConfig);
|
||||
PREP(readWeaponDataFromConfig);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Calculates the ammo temperature induced muzzle velocity shift
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ammo - classname <string>
|
||||
* 0: muzzle velocity shift lookup table - m/s <ARRAY>
|
||||
* 1: temperature - degrees celcius <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
@ -15,17 +15,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ammo", "_temperature", "_muzzleVelocityTable", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"];
|
||||
_ammo = _this select 0;
|
||||
_temperature = _this select 1;
|
||||
private ["_muzzleVelocityShiftTable", "_temperature", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"];
|
||||
_muzzleVelocityShiftTable = _this select 0;
|
||||
_temperature = _this select 1;
|
||||
|
||||
_muzzleVelocityTable = [];
|
||||
|
||||
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then {
|
||||
_muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts");
|
||||
};
|
||||
|
||||
if (count _muzzleVelocityTable != 11) exitWith { 0 };
|
||||
if (count _muzzleVelocityShiftTable != 11) exitWith { 0 };
|
||||
|
||||
_temperatureIndexA = floor((_temperature + 15) / 5);
|
||||
_temperatureIndexA = 0 max _temperatureIndexA;
|
||||
@ -37,6 +31,6 @@ _temperatureIndexB = _temperatureIndexB min 10;
|
||||
|
||||
_temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5);
|
||||
|
||||
_muzzleVelocityShift = (_muzzleVelocityTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityTable select _temperatureIndexB) * _temperatureRatio;
|
||||
_muzzleVelocityShift = (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _temperatureRatio;
|
||||
|
||||
_muzzleVelocityShift
|
||||
|
@ -4,9 +4,10 @@
|
||||
* Calculates the muzzle velocity shift caused by different barrel lengths
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ammo - classname <string>
|
||||
* 0: weapon - classname <string>
|
||||
* 1: muzzle velocity - m/s <NUMBER>
|
||||
* 0: barrel length - mm
|
||||
* 1: muzzle velocity lookup table - m/s <ARRAY>
|
||||
* 2: barrel length lookup table - mm <ARRAY>
|
||||
* 3: muzzle velocity - m/s <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: muzzle velocity shift - m/s <NUMBER>
|
||||
@ -16,25 +17,13 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ammo", "_weapon", "_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"];
|
||||
_ammo = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_muzzleVelocity = _this select 2;
|
||||
|
||||
_barrelLength = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_barrelLength");
|
||||
private ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"];
|
||||
_barrelLength = _this select 0;
|
||||
_muzzleVelocityTable = _this select 1;
|
||||
_barrelLengthTable = _this select 2;
|
||||
_muzzleVelocity = _this select 3;
|
||||
|
||||
if (_barrelLength == 0) exitWith { 0 };
|
||||
|
||||
_muzzleVelocityTable = [];
|
||||
_barrelLengthTable = [];
|
||||
|
||||
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then {
|
||||
_muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_muzzleVelocities");
|
||||
};
|
||||
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_barrelLengths")) then {
|
||||
_barrelLengthTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_barrelLengths");
|
||||
};
|
||||
|
||||
if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 };
|
||||
if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 };
|
||||
if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
|
||||
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
* Calculates the true wind speed at a given world position
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _this - world position <posASL>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: wind speed - m/s <NUMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"];
|
||||
|
||||
fnc_polar2vect = {
|
||||
private ["_mag2D"];
|
||||
_mag2D = (_this select 0) * cos((_this select 2));
|
||||
[_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))];
|
||||
};
|
||||
|
||||
_windSpeed = vectorMagnitude ACE_wind;
|
||||
_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1);
|
||||
|
||||
// Wind gradient
|
||||
if (_windSpeed > 0.05) then {
|
||||
_height = (ASLToATL _this) select 2;
|
||||
_height = 0 max _height min 20;
|
||||
if (_height < 20) then {
|
||||
_roughnessLength = _this call FUNC(calculateRoughnessLength);
|
||||
_windSpeed = _windSpeed * ln(_height / _roughnessLength) / ln(20 / _roughnessLength);
|
||||
};
|
||||
};
|
||||
|
||||
// Terrain effect on wind
|
||||
if (_windSpeed > 0.05) then {
|
||||
_newWindSpeed = 0;
|
||||
{
|
||||
_windSource = [100, _windDir + 180, _x] call fnc_polar2vect;
|
||||
if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith {
|
||||
_newWindSpeed = cos(_x * 9) * _windSpeed;
|
||||
};
|
||||
_windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect;
|
||||
if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith {
|
||||
_newWindSpeed = cos(_x * 9) * _windSpeed;
|
||||
};
|
||||
_windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect;
|
||||
if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith {
|
||||
_newWindSpeed = cos(_x * 9) * _windSpeed;
|
||||
};
|
||||
} forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||
_windSpeed = _newWindSpeed;
|
||||
};
|
||||
|
||||
// Obstacle effect on wind
|
||||
if (_windSpeed > 0.05) then {
|
||||
_newWindSpeed = 0;
|
||||
{
|
||||
_windSource = [20, _windDir + 180, _x] call fnc_polar2vect;
|
||||
if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith {
|
||||
_newWindSpeed = cos(_x * 2) * _windSpeed;
|
||||
};
|
||||
_windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect;
|
||||
if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith {
|
||||
_newWindSpeed = cos(_x * 2) * _windSpeed;
|
||||
};
|
||||
_windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect;
|
||||
if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith {
|
||||
_newWindSpeed = cos(_x * 2) * _windSpeed;
|
||||
};
|
||||
} forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45];
|
||||
_windSpeed = _newWindSpeed;
|
||||
};
|
||||
_windSpeed = 0 max _windSpeed;
|
||||
|
||||
_windSpeed
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"];
|
||||
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"];
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_mode = _this select 3;
|
||||
@ -40,7 +40,7 @@ if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then {
|
||||
// The shooter is non local
|
||||
if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then {
|
||||
_opticsName = (primaryWeaponItems _unit) select 2;
|
||||
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
||||
_opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
||||
_abort = _opticType != 2; // We only abort if the non local shooter is not a sniper
|
||||
};
|
||||
} else {
|
||||
@ -48,19 +48,26 @@ if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then {
|
||||
};
|
||||
};
|
||||
//if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // We currently do not have firedEHs on vehicles
|
||||
if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; };
|
||||
if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; };
|
||||
|
||||
if (_abort || !(GVAR(extensionAvailable))) exitWith {
|
||||
[_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH);
|
||||
[_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH);
|
||||
};
|
||||
|
||||
_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction");
|
||||
_AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo];
|
||||
if (isNil {_AmmoCacheEntry}) then {
|
||||
_AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig);
|
||||
};
|
||||
_WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon];
|
||||
if (isNil {_WeaponCacheEntry}) then {
|
||||
_WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig);
|
||||
};
|
||||
|
||||
_bulletVelocity = velocity _bullet;
|
||||
_muzzleVelocity = vectorMagnitude _bulletVelocity;
|
||||
|
||||
if (GVAR(barrelLengthInfluenceEnabled)) then {
|
||||
_muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
|
||||
_muzzleVelocityShift = [_WeaponCacheEntry select 2, _AmmoCacheEntry select 10, _AmmoCacheEntry select 11, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
|
||||
if (_muzzleVelocityShift != 0) then {
|
||||
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift));
|
||||
_bullet setVelocity _bulletVelocity;
|
||||
@ -69,8 +76,8 @@ if (GVAR(barrelLengthInfluenceEnabled)) then {
|
||||
};
|
||||
|
||||
if (GVAR(ammoTemperatureEnabled)) then {
|
||||
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
|
||||
_muzzleVelocityShift = [_ammo, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift);
|
||||
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
|
||||
_muzzleVelocityShift = [_AmmoCacheEntry select 9, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift);
|
||||
if (_muzzleVelocityShift != 0) then {
|
||||
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift));
|
||||
_bullet setVelocity _bulletVelocity;
|
||||
@ -85,60 +92,27 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then {
|
||||
} else {
|
||||
if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {
|
||||
_opticsName = (primaryWeaponItems ACE_player) select 2;
|
||||
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
||||
_opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
||||
_bulletTraceVisible = _opticType == 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_caliber");
|
||||
_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_bulletLength");
|
||||
_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_bulletMass");
|
||||
_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_barrelTwist");
|
||||
_caliber = _AmmoCacheEntry select 1;
|
||||
_bulletLength = _AmmoCacheEntry select 2;
|
||||
_bulletMass = _AmmoCacheEntry select 3;
|
||||
_barrelTwist = _WeaponCacheEntry select 0;
|
||||
_stabilityFactor = 1.5;
|
||||
|
||||
if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
|
||||
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
|
||||
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
|
||||
_barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure);
|
||||
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
|
||||
};
|
||||
|
||||
_twistDirection = 1;
|
||||
if (isNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_twistDirection")) then {
|
||||
_twistDirection = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_twistDirection");
|
||||
if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then {
|
||||
_twistDirection = 1;
|
||||
};
|
||||
};
|
||||
|
||||
_transonicStabilityCoef = 0.5;
|
||||
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then {
|
||||
_transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef");
|
||||
};
|
||||
|
||||
_dragModel = 1;
|
||||
_ballisticCoefficients = [];
|
||||
_velocityBoundaries = [];
|
||||
_atmosphereModel = "ICAO";
|
||||
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel")) then {
|
||||
_dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel");
|
||||
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
|
||||
_dragModel = 1;
|
||||
};
|
||||
};
|
||||
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then {
|
||||
_ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients");
|
||||
};
|
||||
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then {
|
||||
_velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries");
|
||||
};
|
||||
if (isText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then {
|
||||
_atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere");
|
||||
};
|
||||
|
||||
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
|
||||
|
||||
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)];
|
||||
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)];
|
||||
|
||||
[{
|
||||
private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"];
|
||||
|
@ -22,7 +22,7 @@ _initStartTime = time;
|
||||
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
|
||||
|
||||
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
|
||||
if (GVAR(INIT_MESSAGE_ENABLED)) then {
|
||||
if (GVAR(initMessageEnabled)) then {
|
||||
systemChat "AdvancedBallistics: Terrain already initialized";
|
||||
};
|
||||
};
|
||||
@ -40,7 +40,7 @@ GVAR(currentGrid) = 0;
|
||||
_initStartTime = _args select 2;
|
||||
|
||||
if (GVAR(currentGrid) >= _gridCells) exitWith {
|
||||
if (GVAR(INIT_MESSAGE_ENABLED)) then {
|
||||
if (GVAR(initMessageEnabled)) then {
|
||||
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(time - _initStartTime)];
|
||||
};
|
||||
[_this select 1] call cba_fnc_removePerFrameHandler;
|
||||
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
* Reads the ammo class config and updates the config cache
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ammo - classname <string>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable] <ARRAY>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"];
|
||||
_ammo = _this;
|
||||
|
||||
_airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction");
|
||||
_caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber");
|
||||
_bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength");
|
||||
_bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass");
|
||||
_transonicStabilityCoef = 0.5;
|
||||
if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then {
|
||||
_transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef");
|
||||
};
|
||||
_dragModel = 1;
|
||||
_ballisticCoefficients = [];
|
||||
_velocityBoundaries = [];
|
||||
_atmosphereModel = "ICAO";
|
||||
if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel")) then {
|
||||
_dragModel = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel");
|
||||
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
|
||||
_dragModel = 1;
|
||||
};
|
||||
};
|
||||
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then {
|
||||
_ballisticCoefficients = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients");
|
||||
};
|
||||
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then {
|
||||
_velocityBoundaries = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries");
|
||||
};
|
||||
if (isText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then {
|
||||
_atmosphereModel = getText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere");
|
||||
};
|
||||
_ammoTempMuzzleVelocityShifts = [];
|
||||
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then {
|
||||
_ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts");
|
||||
};
|
||||
_muzzleVelocityTable = [];
|
||||
_barrelLengthTable = [];
|
||||
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then {
|
||||
_muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities");
|
||||
};
|
||||
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then {
|
||||
_barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths");
|
||||
};
|
||||
|
||||
_result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable];
|
||||
|
||||
uiNamespace setVariable [format[QGVAR(%1), _ammo], _result];
|
||||
|
||||
_result
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
* Reads the weapon class config and updates the config cache
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ammo - classname <string>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: [_barrelTwist, _twistDirection, _barrelLength] <ARRAY>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"];
|
||||
_weapon = _this;
|
||||
|
||||
_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist");
|
||||
_twistDirection = 1;
|
||||
if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then {
|
||||
_twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection");
|
||||
if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then {
|
||||
_twistDirection = 1;
|
||||
};
|
||||
};
|
||||
_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength");
|
||||
|
||||
_result = [_barrelTwist, _twistDirection, _barrelLength];
|
||||
|
||||
uiNamespace setVariable [format[QGVAR(%1), _weapon], _result];
|
||||
|
||||
_result
|
@ -21,6 +21,5 @@
|
||||
#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058
|
||||
#define STD_AIR_DENSITY_ICAO 1.22498
|
||||
#define STD_AIR_DENSITY_ASM 1.20885
|
||||
#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h))
|
||||
|
||||
#define EXTENSION_REQUIRED_VERSION "1.0"
|
||||
|
@ -25,5 +25,85 @@
|
||||
<Czech>Zobrazit úhloměr</Czech>
|
||||
<Portuguese>Mostrar Transferidor</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_DisplayName">
|
||||
<English>Advanced Ballistics</English>
|
||||
<Polish>Zaawansowana balistyka</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_enabled_DisplayName">
|
||||
<English>Advanced Ballistics</English>
|
||||
<Polish>Zaawansowana balistyka</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_enabled_Description">
|
||||
<English>Enables advanced ballistics</English>
|
||||
<Polish>Aktywuje zaawansowaną balistykę</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_alwaysSimulateForSnipers_DisplayName">
|
||||
<English>Always Enabled For Snipers</English>
|
||||
<Polish>Zawsze akt. dla snajp.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_alwaysSimulateForSnipers_Description">
|
||||
<English>Always enables advanced ballistics when high power optics are used</English>
|
||||
<Polish>Aktywuje zaawansowaną balistykę zawsze, kiedy używana jest optyka</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_disabledInFullAutoMod_DisplayName">
|
||||
<English>Disabled In FullAuto Mode</English>
|
||||
<Polish>Wył. podczas ognia auto.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_disabledInFullAutoMod_Description">
|
||||
<English>Disables the advanced ballistics during full auto fire</English>
|
||||
<Polish>Dezaktywuje zaawansowaną balistykę podczas ognia automatycznego</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_onlyActiveForLocalPlayers_DisplayName">
|
||||
<English>Disabled For Non Local Players</English>
|
||||
<Polish>Wyłącz dla nielok. graczy</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_onlyActiveForLocalPlayers_Description">
|
||||
<English>Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer)</English>
|
||||
<Polish>Dezaktywuje zaawansowaną balistykę dla pocisków pochodzących od innych graczy(aktywuj tą opcję jeżeli odczuwasz spadki FPS podczas sporych strzelanin w MP)</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_ammoTemperatureEnabled_DisplayName">
|
||||
<English>Enable Ammo Temperature Simulation</English>
|
||||
<Polish>Symulacja temp. amunicji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_ammoTemperatureEnabled_Description">
|
||||
<English>Muzzle velocity varies with ammo temperature</English>
|
||||
<Polish>Prędkość wylotowa pocisku jest zależna od temperatury amunicji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_barrelLengthInfluenceEnabled_DisplayName">
|
||||
<English>Enable Barrel Length Simulation</English>
|
||||
<Polish>Symulacja długości lufy</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_barrelLengthInfluenceEnabled_Description">
|
||||
<English>Muzzle velocity varies with barrel length</English>
|
||||
<Polish>Prędkość wylotowa pocisku jest zależna od długości lufy</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_bulletTraceEnabled_DisplayName">
|
||||
<English>Enable Bullet Trace Effect</English>
|
||||
<Polish>Efekt smugi pocisku</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_bulletTraceEnabled_Description">
|
||||
<English>Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics)</English>
|
||||
<Polish>Aktywuje efekt smugi pocisku dla pocisków wysokokalibrowych (widoczne tylko podczas patrzenia przez optykę)</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_simulationInterval_DisplayName">
|
||||
<English>Simulation Interval</English>
|
||||
<Polish>Interwał symulacji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_simulationInterval_Description">
|
||||
<English>Defines the interval between every calculation step</English>
|
||||
<Polish>Określa interwał pomiędzy każdym krokiem kalkulacji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_simulationRadius_DisplayName">
|
||||
<English>Simulation Radius</English>
|
||||
<Polish>Zasięg symulacji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_simulationRadius_Description">
|
||||
<English>Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles</English>
|
||||
<Polish>Określa obszar naokoło gracza (w metrach), na którym zaawansowana balistyka jest aplikowana dla pocisków</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AdvancedBallistics_Description">
|
||||
<English></English>
|
||||
<Polish>Moduł ten pozwala aktywować zaawansowaną balistykę biorącą przy obliczeniach trajektorii lotu pocisku pod uwagę takie rzeczy jak temperatura powietrza, ciśnienie atmosferyczne, wilgotność powietrza, siły Coriolisa i Eotvosa, grawitację a także broń z jakiej wykonywany jest strzał oraz rodzaj amunicji. Wszystko to sprowadza się na bardzo dokładne odwzorowanie balistyki.</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -891,9 +891,12 @@ class Heli_Attack_01_base_F: Helicopter_Base_F {
|
||||
|
||||
class OpticsIn
|
||||
{
|
||||
class WideUnstabalized
|
||||
{
|
||||
opticsDisplayName = "WU";
|
||||
delete Narrow;
|
||||
delete Medium;
|
||||
delete Wide;
|
||||
|
||||
class ACE_WideUnstabilized {
|
||||
opticsDisplayName = "W NS";
|
||||
initAngleX = 0;
|
||||
minAngleX = -35;
|
||||
maxAngleX = 10;
|
||||
@ -910,8 +913,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F {
|
||||
horizontallyStabilized = 1;
|
||||
gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F";
|
||||
};
|
||||
class Wide
|
||||
{
|
||||
class ACE_Wide: ACE_WideUnstabilized {
|
||||
opticsDisplayName = "W";
|
||||
initAngleX = 0;
|
||||
minAngleX = -35;
|
||||
@ -929,8 +931,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F {
|
||||
horizontallyStabilized = 1;
|
||||
gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F";
|
||||
};
|
||||
class Medium: Wide
|
||||
{
|
||||
class ACE_Medium: ACE_Wide {
|
||||
opticsDisplayName = "M";
|
||||
initFov = 0.093;
|
||||
minFov = 0.093;
|
||||
@ -940,8 +941,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F {
|
||||
horizontallyStabilized = 1;
|
||||
gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F";
|
||||
};
|
||||
class Narrow: Wide
|
||||
{
|
||||
class ACE_Narrow: ACE_Wide {
|
||||
opticsDisplayName = "N";
|
||||
initFov = 0.029;
|
||||
minFov = 0.029;
|
||||
@ -952,8 +952,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F {
|
||||
gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F";
|
||||
|
||||
};
|
||||
class Narrower: Wide
|
||||
{
|
||||
class ACE_Narrower: ACE_Wide {
|
||||
opticsDisplayName = "Z";
|
||||
initFov = 0.01;
|
||||
minFov = 0.01;
|
||||
|
1
addons/atragmx/$PBOPREFIX$
Normal file
1
addons/atragmx/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\atragmx
|
@ -95,36 +95,6 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t
|
||||
GVAR(workingMemory) set [1, _muzzleVelocity];
|
||||
GVAR(workingMemory) set [2, _zeroRange];
|
||||
|
||||
private ["_elevationCur", "_windageCur", "_clickSize", "_clickNumber", "_clickInterval"];
|
||||
_elevationCur = GVAR(workingMemory) select 10;
|
||||
_windageCur = GVAR(workingMemory) select 11;
|
||||
|
||||
switch (GVAR(currentScopeUnit)) do {
|
||||
case 0: {
|
||||
_elevationCur = _elevationCur * 3.38;
|
||||
_windageCur = _windageCur * 3.38;
|
||||
};
|
||||
case 2: {
|
||||
_elevationCur = _elevationCur / 1.047;
|
||||
_windageCur = _windageCur / 1.047;
|
||||
};
|
||||
case 3: {
|
||||
switch (GVAR(workingMemory) select 7) do {
|
||||
case 0: { _clickSize = 1; };
|
||||
case 1: { _clickSize = 1 / 1.047; };
|
||||
case 2: { _clickSize = 3.38; };
|
||||
};
|
||||
_clickNumber = GVAR(workingMemory) select 8;
|
||||
_clickInterval = _clickSize / _clickNumber;
|
||||
|
||||
_elevationCur = Round(_elevationCur / _clickInterval);
|
||||
_windageCur = Round(_windageCur / _clickInterval);
|
||||
};
|
||||
};
|
||||
|
||||
GVAR(workingMemory) set [10, _elevationCur];
|
||||
GVAR(workingMemory) set [11, _windageCur];
|
||||
|
||||
[] call FUNC(update_gun);
|
||||
[] call FUNC(update_gun_ammo_data);
|
||||
[] call FUNC(update_atmosphere);
|
||||
|
@ -190,7 +190,7 @@ class CfgVehicles {
|
||||
class ACE_Box_Ammo: NATO_Box_Base {
|
||||
scope = 2;
|
||||
accuracy = 1000;
|
||||
displayName = "[ACE] Ammo Supply Crate";
|
||||
displayName = "$STR_ACE_AmmoSupplyCrate_DisplayName";
|
||||
model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F";
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
class TransportMagazines {
|
||||
|
@ -1,16 +1,13 @@
|
||||
|
||||
class Single;
|
||||
class Burst;
|
||||
class FullAuto;
|
||||
class Mode_SemiAuto;
|
||||
class Mode_Burst;
|
||||
class Mode_FullAuto;
|
||||
|
||||
class CfgWeapons {
|
||||
class DMR_02_base_F;
|
||||
class DMR_03_base_F;
|
||||
class DMR_04_base_F;
|
||||
class DMR_05_base_F;
|
||||
class DMR_06_base_F;
|
||||
class GM6_base_F;
|
||||
class LMG_RCWS;
|
||||
class LRR_base_F;
|
||||
class MGun;
|
||||
class MGunCore;
|
||||
class MMG_01_base_F;
|
||||
@ -22,19 +19,83 @@ class CfgWeapons {
|
||||
|
||||
/* Long Rifles */
|
||||
|
||||
class GM6_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class LRR_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00020; // radians. Equal to 0.70 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_06_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_05_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_04_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_03_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00032; // radians. Equal to 1.10 MOA.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00032; // radians. Equal to 1.10 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_02_base_F: Rifle_Long_Base_F {
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.000262; // radians. Equal to 0.90 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_01_base_F: Rifle_Long_Base_F {
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {
|
||||
class MuzzleSlot: MuzzleSlot {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_B"};
|
||||
};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.0004; // radians. Equal to 1.375 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
class EBR_base_F: Rifle_Long_Base_F {
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {
|
||||
class MuzzleSlot: MuzzleSlot {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_B"};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class DMR_01_base_F: Rifle_Long_Base_F {
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {
|
||||
class MuzzleSlot: MuzzleSlot {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_B"};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00029; // radians. Equal to 1.00 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
@ -46,14 +107,6 @@ class CfgWeapons {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_H"};
|
||||
};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.000800; // radians. Equal to 2.75 MOA.
|
||||
// Based on widely cited 2 MOA figure for new 5.56 ACR.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00147; // radians. Equal to 5.1 MOA.
|
||||
};
|
||||
};
|
||||
class arifle_MX_SW_F: arifle_MX_Base_F {
|
||||
magazines[] = {
|
||||
@ -74,14 +127,6 @@ class CfgWeapons {
|
||||
compatibleItems[] = {"muzzle_snds_H","muzzle_snds_H_SW","ACE_muzzle_mzls_H"};
|
||||
};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.000800; // radians. Equal to 2.75 MOA.
|
||||
// Based on widely cited 2 MOA figure for new 5.56 ACR.
|
||||
};
|
||||
|
||||
class manual: FullAuto {
|
||||
dispersion = 0.00147; // radians. Equal to 5.1 MOA.
|
||||
};
|
||||
};
|
||||
class arifle_MXM_F: arifle_MX_Base_F {
|
||||
magazines[] = {
|
||||
@ -95,12 +140,11 @@ class CfgWeapons {
|
||||
ACE_barrelTwist=228.6;
|
||||
ACE_barrelLength=457.2;
|
||||
class Single: Single {
|
||||
dispersion = 0.00029; // radians. Equal to 1 MOA.
|
||||
// 6.5mm is easily capable of this in a half-tuned rifle.
|
||||
dispersion = 0.000436; // radians. Equal to 1.50 MOA.
|
||||
};
|
||||
|
||||
class FullAuto: FullAuto {
|
||||
dispersion = 0.000800; // radians. Equal to 2.75 MOA.
|
||||
dispersion = 0.000436; // radians. Equal to 1.50 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
@ -112,15 +156,6 @@ class CfgWeapons {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_H"};
|
||||
};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.000800; // radians. Equal to 2.75 MOA.
|
||||
// Based on widely cited 2 MOA figure for new 5.56 ACR?
|
||||
// Use your imagination for fictional weapons!
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00147; // radians. Equal to 5.1 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -139,13 +174,6 @@ class CfgWeapons {
|
||||
};
|
||||
ACE_barrelTwist=177.8;
|
||||
ACE_barrelLength=317.5;
|
||||
class manual: Mode_FullAuto {
|
||||
dispersion = 0.00175; // radians. Equal to 6 MOA.
|
||||
};
|
||||
|
||||
class Single: manual {
|
||||
dispersion = 0.00175; // radians. Equal to 6 MOA.
|
||||
};
|
||||
};
|
||||
class LMG_Zafir_F: Rifle_Long_Base_F {
|
||||
initSpeed = -1.0;
|
||||
@ -156,13 +184,6 @@ class CfgWeapons {
|
||||
};
|
||||
ACE_barrelTwist=304.8;
|
||||
ACE_barrelLength=459.74;
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00175; // radians. Equal to 6 MOA.
|
||||
};
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.00175; // radians. Equal to 6 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -173,13 +194,6 @@ class CfgWeapons {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_L"};
|
||||
};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.000727; // radians. Equal to 2.5 MOA, about the limit of mass-produced M855.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00147; // radians. Equal to 5.1 MOA.
|
||||
};
|
||||
};
|
||||
class mk20_base_F: Rifle_Base_F {
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {
|
||||
@ -187,14 +201,6 @@ class CfgWeapons {
|
||||
compatibleItems[] += {"ACE_muzzle_mzls_L"};
|
||||
};
|
||||
};
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus
|
||||
// some extra for these worn out Greek Army service rifles.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00147; // radians. Equal to 5.1 MOA.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -202,12 +208,15 @@ class CfgWeapons {
|
||||
class SDAR_base_F: Rifle_Base_F {
|
||||
initSpeed = -0.989;
|
||||
class Single: Mode_SemiAuto {
|
||||
dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus
|
||||
// some extra because Kel-Tec.
|
||||
dispersion = 0.0008727; // radians. Equal to 3 MOA.
|
||||
};
|
||||
|
||||
class Burst: Mode_Burst {
|
||||
dispersion = 0.0008727; // radians. Equal to 3 MOA.
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
dispersion = 0.00147; // radians. Equal to 5.1 MOA.
|
||||
dispersion = 0.0008727; // radians. Equal to 3 MOA.
|
||||
};
|
||||
};
|
||||
class pdw2000_base_F: Rifle_Base_F {
|
||||
@ -642,11 +651,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -675,11 +684,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -708,11 +717,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -741,11 +750,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -774,11 +783,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -807,11 +816,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -840,11 +849,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -873,11 +882,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
@ -906,11 +915,11 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MuzzleCoef {
|
||||
dispersionCoef = "0.8f";
|
||||
dispersionCoef = "0.95f";
|
||||
artilleryDispersionCoef = "1.0f";
|
||||
fireLightCoef = "0.5f";
|
||||
recoilCoef = "1.0f";
|
||||
recoilProneCoef = "1.0f";
|
||||
recoilCoef = "0.95f";
|
||||
recoilProneCoef = "0.95f";
|
||||
minRangeCoef = "1.0f";
|
||||
minRangeProbabCoef = "1.0f";
|
||||
midRangeCoef = "1.0f";
|
||||
|
@ -1,12 +1,12 @@
|
||||
ace_ballistics
|
||||
==============
|
||||
|
||||
Changes to weapon and ammunition values.
|
||||
|
||||
Changes to weapon, magazine and ammunition values.
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [Ruthberg] (http://github.com/Ulteq)
|
||||
- [KoffeinFlummi](https://github.com/KoffeinFlummi)
|
||||
- [commy2](https://github.com/commy2)
|
||||
|
@ -1592,5 +1592,9 @@
|
||||
<Portuguese>Calibre: 12.7x99mm (AMAX)<br/>Cartuchos: 5</Portuguese>
|
||||
<Hungarian>Kaliber: 12,7x99mm (AMAX)<br />Lövedékek: 5</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AmmoSupplyCrate_DisplayName">
|
||||
<English>[ACE] Ammo Supply Crate</English>
|
||||
<Polish>[ACE] Skrzynka z amunicją</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -161,7 +161,7 @@ class CfgVehicles {
|
||||
class GVAR(ModuleSurrender): Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "Make Unit Surrender";
|
||||
displayName = "$STR_ACE_Captives_ModuleSurrender_DisplayName"; //Make Unit Surrender
|
||||
function = QUOTE(DFUNC(moduleSurrender));
|
||||
scope = 2; //show in editor
|
||||
scopeCurator = 2; //show in zeus
|
||||
@ -172,8 +172,8 @@ class CfgVehicles {
|
||||
functionPriority = 0;
|
||||
class Arguments {};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = "Sync a unit to make them surrender.<br/>Source: ace_captives";
|
||||
description = "$STR_ACE_Captives_ModuleSurrender_Description"; //Sync a unit to make them surrender.<br/>Source: ace_captives
|
||||
sync[] = {"AnyAI"};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -11,7 +11,7 @@ if (isServer) then {
|
||||
_escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull];
|
||||
if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then {
|
||||
detach _escortedUnit;
|
||||
systemChat "debug: DC detach";
|
||||
//systemChat "debug: DC detach";
|
||||
};
|
||||
if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then {
|
||||
_disconnectedPlayer setVariable [QGVAR(isEscorting), false, true];
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Checks the conditions for being able to surrender
|
||||
* Checks the conditions for being able switch surrender states
|
||||
*
|
||||
* Arguments:
|
||||
* 0: caller (player) <OBJECT>
|
||||
@ -18,14 +18,14 @@
|
||||
|
||||
PARAMS_2(_unit,_newSurrenderState);
|
||||
|
||||
if (currentWeapon _unit != "") exitWith {false};
|
||||
|
||||
private "_returnValue";
|
||||
|
||||
_returnValue = if (_newSurrenderState) then {
|
||||
!(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
|
||||
//no weapon equiped AND not currently surrendering and
|
||||
(currentWeapon _unit == "") && {!(_unit getVariable [QGVAR(isSurrendering), false])}
|
||||
} else {
|
||||
(_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
|
||||
//is Surrendering
|
||||
(_unit getVariable [QGVAR(isSurrendering), false])
|
||||
};
|
||||
|
||||
_returnValue
|
||||
|
@ -193,5 +193,13 @@
|
||||
<Hungarian>Semmi sincs az egér alatt</Hungarian>
|
||||
<Italian>Nessuna selezione</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleSurrender_DisplayName">
|
||||
<English>Make Unit Surrender</English>
|
||||
<Polish>Poddaj się!</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleSurrender_Description">
|
||||
<English>Sync a unit to make them surrender.<br />Source: ace_captives</English>
|
||||
<Polish>Zsynchronizuj z jednostką aby sprawić by się poddała<br />Źródło: ace_captives</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -25,72 +25,72 @@ class CfgVehicles {
|
||||
// += needs a non inherited entry in that class, otherwise it simply overwrites
|
||||
//#include <DefaultItems.hpp>
|
||||
|
||||
class Module_F;
|
||||
class ACE_ModuleCheckPBOs: Module_F {
|
||||
class Logic;
|
||||
class Module_F: Logic {
|
||||
class ModuleDescription {};
|
||||
};
|
||||
class ACE_ModuleCheckPBOs: Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "Check PBOs";
|
||||
displayName = "$STR_ACE_Common_CheckPBO_DisplayName";
|
||||
function = QFUNC(moduleCheckPBOs);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
|
||||
class Arguments {
|
||||
class Action {
|
||||
displayName = "Action";
|
||||
description = "What to do with people who do not have the right PBOs?";
|
||||
displayName = "$STR_ACE_Common_CheckPBO_Action_DisplayName";
|
||||
description = "$STR_ACE_Common_CheckPBO_Action_Description";
|
||||
class values {
|
||||
class WarnOnce {
|
||||
default = 1;
|
||||
name = "Warn once";
|
||||
name = "$STR_ACE_Common_CheckPBO_Action_WarnOnce";
|
||||
value = 0;
|
||||
};
|
||||
class Warn {
|
||||
name = "Warn (permanent)";
|
||||
name = "$STR_ACE_Common_CheckPBO_Action_WarnPerm";
|
||||
value = 1;
|
||||
};
|
||||
class Kick {
|
||||
name = "Kick";
|
||||
name = "$STR_ACE_Common_CheckPBO_Action_Kick";
|
||||
value = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
class CheckAll {
|
||||
displayName = "Check all addons";
|
||||
description = "Check all addons instead of only those of ACE?";
|
||||
displayName = "$STR_ACE_Common_CheckPBO_CheckAll_DisplayName";
|
||||
description = "$STR_ACE_Common_CheckPBO_CheckAll_Description";
|
||||
typeName = "BOOL";
|
||||
class values {
|
||||
class WarnOnce {
|
||||
default = 1;
|
||||
name = "No";
|
||||
value = 0;
|
||||
};
|
||||
class Warn {
|
||||
name = "Yes";
|
||||
value = 1;
|
||||
};
|
||||
};
|
||||
defaultValue = 0;
|
||||
};
|
||||
class Whitelist {
|
||||
displayName = "Whitelist";
|
||||
description = "What addons are allowed regardless?";
|
||||
displayName = "$STR_ACE_Common_CheckPBO_Whitelist_DisplayName";
|
||||
description = "$STR_ACE_Common_CheckPBO_Whitelist_Description";
|
||||
typeName = "STRING";
|
||||
class values {
|
||||
default = "[]";
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = "$STR_ACE_Common_CheckPBO_Description";
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_ModuleLSDVehicles: Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "LSD Vehicles";
|
||||
displayName = "$STR_ACE_Common_LSDVehicles_DisplayName";
|
||||
function = "ACE_Common_fnc_moduleLSDVehicles";
|
||||
scope = 2;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa));
|
||||
isGlobal = 1;
|
||||
class Arguments {
|
||||
};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = "$STR_ACE_Common_LSDVehicles_Description";
|
||||
sync[] = {"AnyVehicle"};
|
||||
};
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
|
@ -185,6 +185,7 @@ PREP(unmuteUnit);
|
||||
PREP(useItem);
|
||||
PREP(useMagazine);
|
||||
PREP(waitAndExecute);
|
||||
PREP(waveHeightAt);
|
||||
|
||||
PREP(translateToWeaponSpace);
|
||||
PREP(translateToModelSpace);
|
||||
@ -314,6 +315,16 @@ if (hasInterface) then {
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
// Time handling
|
||||
ACE_time = diag_tickTime;
|
||||
ACE_realTime = diag_tickTime;
|
||||
ACE_virtualTime = diag_tickTime;
|
||||
ACE_diagTime = diag_tickTime;
|
||||
ACE_gameTime = time;
|
||||
|
||||
PREP(timePFH);
|
||||
[FUNC(timePFH), 0, []] call cba_fnc_addPerFrameHandler;
|
||||
|
||||
// Init toHex
|
||||
[0] call FUNC(toHex);
|
||||
|
||||
|
@ -101,7 +101,7 @@ class ACE_Settings {
|
||||
isClientSettable = 1;
|
||||
displayName = "$STR_ACE_Common_SettingFeedbackIconsName";
|
||||
description = "$STR_ACE_Common_SettingFeedbackIconsDesc";
|
||||
values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"};
|
||||
values[] = {"$STR_ACE_Common_Hide", "$STR_ACE_Common_TopRightDown", "$STR_ACE_Common_TopRightLeft", "$STR_ACE_Common_TopLeftDown", "$STR_ACE_Common_TopLeftRight"};
|
||||
};
|
||||
class GVAR(SettingProgressBarLocation) {
|
||||
value = 0;
|
||||
@ -110,7 +110,7 @@ class ACE_Settings {
|
||||
isClientSettable = 1;
|
||||
displayName = "$STR_ACE_Common_SettingProgressbarLocationName";
|
||||
description = "$STR_ACE_Common_SettingProgressbarLocationDesc";
|
||||
values[] = {"Top", "Bottom"};
|
||||
values[] = {"$STR_ACE_Common_Top", "$STR_ACE_Common_Bottom"};
|
||||
};
|
||||
class GVAR(displayTextColor) {
|
||||
value[] = {0,0,0,0.1};
|
||||
|
@ -49,6 +49,9 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
|
||||
if (hasInterface) then {
|
||||
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
|
||||
};
|
||||
} else {
|
||||
// Print the current extension version
|
||||
diag_log text format ["[ACE] Extension version: %1: %2", _x, (_x callExtension "version")];
|
||||
};
|
||||
} forEach getArray (configFile >> "ACE_Extensions" >> "extensions");
|
||||
|
||||
|
25
addons/common/functions/fnc_timePFH.sqf
Normal file
25
addons/common/functions/fnc_timePFH.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
private["_lastTime", "_lastRealTime", "_lastVirtualTime", "_lastGameTime", "_delta"];
|
||||
|
||||
_lastRealTime = ACE_realTime;
|
||||
_lastGameTime = ACE_gameTime;
|
||||
|
||||
ACE_gameTime = time;
|
||||
ACE_diagTime = diag_tickTime;
|
||||
|
||||
_delta = ACE_diagTime - _lastRealTime;
|
||||
if(ACE_gameTime <= _lastGameTime) then {
|
||||
ACE_paused = true;
|
||||
// Game is paused or not running
|
||||
ACE_pausedTime = ACE_pausedTime + _delta;
|
||||
ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime);
|
||||
} else {
|
||||
ACE_paused = false;
|
||||
// Time is updating
|
||||
ACE_realTime = ACE_realTime + _delta;
|
||||
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
|
||||
ACE_time = ACE_virtualTime;
|
||||
};
|
||||
|
20
addons/common/functions/fnc_waveHeightAt.sqf
Normal file
20
addons/common/functions/fnc_waveHeightAt.sqf
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
*
|
||||
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Position ASL to get height at
|
||||
*
|
||||
* Return Value:
|
||||
* Wave height in meters
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if(isNil QGVAR(waveHeightLogic)) then {
|
||||
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
|
||||
};
|
||||
GVAR(waveHeightLogic) setPosASL (_this select 0);
|
||||
|
||||
(((getPosASLW GVAR(waveHeightLogic)) select 2) - ((getPosASL GVAR(waveHeightLogic)) select 2))
|
@ -47,7 +47,7 @@ if (!isServer) then {
|
||||
|
||||
_index = _files find _x;
|
||||
if (_index == -1) then {
|
||||
if (_x != "ace_serverconfig") then {_missingAddons pushBack _x;};
|
||||
if (_x != "ace_server") then {_missingAddons pushBack _x;};
|
||||
} else {
|
||||
|
||||
_clientVersion = _versions select _index;
|
||||
|
@ -470,6 +470,58 @@
|
||||
<French>Une banane est un fruit qui, d'un point de vue botanique, fait partie du groupe des baies. Produite par plusieurs sortes de grandes plantes à fleurs herbacées du type Musa.</French>
|
||||
<Portuguese>A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa.</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_DisplayName">
|
||||
<English>Check PBOs</English>
|
||||
<Polish>Sprawdzaj PBO</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Description">
|
||||
<English></English>
|
||||
<Polish>Sprawdzaj spójność addonów z serwerem</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Action_DisplayName">
|
||||
<English>Action</English>
|
||||
<Polish>Akcja</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Action_Description">
|
||||
<English>What to do with people who do not have the right PBOs?</English>
|
||||
<Polish>Co zrobić z graczami, którzy nie mają właściwych PBO?</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Action_WarnOnce">
|
||||
<English>Warn once</English>
|
||||
<Polish>Ostrzeż raz</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Action_WarnPerm">
|
||||
<English>Warn (permanent)</English>
|
||||
<Polish>Ostrzeżenie (permanentne)</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Action_Kick">
|
||||
<English>Kick</English>
|
||||
<Polish>Kick</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_CheckAll_DisplayName">
|
||||
<English>Check all addons</English>
|
||||
<Polish>Sprawdź wsz. addony</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_CheckAll_Description">
|
||||
<English>Check all addons instead of only those of ACE?</English>
|
||||
<Polish>Sprawdzaj wszystkie addony czy tylko te z ACE?</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Whitelist_DisplayName">
|
||||
<English>Whitelist</English>
|
||||
<Polish>Biała lista</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Whitelist_Description">
|
||||
<English>What addons are allowed regardless?</English>
|
||||
<Polish>Jakie addony są dozwolone?</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_LSDVehicles_DisplayName">
|
||||
<English>LSD Vehicles</English>
|
||||
<Polish>Pojazdy LSD</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_LSDVehicles_Description">
|
||||
<English>Adds LSD effect to synchronized vehicle</English>
|
||||
<Polish>Dodaje efekt LSD pod zsynchronizowany pojazd</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_toggleHandheldDevice">
|
||||
<English>Toggle Handheld Device</English>
|
||||
</Key>
|
||||
@ -480,4 +532,4 @@
|
||||
<English>Cycle Handheld Devices</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -79,7 +79,7 @@ _holderMagazinesStart = magazinesAmmoCargo _holder;
|
||||
|
||||
{
|
||||
EXPLODE_2_PVT(_x,_xClassname,_xAmmo);
|
||||
if ((_xClassname in _listOfItemsToRemove) && {!(_xClassname in UNIQUE_MAGAZINES)}) then {
|
||||
if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then {
|
||||
_holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo];
|
||||
_target removeMagazine _xClassname;
|
||||
};
|
||||
@ -89,7 +89,7 @@ _targetMagazinesEnd = magazinesAmmo _target;
|
||||
_holderMagazinesEnd = magazinesAmmoCargo _holder;
|
||||
|
||||
//Verify Mags dropped from unit:
|
||||
if ( ({((_x select 0) in _listOfItemsToRemove) && {!((_x select 0) in UNIQUE_MAGAZINES)}} count _targetMagazinesEnd) != 0) exitWith {
|
||||
if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith {
|
||||
_holder setVariable [QGVAR(holderInUse), false];
|
||||
[_caller, _target, "Debug: Didn't Remove Magazines"] call FUNC(eventTargetFinish);
|
||||
};
|
||||
@ -102,7 +102,7 @@ if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holde
|
||||
|
||||
//Remove Items, Assigned Items and NVG
|
||||
_holderItemsStart = getitemCargo _holder;
|
||||
_targetItemsStart = (assignedItems _target) + (items _target);
|
||||
_targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target);
|
||||
if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);};
|
||||
if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);};
|
||||
|
||||
@ -132,7 +132,7 @@ _addToCrateCount = [];
|
||||
} forEach _addToCrateClassnames;
|
||||
|
||||
_holderItemsEnd = getitemCargo _holder;
|
||||
_targetItemsEnd = (assignedItems _target) + (items _target);
|
||||
_targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target);
|
||||
if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);};
|
||||
if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);};
|
||||
|
||||
@ -146,6 +146,16 @@ if ((([_holderItemsEnd select 1] call _fncSumArray) - ([_holderItemsStart select
|
||||
[_caller, _target, "Debug: Items Not Added to Holder"] call FUNC(eventTargetFinish);
|
||||
};
|
||||
|
||||
//Script drop uniforms/vest if empty
|
||||
if (((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove} && {(uniformItems _target) isEqualTo []}) then {
|
||||
_holder addItemCargoGlobal [(uniform _target), 1];
|
||||
removeUniform _target;
|
||||
};
|
||||
if (((vest _target) != "") && {(vest _target) in _listOfItemsToRemove} && {(vestItems _target) isEqualTo []}) then {
|
||||
_holder addItemCargoGlobal [(vest _target), 1];
|
||||
removeVest _target;
|
||||
};
|
||||
|
||||
|
||||
//If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place
|
||||
//So add a dummy item and just remove at the end
|
||||
|
@ -19,7 +19,7 @@ PARAMS_1(_target);
|
||||
|
||||
private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"];
|
||||
|
||||
_allItems = ((weapons _target) + (magazines _target) + (items _target) + (assignedItems _target));
|
||||
_allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target);
|
||||
|
||||
if ((backpack _target) != "") then {
|
||||
_allItems pushBack (backpack _target);
|
||||
|
@ -28,7 +28,7 @@ private ["_classname", "_count", "_displayName", "_picture"];
|
||||
_classname = _x;
|
||||
_count = (_itemsCountArray select 1) select _forEachIndex;
|
||||
|
||||
if (_classname != DUMMY_ITEM) then { //Don't show the dummy potato
|
||||
if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon
|
||||
|
||||
switch (true) do {
|
||||
case (isClass (configFile >> "CfgWeapons" >> _classname)): {
|
||||
@ -53,8 +53,8 @@ private ["_classname", "_count", "_displayName", "_picture"];
|
||||
};
|
||||
|
||||
_listBoxCtrl lbAdd format ["%1", _displayName];
|
||||
_listBoxCtrl lbSetData [_forEachIndex, _classname];
|
||||
_listBoxCtrl lbSetPicture [_forEachIndex, _picture];
|
||||
_listBoxCtrl lbSetTextRight [_forEachIndex, str _count];
|
||||
_listBoxCtrl lbSetData [((lbSize _listBoxCtrl) - 1), _classname];
|
||||
_listBoxCtrl lbSetPicture [((lbSize _listBoxCtrl) - 1), _picture];
|
||||
_listBoxCtrl lbSetTextRight [((lbSize _listBoxCtrl) - 1), str _count];
|
||||
};
|
||||
} forEach (_itemsCountArray select 0);
|
||||
|
@ -13,4 +13,3 @@
|
||||
|
||||
#define DISARM_CONTAINER "GroundWeaponHolder"
|
||||
#define DUMMY_ITEM "ACE_DebugPotato"
|
||||
#define UNIQUE_MAGAZINES ["ACE_key_customKeyMagazine"]
|
@ -14,7 +14,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_object", "_enableCarry", "_position", "_direction"];
|
||||
private ["_carryAction", "_dropAction", "_object", "_enableCarry", "_position", "_direction"];
|
||||
//IGNORE_PRIVATE_WARNING("_player", "_target");
|
||||
|
||||
_this resize 4;
|
||||
|
||||
|
@ -14,7 +14,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_object", "_enableDrag", "_position", "_direction"];
|
||||
private ["_dragAction", "_dropAction", "_object", "_enableDrag", "_position", "_direction"];
|
||||
//IGNORE_PRIVATE_WARNING("_player", "_target");
|
||||
|
||||
_this resize 4;
|
||||
|
||||
|
@ -1,44 +1,30 @@
|
||||
class Module_F;
|
||||
class Logic;
|
||||
class Module_F: Logic {
|
||||
class ModuleDescription {};
|
||||
};
|
||||
class ACE_ModuleExplosive: Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "Explosive System";
|
||||
displayName = "$STR_ACE_Explosive_Module_DisplayName";
|
||||
function = QUOTE(FUNC(module));
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa);
|
||||
class Arguments {
|
||||
class RequireSpecialist {
|
||||
displayName = "Require specialists?";
|
||||
description = "Require explosive specialists to disable explosives? Default: No";
|
||||
displayName = "$STR_ACE_Explosive_RequireSpecialist_DisplayName";
|
||||
description = "$STR_ACE_Explosive_RequireSpecialist_Description";
|
||||
typeName = "BOOL";
|
||||
class values {
|
||||
class Yes {
|
||||
name = "Yes";
|
||||
value = 1;
|
||||
};
|
||||
class No {
|
||||
default = 1;
|
||||
name = "No";
|
||||
value = 0;
|
||||
};
|
||||
};
|
||||
defaultValue = 0;
|
||||
};
|
||||
class PunishNonSpecialists {
|
||||
displayName = "Punish non-specialists?";
|
||||
description = "Increase the time it takes to complete actions for non-specialists? Default: Yes";
|
||||
displayName = "$STR_ACE_Explosive_PunishNonSpecialists_DisplayName";
|
||||
description = "$STR_ACE_Explosive_PunishNonSpecialists_Description";
|
||||
typeName = "BOOL";
|
||||
class values {
|
||||
class Yes {
|
||||
default = 1;
|
||||
name = "Yes";
|
||||
value = 1;
|
||||
};
|
||||
class No {
|
||||
name = "No";
|
||||
value = 0;
|
||||
};
|
||||
};
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = "$STR_ACE_Explosive_Module_Description";
|
||||
};
|
||||
};
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Explosives">
|
||||
<Key ID="STR_ACE_Explosives_Menu">
|
||||
@ -505,5 +505,29 @@
|
||||
<Italian>Raccogli</Italian>
|
||||
<Portuguese>Pegar</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosive_Module_DisplayName">
|
||||
<English>Explosive System</English>
|
||||
<Polish>System ładunków wybuchowych</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosive_RequireSpecialist_DisplayName">
|
||||
<English>Require specialists?</English>
|
||||
<Polish>Wymagaj specjalistów?</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosive_RequireSpecialist_Description">
|
||||
<English>Require explosive specialists to disable explosives? Default: No</English>
|
||||
<Polish>Wymagać saperów do rozbrajania ładunków wybuchowych? Domyślnie: Nie</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosive_PunishNonSpecialists_DisplayName">
|
||||
<English>Punish non-specialists?</English>
|
||||
<Polish>Karaj nie-specjalistów?</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosive_PunishNonSpecialists_Description">
|
||||
<English>Increase the time it takes to complete actions for non-specialists? Default: Yes</English>
|
||||
<Polish>Zwiększyć ilość wymaganego czasu do ukończenia akcji dla nie-specjalistów? Domyślnie: Tak</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosive_Module_Description">
|
||||
<English></English>
|
||||
<Polish>Moduł ten pozwala dostosować opcje związane z ładunkami wybuchowymi, ich podkładaniem oraz rozbrajaniem.</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -4,11 +4,8 @@
|
||||
GVAR(traceFrags) = true;
|
||||
#endif
|
||||
// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA";
|
||||
private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive",
|
||||
"_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar",
|
||||
"_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k",
|
||||
"_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect",
|
||||
"_fragment", "_index", "_hitData", "_fragTypes", "_fragType", "_foundObjects"];
|
||||
|
||||
private ["_params", "_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"];
|
||||
|
||||
_params = _this select 0;
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
@ -9,13 +9,8 @@
|
||||
if(!isServer) exitWith { };
|
||||
|
||||
// _startTime = diag_tickTime;
|
||||
private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed",
|
||||
"_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom",
|
||||
"_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox",
|
||||
"_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir",
|
||||
"_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount",
|
||||
"_sectorSize", "_sectorOffset", "_randomDir", "_endTime"];
|
||||
|
||||
private ["_startTime", "_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"];
|
||||
|
||||
_round = _this select 0;
|
||||
_lastPos = _this select 1;
|
||||
|
@ -98,21 +98,21 @@ class CfgVehicles {
|
||||
class ACE_ModuleHearing: Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "Hearing";
|
||||
displayName = "$STR_ACE_Hearing_Module_DisplayName";
|
||||
function = QFUNC(moduleHearing);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
|
||||
class Arguments {
|
||||
class EnableCombatDeafness {
|
||||
displayName = "Enable combat deafness?";
|
||||
description = "Enable combat deafness?";
|
||||
displayName = "$STR_ACE_Hearing_CombatDeafness_DisplayName";
|
||||
description = "$STR_ACE_Hearing_CombatDeafness_Description";
|
||||
typeName = "BOOL";
|
||||
class values {
|
||||
class Yes { name = "Yes"; value = 1; default = 1; };
|
||||
class No { name = "No"; value = 0; };
|
||||
};
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = "$STR_ACE_Hearing_Module_Description";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -109,5 +109,21 @@
|
||||
<Italian>Disabilita i fischi nelle orecchie</Italian>
|
||||
<Portuguese>Desabilitar zumbido de ouvidos</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_Module_DisplayName">
|
||||
<English>Hearing</English>
|
||||
<Polish>Słuch</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_CombatDeafness_DisplayName">
|
||||
<English>Enable combat deafness?</English>
|
||||
<Polish>Wł. głuchotę bojową</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_CombatDeafness_Description">
|
||||
<English>Enable combat deafness?</English>
|
||||
<Polish>Możliwość chwilowej utraty słuchu przy głośnych wystrzałach i jednoczesnym braku włożonych stoperów</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_Module_Description">
|
||||
<English></English>
|
||||
<Polish>Głuchota bojowa pojawia się w momentach, kiedy stoimy w pobliżu broni wielkokalibrowej bez ochrony słuchu, lub np. podczas ostrzału artyleryjskiego. Moduł ten pozwala na włączenie lub wyłączenie tego efektu.</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
@ -1,47 +1,8 @@
|
||||
class GVAR(cursorMenu) {
|
||||
idd = 91919;
|
||||
movingEnable = false;
|
||||
access = 0;
|
||||
movingEnable = 0;
|
||||
enableSimulation = 1;
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -25,6 +25,21 @@ PREP(renderSelector);
|
||||
PREP(setupTextColors);
|
||||
PREP(splitPath);
|
||||
|
||||
// Event handlers for all interact menu controls
|
||||
DFUNC(handleMouseMovement) = {
|
||||
if (GVAR(cursorKeepCentered)) then {
|
||||
GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0];
|
||||
setMousePosition [0.5, 0.5];
|
||||
} else {
|
||||
GVAR(cursorPos) = [_this select 1, _this select 2, 0];
|
||||
};
|
||||
};
|
||||
DFUNC(handleMouseButtonDown) = {
|
||||
if !(GVAR(actionOnKeyRelease)) then {
|
||||
[GVAR(openedMenuType),true] call FUNC(keyUp);
|
||||
};
|
||||
};
|
||||
|
||||
GVAR(keyDown) = false;
|
||||
GVAR(keyDownSelfAction) = false;
|
||||
GVAR(keyDownTime) = 0;
|
||||
@ -51,6 +66,7 @@ GVAR(expandedTime) = diag_tickTime;
|
||||
GVAR(iconCtrls) = [];
|
||||
GVAR(iconCount) = 0;
|
||||
|
||||
GVAR(collectedActionPoints) = [];
|
||||
GVAR(foundActions) = [];
|
||||
GVAR(lastTimeSearchedActions) = -1000;
|
||||
|
||||
|
@ -67,12 +67,12 @@ if !({} isEqualTo (_origActionData select 5)) then {
|
||||
if (count _pPath == count _fullPath &&
|
||||
{_pPath isEqualTo _fullPath}) then {
|
||||
|
||||
_action = [_object, _action, _fullPath] call FUNC(collectActiveActionTree);
|
||||
_action = [_object, [_actionData,[]], _fullPath] call FUNC(collectActiveActionTree);
|
||||
if ((count _action) > 0) then {
|
||||
_activeChildren pushBack _action;
|
||||
};
|
||||
};
|
||||
} forEach GVAR(objectActions);
|
||||
} forEach GVAR(objectActionList);
|
||||
|
||||
|
||||
// If the original action has no statement, and no children, don't display it
|
||||
|
@ -37,27 +37,30 @@ GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) ||
|
||||
{(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} ||
|
||||
{(_menuType == 0) && GVAR(AlwaysUseCursorInteraction)};
|
||||
|
||||
// Delete existing controls in case there's any left
|
||||
GVAR(iconCount) = 0;
|
||||
for "_i" from 0 to (count GVAR(iconCtrls))-1 do {
|
||||
ctrlDelete (GVAR(iconCtrls) select _i);
|
||||
GVAR(ParsedTextCached) set [_i, ""];
|
||||
};
|
||||
GVAR(iconCtrls) resize GVAR(iconCount);
|
||||
|
||||
if (GVAR(useCursorMenu)) then {
|
||||
createDialog QGVAR(cursorMenu);
|
||||
(findDisplay 46) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";//
|
||||
(finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}];
|
||||
(finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}];
|
||||
// The dialog sets:
|
||||
// uiNamespace getVariable QGVAR(dlgCursorMenu);
|
||||
// uiNamespace getVariable QGVAR(cursorMenuOpened);
|
||||
ctrlEnable [91921, true];
|
||||
GVAR(cursorPos) = [0.5,0.5,0];
|
||||
((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", {
|
||||
if (GVAR(cursorKeepCentered)) then {
|
||||
GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0];
|
||||
setMousePosition [0.5, 0.5];
|
||||
} else {
|
||||
GVAR(cursorPos) = [_this select 1, _this select 2, 0];
|
||||
};
|
||||
}];
|
||||
// handles LMB in cursor mode when action on keyrelease is disabled
|
||||
((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseButtonDown", {
|
||||
if (!GVAR(actionOnKeyRelease) && GVAR(actionSelected)) then {
|
||||
[GVAR(openedMenuType),true] call FUNC(keyUp);
|
||||
};
|
||||
}];
|
||||
|
||||
_ctrl = (findDisplay 91919) ctrlCreate ["RscStructuredText", 9922];
|
||||
_ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
|
||||
_ctrl ctrlCommit 0;
|
||||
|
||||
// handles Mouse moving and LMB in cursor mode when action on keyrelease is disabled
|
||||
((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)];
|
||||
((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)];
|
||||
setMousePosition [0.5, 0.5];
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,7 @@ _calledByClicking = _this select 1;
|
||||
if (GVAR(openedMenuType) < 0) exitWith {true};
|
||||
|
||||
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
|
||||
closeDialog 0;
|
||||
(findDisplay 91919) closeDisplay 2;
|
||||
};
|
||||
|
||||
if(GVAR(actionSelected)) then {
|
||||
|
@ -14,16 +14,16 @@
|
||||
|
||||
GVAR(currentOptions) = [];
|
||||
|
||||
private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos"];
|
||||
private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos", "_virtualPoint", "_wavesAtOrigin", "_wavesAtVirtualPoint"];
|
||||
_player = ACE_player;
|
||||
|
||||
_cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL);
|
||||
_cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos;
|
||||
|
||||
_fnc_renderNearbyActions = {
|
||||
// Render all nearby interaction menus
|
||||
#define MAXINTERACTOBJECTS 3
|
||||
|
||||
_cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL);
|
||||
_cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos;
|
||||
|
||||
GVAR(foundActions) = [];
|
||||
GVAR(lastTimeSearchedActions) = diag_tickTime;
|
||||
|
||||
@ -101,19 +101,26 @@ _fnc_renderSelfActions = {
|
||||
// Iterate through base level class actions and render them if appropiate
|
||||
_actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target];
|
||||
_classActions = missionNamespace getVariable [_actionsVarName, []];
|
||||
|
||||
_pos = if !(GVAR(useCursorMenu)) then {
|
||||
_virtualPoint = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition);
|
||||
_wavesAtOrigin = [(positionCameraToWorld [0, 0, 0])] call EFUNC(common,waveHeightAt);
|
||||
_wavesAtVirtualPoint = [_virtualPoint] call EFUNC(common,waveHeightAt);
|
||||
_virtualPoint set [2, ((_virtualPoint select 2) - _wavesAtOrigin + _wavesAtVirtualPoint)];
|
||||
_virtualPoint
|
||||
} else {
|
||||
[0.5, 0.5]
|
||||
};
|
||||
|
||||
{
|
||||
_action = _x;
|
||||
|
||||
_pos = if !(GVAR(useCursorMenu)) then {
|
||||
(((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition)
|
||||
} else {
|
||||
[0.5, 0.5]
|
||||
};
|
||||
[_target, _action, _pos] call FUNC(renderBaseMenu);
|
||||
} forEach _classActions;
|
||||
};
|
||||
|
||||
|
||||
GVAR(collectedActionPoints) resize 0;
|
||||
|
||||
// Render nearby actions, unit self actions or vehicle self actions as appropiate
|
||||
if (GVAR(openedMenuType) == 0) then {
|
||||
|
||||
@ -132,3 +139,29 @@ if (GVAR(openedMenuType) == 0) then {
|
||||
} else {
|
||||
ACE_player call _fnc_renderSelfActions;
|
||||
};
|
||||
|
||||
if (count GVAR(collectedActionPoints) > 1) then {
|
||||
// Do the oclusion pass
|
||||
|
||||
// Order action points according to z
|
||||
GVAR(collectedActionPoints) sort true;
|
||||
|
||||
private ["_i","_j","_delta"];
|
||||
for [{_i = count GVAR(collectedActionPoints) - 1}, {_i > 0}, {_i = _i - 1}] do {
|
||||
for [{_j = _i - 1}, {_j >= 0}, {_j = _j - 1}] do {
|
||||
// Check if action point _i is ocluded by _j
|
||||
_delta = vectorNormalized ((GVAR(collectedActionPoints) select _i select 1) vectorDiff (GVAR(collectedActionPoints) select _j select 1));
|
||||
|
||||
// If _i is inside a cone with 20º half angle with origin on _j
|
||||
if (_delta select 2 > 0.94) exitWith {
|
||||
GVAR(collectedActionPoints) deleteAt _i;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Render the non-ocluded points
|
||||
{
|
||||
EXPLODE_3_PVT(_x,_z,_sPos,_activeActionTree);
|
||||
[[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu);
|
||||
} forEach GVAR(collectedActionPoints);
|
||||
|
@ -93,11 +93,17 @@ _fnc_print = {
|
||||
// Check if there's something left for rendering
|
||||
if (count _activeActionTree == 0) exitWith {false};
|
||||
|
||||
//EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren);
|
||||
|
||||
BEGIN_COUNTER(fnc_renderMenus);
|
||||
|
||||
[[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu);
|
||||
// IGNORE_PRIVATE_WARNING(_cameraPos,_cameraDir);
|
||||
if (count _pos > 2) then {
|
||||
_sPos pushBack (((_pos call EFUNC(common,positionToASL)) vectorDiff _cameraPos) vectorDotProduct _cameraDir);
|
||||
} else {
|
||||
_sPos pushBack 0;
|
||||
};
|
||||
|
||||
// Add action point for oclusion and rendering
|
||||
GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree];
|
||||
|
||||
END_COUNTER(fnc_renderMenus);
|
||||
|
||||
|
@ -23,6 +23,10 @@ PARAMS_4(_text,_icon,_sPos,_textSettings);
|
||||
if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
|
||||
_displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
||||
GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
|
||||
if (GVAR(useCursorMenu)) then {
|
||||
((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)];
|
||||
((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)];
|
||||
};
|
||||
};
|
||||
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
|
||||
|
||||
|
@ -20,6 +20,10 @@ private ["_displayNum", "_ctrl", "_pos"];
|
||||
if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
|
||||
_displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
||||
GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
|
||||
if (GVAR(useCursorMenu)) then {
|
||||
((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)];
|
||||
((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)];
|
||||
};
|
||||
};
|
||||
|
||||
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_textColor", "_textSize"];
|
||||
private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_textColor", "_textSize", "_colorShadowMax", "_colorShadowMin", "_colorTextMax", "_colorTextMin", "_shadowSetting"];
|
||||
|
||||
//Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text
|
||||
_mixColor = {
|
||||
@ -30,9 +30,16 @@ _mixColor = {
|
||||
_return
|
||||
};
|
||||
|
||||
_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor;
|
||||
_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor;
|
||||
_textSize = switch (GVAR(textSize)) do {
|
||||
_colorTextMin = missionNamespace getVariable [QGVAR(colorTextMin), [1,1,1,0.25]];
|
||||
_colorTextMax = missionNamespace getVariable [QGVAR(colorTextMax), [1,1,1,1]];
|
||||
_colorShadowMin = missionNamespace getVariable [QGVAR(colorShadowMin), [0,0,0,0.25]];
|
||||
_colorShadowMax = missionNamespace getVariable [QGVAR(colorShadowMax), [0,0,0,1]];
|
||||
_shadowSetting = missionNamespace getVariable [QGVAR(shadowSetting), 2];
|
||||
_textSize = missionNamespace getVariable [QGVAR(textSize), 2];
|
||||
|
||||
_textColor = [_colorTextMin, _colorTextMax, 1] call _mixColor;
|
||||
_shadowColor = [_colorShadowMin, _colorShadowMax, 1] call _mixColor;
|
||||
_textSize = switch (_textSize) do {
|
||||
case (0): {0.4};
|
||||
case (1): {0.6};
|
||||
case (2): {0.8};
|
||||
@ -40,20 +47,20 @@ _textSize = switch (GVAR(textSize)) do {
|
||||
case (4): {1.2};
|
||||
};
|
||||
|
||||
GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor];
|
||||
GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, _shadowSetting, _shadowColor];
|
||||
|
||||
GVAR(textSettingsMatrix) = [];
|
||||
for "_pathCount" from 0 to 15 do {
|
||||
_row = [];
|
||||
for "_menuDepth" from 0 to 15 do {
|
||||
if (_menuDepth > 0) then {
|
||||
_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor;
|
||||
_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor;
|
||||
_textColor = [_colorTextMin, _colorTextMax, (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor;
|
||||
_shadowColor = [_colorShadowMin, _colorShadowMax, (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor;
|
||||
} else {
|
||||
_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor;
|
||||
_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 0] call _mixColor;
|
||||
_textColor = [_colorTextMin, _colorTextMax, 0] call _mixColor;
|
||||
_shadowColor = [_colorShadowMin, _colorShadowMax, 0] call _mixColor;
|
||||
};
|
||||
_row pushBack format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor];
|
||||
_row pushBack format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, _shadowSetting, _shadowColor];
|
||||
};
|
||||
GVAR(textSettingsMatrix) pushBack _row;
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,46 +1,44 @@
|
||||
|
||||
#define HSPACE 0.5-2.0/16/2
|
||||
#define VSPACE 0.5-0.3/9/2
|
||||
|
||||
class RscStructuredText;
|
||||
class ACE_Interaction_Button_Base {
|
||||
tooltip = "";
|
||||
//action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};";
|
||||
action = "";
|
||||
tooltip = "";
|
||||
//action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};";
|
||||
action = "";
|
||||
|
||||
idc = -1;
|
||||
access = 0;
|
||||
type = 1;
|
||||
text = "";
|
||||
font = "PuristaMedium";
|
||||
sizeEx = "0.8 / 40 / (getResolution select 5)";
|
||||
shadow = 2;
|
||||
idc = -1;
|
||||
access = 0;
|
||||
type = 1;
|
||||
text = "";
|
||||
font = "PuristaMedium";
|
||||
sizeEx = "0.8 / 40 / (getResolution select 5)";
|
||||
shadow = 2;
|
||||
|
||||
style = 2;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 2.0 / 16 * safezoneW;
|
||||
h = 0.3 / 9 * safezoneH;
|
||||
style = 2;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 2.0 / 16 * safezoneW;
|
||||
h = 0.3 / 9 * safezoneH;
|
||||
|
||||
offsetX = 0.003;
|
||||
offsetY = 0.003;
|
||||
offsetPressedX = 0.002;
|
||||
offsetPressedY = 0.002;
|
||||
borderSize = 0;
|
||||
offsetX = 0.003;
|
||||
offsetY = 0.003;
|
||||
offsetPressedX = 0.002;
|
||||
offsetPressedY = 0.002;
|
||||
borderSize = 0;
|
||||
|
||||
colorText[] = {1,1,1,1};
|
||||
colorDisabled[] = {0.5,0.5,0.5,1};
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
colorBackgroundDisabled[] = {0,0,0,0.8};
|
||||
colorBackgroundActive[] = {1,1,1,0};
|
||||
colorFocused[] = {1,1,1,1};
|
||||
colorShadow[] = {0,0,0,0};
|
||||
colorBorder[] = {1,1,1,0.8};
|
||||
colorText[] = {1,1,1,1};
|
||||
colorDisabled[] = {0.5,0.5,0.5,1};
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
colorBackgroundDisabled[] = {0,0,0,0.8};
|
||||
colorBackgroundActive[] = {1,1,1,0};
|
||||
colorFocused[] = {1,1,1,1};
|
||||
colorShadow[] = {0,0,0,0};
|
||||
colorBorder[] = {1,1,1,0.8};
|
||||
|
||||
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
|
||||
soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
|
||||
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
|
||||
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
|
||||
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
|
||||
soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
|
||||
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
|
||||
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
|
||||
};
|
||||
|
||||
class RscListbox;
|
||||
@ -49,86 +47,86 @@ class RscText;
|
||||
#define X_OFFSET 0.2
|
||||
|
||||
class RscACE_SelectAnItem {
|
||||
idd = 8854;
|
||||
movingEnable = 0;
|
||||
class controls {
|
||||
class back:IGUIBack {
|
||||
x = X_OFFSET;
|
||||
y = 0;
|
||||
w = 0.6;
|
||||
h = 0.71;
|
||||
colorBackground[] = {0, 0, 0, 0.2};
|
||||
};
|
||||
class header: RscText{
|
||||
idc = 8870;
|
||||
x = X_OFFSET + 0.005;
|
||||
y = 0.005;
|
||||
w = 0.59;
|
||||
h = 0.05;
|
||||
style = 0x02;
|
||||
text = "";
|
||||
};
|
||||
class itemList:RscListBox {
|
||||
onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick";
|
||||
idc = 8866;
|
||||
x = X_OFFSET + 0.005;
|
||||
w = 0.59;
|
||||
h = 0.54;
|
||||
y = 0.06;
|
||||
};
|
||||
idd = 8854;
|
||||
movingEnable = 0;
|
||||
class controls {
|
||||
class back:IGUIBack {
|
||||
x = X_OFFSET;
|
||||
y = 0;
|
||||
w = 0.6;
|
||||
h = 0.71;
|
||||
colorBackground[] = {0, 0, 0, 0.2};
|
||||
};
|
||||
class header: RscText{
|
||||
idc = 8870;
|
||||
x = X_OFFSET + 0.005;
|
||||
y = 0.005;
|
||||
w = 0.59;
|
||||
h = 0.05;
|
||||
style = 0x02;
|
||||
text = "";
|
||||
};
|
||||
class itemList:RscListBox {
|
||||
onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick";
|
||||
idc = 8866;
|
||||
x = X_OFFSET + 0.005;
|
||||
w = 0.59;
|
||||
h = 0.54;
|
||||
y = 0.06;
|
||||
};
|
||||
|
||||
class cancelBtnBackground: ACE_Interaction_Button_Base {
|
||||
type = 0;
|
||||
style = 2;
|
||||
idc = -1;
|
||||
colorBackground[] = {0,0,0,0.5};
|
||||
colorBackgroundDisabled[] = {0,0,0,0.5};
|
||||
x = X_OFFSET + 0.005;
|
||||
w = 0.15;
|
||||
h = 0.1;
|
||||
y = 0.605;
|
||||
};
|
||||
class approveBtnBackground: ACE_Interaction_Button_Base {
|
||||
type = 0;
|
||||
style = 2;
|
||||
idc = -1;
|
||||
colorBackground[] = {0,0,0,0.5};
|
||||
colorBackgroundDisabled[] = {0,0,0,0.5};
|
||||
x = X_OFFSET + 0.445;
|
||||
y = 0.605;
|
||||
h = 0.1;
|
||||
w = 0.15;
|
||||
};
|
||||
class cancelBtnBackground: ACE_Interaction_Button_Base {
|
||||
type = 0;
|
||||
style = 2;
|
||||
idc = -1;
|
||||
colorBackground[] = {0,0,0,0.5};
|
||||
colorBackgroundDisabled[] = {0,0,0,0.5};
|
||||
x = X_OFFSET + 0.005;
|
||||
w = 0.15;
|
||||
h = 0.1;
|
||||
y = 0.605;
|
||||
};
|
||||
class approveBtnBackground: ACE_Interaction_Button_Base {
|
||||
type = 0;
|
||||
style = 2;
|
||||
idc = -1;
|
||||
colorBackground[] = {0,0,0,0.5};
|
||||
colorBackgroundDisabled[] = {0,0,0,0.5};
|
||||
x = X_OFFSET + 0.445;
|
||||
y = 0.605;
|
||||
h = 0.1;
|
||||
w = 0.15;
|
||||
};
|
||||
|
||||
class cancelBtn: ACE_Interaction_Button_Base {
|
||||
idc = 8855;
|
||||
x = X_OFFSET + 0.005;
|
||||
w = 0.15;
|
||||
h = 0.1;
|
||||
y = 0.605;
|
||||
style = 2;
|
||||
text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection;
|
||||
action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf;
|
||||
colorBackground[] = {0,0,0,0};
|
||||
colorBackgroundDisabled[] = {0,0,0,0};
|
||||
colorBackgroundActive[] = {1,1,1,0.2};
|
||||
colorFocused[] = {0,0,0,0};
|
||||
class cancelBtn: ACE_Interaction_Button_Base {
|
||||
idc = 8855;
|
||||
x = X_OFFSET + 0.005;
|
||||
w = 0.15;
|
||||
h = 0.1;
|
||||
y = 0.605;
|
||||
style = 2;
|
||||
text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection;
|
||||
action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf;
|
||||
colorBackground[] = {0,0,0,0};
|
||||
colorBackgroundDisabled[] = {0,0,0,0};
|
||||
colorBackgroundActive[] = {1,1,1,0.2};
|
||||
colorFocused[] = {0,0,0,0};
|
||||
};
|
||||
class approveBtn: ACE_Interaction_Button_Base {
|
||||
idc = 8860;
|
||||
x = X_OFFSET + 0.445;
|
||||
y = 0.605;
|
||||
h = 0.1;
|
||||
w = 0.15;
|
||||
style = 2;
|
||||
text = $STR_ACE_Interaction_MakeSelection;
|
||||
action = "call ACE_Interaction_fnc_hideMenu;";
|
||||
colorBackground[] = {0,0,0,0};
|
||||
colorBackgroundDisabled[] = {0,0,0,0};
|
||||
colorBackgroundActive[] = {1,1,1,0.2};
|
||||
colorFocused[] = {0,0,0,0};
|
||||
};
|
||||
};
|
||||
class approveBtn: ACE_Interaction_Button_Base {
|
||||
idc = 8860;
|
||||
x = X_OFFSET + 0.445;
|
||||
y = 0.605;
|
||||
h = 0.1;
|
||||
w = 0.15;
|
||||
style = 2;
|
||||
text = $STR_ACE_Interaction_MakeSelection;
|
||||
action = "call ACE_Interaction_fnc_hideMenu;";
|
||||
colorBackground[] = {0,0,0,0};
|
||||
colorBackgroundDisabled[] = {0,0,0,0};
|
||||
colorBackgroundActive[] = {1,1,1,0.2};
|
||||
colorFocused[] = {0,0,0,0};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#define GUI_GRID_W (0.025)
|
||||
@ -136,64 +134,64 @@ class RscACE_SelectAnItem {
|
||||
|
||||
class RscPicture;
|
||||
class RscInteractionIcon: RscPicture {
|
||||
x = 19.25 * GUI_GRID_W;
|
||||
y = 15.75 * GUI_GRID_H;
|
||||
w = 2*GUI_GRID_H;
|
||||
h = 2*GUI_GRID_H;
|
||||
x = 19.25 * GUI_GRID_W;
|
||||
y = 15.75 * GUI_GRID_H;
|
||||
w = 2*GUI_GRID_H;
|
||||
h = 2*GUI_GRID_H;
|
||||
};
|
||||
class RscInteractionHelperIcon: RscInteractionIcon {
|
||||
x = 20 * GUI_GRID_W;
|
||||
y = 16 * GUI_GRID_H;
|
||||
w = GUI_GRID_H;
|
||||
h = GUI_GRID_H;
|
||||
x = 20 * GUI_GRID_W;
|
||||
y = 16 * GUI_GRID_H;
|
||||
w = GUI_GRID_H;
|
||||
h = GUI_GRID_H;
|
||||
};
|
||||
class RscInteractionText: RscText{
|
||||
x = 21 * GUI_GRID_W;
|
||||
y = 16 * GUI_GRID_H;
|
||||
w = 8 * GUI_GRID_W;
|
||||
h = 1.5 * GUI_GRID_H;
|
||||
x = 21 * GUI_GRID_W;
|
||||
y = 16 * GUI_GRID_H;
|
||||
w = 8 * GUI_GRID_W;
|
||||
h = 1.5 * GUI_GRID_H;
|
||||
};
|
||||
class RscTitles {
|
||||
class GVAR(InteractionHelper) {
|
||||
idd = 9930;
|
||||
enableSimulation = 1;
|
||||
movingEnable = 0;
|
||||
fadeIn=0.5;
|
||||
fadeOut=0.5;
|
||||
duration = 10e10;
|
||||
onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];";
|
||||
class GVAR(InteractionHelper) {
|
||||
idd = 9930;
|
||||
enableSimulation = 1;
|
||||
movingEnable = 0;
|
||||
fadeIn=0.5;
|
||||
fadeOut=0.5;
|
||||
duration = 10e10;
|
||||
onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];";
|
||||
|
||||
class controls {
|
||||
class SelectIcon: RscInteractionHelperIcon{
|
||||
idc = 1200;
|
||||
text = PATHTOF(UI\mouse_left_ca.paa);
|
||||
y = 17.5 * GUI_GRID_H;
|
||||
};
|
||||
class SelectText: RscInteractionText{
|
||||
idc = 1000;
|
||||
y = 17 * GUI_GRID_H;
|
||||
text = $STR_ACE_Interaction_MakeSelection;
|
||||
};
|
||||
class GoBackIcon: RscInteractionHelperIcon{
|
||||
idc = 1201;
|
||||
text = PATHTOF(UI\mouse_right_ca.paa);
|
||||
y = 19.5 * GUI_GRID_H;
|
||||
};
|
||||
class GoBackText: RscInteractionText{
|
||||
idc = 1001;
|
||||
y = 19 * GUI_GRID_H;
|
||||
text = $STR_ACE_Interaction_Back;
|
||||
};
|
||||
class ScrollIcon: RscInteractionHelperIcon{
|
||||
idc = 1202;
|
||||
text = PATHTOF(UI\mouse_scroll_ca.paa);
|
||||
y = 18.5 * GUI_GRID_H;
|
||||
};
|
||||
class ScrollText: RscInteractionText{
|
||||
idc = 1002;
|
||||
y = 18 * GUI_GRID_H;
|
||||
text = $STR_ACE_Interaction_ScrollHint;
|
||||
};
|
||||
class controls {
|
||||
class SelectIcon: RscInteractionHelperIcon{
|
||||
idc = 1200;
|
||||
text = PATHTOF(UI\mouse_left_ca.paa);
|
||||
y = 17.5 * GUI_GRID_H;
|
||||
};
|
||||
class SelectText: RscInteractionText{
|
||||
idc = 1000;
|
||||
y = 17 * GUI_GRID_H;
|
||||
text = $STR_ACE_Interaction_MakeSelection;
|
||||
};
|
||||
class GoBackIcon: RscInteractionHelperIcon{
|
||||
idc = 1201;
|
||||
text = PATHTOF(UI\mouse_right_ca.paa);
|
||||
y = 19.5 * GUI_GRID_H;
|
||||
};
|
||||
class GoBackText: RscInteractionText{
|
||||
idc = 1001;
|
||||
y = 19 * GUI_GRID_H;
|
||||
text = $STR_ACE_Interaction_Back;
|
||||
};
|
||||
class ScrollIcon: RscInteractionHelperIcon{
|
||||
idc = 1202;
|
||||
text = PATHTOF(UI\mouse_scroll_ca.paa);
|
||||
y = 18.5 * GUI_GRID_H;
|
||||
};
|
||||
class ScrollText: RscInteractionText{
|
||||
idc = 1002;
|
||||
y = 18 * GUI_GRID_H;
|
||||
text = $STR_ACE_Interaction_ScrollHint;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -3,7 +3,6 @@ ace_interaction
|
||||
|
||||
Provides interaction options between units.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
@ -15,6 +15,7 @@ if (!hasInterface) exitWith {};
|
||||
GVAR(isOpeningDoor) = false;
|
||||
|
||||
// restore global fire teams for JIP
|
||||
private ["_team"];
|
||||
{
|
||||
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
|
||||
if (_team != "") then {_x assignTeam _team};
|
||||
|
@ -1,26 +1,24 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interact_menu"};
|
||||
author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interact_menu"};
|
||||
author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
#include <Menu_Config.hpp>
|
||||
#include "Menu_Config.hpp"
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(EnableTeamManagement) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
};
|
||||
class GVAR(EnableTeamManagement) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
};
|
||||
};
|
||||
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Adds an item to the select menu
|
||||
|
||||
Parameters:
|
||||
0: ARRAY/NUMBER - List container
|
||||
1: String - Display Name
|
||||
2: String - Picture
|
||||
3: String/code - data
|
||||
|
||||
Returns:
|
||||
ARRAY/Number
|
||||
|
||||
Example:
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_container", "_displayName", "_picture", "_data", "_index"];
|
||||
|
||||
_container = _this select 0;
|
||||
_displayName = _this select 1;
|
||||
_picture = _this select 2;
|
||||
_data = _this select 3;
|
||||
|
||||
if (_picture == "" || _picture == "PictureThing") then {
|
||||
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
|
||||
};
|
||||
|
||||
_index = lbAdd [_container, _displayName];
|
||||
lbSetData [_container, _index, str _data];
|
||||
lbSetPicture [_container, _index, _picture];
|
||||
|
||||
_container
|
@ -2,7 +2,7 @@
|
||||
* Author: esteldunedain
|
||||
* Mount unit actions inside passenger submenu
|
||||
*
|
||||
* Argument:
|
||||
* Arguments:
|
||||
* 0: Vehicle <OBJECT>
|
||||
* 1: Player <OBJECT>
|
||||
* 3: Parameters <ARRAY>
|
||||
@ -10,14 +10,17 @@
|
||||
* Return value:
|
||||
* Children actions <ARRAY>
|
||||
*
|
||||
* Example:
|
||||
* array = [target, player, [params]] call ace_interaction_fnc_addPassengerAction
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
|
||||
EXPLODE_1_PVT(_parameters,_unit);
|
||||
|
||||
private ["_unit","_actions"];
|
||||
_unit = _parameters select 0;
|
||||
private ["_varName", "_actionTrees", "_actions"];
|
||||
|
||||
_varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
|
||||
_actionTrees = missionNamespace getVariable [_varName, []];
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Author: esteldunedain
|
||||
* Create one action per passenger
|
||||
*
|
||||
* Argument:
|
||||
* Arguments:
|
||||
* 0: Vehicle <OBJECT>
|
||||
* 1: Player <OBJECT>
|
||||
* 3: Parameters <ARRAY>
|
||||
@ -10,6 +10,9 @@
|
||||
* Return value:
|
||||
* Children actions <ARRAY>
|
||||
*
|
||||
* Example:
|
||||
* [target, player, [params]] call ace_interaction_fnc_addPassengersActions
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
@ -20,8 +23,9 @@ private ["_actions"];
|
||||
_actions = [];
|
||||
|
||||
{
|
||||
private ["_unit"];
|
||||
_unit = _x;
|
||||
if (_x != _player) then {
|
||||
if (_unit != _player) then {
|
||||
_actions pushBack
|
||||
[
|
||||
[
|
||||
@ -39,4 +43,4 @@ _actions = [];
|
||||
};
|
||||
} forEach crew _vehicle;
|
||||
|
||||
_actions
|
||||
_actions
|
||||
|
32
addons/interaction/functions/fnc_addSelectableItem.sqf
Normal file
32
addons/interaction/functions/fnc_addSelectableItem.sqf
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Author: Garth de Wet (LH)
|
||||
* Adds an item to the select menu
|
||||
*
|
||||
* Arguments:
|
||||
* 0: List container <ARRAY/NUMBER>
|
||||
* 1: Display name <STRING>
|
||||
* 2: Picture <STRING>
|
||||
* 3: Data <STRING/CODE>
|
||||
*
|
||||
* Return value:
|
||||
* Container <ARRAY/NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_4(_container,_displayName,_picture,_data);
|
||||
|
||||
if (_picture == "" || _picture == "PictureThing") then {
|
||||
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
|
||||
};
|
||||
|
||||
private ["_index"];
|
||||
_index = lbAdd [_container, _displayName];
|
||||
lbSetData [_container, _index, str _data];
|
||||
lbSetPicture [_container, _index, _picture];
|
||||
|
||||
_container
|
@ -1,8 +1,21 @@
|
||||
// by commy2
|
||||
|
||||
/*
|
||||
* Author: commy2
|
||||
* Applies buttons
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_applyButtons
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"];
|
||||
private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon", "_a", "_action", "_count"];
|
||||
|
||||
_object = GVAR(Target);
|
||||
_actions = GVAR(Buttons);
|
||||
|
@ -3,11 +3,11 @@
|
||||
* Test if can Become Leader of group
|
||||
*
|
||||
* Arguments:
|
||||
* 0: target <OBJECT>
|
||||
* 1: player <OBJECT>
|
||||
* 0: Target <OBJECT>
|
||||
* 1: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* <BOOL>
|
||||
* Able to become leader of group <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, player] call ace_interaction_fnc_canBecomeLeader
|
||||
|
@ -1,5 +1,18 @@
|
||||
// by commy2
|
||||
|
||||
/*
|
||||
* Author: commy2
|
||||
* Checks if the player can interact with civilian
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Target <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Able to interact with civilian <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [target] call ace_interaction_fnc_canInteractWithCivilian
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_unit,_isCivilian);
|
||||
@ -8,4 +21,4 @@ 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}
|
||||
|
@ -1,10 +1,22 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Checks if the player can join a group
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Able to join a group <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, target] call ace_interaction_fnc_canJoinGroup
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
alive _target
|
||||
&& {!(_target getVariable ["ACE_isUnconscious", false])}
|
||||
|
@ -1,10 +1,22 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Checks if the player can join a team
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Able to join a team <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, target] call ace_interaction_fnc_canJoinTeam
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
alive _target
|
||||
&& {!(_target getVariable ["ACE_isUnconscious", false])}
|
||||
|
@ -1,11 +1,22 @@
|
||||
// by commy2
|
||||
|
||||
/*
|
||||
* Author: commy2
|
||||
* Checks if the player can tap a shoulder
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Able to tap a shoulder <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, target] call ace_interaction_fnc_canTapShoulder
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
_target isKindOf "CAManBase" &&
|
||||
{alive _target} &&
|
||||
|
@ -3,8 +3,8 @@
|
||||
* Become Leader of group
|
||||
*
|
||||
* Arguments:
|
||||
* 0: target <OBJECT>
|
||||
* 1: player <OBJECT>
|
||||
* 0: Target <OBJECT>
|
||||
* 1: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
|
@ -1,9 +1,25 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Get door
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Distance <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* House objects and door <ARRAY>
|
||||
* 0: House <OBJECT>
|
||||
* 1: Door Name <STRING>
|
||||
*
|
||||
* Example:
|
||||
* [player, target] call ace_interaction_fnc_getDoor
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"];
|
||||
PARAMS_1(_distance);
|
||||
|
||||
_distance = _this select 0;
|
||||
private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"];
|
||||
|
||||
_position0 = positionCameraToWorld [0, 0, 0];
|
||||
_position1 = positionCameraToWorld [0, 0, _distance];
|
||||
@ -22,4 +38,5 @@ _intersections = [_house, "GEOM"] intersect [_position0, _position1];
|
||||
|
||||
_door = _intersections select 0 select 0;
|
||||
if (isNil "_door") exitWith {[_house, ""]};
|
||||
|
||||
[_house, _door]
|
||||
|
@ -1,10 +1,26 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Get door animations
|
||||
*
|
||||
* Arguments:
|
||||
* 0: House <OBJECT>
|
||||
* 1: Door <STRING>
|
||||
*
|
||||
* Return value:
|
||||
* Animation and Locked variable <ARRAY>
|
||||
* 0: Animation <STRING>
|
||||
* 1: Locked variable <STRING>
|
||||
*
|
||||
* Example:
|
||||
* array = [target, "door"] call ace_interaction_fnc_getDoorAnimations
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_house", "_door", "_animations", "_lockedVariable"];
|
||||
PARAMS_2(_house,_door);
|
||||
|
||||
_house = _this select 0;
|
||||
_door = _this select 1;
|
||||
private ["_index", "_animations", "_lockedVariable"];
|
||||
|
||||
_index = [
|
||||
"door_1",
|
||||
|
@ -1,21 +1,25 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Forces a civilian to the ground. (chance of failure).
|
||||
* Forces a civilian to the ground (with a chance of failure)
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit to be sent away (Object)
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* none
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [target] call ace_interaction_fnc_getDown
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define RADIUS 10
|
||||
|
||||
private ["_unit", "_chance", "_x"];
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_unit = _this select 0;
|
||||
private ["_chance", "_x"];
|
||||
|
||||
ACE_player playActionNow "GestureGo"; // put something else here.
|
||||
|
||||
@ -31,4 +35,4 @@ if (count (weapons ACE_player) > 0) then {
|
||||
_this setUnitPos "DOWN";
|
||||
}, _x] call CBA_fnc_globalExecute;
|
||||
};
|
||||
} foreach (_unit nearEntities ["Civilian", RADIUS]);
|
||||
} forEach (_unit nearEntities ["Civilian", RADIUS]);
|
||||
|
@ -1,4 +1,18 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Get selected button
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* Angle <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_getSelectedButton
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define MIN_DISTANCE 0.0065
|
||||
|
@ -2,18 +2,21 @@
|
||||
* Author: esteldunedain
|
||||
* Return a suitable position for the action point for the current weapon
|
||||
*
|
||||
* Argument:
|
||||
* None
|
||||
* Arguments:
|
||||
* None (uses local variable _target)
|
||||
*
|
||||
* Return value:
|
||||
* Children actions <ARRAY>
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_getWeaponPos
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
// IGNORE_PRIVATE_WARNING(_target);
|
||||
|
||||
private ["_weaponDir","_refSystem"];
|
||||
private ["_weaponDir", "_refSystem"];
|
||||
|
||||
_weaponDir = _target weaponDirection currentWeapon _target;
|
||||
_refSystem = _weaponDir call EFUNC(common,createOrthonormalReference);
|
||||
|
@ -1,22 +1,22 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Closes the Interaction menu
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(hideMenu);
|
||||
*/
|
||||
* Author: Garth de Wet (LH)
|
||||
* Closes the Interaction menu
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_hideMenu
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
closeDialog 0;
|
||||
(findDisplay 1713999) closeDisplay 1;
|
||||
(uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0;
|
||||
GVAR(MainButton) = nil;
|
||||
call FUNC(hideMouseHint);
|
||||
call FUNC(hideMouseHint);
|
||||
|
@ -1,22 +1,21 @@
|
||||
/*
|
||||
Author(s):
|
||||
Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Hides the interaction helper text with the mouse buttons at the bottom middle of the screen
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(hideMouseHint);
|
||||
*/
|
||||
* Author: Garth de Wet (LH)
|
||||
* Hides the interaction helper text with the mouse buttons at the bottom middle of the screen
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_hideMouseHint
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{};
|
||||
|
||||
(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||
showHUD true;
|
||||
showHUD true;
|
||||
|
@ -1,21 +1,24 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Check if the vehicle is in range of the player.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicke (Object)
|
||||
* 1: Distance in meters (Number)
|
||||
* Arguments:
|
||||
* 0: Vehicle <OBJECT>
|
||||
* 1: Distance in meters <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* (Bool)
|
||||
* Vehicle in range of player <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [target, 5] call ace_interaction_fnc_isInRange
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_distance", "_player"];
|
||||
PARAMS_2(_vehicle,_distance);
|
||||
|
||||
_vehicle = _this select 0;
|
||||
_distance = _this select 1;
|
||||
private ["_player", "_position0", "_position1"];
|
||||
|
||||
_player = ACE_player;
|
||||
|
||||
|
@ -1,10 +1,24 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Assigns a unit to the team
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Team <STRING>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [target, "YELLOW"] call ace_interaction_fnc_joinTeam
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_team", "_message"];
|
||||
PARAMS_2(_unit,_team);
|
||||
|
||||
_unit = _this select 0;
|
||||
_team = _this select 1;
|
||||
private ["_message"];
|
||||
|
||||
_unit setVariable [QGVAR(assignedFireTeam), _team, true];
|
||||
[_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc);
|
||||
|
@ -1,16 +1,24 @@
|
||||
/*
|
||||
* Author: bux578
|
||||
*
|
||||
* Initializes the Interaction module.
|
||||
* Initializes the Interaction module
|
||||
*
|
||||
* Arguments:
|
||||
* Whatever the module provides. (I dunno.)
|
||||
* 0: Logic <NUMBER>
|
||||
* 1: ???
|
||||
* 2: Activation State <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [logic, ???, activationState] call ace_interaction_fnc_moduleInteraction
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_logic", "_activated"];
|
||||
|
||||
_logic = _this select 0;
|
||||
_activated = _this select 2;
|
||||
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Depending on the passed value, either scrolls down through the list or up.
|
||||
|
||||
Parameters:
|
||||
NUMBER - Amount to increase current interaction target
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
1 call FUNC(MoveDown);
|
||||
-1 call FUNC(MoveDown);
|
||||
*/
|
||||
* Author: Garth de Wet (LH)
|
||||
* Scrolls through the list down or up
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Amount <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [2] call ace_interaction_fnc_moveDown
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_count", "_player", "_vehicle", "_dlgInteractionDialog", "_top", "_i", "", "_ctrl", "_index", "_action", "_color", "_current", "_infoText", "_target"];
|
||||
|
||||
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})
|
||||
if (isNil QGVAR(MainButton)) exitWith{};
|
||||
if (isNil QGVAR(Buttons)) exitWith{};
|
@ -1,7 +1,21 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* On button up
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_onButtonUp
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"];
|
||||
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"];
|
||||
|
||||
_player = ACE_player;
|
||||
_vehicle = vehicle _player;
|
||||
@ -20,11 +34,9 @@ _action = if (_index != -1 && {_index < _count}) then {
|
||||
closeDialog 0;
|
||||
|
||||
|
||||
|
||||
_statement = _action select 1;
|
||||
_condition = _action select 2;
|
||||
_conditionShow = _action select 7;
|
||||
_exceptions = _action select 8;//
|
||||
_distance = _action select 9;
|
||||
|
||||
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {
|
||||
|
@ -1,6 +1,20 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* On click
|
||||
*
|
||||
* Arguments:
|
||||
* Index <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* 5 call ace_interaction_fnc_onClick
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"];
|
||||
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_distance"];
|
||||
|
||||
_player = ACE_player;
|
||||
_vehicle = vehicle _player;
|
||||
@ -29,7 +43,6 @@ if (count _subMenu < 2) then {
|
||||
_statement = _action select 1;
|
||||
_condition = _action select 2;
|
||||
_conditionShow = _action select 7;
|
||||
_exceptions = _action select 8;//
|
||||
_distance = _action select 9;
|
||||
|
||||
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {
|
||||
|
@ -1,4 +1,18 @@
|
||||
// by CorruptedHeart, commy2
|
||||
/*
|
||||
* Author: CorruptedHeart, commy2
|
||||
* On select menu double click
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_onSelectMenuDblClick
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept);
|
||||
|
@ -1,19 +1,32 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Opens door
|
||||
*
|
||||
* Arguments:
|
||||
* 0: House <OBJECT>
|
||||
* 1: Door <STRING>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [house, "door"] call ace_interaction_fnc_openDoor
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_info", "_house", "_door", "_animations", "_lockedVariable"];
|
||||
private ["_info", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"];
|
||||
|
||||
_info = [2] call FUNC(getDoor);
|
||||
|
||||
_house = _info select 0;
|
||||
_door = _info select 1;
|
||||
EXPLODE_2_PVT(_info,_house,_door);
|
||||
|
||||
if (isNull _house) exitWith {};
|
||||
|
||||
_animations = [_house, _door] call FUNC(getDoorAnimations);
|
||||
|
||||
_lockedVariable = _animations select 1;
|
||||
_animations = _animations select 0;
|
||||
EXPLODE_2_PVT(_animations,_animations,_lockedVariable);
|
||||
|
||||
if (count _animations == 0) exitWith {};
|
||||
|
||||
@ -26,6 +39,7 @@ GVAR(isOpeningDoor) = true;
|
||||
playSound "ACE_Sound_Click";
|
||||
|
||||
[_house, _animations] spawn {
|
||||
private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"];
|
||||
_house = _this select 0;
|
||||
_animations = _this select 1;
|
||||
|
||||
|
@ -1,44 +1,57 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Opens menu select UI
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Vehicle <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_vehicle", "_cargo"];
|
||||
PARAMS_2(_unit,_vehicle);
|
||||
|
||||
_unit = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
private ["_cargo", "_actions"];
|
||||
|
||||
// allow interaction with all cargo slots and all ffv slots
|
||||
// Allow interaction with all cargo slots and all FFV slots
|
||||
_cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew);
|
||||
|
||||
// you can only interact if you are in cargo or ffv yourself. exit otherwise
|
||||
// You can only interact if you are in cargo or FFV yourself. exit otherwise
|
||||
if !(_unit in _cargo) exitWith {};
|
||||
|
||||
GVAR(InteractionMenu_Crew) = _cargo;
|
||||
|
||||
// prepare: add header and "OK" button to select menu
|
||||
private "_actions";
|
||||
// Prepare: add header and "OK" button to select menu
|
||||
_actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_Interaction_Interact"] call FUNC(prepareSelectMenu);
|
||||
|
||||
// prepare: add all cargo units as options to select menu
|
||||
// Prepare: add all cargo units as options to select menu
|
||||
{
|
||||
if (_x != _unit) then {
|
||||
_actions = [
|
||||
_actions,
|
||||
[_x] call EFUNC(common,getName),
|
||||
QUOTE(PATHTOF(UI\dot_ca.paa)),
|
||||
_forEachIndex
|
||||
] call FUNC(AddSelectableItem);
|
||||
};
|
||||
if (_x != _unit) then {
|
||||
_actions = [
|
||||
_actions,
|
||||
[_x] call EFUNC(common,getName),
|
||||
QUOTE(PATHTOF(UI\dot_ca.paa)),
|
||||
_forEachIndex
|
||||
] call FUNC(addSelectableItem);
|
||||
};
|
||||
} forEach _cargo;
|
||||
|
||||
// open select menu
|
||||
// Open select menu
|
||||
[
|
||||
_actions,
|
||||
{
|
||||
call FUNC(hideMenu);
|
||||
[0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu);
|
||||
GVAR(InteractionMenu_Crew) = nil;
|
||||
},
|
||||
{
|
||||
call FUNC(hideMenu);
|
||||
}
|
||||
_actions,
|
||||
{
|
||||
call FUNC(hideMenu);
|
||||
[0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu);
|
||||
GVAR(InteractionMenu_Crew) = nil;
|
||||
},
|
||||
{
|
||||
call FUNC(hideMenu);
|
||||
}
|
||||
] call FUNC(openSelectMenu);
|
||||
|
@ -1,36 +1,42 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Opens the select menu UI and sets up the UI
|
||||
|
||||
Parameters:
|
||||
0: ARRAY - items
|
||||
ARRAY
|
||||
0 = Text
|
||||
1 = statement to execute
|
||||
2 = condition before execute
|
||||
3 = showDisabled
|
||||
4 = priority
|
||||
5 = icon
|
||||
6 = extra variables. Passed to the code.
|
||||
1: Code - select action
|
||||
2: Code - Cancel Action
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
*/
|
||||
* Author: Garth de Wet (LH)
|
||||
* Opens the select menu UI and sets up the UI
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Items <ARRAY>
|
||||
* 0: Text <STRING>
|
||||
* 1: Statement to execute <CODE>
|
||||
* 2: Condition before execute <CODE>
|
||||
* 3: showDisabled <BOOL>
|
||||
* 4: Priority <NUMBER>
|
||||
* 5: Icon <STRING>
|
||||
* 6: Extra variables passed to the code <ARRAY>
|
||||
* 1: Select Action <CODE>
|
||||
* 2: Cancel Action <CODE>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private["_action", "_count", "_customActions", "_i"];
|
||||
|
||||
if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then {
|
||||
GVAR(SelectAccept) = _this select 1;
|
||||
GVAR(SelectCancel) = _this select 2;
|
||||
buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel
|
||||
buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept
|
||||
buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel
|
||||
buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept
|
||||
lbSetCurSel [8866, 0];
|
||||
}else{
|
||||
_customActions = _this select 0;
|
||||
PARAMS_1(_customActions);
|
||||
|
||||
private ["_count", "_action"];
|
||||
|
||||
_count = count _customActions;
|
||||
if (_count == 0) exitWith {};
|
||||
_customActions call FUNC(sortOptionsByPriority);
|
||||
|
@ -1,28 +1,29 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Prepares the select menu for use.
|
||||
|
||||
Parameters:
|
||||
0: TEXT - Header text
|
||||
1: TEXT - Approve button text
|
||||
|
||||
Returns:
|
||||
ARRAY/NUMBER - container object for use with AddSelectableItem.
|
||||
|
||||
Example:
|
||||
["Select Explosive", "Place"] call FUNC(prepareSelectMenu);
|
||||
*/
|
||||
* Author: Garth de Wet (LH)
|
||||
* Prepares the select menu for use
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Header Text <STRING>
|
||||
* 1: Approve Button Text <STRING>
|
||||
*
|
||||
* Return value:
|
||||
* Container object <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* array = ["Select Explosive", "Place"] call ace_interaction_fnc_prepareSelectMenu
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_buttonAction", "_header", "_buttonText", "_cancelButton"];
|
||||
PARAMS_2(_header,_buttonText);
|
||||
|
||||
closeDialog 0;
|
||||
_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];
|
||||
|
@ -1,22 +1,26 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Pushes a boat away from the player.
|
||||
* Pushes a boat away from the player
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Boat (object)
|
||||
* 1: Velocity (vectorlike array)
|
||||
* 0: Boat <OBJECT>
|
||||
* 1: Velocity <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [target, [vector]] call ace_interaction_fnc_push
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
_boat = _this select 0;
|
||||
_velocity = _this select 1;
|
||||
PARAMS_2(_boat,_velocity);
|
||||
|
||||
if !(local _boat) exitWith {
|
||||
[_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc);
|
||||
[_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc);
|
||||
};
|
||||
|
||||
_boat setVelocity _velocity;
|
||||
|
@ -1,7 +1,23 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Removes tag
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_interaction_fnc_removeTag
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
0 spawn {
|
||||
private ["_index", "_name"];
|
||||
|
||||
waitUntil {player getVariable ["ACE_Name", ""] != ""};
|
||||
|
||||
_name = player getVariable ["ACE_Name", ""];
|
||||
|
@ -1,36 +1,40 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Sends a civilian crowd away (chance of failure).
|
||||
* Sends a civilian crowd away with a chance of failure
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit to be sent away (Object)
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* none
|
||||
*/
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [target] call ace_interaction_fnc_sendAway
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define DISTANCE 50
|
||||
#define RADIUS 10
|
||||
|
||||
private ["_unit", "_chance", "_x"];
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_unit = _this select 0;
|
||||
private ["_chance", "_x"];
|
||||
|
||||
ACE_player playActionNow "GestureGo";
|
||||
|
||||
if (count weapons ACE_player > 0) then {
|
||||
_chance = 0.8;
|
||||
_chance = 0.8;
|
||||
} else {
|
||||
_chance = 0.5;
|
||||
_chance = 0.5;
|
||||
};
|
||||
|
||||
{
|
||||
if (count (weapons _unit) == 0 and random 1 < _chance) then {
|
||||
[-2, {
|
||||
(_this select 0) setUnitPos "AUTO";
|
||||
(_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0];
|
||||
}, [_x, ACE_player]] call CBA_fnc_globalExecute;
|
||||
};
|
||||
} foreach (_unit nearEntities ["Civilian", RADIUS]);
|
||||
if (count (weapons _unit) == 0 and random 1 < _chance) then {
|
||||
[-2, {
|
||||
(_this select 0) setUnitPos "AUTO";
|
||||
(_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0];
|
||||
}, [_x, ACE_player]] call CBA_fnc_globalExecute;
|
||||
};
|
||||
} forEach (_unit nearEntities ["Civilian", RADIUS]);
|
||||
|
@ -1,28 +1,28 @@
|
||||
/*
|
||||
Author(s):
|
||||
Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Shows the interaction helper text with the mouse buttons at the bottom middle of the screen
|
||||
|
||||
Parameters:
|
||||
0: STRING - Left click text
|
||||
1: STRING - Right click text
|
||||
3: STRING - (Optional) Scroll text
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
["Place Explosive", "Cancel"] call FUNC(showMouseHint);
|
||||
*/
|
||||
* Author: Garth de Wet (LH)
|
||||
* Shows the interaction helper text with the mouse buttons at the bottom middle of the screen
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Left Click Text <STRING>
|
||||
* 1: Right Click Text <STRING>
|
||||
* 2: Scroll Text <STRING> (Optional)
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["Place Explosive", "Cancel"] call ace_interaction_fnc_showMouseHint
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define GUI_GRID_W (0.025)
|
||||
#define GUI_GRID_H (0.04)
|
||||
private ["_leftClick", "_rightClick", "_scroll"];
|
||||
_leftClick = _this select 0;
|
||||
_rightClick = _this select 1;
|
||||
|
||||
private ["_scroll", "_display"];
|
||||
|
||||
PARAMS_2(_leftClick,_rightClick);
|
||||
_scroll = "";
|
||||
if (count _this > 2) then {
|
||||
_scroll = _this select 2;
|
||||
@ -44,11 +44,10 @@ if (isNull _display) exitWith{};
|
||||
if (_scroll == "") exitWith {
|
||||
(_display displayCtrl 1002) ctrlShow false;
|
||||
(_display displayCtrl 1202) ctrlShow false;
|
||||
|
||||
(_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H];
|
||||
(_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H];
|
||||
(_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H];
|
||||
(_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H];
|
||||
(_display displayCtrl 1001) ctrlCommit 0;
|
||||
(_display displayCtrl 1201) ctrlCommit 0;
|
||||
};
|
||||
(_display displayCtrl 1002) ctrlSetText _scroll;
|
||||
showHUD false;
|
||||
showHUD false;
|
||||
|
@ -1,4 +1,18 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Sort options by priority
|
||||
*
|
||||
* Arguments:
|
||||
* Actions <ARRAY>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* customActions call ace_interaction_fnc_sortOptionsByPriority
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_actions", "_count", "_index", "_actionN", "_actionM"];
|
||||
|
@ -1,4 +1,19 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Taps a shoulder
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [player, target] call ace_interaction_fnc_tapShoulder
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum);
|
||||
@ -13,7 +28,7 @@ if (_target != ACE_player) exitWith {
|
||||
|
||||
addCamShake [4, 0.5, 5];
|
||||
|
||||
private "_message";
|
||||
private ["_message"];
|
||||
//localize is converting the escaped <> symbols, so just add them here instead of in the stringtable
|
||||
if (_shoulderNum == 0) then {
|
||||
_message = format ["%1 >", (localize "STR_ACE_Interaction_YouWereTappedRight")];
|
||||
|
@ -1,12 +1,32 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Updates tooltip's position
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Tooltip Display <NUMBER>
|
||||
* 1: X Coordinate <NUMBER>
|
||||
* 2: Y Coordinate <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [player, 0.5, 0.5] call ace_interaction_fnc_updateTooltipPosition
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_tooltip,_coordinateX,_coordinateY);
|
||||
|
||||
private["_ctrl"];
|
||||
|
||||
disableSerialization;
|
||||
_ctrl = ctrlParent (_this select 0) displayCtrl 40;
|
||||
_ctrl = ctrlParent _tooltip displayCtrl 40;
|
||||
|
||||
_ctrl ctrlSetPosition [
|
||||
(_this select 1) + 0.01 * safezoneW,
|
||||
(_this select 2) + 0.01 * safezoneH,
|
||||
_coordinateX + 0.01 * safezoneW,
|
||||
_coordinateY + 0.01 * safezoneH,
|
||||
2.0 / 16 * safezoneW,
|
||||
0.3 / 9 * safezoneH
|
||||
];
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user