Night Vision - Add prefix to colorPreset (#9520)

* Add ACE Prefix to colorPreset, update docs.

* remove pointless bwc
This commit is contained in:
Mike-MF 2023-10-18 20:03:21 +01:00 committed by GitHub
parent c92eca7751
commit 262b7fe5c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View File

@ -27,7 +27,8 @@ 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");
private _preset = getArray (configFile >> "CfgWeapons" >> "NVGoggles" >> QGVAR(colorPreset));
if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) then {
if (((vehicle ACE_player) == ACE_player) || {
// Test if we are using player's nvg or if sourced from vehicle:
@ -47,7 +48,7 @@ if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) 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");};
if (isArray (_config >> QGVAR(colorPreset))) then {_preset = getArray (_config >> QGVAR(colorPreset));};
};
TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope, but no good way to detect that)
@ -62,7 +63,7 @@ if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) 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");};
if (isArray (_config >> QGVAR(colorPreset))) then {_preset = getArray (_config >> QGVAR(colorPreset));};
} else {
TRACE_1("source: vehicle - defaults",typeOf vehicle ACE_player);
};

View File

@ -19,8 +19,8 @@
// 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}}
#define NVG_GREEN_PRESET GVAR(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 GVAR(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

View File

@ -27,10 +27,19 @@ class CfgWeapons {
author = ECSTRING(common,ACETeam);
descriptionShort = "Biocular nightvision goggles";
displayName = "NV Goggles (Bio)";
GVAR(border) = QPATHTOF(data\nvg_mask_binos_4096.paa); // Edge mask for different tube configurations. Three types: mono, bino and quad.
GVAR(bluRadius) = 0.13; // Edge blur radius.
GVAR(eyeCups) = 1; // Does have eyecups.
GVAR(generation) = 4; // Generation 4. Affects image quality.
ace_nightvision_border = QPATHTOF(data\nvg_mask_binos_4096.paa); // Edge mask for different tube configurations. Three types: mono, bino and quad.
ace_nightvision_bluRadius = 0.13; // Edge blur radius.
ace_nightvision_colorPreset[] = {0, {0.0, 0.0, 0.0, 0.0}, {1.3, 1.2, 0.0, 0.9}, {6, 1, 1, 0.0}}; // Green preset
ace_nightvision_eyeCups = 1; // Does have eyecups.
ace_nightvision_generation = 4; // Generation 4. Affects image quality.
};
};
```
## 2. Color Presets
Additional color presets
```cpp
ace_nightvision_colorPreset[] = {0.0, {0.0, 0.0, 0.0, 0.0}, {1.1, 0.8, 1.9, 0.9}, {1, 1, 6, 0.0}}; // White Phosphor Preset
```