mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added new function, updated settings
This commit is contained in:
parent
7fe73c2c80
commit
853333ac49
@ -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.";
|
||||
};
|
||||
|
34
addons/viewdistance/functions/fnc_returnObjectCoeff.sqf
Normal file
34
addons/viewdistance/functions/fnc_returnObjectCoeff.sqf
Normal 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;
|
Loading…
Reference in New Issue
Block a user