mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1757 from Winter259/viewdistance-settings-init
Viewdistance settingsInitialized
This commit is contained in:
commit
9d0dcc5ea2
@ -2,28 +2,33 @@
|
|||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
// Force the view distance down to the limit.
|
["SettingsInitialized", {
|
||||||
if (GVAR(enabled) && {viewDistance > GVAR(limitViewDistance)}) then {
|
// if not enabled, then bugger off.
|
||||||
setViewDistance GVAR(limitViewDistance);
|
if !(GVAR(enabled) exitWith {};
|
||||||
};
|
|
||||||
|
// Force the view distance down to the limit.
|
||||||
// Adapt view distance when the player is created or changed according to whether client is on foot or vehicle.
|
if (viewDistance > GVAR(limitViewDistance)) then {
|
||||||
["playerChanged",{
|
setViewDistance GVAR(limitViewDistance);
|
||||||
[false] call FUNC(adaptViewDistance);
|
|
||||||
}] call ace_common_fnc_addEventHandler;
|
|
||||||
|
|
||||||
// Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately
|
|
||||||
["SettingChanged",{
|
|
||||||
if ((_this select 0 == QGVAR(viewDistanceOnFoot)) ||
|
|
||||||
(_this select 0 == QGVAR(viewDistanceLandVehicle)) ||
|
|
||||||
(_this select 0 == QGVAR(viewDistanceAirVehicle)) ||
|
|
||||||
(_this select 0 == QGVAR(objectViewDistanceCoeff))) then {
|
|
||||||
|
|
||||||
[true] call FUNC(adaptViewDistance);
|
|
||||||
};
|
};
|
||||||
}] call ace_common_fnc_addEventHandler;
|
|
||||||
|
// Adapt view distance when the player is created or changed according to whether client is on foot or vehicle.
|
||||||
|
["playerChanged",{
|
||||||
|
[false] call FUNC(adaptViewDistance);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
|
// Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately
|
||||||
|
["SettingChanged",{
|
||||||
|
if ((_this select 0 == QGVAR(viewDistanceOnFoot)) ||
|
||||||
|
(_this select 0 == QGVAR(viewDistanceLandVehicle)) ||
|
||||||
|
(_this select 0 == QGVAR(viewDistanceAirVehicle)) ||
|
||||||
|
(_this select 0 == QGVAR(objectViewDistanceCoeff))) then {
|
||||||
|
|
||||||
// Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle
|
[true] call FUNC(adaptViewDistance);
|
||||||
["playerVehicleChanged",{
|
};
|
||||||
[false] call FUNC(adaptViewDistance)
|
}] call EFUNC(common,addEventHandler);
|
||||||
}] call ace_common_fnc_addEventHandler;
|
|
||||||
|
// Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle
|
||||||
|
["playerVehicleChanged",{
|
||||||
|
[false] call FUNC(adaptViewDistance)
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
Loading…
Reference in New Issue
Block a user