Working Base MicroDAGR

This commit is contained in:
PabstMirror 2015-03-09 10:46:59 -05:00
parent 107fec4245
commit f387da1475
46 changed files with 1767 additions and 0 deletions

BIN
addons/microdagr.zip Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
z\ace\addons\microdagr

View File

@ -0,0 +1,11 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
};
};

View File

@ -0,0 +1,17 @@
class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_F;
class ACE_microDAGR: ACE_ItemCore {
author = "$STR_ACE_Common_ACETeam";
scope = 2;
displayName = "$STR_ACE_microdagr_itemName";
descriptionShort = "$STR_ACE_microdagr_itemDescription";
picture = QUOTE(PATHTOF(images\microDAGR_item.paa));
icon = "iconObject_circle";
mapSize = 0.034;
class ItemInfo: InventoryItem_Base_F {
mass = 2;
};
};
};

View File

@ -0,0 +1,69 @@
//XEH_clientInit.sqf
#include "script_component.hpp"
if (!hasInterface) exitWith {};
//Add Keybinds:
["ACE3", QGVAR(openGPS), "Open GPS",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (!("ACE_microDAGR" in (items ace_player))) exitWith {false};
[] call FUNC(openDisplay);
true;
},
{false},
[0xC7, [false, false, false]], false] call cba_fnc_addKeybind; //Home Key
["ACE3", QGVAR(closeGpS), "Close GPS",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if (!("ACE_microDAGR" in (items ace_player))) exitWith {false};
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
true;
},
{false},
[0xC7, [false, true, false]], false] call cba_fnc_addKeybind; //CTRL + Home Key
//Add Eventhandler:
["RangerfinderData", {_this call FUNC(recieveRangefinderData)}] call EFUNC(common,addEventHandler);
//Global Variables to default:
GVAR(mapAutoTrackPosition) = true;
GVAR(mapShowTexture) = false;
GVAR(mapPosition) = [-999, -999];
GVAR(mapZoom) = 0.075;
GVAR(currentApplicationPage) = APP_MODE_NULL;
GVAR(currentShowMode) = DISPLAY_MODE_CLOSED;
GVAR(newWaypointPosition) = [];
GVAR(currentWaypoint) = -1;
GVAR(rangeFinderPositionASL) = [];
GVAR(waypointList) = [["Alpha Base", [4000, 4000, 69]], ["Bravo Base", [5000, 5000, 0]]];
GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset");
//Calculate the map's MGRS:
_worldMapLong = getNumber (configFile >> "CfgWorlds" >> worldName >> "longitude");
_worldMapLat = getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude");
//Pull UTM grid from world's long/lat
_zone = 1 + (floor ((_worldMapLong + 180) / 6));
_band = "Z";
if (_worldMapLat <= -80) then {
_band = "A";
} else {
if (_worldMapLat < 84) then {
_band = "CDEFGHJKLMNPQRSTUVWXX" select [(floor ((_worldMapLat / 8) + 10)), 1];
};
};
//calculating square ID from long/lat is a pain in the ass, just fake it unless someone wants to actualy do this
_squareID = if ((count worldName) > 2) then {toUpper(worldName select [0,2])} else {"XG"};
GVAR(mgrsGridZoneDesignator) = format ["%1%2 %3", _zone, _band, _squareID];

View File

@ -0,0 +1,19 @@
#include "script_component.hpp"
ADDON = false;
PREP(appMarkKeypadEntry);
PREP(appMenuButtonConnectRangefinder);
PREP(appWaypointsButtonDeleteWP);
PREP(appWaypointsButtonSetWP);
PREP(dialogClosedEH);
PREP(mapDoubleTapEH);
PREP(mapOnDrawEH);
PREP(modeMapButtons);
PREP(openDisplay);
PREP(recieveRangefinderData);
PREP(saveCurrentAndSetNewMode);
PREP(showApplicationPage);
PREP(updateDisplay);
ADDON = true;

View File

@ -0,0 +1,16 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"PabstMirror"};
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "gui.hpp"

View File

@ -0,0 +1,54 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_1(_keypadButton);
disableSerialization;
_display = (uiNamespace getVariable ["testGPS", displayNull]);
if (isNull _display) then {
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
};
if (isNull _display) exitWith {};
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};
_editText = ctrlText (_display displayCtrl IDC_MODEMARK_CORDSEDIT);
switch (_keypadButton) do {
case ("ok"): {
if ((count GVAR(newWaypointPosition)) == 0) then {
_actualPos = [9000,9000,0];
GVAR(newWaypointPosition) = _actualPos;
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);
} else {
GVAR(waypointList) pushBack [_editText, GVAR(newWaypointPosition)];
[APP_MODE_WAYPOINTS] call FUNC(saveCurrentAndSetNewMode);
};
};
case ("del"): {
_editText = _editText select [0, (((count _editText) - 1) max 0)];
(_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText _editText;
ctrlSetFocus (_display displayCtrl IDC_MODEMARK_CORDSEDIT);
};
default {
_editText = _editText + _keypadButton;
(_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText _editText;
ctrlSetFocus (_display displayCtrl IDC_MODEMARK_CORDSEDIT);
};
};

View File

@ -0,0 +1,22 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2};
GVAR(rangeFinderPositionASL) = [];
[APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode);

View File

@ -0,0 +1,36 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
disableSerialization;
_display = (uiNamespace getVariable ["testGPS", displayNull]);
if (isNull _display) then { _display = (uiNamespace getVariable ["testGPS_T", displayNull]);};
if (isNull _display) exitWith {};
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
if ((_wpIndex < 0) || (_wpIndex > ((count GVAR(waypointList)) - 1))) exitWith {
ERROR("out of bounds wp");
};
//If it's our currentWP then deactivate
if (GVAR(currentWaypoint) == _wpIndex) then {GVAR(currentWaypoint) = -1};
//Delete from list:
GVAR(waypointList) deleteAt _wpIndex;
//Update list now:
[] call FUNC(updateDisplay);

View File

@ -0,0 +1,30 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
disableSerialization;
_wpButton = _this select 0;
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
_newWpIndex = lbCurSel _wpListBox;
if ((_newWpIndex < 0) || (_newWpIndex > ((count GVAR(waypointList)) - 1))) exitWith {
GVAR(currentWaypoint) = -1;
ERROR("out of bounds wp");
};
GVAR(currentWaypoint) = _newWpIndex;
[APP_MODE_COMPASS] call FUNC(saveCurrentAndSetNewMode);

View File

@ -0,0 +1,24 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
systemChat "Debug: dialog closed";
if (GVAR(currentShowMode) == 2) then {
[-1] call FUNC(saveCurrentAndSetNewMode);;
[DISPLAY_MODE_DISPLAY] call FUNC(openDisplay);
};

View File

@ -0,0 +1,27 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
if (_mouseButton != 0) exitWith {};
_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
_worldPos set [2, (getTerrainHeightASL _worldPos)];
GVAR(newWaypointPosition) = _worldPos;
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);

View File

@ -0,0 +1,52 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
_theMap = _this select 0;
_mapSize = (ctrlPosition _theMap) select 3;
if (GVAR(currentApplicationPage) == 1) then {
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
ctrlMapAnimCommit _theMap;
_size = 412 * _mapSize;
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ];
if (GVAR(currentWaypoint) != -1) then {
_targetPos = [];
if (GVAR(currentWaypoint) == -2) then {
if ((count GVAR(rangeFinderPositionASL)) == 3) then {
_targetPos = GVAR(rangeFinderPositionASL);
};
} else {
_targetPos = (GVAR(waypointList) select GVAR(currentWaypoint)) select 1;
};
if ((count _targetPos) == 3) then {
_relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo;
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ];
};
};
} else { //Map Mode:
if (GVAR(mapAutoTrackPosition)) then {
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), GVAR(gpsPositionASL)];
ctrlMapAnimCommit _theMap;
};
_size = 30 * _mapSize;
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], GVAR(gpsPositionASL), _size, _size, (getDir ace_player), '', 0 ];
};

View File

