#777 - mDagr - Update map pos each frame.

This commit is contained in:
PabstMirror 2015-04-20 16:12:01 -05:00
parent fd7611e982
commit fdbd0c1905
3 changed files with 9 additions and 10 deletions

View File

@ -49,11 +49,11 @@ if (GVAR(currentApplicationPage) == 1) then {
} else { //Map Mode:
if (GVAR(mapAutoTrackPosition)) then {
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), GVAR(gpsPositionASL)];
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)];
ctrlMapAnimCommit _theMap;
};
_size = 48 * _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 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ];
if (GVAR(settingShowAllWaypointsOnMap)) then {
_size = 32 * _mapSize;

View File

@ -83,7 +83,6 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
};
[_pfID] call CBA_fnc_removePerFrameHandler;
} else {
GVAR(gpsPositionASL) = getPosAsl ace_player;
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
//If display is hidden, and we can show, then swithc modes:
if ([DISPLAY_MODE_DISPLAY] call FUNC(canShow)) then {

View File

@ -44,7 +44,7 @@ case (APP_MODE_INFODISPLAY): {
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
//Elevation:
_numASL = (GVAR(gpsPositionASL) select 2) + GVAR(mapAltitude);
_numASL = ((getPosASL ace_player) select 2) + GVAR(mapAltitude);
_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;
@ -88,13 +88,13 @@ case (APP_MODE_INFODISPLAY): {
};
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [GVAR(gpsPositionASL), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
_numASL = (_targetPosLocationASL select 2) + GVAR(mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
@ -125,7 +125,7 @@ case (APP_MODE_COMPASS): {
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
} else {
_playerPos2d = GVAR(gpsPositionASL) select [0,2];
_playerPos2d = (getPosASL ace_player) select [0,2];
_targetPosName = "";
_targetPosLocationASL = [];
@ -145,13 +145,13 @@ case (APP_MODE_COMPASS): {
_rangeText = "---";
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [GVAR(gpsPositionASL), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
};
@ -169,7 +169,7 @@ case (APP_MODE_WAYPOINTS): {
{
EXPLODE_2_PVT(_x,_wpName,_wpPos);
_wpListBox lbAdd _wpName;
_2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_wpPos select [0,2])) / 1000;
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000;
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
} forEach _waypoints;