2015-01-12 22:08:37 +00:00
|
|
|
// by commy2
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2015-01-16 20:25:30 +00:00
|
|
|
GVAR(ppEffectBlur) = ppEffectCreate ["dynamicBlur", 1234];
|
2015-01-12 22:08:37 +00:00
|
|
|
GVAR(ppEffectBlur) ppEffectForceInNVG true;
|
2015-01-16 20:25:30 +00:00
|
|
|
GVAR(ppEffectBlur) ppEffectAdjust [0];
|
|
|
|
GVAR(ppEffectBlur) ppEffectCommit 0;
|
2015-01-12 22:08:37 +00:00
|
|
|
|
|
|
|
GVAR(ppEffectRadialBlur) = ppEffectCreate ["radialBlur", 1238];
|
|
|
|
GVAR(ppEffectRadialBlur) ppEffectForceInNVG true;
|
|
|
|
GVAR(ppEffectRadialBlur) ppEffectAdjust [0, 0, 0, 0];
|
|
|
|
GVAR(ppEffectRadialBlur) ppEffectCommit 0;
|
|
|
|
|
|
|
|
GVAR(ppEffectFilmGrain) = ppEffectCreate ["FilmGrain", 1235];
|
|
|
|
GVAR(ppEffectFilmGrain) ppEffectAdjust [0.25, 2.5, 2.5, 2.5*0.3, 2.5*0.3, false];
|
|
|
|
GVAR(ppEffectFilmGrain) ppEffectCommit 0;
|
|
|
|
|
|
|
|
GVAR(ppEffectNVGBrightness) = ppEffectCreate ["ColorCorrections", 1236];
|
|
|
|
GVAR(ppEffectNVGBrightness) ppEffectForceInNVG true;
|
|
|
|
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
|
|
|
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
|
|
|
|
|
|
|
GVAR(ppEffectMuzzleFlash) = ppEffectCreate ["ColorCorrections", 1237];
|
|
|
|
GVAR(ppEffectMuzzleFlash) ppEffectEnable true;
|
|
|
|
GVAR(ppEffectMuzzleFlash) ppEffectForceInNVG true;
|
|
|
|
GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
|
|
|
GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
|
|
|
|
2015-01-16 20:25:30 +00:00
|
|
|
// Setup the event handlers
|
2015-01-17 05:12:37 +00:00
|
|
|
["playerInventoryChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
2015-10-07 18:11:07 +00:00
|
|
|
["playerVisionModeChanged", {
|
|
|
|
_this call FUNC(updatePPEffects);
|
2015-10-08 17:29:30 +00:00
|
|
|
_this call FUNC(onVisionModeChanged);
|
2015-10-07 18:11:07 +00:00
|
|
|
}] call EFUNC(common,addEventHandler);
|
2016-02-21 21:16:12 +00:00
|
|
|
|
2015-10-07 18:11:07 +00:00
|
|
|
["cameraViewChanged", {
|
|
|
|
_this call FUNC(updatePPEffects);
|
2015-10-08 17:29:30 +00:00
|
|
|
_this call FUNC(onCameraViewChanged);
|
2015-10-07 18:11:07 +00:00
|
|
|
}] call EFUNC(common,addEventHandler);
|
2015-01-17 05:12:37 +00:00
|
|
|
["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
|
|
|
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
2015-02-18 04:05:52 +00:00
|
|
|
|
|
|
|
// Add keybinds
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness),
|
2015-02-18 04:05:52 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
2015-06-13 20:08:13 +00:00
|
|
|
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
2015-02-18 04:05:52 +00:00
|
|
|
// Conditions: specific
|
2015-04-17 20:45:00 +00:00
|
|
|
if ((currentVisionMode ACE_player != 1)) exitWith {false};
|
2015-02-18 04:05:52 +00:00
|
|
|
|
|
|
|
// Statement
|
|
|
|
[ACE_player, 1] call FUNC(changeNVGBrightness);
|
|
|
|
true
|
|
|
|
},
|
2015-03-05 08:51:24 +00:00
|
|
|
{false},
|
2015-11-30 15:45:20 +00:00
|
|
|
[201, [false, false, true]], false] call CBA_fnc_addKeybind; //PageUp + ALT
|
2015-02-18 04:05:52 +00:00
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness),
|
2015-02-18 04:05:52 +00:00
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
2015-06-13 20:08:13 +00:00
|
|
|
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
2015-02-18 04:05:52 +00:00
|
|
|
// Conditions: specific
|
2015-04-17 20:45:00 +00:00
|
|
|
if ((currentVisionMode ACE_player != 1)) exitWith {false};
|
2015-02-18 04:05:52 +00:00
|
|
|
|
|
|
|
// Statement
|
|
|
|
[ACE_player, -1] call FUNC(changeNVGBrightness);
|
|
|
|
true
|
|
|
|
},
|
2015-03-05 08:51:24 +00:00
|
|
|
{false},
|
2015-11-30 15:45:20 +00:00
|
|
|
[209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT
|
2016-02-06 20:42:44 +00:00
|
|
|
|
|
|
|
// Register fire event handler
|
|
|
|
["firedPlayer", DFUNC(blending)] call EFUNC(common,addEventHandler);
|
|
|
|
["firedPlayerVehicle", DFUNC(blending)] call EFUNC(common,addEventHandler);
|