2015-05-10 10:00:19 +00:00
|
|
|
/*
|
|
|
|
* Author: Winter
|
|
|
|
* Sets the player's current view distance according to whether s/he is on foot, in a land vehicle or in an air vehicle.
|
2015-05-14 18:24:35 +00:00
|
|
|
*
|
2015-05-10 10:00:19 +00:00
|
|
|
* Arguments:
|
2015-05-10 10:15:34 +00:00
|
|
|
* 0: Show Prompt <BOOL>
|
2015-05-10 10:00:19 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-12 18:16:01 +00:00
|
|
|
* [] call ace_viewdistance_fnc_adaptViewDistance
|
2015-05-10 10:00:19 +00:00
|
|
|
*
|
2015-05-14 16:25:41 +00:00
|
|
|
* Public: No
|
2015-05-10 10:00:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-04-14 11:52:20 +00:00
|
|
|
params ["_showPrompt"];
|
2015-08-04 02:24:30 +00:00
|
|
|
|
2015-05-14 19:36:12 +00:00
|
|
|
if (!GVAR(enabled) || isNull ACE_player) exitWith {};
|
2015-05-14 18:24:35 +00:00
|
|
|
|
2016-04-14 11:52:20 +00:00
|
|
|
private _vehicle = vehicle ACE_player;
|
|
|
|
|
|
|
|
private _landVehicle = _vehicle isKindOf "LandVehicle" || _vehicle isKindOf "Ship_F";
|
|
|
|
private _airVehicle = _vehicle isKindOf "Air";
|
2015-05-10 10:00:19 +00:00
|
|
|
|
2016-04-14 11:52:20 +00:00
|
|
|
if (!_landVehicle && !_airVehicle) exitWith {
|
|
|
|
[GVAR(viewDistanceOnFoot), _showPrompt] call FUNC(changeViewDistance);
|
2015-05-10 10:00:19 +00:00
|
|
|
};
|
|
|
|
|
2016-04-14 11:52:20 +00:00
|
|
|
if (_landVehicle) exitWith {
|
|
|
|
[GVAR(viewDistanceLandVehicle), _showPrompt] call FUNC(changeViewDistance);
|
2015-05-10 10:00:19 +00:00
|
|
|
};
|
|
|
|
|
2016-04-14 11:52:20 +00:00
|
|
|
if (_airVehicle) exitWith {
|
|
|
|
[GVAR(viewDistanceAirVehicle), _showPrompt] call FUNC(changeViewDistance);
|
2015-08-12 18:16:01 +00:00
|
|
|
};
|