Adds a new icon for AA sites with no threat.

Also adds the logic to check for this state.

Contributes-to: #239
This commit is contained in:
Simon Clark
2021-01-30 18:08:17 +00:00
parent 9a41217a59
commit 89392553bd
5 changed files with 17 additions and 2 deletions

View File

@@ -85,10 +85,22 @@ class QMapGroundObject(QMapObject):
is_dead = False
break
if cat == "aa":
has_threat = False
for group in self.ground_object.groups:
if self.ground_object.threat_range(group).distance_in_meters > 0:
has_threat = True
if not is_dead and not self.control_point.captured:
painter.drawPixmap(rect, const.ICONS[cat + enemy_icons])
if cat == "aa" and not has_threat:
painter.drawPixmap(rect, const.ICONS["nothreat" + enemy_icons])
else:
painter.drawPixmap(rect, const.ICONS[cat + enemy_icons])
elif not is_dead:
painter.drawPixmap(rect, const.ICONS[cat + player_icons])
if cat == "aa" and not has_threat:
painter.drawPixmap(rect, const.ICONS["nothreat" + player_icons])
else:
painter.drawPixmap(rect, const.ICONS[cat + player_icons])
else:
painter.drawPixmap(rect, const.ICONS["destroyed"])