Suppress prompts when changing vehicle.

They're only shown when the player changes the setting.
This commit is contained in:
SAM 2015-05-10 12:15:34 +02:00
parent 69648f0e1b
commit c05a91f530
3 changed files with 11 additions and 9 deletions

View File

@ -4,7 +4,7 @@
*
*
* Arguments:
* None
* 0: Show Prompt <BOOL>
*
* Return Value:
* None
@ -17,19 +17,21 @@
#include "script_component.hpp"
PARAMS_1(_show_prompt);
private["_land_vehicle","_air_vehicle"];
_land_vehicle = (vehicle player) isKindOf "LandVehicle";
_air_vehicle = (vehicle player) isKindOf "Air";
if (!_land_vehicle && !_air_vehicle) exitWith {
[GVAR(viewDistanceOnFoot),true] call FUNC(changeViewDistance);
[GVAR(viewDistanceOnFoot),_show_prompt] call FUNC(changeViewDistance);
};
if (_land_vehicle) exitWith {
[GVAR(viewDistanceLandVehicle),true] call FUNC(changeViewDistance);
[GVAR(viewDistanceLandVehicle),_show_prompt] call FUNC(changeViewDistance);
};
if (_air_vehicle) exitWith {
[GVAR(viewDistanceAirVehicle),true] call FUNC(changeViewDistance);
[GVAR(viewDistanceAirVehicle),_show_prompt] call FUNC(changeViewDistance);
};

View File

@ -26,7 +26,7 @@ _view_distance_limit = GVAR(limitViewDistance); // Grab the limit
if (_new_view_distance <= _view_distance_limit) then {
if (_prompt) then {
_text = composeText ["View distance: ",str(_new_view_distance)];
_text = composeText ["View distance successfully changed to: ",str(_new_view_distance)];
[_text,1] call EFUNC(common,displayTextStructured);
};
setViewDistance _new_view_distance;

View File

@ -23,15 +23,15 @@ if (viewDistance > GVAR(limitViewDistance)) then {
setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit.
setObjectViewDistance (0.8 * GVAR(limitViewDistance));
} else {
[] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle.
[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 their vehicle for the changes to have effect.)
// 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 {
[] call FUNC(adaptViewDistance);
[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",{[] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler;
["playerVehicleChanged",{[false] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler;