From f14cbd612f6a674eca164d20eccb01e2c7af9188 Mon Sep 17 00:00:00 2001 From: shukari Date: Tue, 21 Nov 2017 21:21:14 +0100 Subject: [PATCH 1/5] get the 10m for mortars --- addons/microdagr/functions/fnc_updateDisplay.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 87c5ee9751f..34e87de2edc 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -89,7 +89,7 @@ case (APP_MODE_INFODISPLAY): { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; + _rangeText = format ["%1km", ([_2dDistanceKm, 1, 2] call CBA_fnc_formatNumber)]; private _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; @@ -145,7 +145,7 @@ case (APP_MODE_COMPASS): { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; + _rangeText = format ["%1km", ([_2dDistanceKm, 1, 2] call CBA_fnc_formatNumber)]; }; (_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText _bearingText; @@ -163,7 +163,7 @@ case (APP_MODE_WAYPOINTS): { _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; - _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])]; + _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 2] call CBA_fnc_formatNumber)])]; } forEach _waypoints; _currentIndex = (_currentIndex max 0) min (count _waypoints); From 7aa6cc77faab86d8a308f03120a1cc23bd2163a3 Mon Sep 17 00:00:00 2001 From: shukari Date: Tue, 28 Nov 2017 12:32:50 +0100 Subject: [PATCH 2/5] get the exact meter --- addons/microdagr/functions/fnc_updateDisplay.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 34e87de2edc..2219249f81a 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -89,7 +89,7 @@ case (APP_MODE_INFODISPLAY): { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 2] call CBA_fnc_formatNumber)]; + _rangeText = format ["%1km", ([_2dDistanceKm, 1, 3] call CBA_fnc_formatNumber)]; private _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; @@ -145,7 +145,7 @@ case (APP_MODE_COMPASS): { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 2] call CBA_fnc_formatNumber)]; + _rangeText = format ["%1km", ([_2dDistanceKm, 1, 3] call CBA_fnc_formatNumber)]; }; (_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText _bearingText; @@ -163,7 +163,7 @@ case (APP_MODE_WAYPOINTS): { _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; - _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 2] call CBA_fnc_formatNumber)])]; + _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 3] call CBA_fnc_formatNumber)])]; } forEach _waypoints; _currentIndex = (_currentIndex max 0) min (count _waypoints); From 9eed00e7e69171051613d9d382c9ac8ead8d39ab Mon Sep 17 00:00:00 2001 From: shukari Date: Tue, 28 Nov 2017 18:36:36 +0100 Subject: [PATCH 3/5] use toFixed --- addons/microdagr/functions/fnc_updateDisplay.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 2219249f81a..9ca5ac72e46 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -89,7 +89,7 @@ case (APP_MODE_INFODISPLAY): { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 3] call CBA_fnc_formatNumber)]; + _rangeText = format ["%1km", _2dDistanceKm toFixed 3]; private _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; @@ -145,7 +145,7 @@ case (APP_MODE_COMPASS): { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; - _rangeText = format ["%1km", ([_2dDistanceKm, 1, 3] call CBA_fnc_formatNumber)]; + _rangeText = format ["%1km", _2dDistanceKm toFixed 3]; }; (_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText _bearingText; @@ -163,7 +163,7 @@ case (APP_MODE_WAYPOINTS): { _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; - _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 3] call CBA_fnc_formatNumber)])]; + _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed 3)]; } forEach _waypoints; _currentIndex = (_currentIndex max 0) min (count _waypoints); From 508316d2e5edf6f205b65e9a6b948a8d40aaa1d4 Mon Sep 17 00:00:00 2001 From: shukari Date: Tue, 28 Nov 2017 18:40:13 +0100 Subject: [PATCH 4/5] that evil ) --- addons/microdagr/functions/fnc_updateDisplay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 9ca5ac72e46..8d474ac3ec1 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -163,7 +163,7 @@ case (APP_MODE_WAYPOINTS): { _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; - _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed 3)]; + _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed 3]; } forEach _waypoints; _currentIndex = (_currentIndex max 0) min (count _waypoints); From b784a86dd9f69d84194cef68765776995bf164ec Mon Sep 17 00:00:00 2001 From: shukari Date: Tue, 28 Nov 2017 18:49:27 +0100 Subject: [PATCH 5/5] thx travis --- addons/microdagr/functions/fnc_updateDisplay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 8d474ac3ec1..f60db3bb0f0 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -163,7 +163,7 @@ case (APP_MODE_WAYPOINTS): { _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; - _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed 3]; + _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed 3])]; } forEach _waypoints; _currentIndex = (_currentIndex max 0) min (count _waypoints);