2015-05-08 07:28:48 +00:00
|
|
|
/*
|
|
|
|
* Author: Winter
|
|
|
|
* Sets the player's current view distance according to allowed values.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-05-08 12:14:15 +00:00
|
|
|
* None
|
2015-05-08 07:28:48 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-05-08 12:14:15 +00:00
|
|
|
* [] call ace_viewdistance_fnc_changeViewDistance;
|
2015-05-08 07:28:48 +00:00
|
|
|
*
|
2015-05-08 13:36:47 +00:00
|
|
|
* Public: Yes
|
2015-05-08 07:28:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-05-08 13:27:13 +00:00
|
|
|
private ["_text","_new_view_distance","_view_distance_limit"];
|
2015-05-08 12:49:52 +00:00
|
|
|
|
2015-05-08 14:07:57 +00:00
|
|
|
// Change the received index number into an actual view distance number as set in the config:
|
2015-05-08 12:49:52 +00:00
|
|
|
_new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue);
|
2015-05-08 14:07:57 +00:00
|
|
|
|
2015-05-08 16:30:28 +00:00
|
|
|
_view_distance_limit = [] call FUNC(returnViewDistanceLimit);
|
2015-05-08 12:49:52 +00:00
|
|
|
|
2015-05-08 16:30:28 +00:00
|
|
|
if (_new_view_distance > _view_distance_limit) then {
|
|
|
|
_text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)];
|
|
|
|
[_text,1] call EFUNC(common,displayTextStructured);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
_text = composeText ["View distance successfully changed to: ",str(_new_view_distance)];
|
|
|
|
[_text,1] call EFUNC(common,displayTextStructured);
|
|
|
|
setViewDistance _new_view_distance;
|
|
|
|
};
|