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.
|
* **[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.
|
* **[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.
|
* **[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
|
## Fixes
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ from PySide2.QtWidgets import (
|
|||||||
QPushButton,
|
QPushButton,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
QSpinBox,
|
QSpinBox,
|
||||||
|
QWidget,
|
||||||
)
|
)
|
||||||
from dcs import Point
|
from dcs import Point
|
||||||
|
|
||||||
@ -30,6 +31,18 @@ from qt_ui.windows.groundobject.QBuildingInfo import QBuildingInfo
|
|||||||
from qt_ui.windows.groundobject.QGroundObjectBuyMenu import QGroundObjectBuyMenu
|
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):
|
class QGroundObjectMenu(QDialog):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -148,24 +161,21 @@ class QGroundObjectMenu(QDialog):
|
|||||||
self.orientationBox = QGroupBox("Orientation :")
|
self.orientationBox = QGroupBox("Orientation :")
|
||||||
self.orientationBoxLayout = QHBoxLayout()
|
self.orientationBoxLayout = QHBoxLayout()
|
||||||
|
|
||||||
heading_image = QLabel()
|
heading_image = HeadingIndicator(self.ground_object.heading, self)
|
||||||
heading_image.setPixmap(
|
|
||||||
ICONS["heading"].transformed(
|
|
||||||
QTransform().rotate(self.ground_object.heading.degrees)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
self.orientationBoxLayout.addWidget(heading_image)
|
self.orientationBoxLayout.addWidget(heading_image)
|
||||||
self.headingLabel = QLabel("Heading:")
|
self.headingLabel = QLabel("Heading:")
|
||||||
self.orientationBoxLayout.addWidget(self.headingLabel)
|
self.orientationBoxLayout.addWidget(self.headingLabel)
|
||||||
self.headingSelector = QSpinBox()
|
self.headingSelector = QSpinBox()
|
||||||
self.headingSelector.setEnabled(False) # Disable for now
|
self.headingSelector.setEnabled(self.cp.is_friendly(to_player=True))
|
||||||
self.headingSelector.setMinimum(0)
|
self.headingSelector.setRange(0, 359)
|
||||||
self.headingSelector.setMaximum(360)
|
self.headingSelector.setWrapping(True)
|
||||||
|
self.headingSelector.setSingleStep(5)
|
||||||
self.headingSelector.setValue(self.ground_object.heading.degrees)
|
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)
|
self.orientationBoxLayout.addWidget(self.headingSelector)
|
||||||
if self.cp.captured:
|
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")
|
self.head_to_conflict_button = QPushButton("Head to conflict")
|
||||||
heading = (
|
heading = (
|
||||||
self.game.theater.heading_to_conflict_from(self.ground_object.position)
|
self.game.theater.heading_to_conflict_from(self.ground_object.position)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user