mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
add getVariable, setVariable macros
This commit is contained in:
parent
de8ca47e88
commit
ddbc54b992
@ -184,6 +184,21 @@
|
|||||||
|
|
||||||
#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2)
|
#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2)
|
||||||
|
|
||||||
|
|
||||||
|
#define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)]
|
||||||
|
#define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)]
|
||||||
|
#define SETGVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)]
|
||||||
|
|
||||||
|
#define GETVAR(var1,var2,var3) (var1 GETVAR_SYS(var2,var3))
|
||||||
|
#define GETMVAR(var1,var2) (missionNamespace GETVAR_SYS(var1,var2))
|
||||||
|
#define GETUVAR(var1,var2) (uiNamespace GETVAR_SYS(var1,var2))
|
||||||
|
|
||||||
|
#define SETVAR(var1,var2,var3) (var1 SETVAR_SYS(var2,var3))
|
||||||
|
#define SETGVAR(var1,var2,var3) (var1 SETGVAR_SYS(var2,var3))
|
||||||
|
#define SETMVAR(var1,var2) (missionNamespace SETVAR_SYS(var1,var2))
|
||||||
|
#define SETUVAR(var1,var2) (uiNamespace SETVAR_SYS(var1,var2))
|
||||||
|
|
||||||
|
|
||||||
#ifdef DISABLE_COMPILE_CACHE
|
#ifdef DISABLE_COMPILE_CACHE
|
||||||
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))
|
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))
|
||||||
#else
|
#else
|
||||||
|
3
addons/vector/functions/fnc_convertMeterToFeet.sqf
Normal file
3
addons/vector/functions/fnc_convertMeterToFeet.sqf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// by commy2
|
||||||
|
|
||||||
|
3.28084 * (_this select 0)
|
@ -1,12 +1,12 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private "_dlgVectorOptics";
|
private "_dlgVector";
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_dlgVectorOptics = uiNamespace getVariable ['AGM_dlgVectorOptics', displayNull];
|
_dlgVector = uiNamespace getVariable ["AGM_dlgVector", displayNull];
|
||||||
|
|
||||||
[
|
[
|
||||||
round parseNumber ctrlText (_dlgVectorOptics displayCtrl 156),
|
round parseNumber ctrlText (_dlgVector displayCtrl 156),
|
||||||
round parseNumber ctrlText (_dlgVectorOptics displayCtrl 182)
|
round parseNumber ctrlText (_dlgVector displayCtrl 182)
|
||||||
]
|
]
|
||||||
|
@ -2,25 +2,24 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define MIN_DISTANCE 10
|
#define MIN_DISTANCE 10
|
||||||
#define MAX_DISTANCE ([6000, 9000] select (AGM_vectorSettings select 3))
|
#define MAX_DISTANCE ([6000, 9000] select GVAR(useFeet))
|
||||||
#define INTERVAL 2
|
|
||||||
|
|
||||||
private ["_dlgVectorOptics", "_distance"];
|
private ["_dlgVector", "_distance"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_dlgVectorOptics = uiNamespace getVariable ['AGM_dlgVectorOptics', displayNull];
|
_dlgVector = GETUVAR(AGM_dlgVector,displayNull);
|
||||||
|
|
||||||
_distance = ctrlText (_dlgVectorOptics displayCtrl 151);
|
_distance = ctrlText (_dlgVector displayCtrl 151);
|
||||||
|
|
||||||
if (_distance == "----") exitWith {-9999};
|
if (_distance == "----") exitWith {-1};
|
||||||
|
|
||||||
_distance = round parseNumber _distance;
|
_distance = round parseNumber _distance;
|
||||||
|
|
||||||
if (AGM_vectorSettings select 3) then {
|
if (GVAR(useFeet)) then {
|
||||||
_distance = 3.28084 * _distance;
|
_distance = 3.28084 * _distance;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_distance > MAX_DISTANCE) exitWith {-9999};
|
if (_distance > MAX_DISTANCE) exitWith {-1};
|
||||||
if (_distance < MIN_DISTANCE) exitWith {-9999};
|
if (_distance < MIN_DISTANCE) exitWith {-1};
|
||||||
|
|
||||||
_distance
|
_distance
|
||||||
|
Loading…
Reference in New Issue
Block a user