mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Replace mission planning UI.
Mission planning has been completely redone. Missions are now planned by right clicking the target area and choosing "New package". A package can include multiple flights for the same objective. Right now the automatic flight planner is only fragging single-flight packages in the same manner that it used to, but that can be improved now. The air tasking order (ATO) is now the left bar of the main UI. This shows every fragged package, and the flights in the selected package. The info bar that was previously on the left is now a smaller bar at the bottom of the screen. The old "Mission Planning" button is now just the "Take Off" button. The flight plan display no longer shows enemy flight plans. That could be re-added if needed, probably with a difficulty/cheat option. Aircraft inventories have been disassociated from the Planner class. Aircraft inventories are now stored globally in the Game object. Save games made prior to this update will not be compatible do to the changes in how aircraft inventories and planned flights are stored.
This commit is contained in:
@@ -14,11 +14,12 @@ from .QMapObject import QMapObject
|
||||
|
||||
class QMapGroundObject(QMapObject):
|
||||
def __init__(self, parent, x: float, y: float, w: float, h: float,
|
||||
cp: ControlPoint, model: TheaterGroundObject, game: Game,
|
||||
control_point: ControlPoint,
|
||||
ground_object: TheaterGroundObject, game: Game,
|
||||
buildings: Optional[List[TheaterGroundObject]] = None) -> None:
|
||||
super().__init__(x, y, w, h)
|
||||
self.model = model
|
||||
self.cp = cp
|
||||
super().__init__(x, y, w, h, mission_target=ground_object)
|
||||
self.ground_object = ground_object
|
||||
self.control_point = control_point
|
||||
self.parent = parent
|
||||
self.game = game
|
||||
self.setZValue(2)
|
||||
@@ -26,21 +27,20 @@ class QMapGroundObject(QMapObject):
|
||||
self.setFlag(QGraphicsItem.ItemIgnoresTransformations, False)
|
||||
self.ground_object_dialog: Optional[QGroundObjectMenu] = None
|
||||
|
||||
if len(self.model.groups) > 0:
|
||||
if self.ground_object.groups:
|
||||
units = {}
|
||||
for g in self.model.groups:
|
||||
print(g)
|
||||
for g in self.ground_object.groups:
|
||||
for u in g.units:
|
||||
if u.type in units:
|
||||
units[u.type] = units[u.type]+1
|
||||
else:
|
||||
units[u.type] = 1
|
||||
tooltip = "[" + self.model.obj_name + "]" + "\n"
|
||||
tooltip = "[" + self.ground_object.obj_name + "]" + "\n"
|
||||
for unit in units.keys():
|
||||
tooltip = tooltip + str(unit) + "x" + str(units[unit]) + "\n"
|
||||
self.setToolTip(tooltip[:-1])
|
||||
else:
|
||||
tooltip = "[" + self.model.obj_name + "]" + "\n"
|
||||
tooltip = "[" + self.ground_object.obj_name + "]" + "\n"
|
||||
for building in buildings:
|
||||
if not building.is_dead:
|
||||
tooltip = tooltip + str(building.dcs_identifier) + "\n"
|
||||
@@ -53,20 +53,20 @@ class QMapGroundObject(QMapObject):
|
||||
if self.parent.get_display_rule("go"):
|
||||
painter.save()
|
||||
|
||||
cat = self.model.category
|
||||
if cat == "aa" and self.model.sea_object:
|
||||
cat = self.ground_object.category
|
||||
if cat == "aa" and self.ground_object.sea_object:
|
||||
cat = "ship"
|
||||
|
||||
rect = QRect(option.rect.x() + 2, option.rect.y(),
|
||||
option.rect.width() - 2, option.rect.height())
|
||||
|
||||
is_dead = self.model.is_dead
|
||||
is_dead = self.ground_object.is_dead
|
||||
for building in self.buildings:
|
||||
if not building.is_dead:
|
||||
is_dead = False
|
||||
break
|
||||
|
||||
if not is_dead and not self.cp.captured:
|
||||
if not is_dead and not self.control_point.captured:
|
||||
painter.drawPixmap(rect, const.ICONS[cat + enemy_icons])
|
||||
elif not is_dead:
|
||||
painter.drawPixmap(rect, const.ICONS[cat + player_icons])
|
||||
@@ -80,7 +80,7 @@ class QMapGroundObject(QMapObject):
|
||||
units_alive = 0
|
||||
units_dead = 0
|
||||
|
||||
if len(self.model.groups) == 0:
|
||||
if len(self.ground_object.groups) == 0:
|
||||
for building in self.buildings:
|
||||
if building.dcs_identifier in FORTIFICATION_BUILDINGS:
|
||||
continue
|
||||
@@ -89,7 +89,7 @@ class QMapGroundObject(QMapObject):
|
||||
else:
|
||||
units_alive += 1
|
||||
|
||||
for g in self.model.groups:
|
||||
for g in self.ground_object.groups:
|
||||
units_alive += len(g.units)
|
||||
if hasattr(g, "units_losts"):
|
||||
units_dead += len(g.units_losts)
|
||||
@@ -106,9 +106,9 @@ class QMapGroundObject(QMapObject):
|
||||
def on_click(self) -> None:
|
||||
self.ground_object_dialog = QGroundObjectMenu(
|
||||
self.window(),
|
||||
self.model,
|
||||
self.ground_object,
|
||||
self.buildings,
|
||||
self.cp,
|
||||
self.control_point,
|
||||
self.game
|
||||
)
|
||||
self.ground_object_dialog.show()
|
||||
|
||||
Reference in New Issue
Block a user