mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Allow manual SAM orientation.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2479.
This commit is contained in:
parent
83916b9fb0
commit
f9e9c2793a
@ -141,6 +141,7 @@ Saves from 6.x are not compatible with 7.0.
|
||||
* **[Modding]** The `mission_types` field in squadron files has been removed. Squadron task capability is now determined by airframe, and the auto-assignable list has always been overridden by the campaign settings.
|
||||
* **[Squadrons]** Squadron-specific mission capability lists no longer restrict players from assigning missions outside the squadron's preferences.
|
||||
* **[New Game Wizard]** Squadrons can be directly replaced with a preset during air wing configuration rather than needing to remove and create a new squadron.
|
||||
* **[UI]** The orientation of objects like SAMs, EWRs, garrisons, and ships can now be manually adjusted.
|
||||
|
||||
## Fixes
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ from PySide2.QtWidgets import (
|
||||
QPushButton,
|
||||
QVBoxLayout,
|
||||
QSpinBox,
|
||||
QWidget,
|
||||
)
|
||||
from dcs import Point
|
||||
|
||||
@ -30,6 +31,18 @@ from qt_ui.windows.groundobject.QBuildingInfo import QBuildingInfo
|
||||
from qt_ui.windows.groundobject.QGroundObjectBuyMenu import QGroundObjectBuyMenu
|
||||
|
||||
|
||||
class HeadingIndicator(QLabel):
|
||||
def __init__(self, initial_heading: Heading, parent: QWidget) -> None:
|
||||
super().__init__(parent)
|
||||
self.set_heading(initial_heading)
|
||||
self.setFixedSize(32, 32)
|
||||
|
||||
def set_heading(self, heading: Heading) -> None:
|
||||
self.setPixmap(
|
||||
ICONS["heading"].transformed(QTransform().rotate(heading.degrees))
|
||||
)
|
||||
|
||||
|
||||
class QGroundObjectMenu(QDialog):
|
||||
def __init__(
|
||||
self,
|
||||
@ -148,24 +161,21 @@ class QGroundObjectMenu(QDialog):
|
||||
self.orientationBox = QGroupBox("Orientation :")
|
||||
self.orientationBoxLayout = QHBoxLayout()
|
||||
|
||||
heading_image = QLabel()
|
||||
heading_image.setPixmap(
|
||||
ICONS["heading"].transformed(
|
||||
QTransform().rotate(self.ground_object.heading.degrees)
|
||||
)
|
||||
)
|
||||
heading_image = HeadingIndicator(self.ground_object.heading, self)
|
||||
self.orientationBoxLayout.addWidget(heading_image)
|
||||
self.headingLabel = QLabel("Heading:")
|
||||
self.orientationBoxLayout.addWidget(self.headingLabel)
|
||||
self.headingSelector = QSpinBox()
|
||||
self.headingSelector.setEnabled(False) # Disable for now
|
||||
self.headingSelector.setMinimum(0)
|
||||
self.headingSelector.setMaximum(360)
|
||||
self.headingSelector.setEnabled(self.cp.is_friendly(to_player=True))
|
||||
self.headingSelector.setRange(0, 359)
|
||||
self.headingSelector.setWrapping(True)
|
||||
self.headingSelector.setSingleStep(5)
|
||||
self.headingSelector.setValue(self.ground_object.heading.degrees)
|
||||
self.headingSelector.valueChanged.connect(
|
||||
lambda degrees: heading_image.set_heading(Heading(degrees))
|
||||
)
|
||||
self.orientationBoxLayout.addWidget(self.headingSelector)
|
||||
if self.cp.captured:
|
||||
# TODO Let the user choose the heading with the SpinBox
|
||||
self.headingSelector.setEnabled(False)
|
||||
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