Map cp lines and flight paths are now the color of your coalition (red or blue)

This commit is contained in:
Donnie
2020-06-30 16:44:04 -04:00
parent 04e77a97f2
commit ae3518f450
4 changed files with 73 additions and 41 deletions

View File

@@ -17,17 +17,22 @@ class QMapEvent(QGraphicsRectItem):
self.setToolTip(str(self.gameEvent))
self.playable = not isinstance(self.gameEvent, UnitsDeliveryEvent)
def paint(self, painter, option, widget=None):
playerColor = self.game.get_player_color()
enemyColor = self.game.get_enemy_color()
if self.parent.get_display_rule("events"):
painter.save()
if self.gameEvent.is_player_attacking:
painter.setPen(QPen(brush=CONST.COLORS["blue"]))
painter.setBrush(CONST.COLORS["blue"])
painter.setPen(QPen(brush=CONST.COLORS[playerColor]))
painter.setBrush(CONST.COLORS[playerColor])
else:
painter.setPen(QPen(brush=CONST.COLORS["red"]))
painter.setBrush(CONST.COLORS["red"])
painter.setPen(QPen(brush=CONST.COLORS[enemyColor]))
painter.setBrush(CONST.COLORS[enemyColor])
if self.isUnderMouse() and self.playable:
painter.setBrush(CONST.COLORS["white"])