From 2c8dddfc473fe156576bd8bba288f0bee00fadd5 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 09:28:48 +0200 Subject: [PATCH] Adding required files --- addons/viewdistance/ACE_Settings.hpp | 9 +++++++ addons/viewdistance/config.cpp | 5 ++-- .../functions/fnc_changeViewDistance.sqf | 24 +++++++++++++++++++ addons/viewdistance/functions/fnc_empty.sqf | 3 --- 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 addons/viewdistance/ACE_Settings.hpp create mode 100644 addons/viewdistance/functions/fnc_changeViewDistance.sqf delete mode 100644 addons/viewdistance/functions/fnc_empty.sqf diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp new file mode 100644 index 0000000000..572358876a --- /dev/null +++ b/addons/viewdistance/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(viewdistance) { + typeName = "SCALAR"; + isClientSettable = 1; + values[] = {1500,2000,2500,3000,3500,4000,5000,6000,7000,8000,9000,10000}; + displayName = "View Distance"; // has to be changed to string table type + description = "Change View Distance"; + }; +}; \ No newline at end of file diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp index a7b7bae6df..dcffe0f257 100644 --- a/addons/viewdistance/config.cpp +++ b/addons/viewdistance/config.cpp @@ -6,10 +6,11 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {""}; - authorUrl = ""; + author[] = {"Winter"}; + authorUrl = "https://github.com/Winter259"; VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf new file mode 100644 index 0000000000..4543be000b --- /dev/null +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -0,0 +1,24 @@ +/* + * Author: Winter + * Sets the player's current view distance according to allowed values. + * + * + * Arguments: + * 0: View Distance Setting (SCALAR) + * + * Return Value: + * None + * + * Example: + * [1500] call ace_common_fnc_imanexample + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_new_view_distance"]; + +_new_view_distance = _this select 0; + +player setViewDistance (_new_view_distance); \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_empty.sqf b/addons/viewdistance/functions/fnc_empty.sqf deleted file mode 100644 index c60a82b2d8..0000000000 --- a/addons/viewdistance/functions/fnc_empty.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -diag_log text format["This is here as an example!!!"];