diff --git a/AUTHORS.txt b/AUTHORS.txt index c26391b869..355c5017cf 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -44,6 +44,7 @@ aeroson Aggr094 alef Aleksey EpMAK Yermakov +AleM Alganthe Andrea "AtixNeon" Verano Anthariel @@ -113,6 +114,7 @@ Hawkins Head Hybrid V JasperRab +JDT john681611 JoramD Karneck @@ -131,6 +133,7 @@ MarcBook meat Michail Nikolaev MikeMatrix +MikeMF mjc4wilton Mysteryjuju nic547 @@ -174,7 +177,6 @@ Toaster Tonic Tourorist Tuupertunut -TyroneMF Valentin Torikian voiper VyMajoris(W-Cephei) diff --git a/addons/nightvision/CfgWeapons.hpp b/addons/nightvision/CfgWeapons.hpp index 52c3d32d18..0e3d03c35e 100644 --- a/addons/nightvision/CfgWeapons.hpp +++ b/addons/nightvision/CfgWeapons.hpp @@ -5,6 +5,12 @@ class CfgWeapons { modelOptics = ""; GVAR(border) = QPATHTOF(data\nvg_mask_binos_4096.paa); GVAR(bluRadius) = 0.15; + NVG_GREEN_PRESET; + }; + class ACE_NVGoggles_WP: NVGoggles { + displayName = CSTRING(NVG_Gen3_brown_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; }; class O_NVGoggles_hex_F: NVGoggles { // APEX NVG with multiple lenses (spider eyes) modelOptics = ""; @@ -21,10 +27,20 @@ class CfgWeapons { modelOptics = ""; displayName = CSTRING(NVG_Gen3_black); }; + class ACE_NVGoggles_OPFOR_WP: NVGoggles_OPFOR { + displayName = CSTRING(NVG_Gen3_black_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class NVGoggles_INDEP: NVGoggles { modelOptics = ""; displayName = CSTRING(NVG_Gen3_green); }; + class ACE_NVGoggles_INDEP_WP: NVGoggles_INDEP { + displayName = CSTRING(NVG_Gen3_green_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class ACE_NVG_Gen1: NVGoggles_OPFOR { author = ECSTRING(common,ACETeam); displayName = CSTRING(NVG_Gen1_black); @@ -60,31 +76,61 @@ class CfgWeapons { displayName = CSTRING(NVG_Gen4_black); GVAR(generation) = 4; }; + class ACE_NVG_Gen4_Black_WP: ACE_NVG_Gen4_Black { + displayName = CSTRING(NVG_Gen4_black_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class ACE_NVG_Gen4: NVGoggles { author = ECSTRING(common,ACETeam); displayName = CSTRING(NVG_Gen4_brown); GVAR(generation) = 4; }; + class ACE_NVG_Gen4_WP: ACE_NVG_Gen4 { + displayName = CSTRING(NVG_Gen4_brown_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class ACE_NVG_Gen4_Green: NVGoggles_INDEP { author = ECSTRING(common,ACETeam); displayName = CSTRING(NVG_Gen4_green); GVAR(generation) = 4; }; + class ACE_NVG_Gen4_Green_WP: ACE_NVG_Gen4_Green { + displayName = CSTRING(NVG_Gen4_green_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class ACE_NVG_Wide_Black: NVGoggles_OPFOR { author = ECSTRING(common,ACETeam); modelOptics = QPATHTOF(models\ACE_nvg_wide_optics); displayName = CSTRING(NVG_Wide_black); }; + class ACE_NVG_Wide_Black_WP: ACE_NVG_Wide_Black { + displayName = CSTRING(NVG_Wide_black_wP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class ACE_NVG_Wide: NVGoggles { author = ECSTRING(common,ACETeam); modelOptics = QPATHTOF(models\ACE_nvg_wide_optics); displayName = CSTRING(NVG_Wide_brown); }; + class ACE_NVG_Wide_WP: ACE_NVG_Wide { + displayName = CSTRING(NVG_Wide_brown_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; class ACE_NVG_Wide_Green: NVGoggles_INDEP { author = ECSTRING(common,ACETeam); modelOptics = QPATHTOF(models\ACE_nvg_wide_optics); displayName = CSTRING(NVG_Wide_green); }; + class ACE_NVG_Wide_Green_WP: ACE_NVG_Wide_Green { + displayName = CSTRING(NVG_Wide_green_WP); + descriptionShort = CSTRING(NVG_WP_desc); + NVG_WHITE_PRESET; + }; // Examples of different goggle effect types (scope=1) diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index 3e629585e2..9028e6951e 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -13,8 +13,11 @@ class CfgPatches { "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4_Black", + "ACE_NVG_Gen4_Black_WP", "ACE_NVG_Gen4", + "ACE_NVG_Gen4_WP", "ACE_NVG_Gen4_Green", + "ACE_NVG_Gen4_Green_WP", "ACE_NVG_Wide_Black", "ACE_NVG_Wide", "ACE_NVG_Wide_Green" diff --git a/addons/nightvision/functions/fnc_pfeh.sqf b/addons/nightvision/functions/fnc_pfeh.sqf index 794fe9b555..2cc8e1bc47 100644 --- a/addons/nightvision/functions/fnc_pfeh.sqf +++ b/addons/nightvision/functions/fnc_pfeh.sqf @@ -140,7 +140,7 @@ if (CBA_missionTime < GVAR(nextEffectsUpdate)) then { // ColorCorrections - Changes brightness, contrast and "green" color of nvg // Params: [brightness(0..2), contrast(0..inf), offset(-x..+x), blendArray, colorizeArray, weightArray] GVAR(ppeffectColorCorrect) = ppEffectCreate ["ColorCorrections", 2003]; - GVAR(ppeffectColorCorrect) ppEffectAdjust [_brightFinal, _contrastFinal, 0, [0.0, 0.0, 0.0, 0.0], [1.3, 1.2, 0.0, 0.9], [6, 1, 1, 0.0]]; + GVAR(ppeffectColorCorrect) ppEffectAdjust [_brightFinal, _contrastFinal, GVAR(nvgOffset), GVAR(nvgBlend), GVAR(nvgColorize), GVAR(nvgWeight)]; GVAR(ppeffectColorCorrect) ppEffectCommit 0; GVAR(ppeffectColorCorrect) ppEffectForceInNVG true; GVAR(ppeffectColorCorrect) ppEffectEnable true; diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index 6bb9e35fdb..40f94a7bfc 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -26,6 +26,8 @@ private _hideHex = true; private _nvgGen = 3; private _blurRadius = -1; +// Adds Array of Params / Original ACE3's (ST's) by default. (NVG_GREEN_PRESET) +private _preset = getArray (configFile >> "CfgWeapons" >> "NVGoggles" >> "colorPreset"); if (alive ACE_player) then { if (((vehicle ACE_player) == ACE_player) || { // Test if we are using player's nvg or if sourced from vehicle: @@ -61,6 +63,7 @@ if (alive ACE_player) then { TRACE_1("souce: binocular",binocular ACE_player); // Source is from player's binocular (Rangefinder/Vector21bNite) private _config = configFile >> "CfgWeapons" >> (binocular ACE_player); if (isNumber (_config >> QGVAR(generation))) then {_nvgGen = getNumber (_config >> QGVAR(generation));}; + if (isArray (_config >> "colorPreset")) then {_preset = getArray (_config >> "colorPreset");}; }; TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope, but no good way to detect that) @@ -75,7 +78,7 @@ if (alive ACE_player) then { if (isNumber (_config >> QGVAR(bluRadius))) then {_blurRadius = getNumber (_config >> QGVAR(bluRadius));}; }; if (isNumber (_config >> QGVAR(generation))) then {_nvgGen = getNumber (_config >> QGVAR(generation));}; - + if (isArray (_config >> "colorPreset")) then {_preset = getArray (_config >> "colorPreset");}; } else { TRACE_1("source: vehicle - defaults",typeOf vehicle ACE_player); }; @@ -86,9 +89,18 @@ systemChat format ["NVG Refresh - Border: %1", _borderImage]; systemChat format ["EyeCups: %1, HideHex %2, NVGen: %3, BluRadius: %4", _eyeCups, _hideHex, _nvgGen, _blurRadius]; #endif +// Selection cancelled, params added +_preset params ["_offset", "_blend", "_colorize", "_weight"]; + GVAR(nvgBlurRadius) = _blurRadius; GVAR(nvgGeneration) = _nvgGen; +// Additional Global variables for Params transfer & supporting +GVAR(nvgOffset) = _offset; +GVAR(nvgBlend) = _blend; +GVAR(nvgColorize) = _colorize; +GVAR(nvgWeight) = _weight; + // Setup border and hex image based on NVG config: private _scale = (call EFUNC(common,getZoom)) * 1.12513; diff --git a/addons/nightvision/script_component.hpp b/addons/nightvision/script_component.hpp index 7f80b1b4fa..2bf48a8d05 100644 --- a/addons/nightvision/script_component.hpp +++ b/addons/nightvision/script_component.hpp @@ -19,6 +19,9 @@ // Effect Settings / Magic values to tweak: +#define NVG_GREEN_PRESET colorPreset[] = {0, {0.0, 0.0, 0.0, 0.0}, {1.3, 1.2, 0.0, 0.9}, {6, 1, 1, 0.0}} +#define NVG_WHITE_PRESET colorPreset[] = {0.0, {0.0, 0.0, 0.0, 0.0}, {1.1, 0.8, 1.9, 0.9}, {1, 1, 6, 0.0}} + // Decreases fog when in air vehicles #define ST_NVG_AIR_FOG_MULTIPLIER 0.5 diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 4683867546..7cca56ebe0 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -117,6 +117,12 @@ 夜視鏡 (三代, 棕色) GG Gözlüğü (3. Jen Kahverengi) + + NV Goggles (Gen3, Brown, WP) + + + Night Vision Goggles, White Phosphor + NV Goggles (Gen3, Green) Noktovizor (Gen3, zelený) @@ -134,6 +140,9 @@ 夜視鏡 (三代, 綠色) GG Gözlüğü (3. Jen Yeşil) + + NV Goggles (Gen3, Green, WP) + NV Goggles (Gen3, Black) Noktovizor (Gen3, černý) @@ -151,6 +160,9 @@ 夜視鏡 (三代, 黑色) GG Gözlüğü (3. Jen Siyah) + + NV Goggles (Gen3, Black, WP) + NV Goggles (Gen4, Brown) JVN (Gen4, marron) @@ -162,6 +174,9 @@ 야투경 (4세대, 갈색) Gafas de visión nocturna (Gen4, Marrón) + + NV Goggles (Gen4, Brown, WP) + NV Goggles (Gen4, Black) JVN (Gen4, noires) @@ -173,6 +188,9 @@ 야투경 (4세대, 검정색) Gafas de visión nocturna (Gen4, Negro) + + NV Goggles (Gen4, Black, WP) + NV Goggles (Gen4, Green) JVN (Gen4, vertes) @@ -184,6 +202,9 @@ 야투경 (4세대, 녹색) Gafas de visión nocturna (Gen4, Verde) + + NV Goggles (Gen4, Green, WP) + NV Goggles (Wide, Brown) JVN (Large, marron) @@ -195,6 +216,9 @@ 야투경 (넓음, 갈색) Gafas de visión nocturna (Panorámicas, Marrón) + + NV Goggles (Wide, Brown, WP) + NV Goggles (Wide, Black) JVN (Large, noires) @@ -206,6 +230,9 @@ 야투경 (넓음, 검정색) Gafas de visión nocturna (Panorámicas, Negro) + + NV Goggles (Wide, Black, WP) + NV Goggles (Wide, Green) JVN (Large, vertes) @@ -217,6 +244,9 @@ 야투경 (넓음, 녹색) Gafas de visión nocturna (Panorámicas, Verde) + + NV Goggles (Wide, Green, WP) + Brightness: %1 Helligkeit: %1