@ -0,0 +1,33 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
_mode = _this select 0;
[-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom
if (_mode == "autotrack") then {
GVAR(mapAutoTrackPosition) = !GVAR(mapAutoTrackPosition);
} else {
if (_mode == "zoomin") then {
GVAR(mapZoom) = GVAR(mapZoom) * (10/11);
} else {
GVAR(mapZoom) = GVAR(mapZoom) * (11/10);
};
};
[] call FUNC(showApplicationPage);

View File

@ -0,0 +1,72 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
_this spawn {
_swap = if (GVAR(currentShowMode) == DISPLAY_MODE_DISPLAY) then {DISPLAY_MODE_DIALOG} else {DISPLAY_MODE_DISPLAY};
DEFAULT_PARAM(0,_newDisplayShowMode,_swap);
GVAR(currentShowMode) = _newDisplayShowMode;
systemChat format ["New ShowMode: %1", GVAR(currentShowMode)];
disableSerialization;
//On first-startup
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
GVAR(currentApplicationPage) = APP_MODE_MARK;
GVAR(mapPosition) = getPos ace_player;
};
_display = displayNull;
if (_newDisplayShowMode == 0) then {
systemChat "Closing";
if (dialog && {!isNull (uiNamespace getVariable ["testGPS", displayNull])}) then {
[-1] call FUNC(saveCurrentAndSetNewMode);
closeDialog 0;
};
("testGPS_T" call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
} else {
if (_newDisplayShowMode == 1) then {
systemChat "Opening Display";
if (dialog && {!isNull (uiNamespace getVariable ["testGPS", displayNull])}) then {
systemChat "backing up";
[-1] call FUNC(saveCurrentAndSetNewMode);
closeDialog 0;
};
("testGPS_T" call BIS_fnc_rscLayer) cutRsc ["testGPS_T", "PLAIN", 0, true];
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
} else {
systemChat "Opening Dialog";
("testGPS_T" call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
createDialog "testGPS";
_display = (uiNamespace getVariable ["testGPS", displayNull]);
};
};
[] call FUNC(showApplicationPage);
waitUntil {
if (isNull _display) exitWith {true};
[] call FUNC(updateDisplay);
GVAR(gpsPositionASL) = getPosAsl player;
GVAR(compassDirection) = getDir player;
sleep 0.1;
false;
};
};

View File

@ -0,0 +1,32 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_3(_slopeDistance,_azimuth,_inclination);
if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected"
if (_slopeDistance < 0) exitWith {}; //Bad Data
_horizontalDistance = (cos _inclination) * _slopeDistance;
_verticleDistance = (sin _inclination) * _slopeDistance;
_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance];
//This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different
_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset;
GVAR(rangeFinderPositionASL) = _targetPosASL;

View File

@ -0,0 +1,43 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_1(_newMode);
systemChat format ["Switching App To %1", _newMode];
disableSerialization;
_display = (uiNamespace getVariable ["testGPS", displayNull]);
if (isNull _display) then { _display = (uiNamespace getVariable ["testGPS_T", displayNull]);};
if (isNull _display) exitWith {};
if (GVAR(currentApplicationPage) == 2) then {
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
_pos = ctrlPosition _theMap;
_mapSize = _pos select 3;
_centerPos = [((_pos select 0) + (_pos select 2) / 2), ((_pos select 1) + (_pos select 3) / 2)];
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;
//Hit button again, toggle map modes:
if (_newMode == 2) then {
GVAR(mapShowTexture) = !GVAR(mapShowTexture);
};
};
if (_newMode != -1) then {
GVAR(currentApplicationPage) = _newMode;
[] call FUNC(showApplicationPage);
};

View File

@ -0,0 +1,124 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
disableSerialization;
_display = (uiNamespace getVariable ["testGPS", displayNull]);
_isControl = true;
if (isNull _display) then {
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
_isControl = false;
};
if (isNull _display) exitWith {};
//Fade "shell" at night
_daylight = (1 - cos (daytime * 360/24)) / 2;
(_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1];
//TopBar
(_display displayCtrl IDC_RANGEFINDERCONNECTEDICON) ctrlShow (GVAR(currentWaypoint) == -2);
//Mode: Info:
(_display displayCtrl IDC_MODEDISPLAY) ctrlShow (GVAR(currentApplicationPage) == 0);
if (GVAR(currentApplicationPage) == 0) then {
(_display displayCtrl IDC_MODEDISPLAY_UTMGRID) ctrlSetText GVAR(mgrsGridZoneDesignator);
if (GVAR(currentWaypoint) == -1) then {
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTIMECG) ctrlShow true;
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTARGETCG) ctrlShow false;
} else {
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTIMECG) ctrlShow false;
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTARGETCG) ctrlShow true;
if (GVAR(currentWaypoint) == -2) then {
(_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa"
} else {
(_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText QUOTE(PATHTOF(images\icon_menuMark.paa));
};
};
};
//Mode: Compass:
(_display displayCtrl IDC_MODECOMPASS) ctrlShow (GVAR(currentApplicationPage) == 1);
(_display displayCtrl IDC_MAPCOMPASS) ctrlShow (GVAR(currentApplicationPage) == 1);
//Mode: Map
(_display displayCtrl IDC_MODEMAP_MAPTRACKBUTTON) ctrlShow (GVAR(currentApplicationPage) == 2);
(_display displayCtrl IDC_MODEMAP_MAPZOOMIN) ctrlShow (GVAR(currentApplicationPage) == 2);
(_display displayCtrl IDC_MODEMAP_MAPZOOMOUT) ctrlShow (GVAR(currentApplicationPage) == 2);
(_display displayCtrl IDC_MAPPLAIN) ctrlShow ((GVAR(currentApplicationPage) == 2) && {!GVAR(mapShowTexture)});
(_display displayCtrl IDC_MAPDETAILS) ctrlShow ((GVAR(currentApplicationPage) == 2) && {GVAR(mapShowTexture)});
if (GVAR(currentApplicationPage) == 2) then {
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
_mapSize = (ctrlPosition _theMap) select 3;
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom) / _mapSize), GVAR(mapPosition)];
ctrlMapAnimCommit _theMap;
if (GVAR(mapAutoTrackPosition)) then {
(_display displayCtrl IDC_MODEMAP_MAPTRACKBUTTON) ctrlSetTextColor [1,1,1,0.8];
} else {
(_display displayCtrl IDC_MODEMAP_MAPTRACKBUTTON) ctrlSetTextColor [1,1,1,0.4];
};
};
//Mode: Menu
(_display displayCtrl IDC_MODEMENU) ctrlShow (GVAR(currentApplicationPage) == 3);
//Mode: Mark
if (GVAR(currentApplicationPage) == APP_MODE_MARK) then {
(_display displayCtrl IDC_MODEMARK) ctrlShow true;
//not backed up for displayMode swap, not a big deal
if ((count GVAR(newWaypointPosition)) == 0) then {
(_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText format ["Enter Grid Cords:"];
(_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText "";
} else {
(_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText format ["Name of [%1]", mapGridPosition GVAR(newWaypointPosition)];
(_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText format ["[%1]", mapGridPosition GVAR(newWaypointPosition)];
};
ctrlSetFocus (_display displayCtrl IDC_MODEMARK_CORDSEDIT);
} else {
(_display displayCtrl IDC_MODEMARK) ctrlShow false;
GVAR(newWaypointPosition) = [];
};
//Mode: Waypoints
(_display displayCtrl IDC_MODEWAYPOINTS) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_WAYPOINTS);
//Button's pushed:
if (GVAR(currentApplicationPage) == 0) then {
(_display displayCtrl IDC_BUTTONBG0) ctrlSetText QUOTE(PATHTOF(images\button_pushedDown.paa));
} else {
(_display displayCtrl IDC_BUTTONBG0) ctrlSetText QUOTE(PATHTOF(images\button_pushedUp.paa));
};
if (GVAR(currentApplicationPage) == 1) then {
(_display displayCtrl IDC_BUTTONBG1) ctrlSetText QUOTE(PATHTOF(images\button_pushedDown.paa));
} else {
(_display displayCtrl IDC_BUTTONBG1) ctrlSetText QUOTE(PATHTOF(images\button_pushedUp.paa));
};
if (GVAR(currentApplicationPage) == 2) then {
(_display displayCtrl IDC_BUTTONBG2) ctrlSetText QUOTE(PATHTOF(images\button_pushedDown.paa));
} else {
(_display displayCtrl IDC_BUTTONBG2) ctrlSetText QUOTE(PATHTOF(images\button_pushedUp.paa));
};
//Update the page now:
[] call FUNC(updateDisplay);

View File

@ -0,0 +1,165 @@
/*
* Author: PabstMirror
* Takes some arguments and returns something or other.
*
* Arguments:
* 0: The first argument <STRING>
* 1: The second argument <OBJECT>
* 2: Third Optional Argument <BOOL><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* _bool = ["something", player] call ace_common_fnc_imanexample
*
* Public: Yes
*/
#include "script_component.hpp"
disableSerialization;
_display = (uiNamespace getVariable ["testGPS", displayNull]);
_isControl = true;
if (isNull _display) then {
_display = (uiNamespace getVariable ["testGPS_T", displayNull]);
_isControl = false;
};
if (isNull _display) exitWith {};
(_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString);
switch (GVAR(currentApplicationPage)) do {
case (0): {
//Easting/Northing:
_posString = mapGridPosition ACE_player;
_eastingText = "";
_northingText = "";
if (count _posString > 0) then {
_eastingText = (_posString select [0, ((count _posString)/2)]) + "e";
_northingText = (_posString select [(count _posString)/2, (count _posString - 1)]) + "n";
};
(_display displayCtrl IDC_MODEDISPLAY_EASTING) ctrlSetText _eastingText;
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
//Elevation:
_numASL = (GVAR(gpsPositionASL) select 2) + getNumber(configFile >> "CfgWorlds" >> worldName >> "elevationOffset");
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
//Heading:
_compassAngleText = [(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber;
_compassAngleText = _compassAngleText + "°"; //degree symbol is in UTF-8
(_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText;
//Speed:
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];;
if (GVAR(currentWaypoint) == -1) then {
(_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN1) ctrlSetText "18-Feb-2010";
(_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN2) ctrlSetText ([daytime, "HH:MM:SS"] call bis_fnc_timeToString);
} else {
_targetPosName = "";
_targetPosLocationASL = [];
_bearingText = "----";
_rangeText = "----";
_aboveSeaLevelText = "----";
_targetName = "----";
if (GVAR(currentWaypoint) == -2) then {
if (!(GVAR(rangeFinderPositionASL) isEqualTo [])) then {
_targetPosName = format ["[%1]", (mapGridPosition GVAR(rangeFinderPositionASL))];
_targetPosLocationASL = GVAR(rangeFinderPositionASL);
};
} else {
if (GVAR(currentWaypoint) > ((count GVAR(waypointList) - 1))) exitWith {ERROR("bounds");};
_targetPosName = (GVAR(waypointList) select GVAR(currentWaypoint)) select 0;
_targetPosLocationASL = (GVAR(waypointList) select GVAR(currentWaypoint)) select 1;
};
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [GVAR(gpsPositionASL), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = format ["%1°M", [_bearing, 3, 1] call CBA_fnc_formatNumber];
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
_numASL = (_targetPosLocationASL select 2) + getNumber(configFile >> "CfgWorlds" >> worldName >> "elevationOffset");
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
};
(_display displayCtrl IDC_MODEDISPLAY_TRACKNUM) ctrlSetText _bearingText;
(_display displayCtrl IDC_MODEDISPLAY_TARGETRANGENUM) ctrlSetText _rangeText;
(_display displayCtrl IDC_MODEDISPLAY_TARGETELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
(_display displayCtrl IDC_MODEDISPLAY_TARGETNAME) ctrlSetText _targetPosName;
};
// _modePositionInfo ctrlSetStructuredText parseText format ["<t font='EtelkaMonospacePro'><t size='1' align='left'>MGRS-New</t><t align='right'>WGD</t><br/><br/><t size='2' align='right'>%1 %2e<br/>%3n</t><br/><br/><t size='1' align='left'>Elevation:</t><t size='1.5' align='right'>+%4m MSL</t><br/><br/><t align='left'><img size='2' image='mapButton_track.paa'/><t size='1.5' align='center'>%5°</t><t size='1.5' align='right'>%6kph</t><br/><br/><t align='left'><img size='2' image='mapButton_track.paa'/><t size='1' color='#449d65' align='center'>%7 %8L</t></t>", _utmGrid, _easting, _northing, _aboveSeaLevel, _compassAngle, _playerSpeed, _date, _time];
//bullshit gps accuracy: <t size='1' align='left'>EHE: +03.7</t><t size='1' align='right'>FOM: 1</t><br/><br/>
};
case (1): {
//Heading:
_compassAngleText = [(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber;
_compassAngleText = _compassAngleText + "°M"; //degree symbol is in UTF-8
(_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText;
//Speed:
_SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];;
(_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText;
if (GVAR(currentWaypoint) == -1) then {
(_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText "";
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
} else {
_playerPos2d = GVAR(gpsPositionASL) select [0,2];
_targetPosName = "";
_targetPosLocationASL = [];
if (GVAR(currentWaypoint) == -2) then {
if (!(GVAR(rangeFinderPositionASL) isEqualTo [])) then {
_targetPosName = format ["[%1]", (mapGridPosition GVAR(rangeFinderPositionASL))];
_targetPosLocationASL = GVAR(rangeFinderPositionASL);
};
} else {
if (GVAR(currentWaypoint) > ((count GVAR(waypointList) - 1))) exitWith {ERROR("bounds");};
_targetPosName = (GVAR(waypointList) select GVAR(currentWaypoint)) select 0;
_targetPosLocationASL = (GVAR(waypointList) select GVAR(currentWaypoint)) select 1;
};
_bearing = "---";
_rangeText = "---";
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [GVAR(gpsPositionASL), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = format ["%1°M", [_bearing, 3, 1] call CBA_fnc_formatNumber];
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
};
(_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText _bearing;
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText _rangeText;
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText _targetPosName;
};
};
case (APP_MODE_WAYPOINTS): {
_wpListBox = _display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS;
_currentIndex = lbCurSel _wpListBox;
lbClear _wpListBox;
{
EXPLODE_2_PVT(_x,_wpName,_wpPos);
_wpListBox lbAdd _wpName;
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_wpPos select [0,2])) / 1000;
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
} forEach GVAR(waypointList);
_currentIndex = (_currentIndex max 0) min (count GVAR(waypointList));
_wpListBox lbSetCurSel _currentIndex;
};
};

View File

@ -0,0 +1 @@
#include "\z\ace\addons\microdagr\script_component.hpp"

83
addons/microdagr/gui.hpp Normal file
View File

@ -0,0 +1,83 @@
#define ST_LEFT 0x00
#define ST_RIGHT 0x01
#define ST_CENTER 0x02
class RscActiveText;
class RscText;
class RscPicture;
class RscMapControl {
class hospital;
class church;
class lighthouse;
class power;
class fuelstation;
class transmitter;
};
class RscMapControlEmpty;
class RscControlsGroupNoScrollbars;
class RscEdit;
class RscButton;
class RscListBox;
class GVAR(RscActiveTextPicture): RscActiveText {
style = 48;
onbuttonclick = "hint 'cen'";
colorText[] = {1,1,1,1};
colorActive[] = {1,1,1,1};
color[] = {1,1,1,1};
color2[] = {1,1,1,1};
colorFocused[] = {1,1,1,1};
colorDisabled[] = {1,1,1,1};
colorBackground[] = {1,1,1,1};
colorBackground2[] = {1,1,1,1};
colorBackgroundFocused[] = {1,1,1,1};
};
class GVAR(RscText): RscText {
font = "EtelkaMonospacePro";
colorText[] = {0.75,0.75,0.75,1};
};
//Redfine Scaling for the Dialog
#define X_PART(num) QUOTE((((60 - 25)/2) + (num)) * (safeZoneH / 64) + (safezoneX + (safezoneW - safeZoneH)/2))
#define Y_PART(num) QUOTE((0 + (num)) * (safeZoneH / 36) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2))
#define W_PART(num) QUOTE((num) * (safeZoneH / 64))
#define H_PART(num) QUOTE((num) * (safeZoneH / 36))
class testGPS {
idd = -1;
movingEnable = 1;
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable ['testGPS', _this select 0];"; //@todo cbaify this
onUnload = QUOTE([] call FUNC(dialogClosedEH));
#include "gui_controls.hpp"
};
//Redfine Scaling for the RscTitle
#define PROFILE_X (profilenamespace getvariable ['IGUI_GRID_GPS_X', 0])
#define PROFILE_Y (profilenamespace getvariable ['IGUI_GRID_GPS_Y', 0])
#define PROFILE_W (profilenamespace getvariable ['IGUI_GRID_GPS_W', 1])
#define PROFILE_H ((16/9) * (profilenamespace getvariable ['IGUI_GRID_GPS_W', 1]))
#define X_PART(num) QUOTE((num) / 25 * PROFILE_W + PROFILE_X)
#define Y_PART(num) QUOTE((num) / 25 * PROFILE_H + PROFILE_Y)
#define W_PART(num) QUOTE((num) / 25 * PROFILE_W)
#define H_PART(num) QUOTE((num) / 25 * PROFILE_H)
class RscTitles {
class testGPS_T {
idd = -1;
movingEnable = 1;
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable ['testGPS_T', _this select 0];"; //@todo cbaify this
#include "gui_controls.hpp"
};
};

View File

@ -0,0 +1,743 @@
class controlsBackground {
class BackgroundBlackScreen: GVAR(RscText) {
idc = -1;
x = X_PART(-1);
y = Y_PART(-1);
//Cover the "seams" and make it bigger
w = W_PART(27);
h = H_PART(27);
colorBackground[] = {0,0,0,1};
};
class StatusBarBS: RscPicture {
idc = -1;
text = QUOTE(PATHTOF(images\microDAGR_topBar.paa));
x = X_PART(0);
y = Y_PART(0);
w = W_PART(25);
h = H_PART(2);
};
class RangefinderConnectedIcon: RscPicture {
idc = IDC_RANGEFINDERCONNECTEDICON;
text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
x = X_PART(6.35);
y = Y_PART(0.1);
w = W_PART(2.7);
h = H_PART(1.8);
};
class ClockText: GVAR(RscText) {
idc = IDC_CLOCKTEXT;
style = ST_RIGHT;
text = "12:00";
x = X_PART(0);
y = Y_PART(0.2);
w = W_PART(15);
h = H_PART(1.8);
sizeEx = H_PART(1.5);
colorText[] = {0,0.67,0.22,1};
};
class ClockText2: GVAR(RscText) {
idc = -1;
style = ST_LEFT;
text = "L";
x = X_PART(14.75);
y = Y_PART(0.2);
w = W_PART(2);
h = H_PART(1.8);
sizeEx = H_PART(1.5);
};
class MapPlain: RscMapControl {
idc = IDC_MAPPLAIN;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
onDraw = QUOTE(_this call FUNC(mapOnDrawEH));
onMouseButtonDblClick = QUOTE(_this call FUNC(mapDoubleTapEH));
scaleMin = 0.005;
scaleMax = 10; //Lets the mini display zoom out far enough
drawObjects = 0;
text = "#(argb,8,8,3)color(1,1,1,1)";
maxSatelliteAlpha = 0;
alphaFadeStartScale = 100;
alphaFadeEndScale = 100;
colorBackground[] = {1,1,1,1};
colorOutside[] = {"uinamespace getvariable ['RscDisplayStrategicMap_colorOutside_R',0]","uinamespace getvariable ['RscDisplayStrategicMap_colorOutside_G',0]","uinamespace getvariable ['RscDisplayStrategicMap_colorOutside_B',0]",1};
colorSea[] = {0.467,0.631,0.851,0.25};
colorCountlines[] = {0.572,0.354,0.188,0.25};
colorMainCountlines[] = {0.572,0.354,0.188,0.5};
colorCountlinesWater[] = {0.491,0.577,0.702,0.3};
colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6};
colorForest[] = {0,1,0,0.1};
colorForestBorder[] = {0,1,0,0.1};
colorRocks[] = {0,0,0,0};
colorGrid[] = {0,0,0,0.15};
colorGridMap[] = {0,0,0,0.2};
ptsPerSquareTxt = 50;
ptsPerSquareRoad = 7;
ptsPerSquareObj = 2000; //show buildings
ptsPerSquareCLn = 1;
ptsPerSquareCost = 200;
ptsPerSquareFor = 15;
ptsPerSquareForEdge = 15;
sizeExLabel = 0;
sizeExGrid = 0;
sizeExUnits = 0;
sizeExNames = 0;
sizeExInfo = 0;
sizeExLevel = 0;
moveOnEdges = 1;
showCountourInterval = 0;
colorRailWay[] = {0,0,0,0.5};
colorTracks[] = {0.84,0.76,0.65,0.15};
colorRoads[] = {0.7,0.7,0.7,1};
colorMainRoads[] = {0.9,0.5,0.3,1};
colorTracksFill[] = {0.84,0.76,0.65,1};
colorRoadsFill[] = {1,1,1,1};
colorMainRoadsFill[] = {1,0.6,0.4,1};
};
class MapDetails: MapPlain {
idc = IDC_MAPDETAILS;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
onDraw = QUOTE(_this call FUNC(mapOnDrawEH));
onMouseButtonDblClick = QUOTE(_this call FUNC(mapDoubleTapEH));
ptsPerSquareSea = 5;
ptsPerSquareTxt = 20;
ptsPerSquareCLn = 10;
ptsPerSquareExp = 10;
ptsPerSquareCost = 10;
ptsPerSquareFor = 9;
ptsPerSquareForEdge = 9;
ptsPerSquareRoad = 0.01;
ptsPerSquareObj = 9;
maxSatelliteAlpha = 0.666;
class hospital: Hospital {color[] = {0,0,0,0.25};};
class church: Church {color[] = {0,0,0,0.25};};
class lighthouse: Lighthouse {color[] = {0,0,0,0.25};};
class power: power {color[] = {0,0,0,0.25};};
class fuelstation: Fuelstation {color[] = {0,0,0,0.25};};
class transmitter: Transmitter {color[] = {0,0,0,0.25};};
};
class MapCompass: RscMapControlEmpty {
idc = IDC_MAPCOMPASS;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
onDraw = QUOTE(_this call FUNC(mapOnDrawEH));
colorBackground[] = {0,0,0,1};
colorOutside[] = {0,0,0,1};
moveOnEdges = 0;
};
};
class controls {
class TopMenuClick: GVAR(RscActiveTextPicture) {
idc = -1;
text = "#(argb,8,8,3)color(0,0,0,0)";
x = X_PART(0);
y = Y_PART(0);
w = W_PART(25);
h = H_PART(2);
onbuttonclick = QUOTE([3] call FUNC(saveCurrentAndSetNewMode));
};
//Mode: Display
class ModeDisplay: RscControlsGroupNoScrollbars {
idc = IDC_MODEDISPLAY;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
class Controls {
class MGRSNew: GVAR(RscText) {
idc = -1;
text = "MGRS-New"; //--- ToDo: Localize;
x = W_PART(0.5);
y = H_PART(0);
w = W_PART(10);
h = H_PART(1);
sizeEx = H_PART(1);
};
class WGD: GVAR(RscText) {
idc = -1;
style = ST_RIGHT;
text = "WGD"; //--- ToDo: Localize;
x = W_PART(14.5);
y = H_PART(0);
w = W_PART(10);
h = H_PART(1);
sizeEx = H_PART(1);
};
class UTMGrid: GVAR(RscText) {
idc = IDC_MODEDISPLAY_UTMGRID;
text = "15T XG";
x = W_PART(4.5);
y = H_PART(1.5);
w = W_PART(10);
h = H_PART(2);
sizeEx = H_PART(2);
};
class selfIcon: RscPicture {
idc = -1;
text = QUOTE(PATHTOF(images\icon_self.paa));
x = W_PART(0.5);
y = H_PART(2);
w = W_PART(4);
h = H_PART(3);
};
class Easting: GVAR(RscText) {
idc = IDC_MODEDISPLAY_EASTING;
text = "11994e"; //--- ToDo: Localize;
style = ST_RIGHT;
x = W_PART(14.5);
y = H_PART(1.5);
w = W_PART(10);
h = H_PART(2);
sizeEx = H_PART(2);
};
class Northing: GVAR(RscText) {
idc = IDC_MODEDISPLAY_NORTHING;
text = "11994n"; //--- ToDo: Localize;
style = ST_RIGHT;
x = W_PART(14.5);
y = H_PART(3.5);
w = W_PART(10);
h = H_PART(2);
sizeEx = H_PART(2);
};
class ElevationText: GVAR(RscText) {
idc = -1;
text = "Elevation:"; //--- ToDo: Localize;
x = W_PART(0.5);
y = H_PART(6);
w = W_PART(10);
h = H_PART(1.5);
sizeEx = H_PART(1.25);
};
class ElevationNum: GVAR(RscText) {
idc = IDC_MODEDISPLAY_ELEVATIONNUM;
text = "+000232 MSL"; //--- ToDo: Localize;
style = ST_RIGHT;
x = W_PART(12);
y = H_PART(6);
w = W_PART(12.5);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class RscPicture_1201: RscPicture {
idc = -1;
text = "#(argb,8,8,3)color(1,1,1,0.75)";
x = W_PART(0.5);
y = H_PART(8.115);
w = W_PART(24);
h = H_PART(0.05);
};
class CompasIcon: RscPicture {
idc = -1;
text = QUOTE(PATHTOF(images\icon_infoCompass.paa));
x = W_PART(0.5);
y = H_PART(8.5);
w = W_PART(2);
h = H_PART(1.5);
};
class HeadingNum: GVAR(RscText) {
idc = IDC_MODEDISPLAY_HEADINGNUM;
text = "097.2oM"; //--- ToDo: Localize;
x = W_PART(4);
y = H_PART(8.5);
w = W_PART(10);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class SpeedNum: GVAR(RscText) {
idc = IDC_MODEDISPLAY_SPEEDNUM;
text = "34kph"; //--- ToDo: Localize;
style = ST_RIGHT;
x = W_PART(14.5);
y = H_PART(8.5);
w = W_PART(7.5);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class RscPicture_1204: RscPicture {
idc = -1;
text = "#(argb,8,8,3)color(1,1,1,0.75)";
x = W_PART(0.5);
y = H_PART(10.45);
w = W_PART(24);
h = H_PART(0.05);
};
class modePosTimeCG: RscControlsGroupNoScrollbars {
idc = IDC_MODEDISPLAY_MODEPOSTIMECG;
x = W_PART(0);
y = H_PART(10.5);
w = W_PART(25);
h = H_PART(8.5);
class controls {
class TimeIcon: RscPicture {
idc = -1;
text = QUOTE(PATHTOF(images\icon_infoClock.paa));
x = W_PART(0.5);
y = H_PART(3.5);
w = W_PART(2);
h = H_PART(1.5);
};
class TimeDisplayGreen1: GVAR(RscText) {
idc = IDC_MODEDISPLAY_TIMEDISPLAYGREEN1;
x = W_PART(5);
y = H_PART(2.75);
w = W_PART(15);
h = H_PART(1.5);
style = ST_CENTER;
sizeEx = H_PART(1.5);
colorText[] = {0,0.67,0.22,1};
};
class TimeDisplayGreen2: TimeDisplayGreen1 {
idc = IDC_MODEDISPLAY_TIMEDISPLAYGREEN2;
y = H_PART(4.25);
};
};
};
class modePosTargetCG: RscControlsGroupNoScrollbars {
idc = IDC_MODEDISPLAY_MODEPOSTARGETCG;
x = W_PART(0);
y = H_PART(10.5);
w = W_PART(25);
h = H_PART(8.5);
class controls {
class TargetIcon: RscPicture {
idc = IDC_MODEDISPLAY_TARGETICON;
text = QUOTE(PATHTOF(images\icon_menuMark.paa));
x = W_PART(0.5);
y = H_PART(0.5);
w = W_PART(2);
h = H_PART(1.5);
};
class TrackNum: GVAR(RscText) {
idc = IDC_MODEDISPLAY_TRACKNUM;
text = "097.2oM"; //--- ToDo: Localize;
x = W_PART(4);
y = H_PART(0.5);
w = W_PART(10);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class TargetRangeText: GVAR(RscText) {
idc = -1;
text = "Range: "; //--- ToDo: Localize;
x = W_PART(0.5);
y = H_PART(2);
w = W_PART(7.5);
h = H_PART(1.5);
sizeEx = H_PART(1.25);
};
class TargetRangeNum: GVAR(RscText) {
idc = IDC_MODEDISPLAY_TARGETRANGENUM;
text = "1250 m";
style = ST_RIGHT;
x = W_PART(14.5);
y = H_PART(2);
w = W_PART(10);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class TargetElevationText: GVAR(RscText) {
idc = -1;
text = "Elevation:"; //--- ToDo: Localize;
x = W_PART(0.5);
y = H_PART(3.5);
w = W_PART(10);
h = H_PART(1.5);
sizeEx = H_PART(1.25);
};
class TargetElevationNum: GVAR(RscText) {
idc = IDC_MODEDISPLAY_TARGETELEVATIONNUM;
text = "+000232 MSL"; //--- ToDo: Localize;
style = ST_RIGHT;
x = W_PART(12);
y = H_PART(3.5);
w = W_PART(12.5);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class TargetName: GVAR(RscText) {
idc = IDC_MODEDISPLAY_TARGETNAME;
text = "43243 33432"; //--- ToDo: Localize;
style = ST_CENTER;
x = W_PART(1);
y = H_PART(5.5);
w = W_PART(23);
h = H_PART(2);
sizeEx = H_PART(2);
};
};
};
};
};
//Mode: Compass
class ModeCompass: RscControlsGroupNoScrollbars {
idc = IDC_MODECOMPASS;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
class Controls {
class CompassHeader: GVAR(RscText) {
idc = -1;
style = ST_CENTER;
text = "Compass Direction";
x = W_PART(0);
y = H_PART(0);
w = W_PART(25);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
};
class CompassHeading: GVAR(RscText) {
idc = IDC_MODECOMPASS_HEADING;
style = ST_LEFT;
x = W_PART(0);
y = H_PART(1.5);
w = W_PART(25);
h = H_PART(1.25);
sizeEx = H_PART(1.25);
colorText[] = {0.533,0.769,0.76,1};
};
class CompassSpeed: CompassHeading {
idc = IDC_MODECOMPASS_SPEED;
style = ST_RIGHT;
};
class CompassBearing: CompassHeading {
idc = IDC_MODECOMPASS_BEARING;
y = H_PART(16.25);
style = ST_LEFT;
colorText[] = {1,0.564,0.564,1};
};
class CompassRange: CompassHeading {
idc = IDC_MODECOMPASS_RANGE;
y = H_PART(16.25);
style = ST_RIGHT;
colorText[] = {1,0.564,0.564,1};
};
class CompassTARGET: CompassHeader {
idc = IDC_MODECOMPASS_TARGET;
y = H_PART(17.5);
};
};
};
//Mode: Map
class mapTrackButton: GVAR(RscActiveTextPicture) {
onbuttonclick = QUOTE(['autotrack'] call FUNC(modeMapButtons));
idc = IDC_MODEMAP_MAPTRACKBUTTON;
text = QUOTE(PATHTOF(images\icon_mapTrack.paa));
x = X_PART(11);
y = Y_PART(18.75);
w = W_PART(3);
h = H_PART(2.25);
};
class mapZoomIn: mapTrackButton {
onbuttonclick = QUOTE(['zoomin'] call FUNC(modeMapButtons));
idc = IDC_MODEMAP_MAPZOOMIN;
text = QUOTE(PATHTOF(images\icon_mapPlus.paa));
color[] = {1,1,1,0.4};
x = X_PART(4);
};
class mapZoomOut: mapTrackButton {
onbuttonclick = QUOTE(['zoomout'] call FUNC(modeMapButtons));
idc = IDC_MODEMAP_MAPZOOMOUT;
text = QUOTE(PATHTOF(images\icon_mapMinus.paa));
color[] = {1,1,1,0.4};
x = X_PART(18);
};
// Mode: Menu
class ModeMenu: RscControlsGroupNoScrollbars {
idc = IDC_MODEMENU;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
class Controls {
// class MenuBackground: RscPicture {
// idc = -1;
// text = "#(argb,8,8,3)color(0,0,0,1)";
// x = W_PART(0.1);
// y = H_PART(0);
// w = W_PART(24.8);
// h = H_PART(25);
// };
class ButtonTL: GVAR(RscActiveTextPicture) {
idc = -1;
text = QUOTE(PATHTOF(images\icon_menuMark.paa));
x = W_PART(3);
y = H_PART(1.5);
w = W_PART(8);
h = H_PART(6);
onbuttonclick = QUOTE([4] call FUNC(saveCurrentAndSetNewMode));
};
class ButtonTR: ButtonTL {
text = QUOTE(PATHTOF(images\icon_menuWaypoints.paa));
x = W_PART(14);
y = H_PART(1.5);
onbuttonclick = QUOTE([5] call FUNC(saveCurrentAndSetNewMode));
};
class ButtonBL: ButtonTL {
text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
x = W_PART(3);
y = H_PART(10.5);
onbuttonclick = QUOTE(_this call FUNC(appMenuButtonConnectRangefinder));
};
class ButtonBR: ButtonTL {
text = QUOTE(PATHTOF(images\icon_menuSettings.paa));
x = W_PART(14);
y = H_PART(10.5);
onbuttonclick = QUOTE([6] call FUNC(saveCurrentAndSetNewMode));
};
class TextTL: GVAR(RscText) {
idc = -1;
style = ST_CENTER;
text = "Mark"; //--- ToDo: Localize;
x = W_PART(0);
y = H_PART(7.5);
w = W_PART(14);
h = H_PART(1.2);
sizeEx = H_PART(1.2);
};
class TextTR: TextTL {
text = "Waypoints"; //--- ToDo: Localize;
x = W_PART(11);
y = H_PART(7.5);
};
class TextBL: TextTL {
text = "Connect To"; //--- ToDo: Localize;
x = W_PART(0);
y = H_PART(16.5);
}; class TextBR: TextTL {
text = "Settings"; //--- ToDo: Localize;
x = W_PART(11);
y = H_PART(16.5);
};
};
};
// Mode: Mark
class ModeMark: RscControlsGroupNoScrollbars {
idc = IDC_MODEMARK;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
class Controls {
class InfoText: GVAR(RscText) {
idc = IDC_MODEMARK_HEADER;
x = W_PART(3);
y = H_PART(1);
w = W_PART(19);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
colorText[] = {0.95,0.95,0.95,1};
};
class RscEdit_1400: RscEdit {
idc = IDC_MODEMARK_CORDSEDIT;
x = W_PART(3);
y = H_PART(2.75);
w = W_PART(17);
h = H_PART(1.5);
size = H_PART(1.5);
sizeEx = H_PART(1.5);
colorText[] = {0.95,0.95,0.95,1};
font = "EtelkaMonospacePro";
};
class DeleteButton: GVAR(RscActiveTextPicture) {
idc = -1;
text = QUOTE(PATHTOF(images\icon_deleteButton.paa));
x = W_PART(20);
y = H_PART(2.75);
w = W_PART(2);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
onbuttonclick = QUOTE(['del'] call FUNC(appMarkKeypadEntry));
};
class Keypad1: RscButton {
idc = -1;
text = "1";
x = W_PART(3);
y = H_PART(5);
w = W_PART(6);
h = H_PART(3);
sizeEx = H_PART(3);
colorText[] = {0.95,0.95,0.95,1};
colorBackground[] = {0.3,0.3,0.3,1};
colorBackgroundDisabled[] = {0.3,0.3,0.3,1};
colorBackgroundActive[] = {0.3,0.3,0.3,1};
colorFocused[] = {0.3,0.3,0.3,1};
onbuttonclick = QUOTE(['1'] call FUNC(appMarkKeypadEntry));
};
class Keypad2: Keypad1 {
text = "2";
x = W_PART(9.5);
onbuttonclick = QUOTE(['2'] call FUNC(appMarkKeypadEntry));
};
class Keypad3: Keypad1 {
text = "2";
x = W_PART(16);
onbuttonclick = QUOTE(['3'] call FUNC(appMarkKeypadEntry));
};
class Keypad4: Keypad1 {
text = "4";
x = W_PART(3);
y = H_PART(8.5);
onbuttonclick = QUOTE(['4'] call FUNC(appMarkKeypadEntry));
};
class Keypad5: Keypad4 {
text = "5";
x = W_PART(9.5);
onbuttonclick = QUOTE(['5'] call FUNC(appMarkKeypadEntry));
};
class Keypad6: Keypad4 {
text = "6";
x = W_PART(16);
onbuttonclick = QUOTE(['6'] call FUNC(appMarkKeypadEntry));
};
class Keypad7: Keypad1 {
text = "7";
x = W_PART(3);
y = H_PART(12);
onbuttonclick = QUOTE(['7'] call FUNC(appMarkKeypadEntry));
};
class Keypad8: Keypad7 {
text = "8";
x = W_PART(9.5);
onbuttonclick = QUOTE(['8'] call FUNC(appMarkKeypadEntry));
};
class Keypad9: Keypad7 {
text = "9";
x = W_PART(16);
onbuttonclick = QUOTE(['9'] call FUNC(appMarkKeypadEntry));
};
class Keypad0: Keypad1 {
text = "0";
x = W_PART(3);
y = H_PART(15.5);
w = W_PART(12.5)
onbuttonclick = QUOTE(['0'] call FUNC(appMarkKeypadEntry));
};
class KeypadEnter: Keypad1 {
text = "OK";
x = W_PART(16);
y = H_PART(15.5);
onbuttonclick = QUOTE(['ok'] call FUNC(appMarkKeypadEntry));
};
};
};
// Mode: Waypoints
class ModeWaypoints: RscControlsGroupNoScrollbars {
idc = IDC_MODEWAYPOINTS;
x = X_PART(0);
y = Y_PART(2);
w = W_PART(25);
h = H_PART(19);
class Controls {
class ListOfWaypoints: RscListBox {
idc = IDC_MODEWAYPOINTS_LISTOFWAYPOINTS;
sizeEx = H_PART(1.5);
sizeEx2 = H_PART(1.5);
rowHeight = H_PART(1.75);
colorText[] = {1,1,1,1};
colorBackground[] = {0.05,0.05,0.05,1};
itemBackground[] = {1,1,1,0.2};
itemSpacing = 0.001;
x = W_PART(0.5);
y = H_PART(0.5);
w = W_PART(24);
h = H_PART(16.5);
};
class ButtonSetWP: RscButton {
idc = -1;
text = "SetWP";
x = W_PART(1);
y = H_PART(17);
w = W_PART(7);
h = H_PART(1.5);
sizeEx = H_PART(1.5);
font = "EtelkaMonospacePro";
colorText[] = {0.95,0.95,0.95,1};
colorBackground[] = {0.3,0.3,0.3,1};
colorBackgroundDisabled[] = {0.3,0.3,0.3,1};
colorBackgroundActive[] = {0.3,0.3,0.3,1};
colorFocused[] = {0.3,0.3,0.3,1};
onbuttonclick = QUOTE(_this call FUNC(appWaypointsButtonSetWP));
};
class ButtonAdd: ButtonSetWP {
text = "Add";
x = W_PART(9);
onbuttonclick = QUOTE([APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode));
};
class ButtonDelete: ButtonSetWP {
text = "Delete";
x = W_PART(17);
onbuttonclick = QUOTE(_this call FUNC(appWaypointsButtonDeleteWP));
};
};
};
class ButtonBG0: RscPicture {
idc = IDC_BUTTONBG0;
text = QUOTE(PATHTOF(images\button_pushedDown.paa));
x = X_PART(0 * (25/3));
y = Y_PART(21);
w = W_PART((25/3));
h = H_PART(4);
};
class ButtonBG1: ButtonBG0 {
idc = IDC_BUTTONBG1;
x = X_PART(1 * (25/3));
};
class ButtonBG2: ButtonBG0 {
idc = IDC_BUTTONBG2;
x = X_PART(2 * (25/3));
};
class ButtonIcon0: GVAR(RscActiveTextPicture) {
idc = -1;
text = QUOTE(PATHTOF(images\icon_info.paa));
x = X_PART(0 * (25/3));
y = Y_PART(21);
w = W_PART((25/3));
h = H_PART(4);
onbuttonclick = QUOTE([APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode));
};
class ButtonIcon1: ButtonIcon0 {
text = QUOTE(PATHTOF(images\icon_compass.paa));
x = X_PART(1 * (25/3));
onbuttonclick = QUOTE([APP_MODE_COMPASS] call FUNC(saveCurrentAndSetNewMode));
};
class ButtonIcon2: ButtonIcon0 {
text = QUOTE(PATHTOF(images\icon_map.paa));
x = X_PART(2 * (25/3));
onbuttonclick = QUOTE([APP_MODE_MAP] call FUNC(saveCurrentAndSetNewMode));
};
//At the end: The Big Shell overlay
class MicroDagrShell: RscPicture {
idc = IDC_MICRODAGRSHELL;
text = QUOTE(PATHTOF(images\microDAGR_shellPicture.paa));
x = X_PART(-14.77);
y = Y_PART(-5.875);
w = W_PART(53.62);
h = H_PART(39.9);
};
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,76 @@
#define COMPONENT microdagr
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_MICRODAGR
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_MICRODAGR
#define DEBUG_SETTINGS DEBUG_SETTINGS_MICRODAGR
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define DUMMY_POS [-1,-1]
#define DUMMY_ZOOM 0.1
#define APP_MODE_NULL -1
#define APP_MODE_INFODISPLAY 0
#define APP_MODE_COMPASS 1
#define APP_MODE_MAP 2
#define APP_MODE_MENU 3
#define APP_MODE_MARK 4
#define APP_MODE_WAYPOINTS 5
#define APP_MODE_SETUP 6
#define DISPLAY_MODE_CLOSED 0
#define DISPLAY_MODE_DISPLAY 1
#define DISPLAY_MODE_DIALOG 2
#define IDC_RANGEFINDERCONNECTEDICON 77700
#define IDC_CLOCKTEXT 77701
#define IDC_MAPPLAIN 77702
#define IDC_MAPDETAILS 77703
#define IDC_MAPCOMPASS 77704
#define IDC_MODEDISPLAY 144000
#define IDC_MODEDISPLAY_UTMGRID 144001
#define IDC_MODEDISPLAY_EASTING 144002
#define IDC_MODEDISPLAY_NORTHING 144003
#define IDC_MODEDISPLAY_ELEVATIONNUM 144004
#define IDC_MODEDISPLAY_HEADINGNUM 144005
#define IDC_MODEDISPLAY_SPEEDNUM 144006
#define IDC_MODEDISPLAY_MODEPOSTIMECG 144010
#define IDC_MODEDISPLAY_TIMEDISPLAYGREEN1 144011
#define IDC_MODEDISPLAY_TIMEDISPLAYGREEN2 144012
#define IDC_MODEDISPLAY_MODEPOSTARGETCG 144020
#define IDC_MODEDISPLAY_TARGETICON 144021
#define IDC_MODEDISPLAY_TRACKNUM 144022
#define IDC_MODEDISPLAY_TARGETRANGENUM 144023
#define IDC_MODEDISPLAY_TARGETELEVATIONNUM 144024
#define IDC_MODEDISPLAY_TARGETNAME 144025
#define IDC_MODECOMPASS 144100
#define IDC_MODECOMPASS_HEADING 144110
#define IDC_MODECOMPASS_SPEED 144111
#define IDC_MODECOMPASS_BEARING 144112
#define IDC_MODECOMPASS_RANGE 144113
#define IDC_MODECOMPASS_TARGET 144114
#define IDC_MODEMAP_MAPTRACKBUTTON 144211
#define IDC_MODEMAP_MAPZOOMIN 144212
#define IDC_MODEMAP_MAPZOOMOUT 144213
#define IDC_MODEMENU 144300
#define IDC_MODEMARK 144400
#define IDC_MODEMARK_HEADER 144411
#define IDC_MODEMARK_CORDSEDIT 144412
#define IDC_MODEWAYPOINTS 144500
#define IDC_MODEWAYPOINTS_LISTOFWAYPOINTS 144501
#define IDC_BUTTONBG0 77710
#define IDC_BUTTONBG1 77711
#define IDC_BUTTONBG2 77712
#define IDC_MICRODAGRSHELL 77713

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2015-03-09 -->
<Project name="ACE">
<Package name="microdagr">
<Key ID="STR_ACE_microdagr_itemName">
<English>MicroDAGR GPS</English>
</Key>
<Key ID="STR_ACE_microdagr_itemDescription">
<English>MicroDAGR advanced GPS receiver</English>
</Key>
</Package>
</Project>

View File

@ -13,4 +13,9 @@ if (_distance < -999) exitWith {
[-1000, -1000] // return [-1000, -1000] // return
}; };
//Send Data to connected GPS
["RangerfinderData", [_distance, _azimuth, _inclination]] call EFUNC(common,localEvent);
[sin _inclination * _distance, cos _inclination * _distance] [sin _inclination * _distance, cos _inclination * _distance]