Use common icon function for vehicle actions (#5923)

* Use common icon function for vehicle actions

* Always create vehicle icon namespace
This commit is contained in:
SilentSpike
2017-12-20 20:30:50 +00:00
committed by PabstMirror
parent 26fddc34a2
commit 2bf67ea057
3 changed files with 4 additions and 5 deletions

View File

@ -21,13 +21,13 @@
params ["_vehicles", "_statement", "_target"];
_vehicles apply {
private _config = configFile >> "CfgVehicles" >> typeOf _x;
private _name = getText (_config >> "displayName");
private _type = typeOf _x;
private _name = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
private _ownerName = [_x, true] call EFUNC(common,getName);
if ("" != _ownerName) then {
_name = format ["%1 (%2)", _name, _ownerName];
};
private _icon = (getText (_config >> "icon")) call BIS_fnc_textureVehicleIcon;
private _icon = [_type] call EFUNC(common,getVehicleIcon);
private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction);
[_action, [], _target]
}