Fix tooltips for scuds/silkworms.

Same problem as the ground object menu, same cleanup required at some
point.
This commit is contained in:
Dan Albert 2021-06-18 18:14:20 -07:00
parent 933517055e
commit d3be732566

View File

@ -226,7 +226,12 @@ class GroundObjectJs(QObject):
if dcs_unit_type is not None:
# TODO: Make the TGO contain GroundUnitType instead of the pydcs Group.
# This is a hack because we can't know which variant was used.
unit_display_name = next(GroundUnitType.for_dcs_type(dcs_unit_type)).name
try:
unit_display_name = next(
GroundUnitType.for_dcs_type(dcs_unit_type)
).name
except StopIteration:
pass
return f"Unit #{unit.id} - {unit_display_name}{dead_label}"
@Property(list, notify=unitsChanged)