Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MicroDAGR] get the meters for mortars (better rangetable calcs) #5802

Merged
merged 5 commits into from
Nov 28, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/microdagr/functions/fnc_updateDisplay.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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, 3] call CBA_fnc_formatNumber)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CBA_fnc_formatNumber can be replaced by the toFixed command 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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"};
Expand Down Expand Up @@ -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, 3] call CBA_fnc_formatNumber)];
};

(_display displayCtrl IDC_MODECOMPASS_BEARING) ctrlSetText _bearingText;
Expand All @@ -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, 3] call CBA_fnc_formatNumber)])];
} forEach _waypoints;

_currentIndex = (_currentIndex max 0) min (count _waypoints);
Expand Down