mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make viewdistance disabable through settings and module
This commit is contained in:
parent
195643d557
commit
a9197a8e33
@ -1,4 +1,10 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(enabled) {
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
displayName = "Enable ACE viewdistance";
|
||||
description = "Enables ACE viewdistance module.";
|
||||
};
|
||||
class GVAR(viewDistanceOnFoot) {
|
||||
typeName = "SCALAR";
|
||||
isClientSettable = 1;
|
||||
|
@ -9,6 +9,12 @@ class CfgVehicles {
|
||||
isGlobal = 1;
|
||||
//icon = ""; // needs an icon
|
||||
class Arguments {
|
||||
class moduleViewDistanceEnabled {
|
||||
displayName = "Enable ACE viewdistance";
|
||||
description = "Enables ACE viewdistance";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class moduleViewDistanceLimit {
|
||||
displayName = "View Distance Limit";
|
||||
description = "Sets the limit for how high clients can raise their view distance (<= 10000)";
|
||||
|
@ -3,7 +3,7 @@
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
// Force the view distance down to the limit.
|
||||
if (viewDistance > GVAR(limitViewDistance)) then {
|
||||
if (GVAR(enabled) && {viewDistance > GVAR(limitViewDistance)}) then {
|
||||
setViewDistance GVAR(limitViewDistance);
|
||||
};
|
||||
|
||||
|
@ -21,7 +21,7 @@ PARAMS_1(_show_prompt);
|
||||
|
||||
private["_land_vehicle","_air_vehicle"];
|
||||
|
||||
if (isNull ACE_player) exitWith {};
|
||||
if (!GVAR(enabled) || isNull ACE_player) exitWith {};
|
||||
|
||||
_land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle";
|
||||
_air_vehicle = (vehicle ACE_player) isKindOf "Air";
|
||||
|
@ -23,6 +23,7 @@ if (!_activated) exitWith {
|
||||
diag_log text "[ACE]: View Distance Limit Module is placed but NOT active.";
|
||||
};
|
||||
|
||||
[_logic, QGVAR(enabled),"moduleViewDistanceEnabled"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(limitViewDistance),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limitViewDistance)];
|
Loading…
Reference in New Issue
Block a user