Added some factions, refactor bluefor/redfor distinction code.

This commit is contained in:
Khopa
2019-10-12 00:02:07 +02:00
parent 707e1f8b67
commit ba0b3adf71
8 changed files with 181 additions and 18 deletions

View File

@@ -6,7 +6,7 @@ from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsSceneHoverEvent, QGrap
import qt_ui.uiconstants as CONST
from game import Game
from qt_ui.windows.QBaseMenu import QBaseMenu
from theater import ControlPoint
from theater import ControlPoint, db
class QMapControlPoint(QGraphicsRectItem):
@@ -81,14 +81,14 @@ class QMapControlPoint(QGraphicsRectItem):
@property
def brush_color(self)->QColor:
if self.parent.game.player_country in ["USA", "France", "Germany", "UK", "The Netherlands", "Italy", "Spain", "India"]:
if self.parent.game.player_country in db.BLUEFOR_FACTIONS:
return self.model.captured and CONST.COLORS["blue"] or CONST.COLORS["red"]
else:
return self.model.captured and CONST.COLORS["red"] or CONST.COLORS["blue"]
@property
def pen_color(self) -> QColor:
if self.parent.game.player_country in ["USA", "France", "Germany", "UK", "The Netherlands", "Italy", "Spain", "India"]:
if self.parent.game.player_country in db.BLUEFOR_FACTIONS:
return self.model.captured and CONST.COLORS["dark_blue"] or CONST.COLORS["bright_red"]
else:
return self.model.captured and CONST.COLORS["bright_red"] or CONST.COLORS["dark_blue"]