2015-05-08 12:14:15 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-05-10 11:04:08 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2016-05-24 13:13:11 +00:00
|
|
|
["ace_settingsInitialized", {
|
2015-06-28 08:18:53 +00:00
|
|
|
// if not enabled, then bugger off.
|
2015-07-01 17:39:49 +00:00
|
|
|
if !(GVAR(enabled)) exitWith {};
|
2015-08-12 18:16:01 +00:00
|
|
|
|
2015-08-21 22:33:16 +00:00
|
|
|
// Limit on load
|
|
|
|
[false] call FUNC(adaptViewDistance);
|
2015-08-12 18:16:01 +00:00
|
|
|
|
2015-06-28 08:18:53 +00:00
|
|
|
// Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately
|
2016-05-25 00:19:50 +00:00
|
|
|
["ace_settingChanged",{
|
2015-08-12 18:16:01 +00:00
|
|
|
params ["_name"];
|
|
|
|
if ((_name == QGVAR(viewDistanceOnFoot)) ||
|
|
|
|
(_name == QGVAR(viewDistanceLandVehicle)) ||
|
|
|
|
(_name == QGVAR(viewDistanceAirVehicle)) ||
|
|
|
|
(_name == QGVAR(objectViewDistanceCoeff))) then {
|
2015-06-28 08:18:53 +00:00
|
|
|
|
|
|
|
[true] call FUNC(adaptViewDistance);
|
|
|
|
};
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-05-14 15:44:35 +00:00
|
|
|
|
2015-06-28 08:18:53 +00:00
|
|
|
// Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle
|
2015-08-21 22:33:16 +00:00
|
|
|
// Also run when SettingsInitialized runs (not guaranteed)
|
2016-06-21 23:39:20 +00:00
|
|
|
["vehicle",{
|
2016-04-14 11:52:20 +00:00
|
|
|
[false] call FUNC(adaptViewDistance);
|
2016-06-21 23:39:20 +00:00
|
|
|
}] call CBA_fnc_addPlayerEventHandler;
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|