Interaction Menu - Show distance to target on vehicle actions (#9644)

* add distance to action

* sort by distance

* Revert "sort by distance"

This reverts commit 89834613dd.

* show distance for crewed vehicles

* Update fnc_createVehiclesActions.sqf
This commit is contained in:
Grim 2023-11-17 20:07:58 -03:00 committed by GitHub
parent d1f0dc5e83
commit 5e792082ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,8 +23,11 @@ params ["_vehicles", "_statement", "_target"];
_vehicles apply {
private _name = getText ((configOf _x) >> "displayName");
private _ownerName = [_x, true] call EFUNC(common,getName);
private _distanceStr = (ACE_player distance _x) toFixed 1;
if ("" != _ownerName) then {
_name = format ["%1 (%2)", _name, _ownerName];
_name = format ["%1 (%2, %3m)", _name, _ownerName, _distanceStr];
} else {
_name = format ["%1 (%2m)", _name, _distanceStr];
};
private _icon = [_x] call EFUNC(common,getVehicleIcon);
private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction);