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:
Dan Albert
2021-02-15 12:49:36 -08:00
parent b65d178cf1
commit e9ff554f39
12 changed files with 702 additions and 30 deletions

View File

@@ -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