Added new function, updated settings

This commit is contained in:
SAM 2015-05-14 17:19:14 +02:00
parent 7fe73c2c80
commit 853333ac49
2 changed files with 35 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class ACE_Settings {
typeName = "SCALAR";
isClientSettable = 1;
value = 0; // index. Actual coefficient is given by functions/fnc_returnObjectCoeff.sqf
values[] = {"Off","Low","Medium","High"};
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;