mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
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
14 lines
275 B
Python
14 lines
275 B
Python
from contextlib import contextmanager
|
|
from typing import ContextManager
|
|
|
|
from PySide2.QtGui import QPainter
|
|
|
|
|
|
@contextmanager
|
|
def painter_context(painter: QPainter) -> ContextManager[None]:
|
|
try:
|
|
painter.save()
|
|
yield
|
|
finally:
|
|
painter.restore()
|