mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Datalink support + pydcs update
Support for 2.9.10.4160, though without Iraq, but finally there's some basic support for datalink...
This commit is contained in:
@@ -11,6 +11,7 @@ from game.ato.flightmember import FlightMember
|
||||
from .missingpropertydataerror import MissingPropertyDataError
|
||||
from .propertycheckbox import PropertyCheckBox
|
||||
from .propertycombobox import PropertyComboBox
|
||||
from .propertyeditbox import PropertyEditBox
|
||||
from .propertyspinbox import PropertySpinBox
|
||||
|
||||
|
||||
@@ -22,6 +23,7 @@ class UnhandledControlTypeError(RuntimeError):
|
||||
class PropertyEditor(QGridLayout):
|
||||
def __init__(self, flight: Flight, flight_member: FlightMember) -> None:
|
||||
super().__init__()
|
||||
self.flight = flight
|
||||
self.flight_member = flight_member
|
||||
self.flight_member_update_listeners: list[Callable[[FlightMember], None]] = []
|
||||
|
||||
@@ -78,7 +80,7 @@ class PropertyEditor(QGridLayout):
|
||||
|
||||
def control_for_property(self, prop: UnitPropertyDescription) -> Optional[QWidget]:
|
||||
# Valid values are:
|
||||
# "checkbox", "comboList", "groupbox", "label", "slider", "spinbox"
|
||||
# "checkbox", "comboList", "groupbox", "label", "slider", "spinbox", "editbox"
|
||||
match prop.control:
|
||||
case "checkbox":
|
||||
widget = PropertyCheckBox(self.flight_member, prop)
|
||||
@@ -94,6 +96,10 @@ class PropertyEditor(QGridLayout):
|
||||
widget = PropertySpinBox(self.flight_member, prop)
|
||||
self.flight_member_update_listeners.append(widget.set_flight_member)
|
||||
return widget
|
||||
case "editbox":
|
||||
widget = PropertyEditBox(self.flight_member, prop, self.flight)
|
||||
self.flight_member_update_listeners.append(widget.set_flight_member)
|
||||
return widget
|
||||
case _:
|
||||
raise UnhandledControlTypeError(prop.control)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user