Added wind deflection module settings:

*simulationInterval
*simulationRadius
This commit is contained in:
ulteq 2015-04-12 12:33:09 +02:00
parent a993f2d5f1
commit 85a7bea42b
8 changed files with 69 additions and 18 deletions

View File

@ -1,8 +1,8 @@
class CfgVehicles {
class ACE_Module;
class GVAR(Module): ACE_Module {
class GVAR(ModuleSettings): ACE_Module {
scope = 2;
displayName = "Advanced Ballistics [ACE]";
displayName = "Advanced Ballistics";
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));
category = "ACE";
function = QUOTE(DFUNC(initModuleSettings));

View File

@ -0,0 +1,14 @@
class ACE_Settings {
class GVAR(simulationInterval) {
displayName = "Simulation Interval";
description = "Defines the interval between every calculation step";
typeName = "NUMBER";
defaultValue = 0;
};
class GVAR(simulationRadius) {
displayName = "Simulation Radius";
description = "Defines the radius (in meters) in which advanced ballistics are applied";
typeName = "NUMBER";
defaultValue = 3000;
};
};

View File

@ -1,11 +1,28 @@
class CfgVehicles {
class Module_F;
class GVAR(Module): Module_F {
author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = "Wind Deflection";
class ACE_Module;
class GVAR(ModuleSettings): ACE_Module {
scope = 2;
isGlobal = 1;
displayName = "Wind Deflection";
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));
category = "ACE";
function = QUOTE(DFUNC(initModuleSettings));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "$STR_ACE_Common_ACETeam";
class Arguments {
class simulationInterval {
displayName = "Simulation Interval";
description = "Defines the interval between every calculation step";
typeName = "NUMBER";
defaultValue = 0;
};
class simulationRadius {
displayName = "Simulation Radius";
description = "Defines the radius (in meters) in which advanced ballistics are applied";
typeName = "NUMBER";
defaultValue = 3000;
};
};
};
};

View File

@ -14,5 +14,6 @@ ADDON = false;
PREP(handleFired);
PREP(updateTrajectoryPFH);
PREP(initModuleSettings);
ADDON = true;

View File

@ -21,13 +21,6 @@ class CfgAddons {
};
};
class ACE_Settings {
class GVAR(EnableForAI) {
value = 0;
typeName = "BOOL";
isClientSetable = 0;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "ACE_Settings.hpp"

View File

@ -29,7 +29,7 @@ _bullet = _this select 6;
if (!hasInterface) exitWith {false};
if (!(_bullet isKindOf "BulletBase")) exitWith {false};
if (_unit distanceSqr ACE_player > 9000000) exitWith {false};
if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false};
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false};
[_bullet, getNumber(configFile >> "cfgAmmo" >> (_this select 4) >> "airFriction")] call FUNC(updateTrajectoryPFH);

View File

@ -0,0 +1,26 @@
/*
* Author: Glowbal, Ruthberg
* Module for adjusting the wind deflection settings
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: units <ARRAY>
* 2: activated <BOOL>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"
private ["_logic", "_units", "_activated"];
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if !(_activated) exitWith {};
[_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule);

View File

@ -47,4 +47,4 @@
};
_bullet setVelocity _bulletVelocity;
}, 0, [_this select 0, _this select 1, time]] call CBA_fnc_addPerFrameHandler;
}, GVAR(simulationInterval), [_this select 0, _this select 1, time]] call CBA_fnc_addPerFrameHandler;