mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Adding required files for module integration
This commit is contained in:
parent
5732015370
commit
6cda97e3a0
20
addons/viewdistance/CfgVehicles.hpp
Normal file
20
addons/viewdistance/CfgVehicles.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
class CfgVehicles {
|
||||
class Module_F;
|
||||
class ACE_ModuleViewDistance : Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "View Distance Limit";
|
||||
function = QFUNC(moduleViewDistance);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
//icon = ""; // needs an icon
|
||||
class Arguments {
|
||||
class ViewDistanceLimit {
|
||||
displayName = "View Distance setting limit";
|
||||
description = "Sets the limit for how high clients can raise their view distance (< 10,000)";
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 10000;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,4 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
[] call FUNC(moduleViewDistance);
|
||||
if (!hasInterface || !GVAR(enabled)) exitWith {};
|
||||
[] call FUNC(initViewDistance);
|
@ -19,9 +19,12 @@
|
||||
|
||||
private ["_text","_new_view_distance","_view_distance_limit"];
|
||||
|
||||
// Change the received index number into an actual view distance number as set in the config:
|
||||
_new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue);
|
||||
|
||||
_view_distance_limit = [GVAR(topViewDistanceLimit)] call FUNC(returnViewDistanceValue);
|
||||
|
||||
|
||||
if !GVAR(changeAllowed) then {
|
||||
_text = "You are not allowed to change the view distance!";
|
||||
[_text,2] call EFUNC(common,displayTextStructured);
|
||||
|
@ -15,9 +15,15 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!isServer) exitWith {};
|
||||
/*
|
||||
if (!isServer) exitWith {
|
||||
GVAR(modulePresent) = false
|
||||
};
|
||||
|
||||
PARAMS_2(_logic,_activated);
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
*/
|
||||
|
||||
GVAR(modulePresent) = true;
|
||||
publicVariable QGVAR(modulePresent);
|
||||
|
||||
diag_log text "[ACE]: ViewDistance Module Initialized.";
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Author: Winter
|
||||
* Returns the view distance limit depending on either the config or (if present) the module.
|
||||
*
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* View Distance Limit <SCALAR>
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_viewdistance_fnc_returnViewDistanceLimit;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if GVAR(modulePresent) then {
|
||||
// module always takes priority
|
||||
_view_distance_limit =
|
||||
} else {
|
||||
|
||||
};
|
||||
// To do: add a check against a module limit.
|
@ -17,9 +17,9 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_index","_return"];
|
||||
PARAMS_1(_index);
|
||||
|
||||
_index = _this select 0;
|
||||
private ["_return"];
|
||||
_return = 0;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user