mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Headers and formating
This commit is contained in:
parent
c291f29702
commit
e649c8e853
@ -1,19 +1,19 @@
|
|||||||
class Extended_PreInit_EventHandlers {
|
class Extended_PreInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_PostInit_EventHandlers {
|
class Extended_PostInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) );
|
clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_FiredBIS_EventHandlers {
|
class Extended_FiredBIS_EventHandlers {
|
||||||
class AllVehicles {
|
class AllVehicles {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
clientFiredBIS = QUOTE( _this call FUNC(blending) );
|
clientFiredBIS = QUOTE( _this call FUNC(blending) );
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class All {
|
class All {
|
||||||
ACE_NightVision_grain = 0.75;
|
ACE_NightVision_grain = 0.75;
|
||||||
ACE_NightVision_blur = 0.055;
|
ACE_NightVision_blur = 0.055;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||||
name = #ITEM; \
|
name = #ITEM; \
|
||||||
count = COUNT; \
|
count = COUNT; \
|
||||||
};
|
};
|
||||||
|
|
||||||
class Box_NATO_Support_F;
|
class Box_NATO_Support_F;
|
||||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||||
class TransportItems {
|
class TransportItems {
|
||||||
MACRO_ADDITEM(ACE_NVG_Gen1,6)
|
MACRO_ADDITEM(ACE_NVG_Gen1,6)
|
||||||
MACRO_ADDITEM(ACE_NVG_Gen2,6)
|
MACRO_ADDITEM(ACE_NVG_Gen2,6)
|
||||||
//MACRO_ADDITEM(ACE_NVG_Gen3,6)
|
//MACRO_ADDITEM(ACE_NVG_Gen3,6)
|
||||||
MACRO_ADDITEM(ACE_NVG_Gen4,6)
|
MACRO_ADDITEM(ACE_NVG_Gen4,6)
|
||||||
MACRO_ADDITEM(ACE_NVG_Wide,6)
|
MACRO_ADDITEM(ACE_NVG_Wide,6)
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
ADDON = false;
|
ADDON = false;
|
||||||
|
|
||||||
PREP(blending);
|
PREP(blending);
|
||||||
PREP(decreaseNVGBrightness);
|
PREP(changeNVGBrightness);
|
||||||
PREP(increaseNVGBrightness);
|
|
||||||
PREP(updatePPEffects);
|
PREP(updatePPEffects);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -1,4 +1,24 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Change the blending when the player fires??
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: unit - Object the event handler is assigned to <OBJECT>
|
||||||
|
* 1: weapon - Fired weapon <STRING>
|
||||||
|
* 2: muzzle - Muzzle that was used <STRING>
|
||||||
|
* 3: mode - Current mode of the fired weapon <STRING>
|
||||||
|
* 4: ammo - Ammo used <STRING>
|
||||||
|
* 5: magazine - magazine name which was used <STRING>
|
||||||
|
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [clientFiredBIS-XEH] call ace_nightvision_fnc_blending
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"];
|
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"];
|
||||||
@ -8,26 +28,26 @@ _weapon = _this select 1;
|
|||||||
_ammo = _this select 4;
|
_ammo = _this select 4;
|
||||||
_magazine = _this select 5;
|
_magazine = _this select 5;
|
||||||
|
|
||||||
if ((_vehicle != (vehicle ACE_player)) || {(currentVisionMode _vehicle) != 1}) exitWith {};
|
|
||||||
|
|
||||||
_player = ACE_player;
|
_player = ACE_player;
|
||||||
|
|
||||||
|
if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {};
|
||||||
|
|
||||||
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {};
|
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {};
|
||||||
|
|
||||||
private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"];
|
private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"];
|
||||||
|
|
||||||
_silencer = switch (_weapon) do {
|
_silencer = switch (_weapon) do {
|
||||||
case (primaryWeapon _player) : {primaryWeaponItems _player select 0};
|
case (primaryWeapon _player) : {primaryWeaponItems _player select 0};
|
||||||
case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0};
|
case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0};
|
||||||
case (handgunWeapon _player) : {handgunItems _player select 0};
|
case (handgunWeapon _player) : {handgunItems _player select 0};
|
||||||
default {""};
|
default {""};
|
||||||
};
|
};
|
||||||
|
|
||||||
_visibleFireCoef = 1;
|
_visibleFireCoef = 1;
|
||||||
_visibleFireTimeCoef = 1;
|
_visibleFireTimeCoef = 1;
|
||||||
if (_silencer != "") then {
|
if (_silencer != "") then {
|
||||||
_visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire");
|
_visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire");
|
||||||
_visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime");
|
_visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime");
|
||||||
};
|
};
|
||||||
|
|
||||||
_visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire");
|
_visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire");
|
||||||
@ -36,24 +56,24 @@ _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTi
|
|||||||
_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4;
|
_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4;
|
||||||
|
|
||||||
_fnc_isTracer = {
|
_fnc_isTracer = {
|
||||||
private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"];
|
private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"];
|
||||||
|
|
||||||
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false};
|
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false};
|
||||||
|
|
||||||
_indexShot = (_player ammo _weapon) + 1;
|
_indexShot = (_player ammo _weapon) + 1;
|
||||||
|
|
||||||
_lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer");
|
_lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer");
|
||||||
if (_indexShot <= _lastRoundsTracer) exitWith {true};
|
if (_indexShot <= _lastRoundsTracer) exitWith {true};
|
||||||
|
|
||||||
_tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery");
|
_tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery");
|
||||||
if (_tracersEvery == 0) exitWith {false};
|
if (_tracersEvery == 0) exitWith {false};
|
||||||
|
|
||||||
(_indexShot - _lastRoundsTracer) % _tracersEvery == 0
|
(_indexShot - _lastRoundsTracer) % _tracersEvery == 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (call _fnc_isTracer) then {
|
if (call _fnc_isTracer) then {
|
||||||
_visibleFire = _visibleFire + 2;
|
_visibleFire = _visibleFire + 2;
|
||||||
_visibleFireTime = _visibleFireTime + 2;
|
_visibleFireTime = _visibleFireTime + 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
_darkness = 1 - (call EFUNC(common,ambientBrightness));
|
_darkness = 1 - (call EFUNC(common,ambientBrightness));
|
||||||
|
33
addons/nightvision/functions/fnc_changeNVGBrightness.sqf
Normal file
33
addons/nightvision/functions/fnc_changeNVGBrightness.sqf
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Change the brightness of the unit's NVG
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The Unit <OBJECT>
|
||||||
|
* 1: Change in brightness (1 or -1) <SCALAR>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player, 1] call ace_nightvision_fnc_changeNVGBrightness
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_brightness"];
|
||||||
|
|
||||||
|
PARAMS_2(_player,_changeInBrightness);
|
||||||
|
|
||||||
|
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
||||||
|
|
||||||
|
_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 1) max -1;
|
||||||
|
|
||||||
|
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
|
||||||
|
|
||||||
|
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||||
|
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
||||||
|
|
||||||
|
[format [(localize "STR_ACE_NightVision_NVGBrightness"), (_brightness * 100)]] call EFUNC(common,displayTextStructured);
|
||||||
|
playSound "ACE_Sound_Click";
|
@ -1,21 +0,0 @@
|
|||||||
// by commy2
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
private ["_player", "_vehicle", "_brightness"];
|
|
||||||
|
|
||||||
_player = _this select 0;
|
|
||||||
_vehicle = _this select 1;
|
|
||||||
|
|
||||||
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
|
||||||
|
|
||||||
if (_brightness > -1) then {
|
|
||||||
_brightness = round (10 * _brightness - 1) / 10;
|
|
||||||
|
|
||||||
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
|
|
||||||
|
|
||||||
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
|
||||||
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
|
||||||
|
|
||||||
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
|
|
||||||
playSound "ACE_Sound_Click";
|
|
||||||
};
|
|
@ -1,21 +0,0 @@
|
|||||||
// by commy2
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
private ["_player", "_vehicle", "_brightness"];
|
|
||||||
|
|
||||||
_player = _this select 0;
|
|
||||||
_vehicle = _this select 1;
|
|
||||||
|
|
||||||
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
|
||||||
|
|
||||||
if (_brightness < 1) then {
|
|
||||||
_brightness = round (10 * _brightness + 1) / 10;
|
|
||||||
|
|
||||||
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
|
|
||||||
|
|
||||||
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
|
||||||
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
|
||||||
|
|
||||||
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
|
|
||||||
playSound "ACE_Sound_Click";
|
|
||||||
};
|
|
@ -1,4 +1,18 @@
|
|||||||
//by commy2, PabstMirror and CAA-Picard
|
/*
|
||||||
|
* Author: commy2, PabstMirror and CAA-Picard
|
||||||
|
* Update the ppEffects everytime something changes
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [someEvent] call ace_nightvision_fnc_updatePPEffects
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"];
|
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"];
|
||||||
|
Loading…
Reference in New Issue
Block a user