Adding required files for module integration

This commit is contained in:
SAM 2015-05-08 16:07:57 +02:00
parent 5732015370
commit 6cda97e3a0
6 changed files with 61 additions and 5 deletions

View 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;
};
};
};
};

View File

@ -1,4 +1,5 @@
#include "script_component.hpp"
[] call FUNC(moduleViewDistance);
if (!hasInterface || !GVAR(enabled)) exitWith {};
[] call FUNC(initViewDistance);

View File

@ -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);

View File

@ -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.";

View File

@ -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.

View File

@ -17,9 +17,9 @@
#include "script_component.hpp"
private ["_index","_return"];
PARAMS_1(_index);
_index = _this select 0;
private ["_return"];
_return = 0;