mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Streamlining
This commit is contained in:
parent
e514cb1397
commit
60172d0e52
@ -1,5 +1,7 @@
|
||||
from PySide6.QtCore import Signal
|
||||
from PySide6.QtWidgets import QWidget, QHBoxLayout, QLabel, QPushButton
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtCore import Signal
|
||||
from PySide2.QtWidgets import QWidget, QHBoxLayout, QLabel, QPushButton
|
||||
|
||||
from game import Game
|
||||
from game.ato.flightmember import FlightMember
|
||||
@ -9,7 +11,7 @@ class OwnLaserCodeInfo(QHBoxLayout):
|
||||
assigned_laser_code_changed = Signal()
|
||||
|
||||
def __init__(
|
||||
self, game: Game, flight_member: FlightMember, parent: QWidget | None = None
|
||||
self, game: Game, flight_member: FlightMember, parent: Optional[QWidget] = None
|
||||
) -> None:
|
||||
super().__init__(parent)
|
||||
self.game = game
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from PySide6.QtWidgets import QComboBox, QWidget
|
||||
from PySide2.QtWidgets import QComboBox, QWidget
|
||||
|
||||
from game import Game
|
||||
from game.ato.flightmember import FlightMember
|
||||
|
||||
@ -31,13 +31,13 @@ class QGeneralFlightSettingsTab(QFrame):
|
||||
payload_tab: QFlightPayloadTab,
|
||||
):
|
||||
super().__init__()
|
||||
self.flight = flight
|
||||
self.payload_tab = payload_tab
|
||||
|
||||
self.flight_slot_editor = QFlightSlotEditor(package_model, flight, game.game)
|
||||
self.flight_slot_editor.flight_resized.connect(self.flight_size_changed)
|
||||
for pc in self.flight_slot_editor.roster_editor.pilot_controls:
|
||||
pc.player_toggled.connect(
|
||||
lambda: payload_tab.property_editor.build_props(flight)
|
||||
)
|
||||
pc.player_toggled.connect(self.on_player_toggle)
|
||||
|
||||
widgets = [
|
||||
QFlightTypeTaskInfo(flight),
|
||||
@ -59,3 +59,7 @@ class QGeneralFlightSettingsTab(QFrame):
|
||||
vstretch.addStretch()
|
||||
layout.addLayout(vstretch, row, 0)
|
||||
self.setLayout(layout)
|
||||
|
||||
def on_player_toggle(self) -> None:
|
||||
self.payload_tab.property_editor.build_props(self.flight)
|
||||
self.payload_tab.own_laser_code_info.bind_to_selected_member()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user