Merge branch 'theater-refactor' into develop

This commit is contained in:
Dan Albert
2020-11-07 13:39:35 -08:00
17 changed files with 265 additions and 232 deletions

View File

@@ -95,7 +95,7 @@ class QFlightTypeComboBox(QComboBox):
yield from self.ENEMY_AIRBASE_MISSIONS
elif isinstance(self.target, TheaterGroundObject):
# TODO: Filter more based on the category.
friendly = self.target.parent_control_point(self.theater).captured
friendly = self.target.control_point.captured
if friendly:
yield from self.FRIENDLY_GROUND_OBJECT_MISSIONS
else:

View File

@@ -1,7 +1,7 @@
from PySide2.QtGui import QStandardItem, QStandardItemModel
from game import Game
from gen import Conflict, FlightWaypointType
from gen import BuildingGroundObject, Conflict, FlightWaypointType
from gen.flights.flight import FlightWaypoint
from qt_ui.widgets.combos.QFilteredComboBox import QFilteredComboBox
from theater import ControlPointType
@@ -71,7 +71,7 @@ class QPredefinedWaypointSelectionComboBox(QFilteredComboBox):
for cp in self.game.theater.controlpoints:
if (self.include_enemy and not cp.captured) or (self.include_friendly and cp.captured):
for ground_object in cp.ground_objects:
if not ground_object.is_dead and not ground_object.dcs_identifier == "AA":
if not ground_object.is_dead and not isinstance(ground_object, BuildingGroundObject):
wpt = FlightWaypoint(
FlightWaypointType.CUSTOM,
ground_object.position.x,

View File

@@ -121,8 +121,8 @@ class QLiberationMap(QGraphicsView):
def setGame(self, game: Optional[Game]):
self.game = game
logging.debug("Reloading Map Canvas")
if self.game is not None:
logging.debug("Reloading Map Canvas")
self.reload_scene()
"""