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"
|
|
|
|
|
|
|
|
private["_land_vehicle","_air_vehicle"];
|
|
|
|
|
2015-08-04 02:24:30 +00:00
|
|
|
params ["_show_prompt"];
|
|
|
|
|
2015-05-14 19:36:12 +00:00
|
|
|
if (!GVAR(enabled) || isNull ACE_player) exitWith {};
|
2015-05-14 18:24:35 +00:00
|
|
|
|
2015-05-10 10:54:53 +00:00
|
|
|
_land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle";
|
|
|
|
_air_vehicle = (vehicle ACE_player) isKindOf "Air";
|
2015-05-10 10:00:19 +00:00
|
|
|
|
|
|
|
if (!_land_vehicle && !_air_vehicle) exitWith {
|
2015-05-10 10:15:34 +00:00
|
|
|
[GVAR(viewDistanceOnFoot),_show_prompt] call FUNC(changeViewDistance);
|
2015-05-10 10:00:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (_land_vehicle) exitWith {
|
2015-05-10 10:15:34 +00:00
|
|
|
[GVAR(viewDistanceLandVehicle),_show_prompt] call FUNC(changeViewDistance);
|
2015-05-10 10:00:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (_air_vehicle) exitWith {
|
2015-05-10 10:15:34 +00:00
|
|
|
[GVAR(viewDistanceAirVehicle),_show_prompt] call FUNC(changeViewDistance);
|
2015-08-12 18:16:01 +00:00
|
|
|
};
|