mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merged fnc_init.sqf into XEH_postInit.sqf
This commit is contained in:
parent
283768fabb
commit
495e94f3f0
@ -1,3 +1,20 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
[] call FUNC(init);
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
if (viewDistance > GVAR(limitViewDistance)) then {
|
||||
setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit.
|
||||
setObjectViewDistance (0.8 * GVAR(limitViewDistance));
|
||||
} else {
|
||||
[true] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle.
|
||||
};
|
||||
|
||||
// Set the EH which waits for any of the view distance settings to be changed, avoids the player having to enter or leave a vehicle for the changes to have effect.
|
||||
["SettingChanged",{
|
||||
if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || (_this select 0 == QGVAR(viewDistanceLandVehicle)) || (_this select 0 == QGVAR(viewDistanceAirVehicle))) then {
|
||||
[true] call FUNC(adaptViewDistance);
|
||||
};
|
||||
},true] call ace_common_fnc_addEventHandler;
|
||||
|
||||
// Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle
|
||||
["playerVehicleChanged",{[false] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler;
|
@ -3,7 +3,6 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(initModule);
|
||||
PREP(init);
|
||||
PREP(returnValue);
|
||||
PREP(changeViewDistance);
|
||||
PREP(adaptViewDistance);
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Author: Winter
|
||||
* Assigns the Event Handler which triggers when a player adjusts their view distance in the menu
|
||||
*
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_viewdistance_fnc_initViewDistance;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
if (viewDistance > GVAR(limitViewDistance)) then {
|
||||
setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit.
|
||||
setObjectViewDistance (0.8 * GVAR(limitViewDistance));
|
||||
} else {
|
||||
[true] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle.
|
||||
};
|
||||
|
||||
// Set the EH which waits for any of the view distance settings to be changed, avoids the player having to enter or leave a vehicle for the changes to have effect.
|
||||
["SettingChanged",{
|
||||
if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || (_this select 0 == QGVAR(viewDistanceLandVehicle)) || (_this select 0 == QGVAR(viewDistanceAirVehicle))) then {
|
||||
[true] call FUNC(adaptViewDistance);
|
||||
};
|
||||
},true] call ace_common_fnc_addEventHandler;
|
||||
|
||||
// Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle
|
||||
["playerVehicleChanged",{[false] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler;
|
Loading…
Reference in New Issue
Block a user