Merge branch 'viewdistance' of https://github.com/Winter259/ACE3 into viewdistance

This commit is contained in:
esteldunedain 2015-05-14 12:43:47 -03:00
commit 54325b4591
2 changed files with 40 additions and 10 deletions

View File

@ -29,17 +29,13 @@ class ACE_Settings {
displayName = "View Distance Limit";
description = "Limit for client's view distance set here and can overridden by module";
};
class GVAR(terrainGrid) {
class GVAR(objectViewDistanceCoeff) {
typeName = "SCALAR";
value = 10; // MP default as found in: https://community.bistudio.com/wiki/setTerrainGrid
displayName = "Client Terrain Grid";
description = "Changes in game terrain grid";
};
class GVAR(shadows) {
typeName = "SCALAR";
value = 200; // MP default as found in: https://community.bistudio.com/wiki/setObjectViewDistance
displayName = "Client Shadows distance";
description = "Changes in game shadows";
isClientSettable = 1;
value = 0; // index. Actual coefficient is given by functions/fnc_returnObjectCoeff.sqf
values[] = {"Off","Very Low","Low","Medium","High","Very High"};
displayName = "Dynamic Object View Distance";
description = "Sets the object view distance as a coefficient of the view distance.";
};
};

View File

@ -0,0 +1,34 @@
/*
* Author: Winter
* Returns the object view distance coefficient according to the given index
*
*
* Arguments:
* 0: Object View Distance setting Index <SCALAR>
*
* Return Value:
* Object View Distance <SCALAR>
*
* Example:
* [2] call ace_viewdistance_fnc_returnObjectCoeff;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_index);
private ["_return"];
_return = switch (_index) do {
case 0: {0.00}; // Off
case 1: {0.20}; // Very Low
case 2: {0.40}; // Low
case 3: {0.60}; // Medium
case 4: {0.80}; // High
case 5: {1.00}; // Very High
default {0.50}; // something broke if this returns
};
_return;