From 9022e07ddcad0d640eb251305d4744f79b0baed9 Mon Sep 17 00:00:00 2001 From: vbawol Date: Sat, 6 Aug 2016 12:54:53 -0500 Subject: [PATCH] config support for epoch nite light --- .../epoch_code/compile/EPOCH_niteLight.sqf | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_niteLight.sqf b/Sources/epoch_code/compile/EPOCH_niteLight.sqf index ea43fb4f..c2101ade 100644 --- a/Sources/epoch_code/compile/EPOCH_niteLight.sqf +++ b/Sources/epoch_code/compile/EPOCH_niteLight.sqf @@ -13,21 +13,20 @@ https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/compile/EPOCH_niteLight.sqf */ private ["_pos"]; - if (!isNull EP_light) then { deleteVehicle EP_light; }; _config = 'CfgEpochClient' call EPOCH_returnConfig; -_nlSettings = getArray ( _config >> "niteLight"); -_nlBright = _nlSettings select 0; -_nlZ = _nlSettings select 1; -_pos = (getPosATL player); -_pos set [2,_nlZ]; -EP_light = "#lightpoint" createvehiclelocal _pos; -EP_light setposATL _pos; -EP_light attachTo [player,[0,8.11,_nlZ]]; //offset infront of player so that the darkness is 'following' them. -EP_light setLightDayLight true; //TODO: Test if this can be turned off (Dawn / Dusk) -EP_light setLightBrightness _nlBright; -EP_light setLightAmbient [0.435, 0.439, 0.439];//Using new Colours. -EP_light setlightcolor [0.435, 0.439, 0.439]; +_nlSettings = getArray ( _config >> "niteLight") params [["_nlEnabled",1],["_nlBright",1.88],["_nlZ",22]]; +if (_nlEnabled isEqualTo 1) then { + _pos = (getPosATL player); + _pos set [2,_nlZ]; + EP_light = "#lightpoint" createvehiclelocal _pos; + EP_light setposATL _pos; + EP_light attachTo [player,[0,8.11,_nlZ]]; //offset infront of player so that the darkness is 'following' them. + EP_light setLightDayLight true; //TODO: Test if this can be turned off (Dawn / Dusk) + EP_light setLightBrightness _nlBright; + EP_light setLightAmbient [0.435, 0.439, 0.439];//Using new Colours. + EP_light setlightcolor [0.435, 0.439, 0.439]; +}; true