mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Adjustable OPFOR headings when OPFOR ATO is selected
This commit is contained in:
parent
a68bcb9ea1
commit
2b780e3d69
@ -603,7 +603,7 @@ class QLiberationWindow(QMainWindow):
|
||||
self.game_model.init_comms_registry()
|
||||
|
||||
def open_tgo_info_dialog(self, tgo: TheaterGroundObject) -> None:
|
||||
QGroundObjectMenu(self, tgo, tgo.control_point, self.game).show()
|
||||
QGroundObjectMenu(self, tgo, tgo.control_point, self.game_model).show()
|
||||
|
||||
def open_control_point_info_dialog(self, cp: ControlPoint) -> None:
|
||||
self._cp_dialog = QBaseMenu2(None, cp, self.game_model)
|
||||
|
||||
@ -15,7 +15,6 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
from dcs import Point
|
||||
|
||||
from game import Game
|
||||
from game.config import REWARDS
|
||||
from game.data.building_data import FORTIFICATION_BUILDINGS
|
||||
from game.server import EventStream
|
||||
@ -25,6 +24,7 @@ from game.theater.theatergroundobject import (
|
||||
BuildingGroundObject,
|
||||
)
|
||||
from game.utils import Heading
|
||||
from qt_ui.models import GameModel
|
||||
from qt_ui.uiconstants import EVENT_ICONS, ICONS
|
||||
from qt_ui.widgets.QBudgetBox import QBudgetBox
|
||||
from qt_ui.windows.GameUpdateSignal import GameUpdateSignal
|
||||
@ -57,13 +57,14 @@ class QGroundObjectMenu(QDialog):
|
||||
parent,
|
||||
ground_object: TheaterGroundObject,
|
||||
cp: ControlPoint,
|
||||
game: Game,
|
||||
gm: GameModel,
|
||||
):
|
||||
super().__init__(parent)
|
||||
self.setMinimumWidth(350)
|
||||
self.ground_object = ground_object
|
||||
self.cp = cp
|
||||
self.game = game
|
||||
self.game_model = gm
|
||||
self.game = gm.game
|
||||
self.setWindowTitle(
|
||||
f"Location - {self.ground_object.obj_name} ({self.cp.name})"
|
||||
)
|
||||
@ -184,7 +185,6 @@ class QGroundObjectMenu(QDialog):
|
||||
self.headingLabel = QLabel("Heading:")
|
||||
self.orientationBoxLayout.addWidget(self.headingLabel)
|
||||
self.headingSelector = QSpinBox()
|
||||
self.headingSelector.setEnabled(self.cp.is_friendly(to_player=True))
|
||||
self.headingSelector.setRange(0, 359)
|
||||
self.headingSelector.setWrapping(True)
|
||||
self.headingSelector.setSingleStep(5)
|
||||
@ -193,7 +193,8 @@ class QGroundObjectMenu(QDialog):
|
||||
lambda degrees: self.rotate_tgo(Heading(degrees))
|
||||
)
|
||||
self.orientationBoxLayout.addWidget(self.headingSelector)
|
||||
if self.cp.captured:
|
||||
can_adjust_heading = self.cp.is_friendly(to_player=self.game_model.is_ownfor)
|
||||
if can_adjust_heading:
|
||||
self.head_to_conflict_button = QPushButton("Head to conflict")
|
||||
heading = (
|
||||
self.game.theater.heading_to_conflict_from(self.ground_object.position)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user