Update pydcs, adapt to new Point APIs.

This is briefly moving us over to my fork of pydcs while we wait for
https://github.com/pydcs/dcs/pull/206 to be merged. The adaptation is
invasive enough that I don't want it lingering for long.
This commit is contained in:
Dan Albert
2022-02-21 18:14:49 -08:00
parent ff12b37431
commit 9e2e4ffa74
29 changed files with 155 additions and 186 deletions

View File

@@ -4,9 +4,10 @@ from typing import Optional
from PySide2.QtCore import Property, QObject, Signal, Slot
from dcs import Point
from dcs.mapping import LatLng
from game.server.leaflet import LeafletLatLon
from game.theater import ConflictTheater, ControlPoint, ControlPointStatus, LatLon
from game.theater import ConflictTheater, ControlPoint, ControlPointStatus
from game.utils import meters, nautical_miles
from qt_ui.dialogs import Dialog
from qt_ui.models import GameModel
@@ -83,7 +84,7 @@ class ControlPointJs(QObject):
@Slot(list, result=bool)
def destinationInRange(self, destination: LeafletLatLon) -> bool:
return self.destination_in_range(self.theater.ll_to_point(LatLon(*destination)))
return self.destination_in_range(self.theater.ll_to_point(LatLng(*destination)))
@Slot(list, result=str)
def setDestination(self, destination: LeafletLatLon) -> str:
@@ -92,7 +93,7 @@ class ControlPointJs(QObject):
if not self.control_point.captured:
return f"{self.control_point} is not owned by player"
point = self.theater.ll_to_point(LatLon(*destination))
point = self.theater.ll_to_point(LatLng(*destination))
if not self.destination_in_range(point):
return (
f"Cannot move {self.control_point} more than "