Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds optics hidePeripheralVision config entry #1143

Merged
merged 1 commit into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions addons/optics/RscInGameUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ class RscInGameUI {
// It will ONLY effect tripple head users, as (safeZoneX == safeZoneXAbs) for everyone else.
class TrippleHeadLeft: RscText {
idc = IDC_BLACK_LEFT;
x = "safeZoneXAbs";
y = "safeZoneY";
w = "(safeZoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))";
h = "safeZoneH";
x = safezoneXAbs;
y = safezoneY;
w = THIRD_SCREEN_WIDTH;
h = safezoneH;
colorBackground[] = {0,0,0,1};
};

class TrippleHeadRight: TrippleHeadLeft {
idc = IDC_BLACK_RIGHT;
x = "safeZoneXAbs + safeZoneWAbs - (safeZoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))";
x = safezoneXAbs + safezoneWAbs - THIRD_SCREEN_WIDTH;
};

class Magnification: CA_Zeroing {
Expand Down
1 change: 1 addition & 0 deletions addons/optics/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GVAR(ppEffects) = [];
GVAR(manualReticleNightSwitch) = false;
GVAR(useReticleNight) = false;
GVAR(reticleSafezoneSize) = RETICLE_SAFEZONE_DEFAULT_SIZE;
GVAR(hidePeripheralVision) = false;

// Update optic info.
["weapon", {
Expand Down
13 changes: 13 additions & 0 deletions addons/optics/fnc_loadScriptedOptic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ _ctrlReticleSafezone ctrlSetPosition [
];
_ctrlReticleSafezone ctrlCommit 0;

private _width = THIRD_SCREEN_WIDTH;

if (GVAR(hidePeripheralVision)) then {
_width = 0.5 - (_bodyPosition select 2)/2 - safezoneXAbs;
};

_ctrlBlackLeft ctrlSetPositionW _width;
_ctrlBlackLeft ctrlCommit 0;

_ctrlBlackRight ctrlSetPositionW _width;
_ctrlBlackRight ctrlSetPositionX (safezoneXAbs + safezoneWAbs - _width);
_ctrlBlackRight ctrlCommit 0;

if (_init) then {
[missionNamespace, "Draw3D", {
if (isNull _thisArgs) exitWith {
Expand Down
2 changes: 2 additions & 0 deletions addons/optics/fnc_updateOpticInfo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ if (isNumber (_config >> "reticleSafezoneSize")) then {
GVAR(reticleSafezoneSize) = getNumber (_config >> "reticleSafezoneSize");
};

GVAR(hidePeripheralVision) = getNumber (_config >> "hidePeripheralVision") != 0;

// zeroing distances
configProperties [configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "OpticsModes"] findIf {
GVAR(ZeroingDistances) = getArray (_x >> "discreteDistance");
Expand Down
1 change: 1 addition & 0 deletions addons/optics/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define WEAPON_MAGAZINES(unit,weapon) (weaponsItems (unit) select {_x select 0 == (weapon)} param [0, []] select {_x isEqualType []})

#define SOUND_RETICLE_SWITCH ["A3\Sounds_F\arsenal\weapons\UGL\Firemode_ugl",0.31622776,1,5]
#define THIRD_SCREEN_WIDTH ((safezoneX - safezoneXAbs) * ((getResolution select 4)/(16/3)))

// control ids
#define IDC_RETICLE 4000
Expand Down