ACE3/addons/microdagr/XEH_clientInit.sqf

43 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-03-09 15:46:59 +00:00
//XEH_clientInit.sqf
#include "script_component.hpp"
if (!hasInterface) exitWith {};
2015-05-10 20:17:50 +00:00
//Add deviceKey entry:
private ["_conditonCode", "_toggleCode", "_closeCode"];
_conditonCode = {
2015-06-06 00:46:19 +00:00
("ACE_microDAGR" in (items ACE_player))
};
_toggleCode = {
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {};
[] call FUNC(openDisplay); //toggle display mode
};
_closeCode = {
2015-06-06 00:46:19 +00:00
if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {};
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
};
2015-06-06 00:46:19 +00:00
[(localize LSTRING(itemName)), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew);
2015-03-09 15:46:59 +00:00
//Add Eventhandler:
["RangerfinderData", {_this call FUNC(recieveRangefinderData)}] call EFUNC(common,addEventHandler);
//Global Variables to default:
2015-03-11 07:06:07 +00:00
GVAR(gpsPositionASL) = [0,0,0];
2015-03-09 15:46:59 +00:00
GVAR(mapAutoTrackPosition) = true;
GVAR(mapShowTexture) = false;
GVAR(mapPosition) = [-999, -999];
GVAR(mapZoom) = 0.075;
GVAR(currentApplicationPage) = APP_MODE_NULL;
GVAR(currentShowMode) = DISPLAY_MODE_CLOSED;
2015-03-11 02:48:57 +00:00
//User Settings
GVAR(settingUseMils) = false;
GVAR(settingShowAllWaypointsOnMap) = true;
2015-03-09 15:46:59 +00:00
GVAR(newWaypointPosition) = [];
GVAR(currentWaypoint) = -1;
GVAR(rangeFinderPositionASL) = [];
2015-03-09 18:52:15 +00:00
GVAR(mgrsGridZoneDesignator) = format ["%1 %2",EGVAR(common,MGRS_data) select 0, EGVAR(common,MGRS_data) select 1];