mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'viewdistance' of https://github.com/Winter259/ACE3 into viewdistance
This commit is contained in:
commit
54325b4591
@ -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.";
|
||||
};
|
||||
};
|
||||
|
||||
|
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