mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Modify changeViewDistance so:
- Displays objects distance percentage instead of coeficient - Only display that if not off
This commit is contained in:
parent
7a6fb54654
commit
2027a28959
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Author: Winter
|
||||
* Sets the player's current view distance according to allowed values.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Arguments:
|
||||
* 0: View Distance setting INDEX <SCALAR>
|
||||
@ -26,23 +26,21 @@ _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.
|
||||
_view_distance_limit = GVAR(limitViewDistance); // Grab the limit
|
||||
|
||||
if (_new_view_distance <= _view_distance_limit) then {
|
||||
if (_show_prompt) then {
|
||||
_text = parseText format ["<t align='center'>View Distance: %1<br />Object View Distance Coefficient: %2</t>",str(_new_view_distance),str(_object_view_distance_coeff)];
|
||||
[_text,2] call EFUNC(common,displayTextStructured);
|
||||
if (_show_prompt) then {
|
||||
_text = if (_new_view_distance <= _view_distance_limit) then {
|
||||
format ["<t align='center'>View Distance: %1m",str(_new_view_distance)];
|
||||
} else {
|
||||
format ["<t align='center'>That option is invalid! The limit is %1m",str(_view_distance_limit)];
|
||||
};
|
||||
|
||||
if (GVAR(objectViewDistanceCoeff) > 0) then {
|
||||
_text = _text + format ["<br/><t align='center'>Object View Distance is %1%2</t>",str(_object_view_distance_coeff * 100),"%"];
|
||||
};
|
||||
setViewDistance _new_view_distance;
|
||||
if (_object_view_distance_coeff > 0) then {
|
||||
setObjectViewDistance (_object_view_distance_coeff * _new_view_distance);
|
||||
};
|
||||
}
|
||||
else {
|
||||
if (_show_prompt) then {
|
||||
_text = parseText format ["<t align='center'>That option is invalid! The limit is: %1<br />Object View Distance Coefficient: %2</t>",str(_view_distance_limit),str(_object_view_distance_coeff)];
|
||||
[_text,2] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
setViewDistance _view_distance_limit;
|
||||
if (_object_view_distance_coeff > 0) then {
|
||||
setObjectViewDistance (_object_view_distance_coeff * _view_distance_limit);
|
||||
};
|
||||
};
|
||||
[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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user