mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
- Default viewDistance to video settings - Add 500m and 100m as optional view distances
This commit is contained in:
parent
96322fe689
commit
23117db401
@ -8,24 +8,24 @@ class ACE_Settings {
|
|||||||
class GVAR(viewDistanceOnFoot) {
|
class GVAR(viewDistanceOnFoot) {
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
value = 11; // index, NOT value // Can set it to client's actual viewdistance in the init function once ACE_Settings supports numbers (if ever).
|
value = 0; // index, NOT value // Can set it to client's actual viewdistance in the init function once ACE_Settings supports numbers (if ever).
|
||||||
values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf
|
values[] = {"Video settings","500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf
|
||||||
displayName = "Client View Distance (On Foot)";
|
displayName = "Client View Distance (On Foot)";
|
||||||
description = "Changes in game view distance when the player is on foot.";
|
description = "Changes in game view distance when the player is on foot.";
|
||||||
};
|
};
|
||||||
class GVAR(viewDistanceLandVehicle) {
|
class GVAR(viewDistanceLandVehicle) {
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
value = 11; // index, NOT value
|
value = 0; // index, NOT value
|
||||||
values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf
|
values[] = {"Video settings","500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf
|
||||||
displayName = "Client View Distance (Land Vehicle)";
|
displayName = "Client View Distance (Land Vehicle)";
|
||||||
description = "Changes in game view distance when the player is in a land vehicle.";
|
description = "Changes in game view distance when the player is in a land vehicle.";
|
||||||
};
|
};
|
||||||
class GVAR(viewDistanceAirVehicle) {
|
class GVAR(viewDistanceAirVehicle) {
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
value = 11; // index, NOT value
|
value = 0; // index, NOT value
|
||||||
values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf
|
values[] = {"Video settings","500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf
|
||||||
displayName = "Client View Distance (Air Vehicle)";
|
displayName = "Client View Distance (Air Vehicle)";
|
||||||
description = "Changes in game view distance when the player is in an air vehicle.";
|
description = "Changes in game view distance when the player is in an air vehicle.";
|
||||||
};
|
};
|
||||||
|
@ -26,11 +26,17 @@ _new_view_distance = [_index_requested] call FUNC(returnValue); // changes the s
|
|||||||
_object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient.
|
_object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient.
|
||||||
_view_distance_limit = GVAR(limitViewDistance); // Grab the limit
|
_view_distance_limit = GVAR(limitViewDistance); // Grab the limit
|
||||||
|
|
||||||
|
setViewDistance (_new_view_distance min _view_distance_limit);
|
||||||
|
|
||||||
|
if (_object_view_distance_coeff > 0) then {
|
||||||
|
setObjectViewDistance (_object_view_distance_coeff * viewDistance);
|
||||||
|
};
|
||||||
|
|
||||||
if (_show_prompt) then {
|
if (_show_prompt) then {
|
||||||
_text = if (_new_view_distance <= _view_distance_limit) then {
|
_text = if (_new_view_distance <= _view_distance_limit) then {
|
||||||
format ["<t align='center'>View Distance: %1m",str(_new_view_distance)];
|
format ["<t align='center'>View Distance: %1m", str(viewDistance)];
|
||||||
} else {
|
} else {
|
||||||
format ["<t align='center'>That option is invalid! The limit is %1m",str(_view_distance_limit)];
|
format ["<t align='center'>That option is invalid! The limit is %1m", str(viewDistance)];
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(objectViewDistanceCoeff) > 0) then {
|
if (GVAR(objectViewDistanceCoeff) > 0) then {
|
||||||
@ -38,9 +44,3 @@ if (_show_prompt) then {
|
|||||||
};
|
};
|
||||||
[parseText _text,2] call EFUNC(common,displayTextStructured);
|
[parseText _text,2] call EFUNC(common,displayTextStructured);
|
||||||
};
|
};
|
||||||
|
|
||||||
setViewDistance (_new_view_distance min _view_distance_limit);
|
|
||||||
|
|
||||||
if (_object_view_distance_coeff > 0) then {
|
|
||||||
setObjectViewDistance (_object_view_distance_coeff * _new_view_distance);
|
|
||||||
};
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Winter
|
* Author: Winter
|
||||||
* Returns the view distance value according to the given index
|
* Returns the view distance value according to the given index
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: View Distance Index <SCALAR>
|
* 0: View Distance Index <SCALAR>
|
||||||
@ -22,18 +22,21 @@ PARAMS_1(_index);
|
|||||||
private ["_return"];
|
private ["_return"];
|
||||||
|
|
||||||
_return = switch (_index) do {
|
_return = switch (_index) do {
|
||||||
case 0: {1500};
|
case 0: {-1};
|
||||||
case 1: {2000};
|
case 1: {500};
|
||||||
case 2: {2500};
|
case 2: {1000};
|
||||||
case 3: {3000};
|
case 3: {1500};
|
||||||
case 4: {3500};
|
case 4: {2000};
|
||||||
case 5: {4000};
|
case 5: {2500};
|
||||||
case 6: {5000};
|
case 6: {3000};
|
||||||
case 7: {6000};
|
case 7: {3500};
|
||||||
case 8: {7000};
|
case 8: {4000};
|
||||||
case 9: {8000};
|
case 9: {5000};
|
||||||
case 10: {9000};
|
case 10: {6000};
|
||||||
case 11: {10000};
|
case 11: {7000};
|
||||||
|
case 12: {8000};
|
||||||
|
case 13: {9000};
|
||||||
|
case 14: {10000};
|
||||||
default {1000};
|
default {1000};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user