mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Basic implementation of road based transfers.
This adds the models and UIs for creating ground unit transfer orders. Most of the feature is still missing: * The AI doesn't do them. * Transfers can move across the whole map in one turn. * Transfers between disconnected bases are allowed. * Transfers are not modeled in the simulation, so they can't be interdicted. https://github.com/Khopa/dcs_liberation/issues/824
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Widgets for displaying air tasking orders."""
|
||||
import logging
|
||||
from contextlib import contextmanager
|
||||
from typing import ContextManager, Optional
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtCore import (
|
||||
QItemSelectionModel,
|
||||
@@ -32,11 +31,11 @@ from PySide2.QtWidgets import (
|
||||
QVBoxLayout,
|
||||
)
|
||||
|
||||
from game import db
|
||||
from gen.ato import Package
|
||||
from gen.flights.flight import Flight
|
||||
from gen.flights.traveltime import TotEstimator
|
||||
from qt_ui.windows.GameUpdateSignal import GameUpdateSignal
|
||||
from ..delegate_helpers import painter_context
|
||||
from ..models import AtoModel, GameModel, NullListModel, PackageModel
|
||||
|
||||
|
||||
@@ -312,15 +311,6 @@ class QFlightPanel(QGroupBox):
|
||||
self.flight_list.delete_flight(index)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def painter_context(painter: QPainter) -> ContextManager[None]:
|
||||
try:
|
||||
painter.save()
|
||||
yield
|
||||
finally:
|
||||
painter.restore()
|
||||
|
||||
|
||||
class PackageDelegate(QStyledItemDelegate):
|
||||
FONT_SIZE = 12
|
||||
HMARGIN = 4
|
||||
|
||||
Reference in New Issue
Block a user