Update ControlPoint UI to use milsymbol library.
This gets us out of the business of maintaining our own icons. The milsymbol library generates the SVG data needed to display anything covered by APP-6.
@ -27,12 +27,21 @@ from dcs.ships import Forrestal, KUZNECOW, LHA_Tarawa, Stennis, Type_071
|
|||||||
from dcs.terrain.terrain import Airport, ParkingSlot
|
from dcs.terrain.terrain import Airport, ParkingSlot
|
||||||
from dcs.unitgroup import ShipGroup, StaticGroup
|
from dcs.unitgroup import ShipGroup, StaticGroup
|
||||||
|
|
||||||
|
from game.ato.closestairfields import ObjectiveDistanceCache
|
||||||
from game.ground_forces.combat_stance import CombatStance
|
from game.ground_forces.combat_stance import CombatStance
|
||||||
from game.point_with_heading import PointWithHeading
|
from game.point_with_heading import PointWithHeading
|
||||||
from game.runways import RunwayAssigner, RunwayData
|
from game.runways import RunwayAssigner, RunwayData
|
||||||
from game.scenery_group import SceneryGroup
|
from game.scenery_group import SceneryGroup
|
||||||
|
from game.sidc import (
|
||||||
|
Entity,
|
||||||
|
LandInstallationEntity,
|
||||||
|
SeaSurfaceEntity,
|
||||||
|
StandardIdentity,
|
||||||
|
Status,
|
||||||
|
SymbolIdentificationCode,
|
||||||
|
SymbolSet,
|
||||||
|
)
|
||||||
from game.utils import Heading
|
from game.utils import Heading
|
||||||
from game.ato.closestairfields import ObjectiveDistanceCache
|
|
||||||
from .base import Base
|
from .base import Base
|
||||||
from .missiontarget import MissionTarget
|
from .missiontarget import MissionTarget
|
||||||
from .theatergroundobject import (
|
from .theatergroundobject import (
|
||||||
@ -342,6 +351,29 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
def captured(self) -> bool:
|
def captured(self) -> bool:
|
||||||
return self.coalition.player
|
return self.coalition.player
|
||||||
|
|
||||||
|
def sidc(self) -> SymbolIdentificationCode:
|
||||||
|
iff = (
|
||||||
|
StandardIdentity.FRIEND if self.captured else StandardIdentity.HOSTILE_FAKER
|
||||||
|
)
|
||||||
|
|
||||||
|
if self.status is ControlPointStatus.Functional:
|
||||||
|
status = Status.PRESENT
|
||||||
|
elif self.status is ControlPointStatus.Damaged:
|
||||||
|
status = Status.PRESENT_DAMAGED
|
||||||
|
elif self.status is ControlPointStatus.Destroyed:
|
||||||
|
status = Status.PRESENT_DESTROYED
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Unexpected ControlPointStatus: {self.status}")
|
||||||
|
|
||||||
|
symbol_set, entity = self.symbol_set_and_entity()
|
||||||
|
return SymbolIdentificationCode(
|
||||||
|
standard_identity=iff, symbol_set=symbol_set, status=status, entity=entity
|
||||||
|
)
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||||
|
...
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ground_objects(self) -> List[TheaterGroundObject]:
|
def ground_objects(self) -> List[TheaterGroundObject]:
|
||||||
return list(self.connected_objectives)
|
return list(self.connected_objectives)
|
||||||
@ -875,6 +907,9 @@ class Airfield(ControlPoint):
|
|||||||
self.airport = airport
|
self.airport = airport
|
||||||
self._runway_status = RunwayStatus()
|
self._runway_status = RunwayStatus()
|
||||||
|
|
||||||
|
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||||
|
return SymbolSet.LAND_INSTALLATIONS, LandInstallationEntity.AIPORT_AIR_BASE
|
||||||
|
|
||||||
def can_operate(self, aircraft: AircraftType) -> bool:
|
def can_operate(self, aircraft: AircraftType) -> bool:
|
||||||
# TODO: Allow helicopters.
|
# TODO: Allow helicopters.
|
||||||
# Need to implement ground spawns so the helos don't use the runway.
|
# Need to implement ground spawns so the helos don't use the runway.
|
||||||
@ -1058,6 +1093,9 @@ class Carrier(NavalControlPoint):
|
|||||||
cptype=ControlPointType.AIRCRAFT_CARRIER_GROUP,
|
cptype=ControlPointType.AIRCRAFT_CARRIER_GROUP,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||||
|
return SymbolSet.SEA_SURFACE, SeaSurfaceEntity.CARRIER
|
||||||
|
|
||||||
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
|
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
|
||||||
from game.ato import FlightType
|
from game.ato import FlightType
|
||||||
|
|
||||||
@ -1099,6 +1137,9 @@ class Lha(NavalControlPoint):
|
|||||||
cptype=ControlPointType.LHA_GROUP,
|
cptype=ControlPointType.LHA_GROUP,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||||
|
return SymbolSet.SEA_SURFACE, SeaSurfaceEntity.AMPHIBIOUS_ASSAULT_SHIP_GENERAL
|
||||||
|
|
||||||
def capture(self, game: Game, for_player: bool) -> None:
|
def capture(self, game: Game, for_player: bool) -> None:
|
||||||
raise RuntimeError("LHAs cannot be captured")
|
raise RuntimeError("LHAs cannot be captured")
|
||||||
|
|
||||||
@ -1133,6 +1174,9 @@ class OffMapSpawn(ControlPoint):
|
|||||||
cptype=ControlPointType.OFF_MAP,
|
cptype=ControlPointType.OFF_MAP,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||||
|
return SymbolSet.LAND_INSTALLATIONS, LandInstallationEntity.AIPORT_AIR_BASE
|
||||||
|
|
||||||
def capture(self, game: Game, for_player: bool) -> None:
|
def capture(self, game: Game, for_player: bool) -> None:
|
||||||
raise RuntimeError("Off map control points cannot be captured")
|
raise RuntimeError("Off map control points cannot be captured")
|
||||||
|
|
||||||
@ -1195,6 +1239,9 @@ class Fob(ControlPoint):
|
|||||||
)
|
)
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
|
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||||
|
return SymbolSet.LAND_INSTALLATIONS, LandInstallationEntity.MILITARY_BASE
|
||||||
|
|
||||||
def runway_is_operational(self) -> bool:
|
def runway_is_operational(self) -> bool:
|
||||||
return self.has_helipads
|
return self.has_helipads
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ from dcs import Point
|
|||||||
from dcs.mapping import LatLng
|
from dcs.mapping import LatLng
|
||||||
|
|
||||||
from game.server.leaflet import LeafletLatLon
|
from game.server.leaflet import LeafletLatLon
|
||||||
from game.theater import ConflictTheater, ControlPoint, ControlPointStatus
|
from game.theater import ConflictTheater, ControlPoint
|
||||||
from game.utils import meters, nautical_miles
|
from game.utils import meters, nautical_miles
|
||||||
from qt_ui.dialogs import Dialog
|
from qt_ui.dialogs import Dialog
|
||||||
from qt_ui.models import GameModel
|
from qt_ui.models import GameModel
|
||||||
@ -22,8 +22,7 @@ class ControlPointJs(QObject):
|
|||||||
positionChanged = Signal()
|
positionChanged = Signal()
|
||||||
mobileChanged = Signal()
|
mobileChanged = Signal()
|
||||||
destinationChanged = Signal(list)
|
destinationChanged = Signal(list)
|
||||||
categoryChanged = Signal()
|
sidcChanged = Signal()
|
||||||
statusChanged = Signal()
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -45,20 +44,9 @@ class ControlPointJs(QObject):
|
|||||||
def blue(self) -> bool:
|
def blue(self) -> bool:
|
||||||
return self.control_point.captured
|
return self.control_point.captured
|
||||||
|
|
||||||
@Property(str, notify=categoryChanged)
|
@Property(str, notify=sidcChanged)
|
||||||
def category(self) -> str:
|
def sidc(self) -> str:
|
||||||
return self.control_point.category
|
return str(self.control_point.sidc())
|
||||||
|
|
||||||
@Property(str, notify=statusChanged)
|
|
||||||
def status(self) -> str:
|
|
||||||
status = self.control_point.status
|
|
||||||
if status is ControlPointStatus.Functional:
|
|
||||||
return "alive"
|
|
||||||
elif status is ControlPointStatus.Damaged:
|
|
||||||
return "damaged"
|
|
||||||
elif status is ControlPointStatus.Destroyed:
|
|
||||||
return "destroyed"
|
|
||||||
raise ValueError(f"Unhandled ControlPointStatus: {status.name}")
|
|
||||||
|
|
||||||
@Property(list, notify=positionChanged)
|
@Property(list, notify=positionChanged)
|
||||||
def position(self) -> LeafletLatLon:
|
def position(self) -> LeafletLatLon:
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="158" height="118" viewBox="21 36 158 118"><path d="M25,50 l150,0 0,100 -150,0 z" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></path><path d="M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M80,70 l40,0 M80,80 l25,-25 M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M85,48 85,40 115,40 115,48 100,46 Z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 767 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="158" height="148" viewBox="21 36 158 148"><path d="M25,50 l150,0 0,100 -150,0 z" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></path><path d="M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M80,70 l40,0 M80,80 l25,-25 M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M85,48 85,40 115,40 115,48 100,46 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M25,155 l150,0 0,25 -150,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 868 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="158" height="148" viewBox="21 36 158 148"><path d="M25,50 l150,0 0,100 -150,0 z" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></path><path d="M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M80,70 l40,0 M80,80 l25,-25 M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M85,48 85,40 115,40 115,48 100,46 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M25,155 l150,0 0,25 -150,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 866 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="162" viewBox="24 14 152 162"><path d="M 100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M80,70 l40,0 M80,80 l25,-25 M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M85,40 85,18 115,18 115,40 100,24 Z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 778 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="192" viewBox="24 14 152 192"><path d="M 100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M80,70 l40,0 M80,80 l25,-25 M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M85,40 85,18 115,18 115,40 100,24 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 879 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="192" viewBox="24 14 152 192"><path d="M 100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M80,70 l40,0 M80,80 l25,-25 M100,80 l0,40 M81,90.5 l38,19 M81,109.5 l38,-19" stroke-width="4" stroke="black" fill="none" ></path><circle cx="100" cy="100" r="20" stroke-width="4" stroke="black" fill="none" ></circle><path d="M85,40 85,18 115,18 115,40 100,24 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 877 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="128" viewBox="36 36 128 128"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 347 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="158" viewBox="36 36 128 158"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path><path d="M40,165 l120,0 0,25 -120,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 448 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="128" viewBox="36 36 128 128"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><circle cx="100" cy="100" r="60" stroke-width="5" stroke-dasharray="8,12" stroke="rgb(239, 239, 239)" fill="none" ></circle><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 471 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="158" viewBox="36 36 128 158"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path><path d="M40,165 l120,0 0,25 -120,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 446 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="152" viewBox="24 24 152 152"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 361 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="182" viewBox="24 24 152 182"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 462 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="152" viewBox="24 24 152 152"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="5" stroke-dasharray="8,12" stroke="rgb(239, 239, 239)" fill="none" ></path><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 501 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="182" viewBox="24 24 152 182"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="m 80,100 20,20 20,-20 -20,0 0,-20 -20,0 z" stroke-width="4" stroke="black" fill="black" ></path><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 460 B |
|
Before Width: | Height: | Size: 417 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="158" height="118" viewBox="21 36 158 118"><path d="M25,50 l150,0 0,100 -150,0 z" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></path><path d="m 75,85 50,30 m -50,0 50,-30" stroke-width="4" stroke="black" fill="none" ></path><path d="M85,48 85,40 115,40 115,48 100,46 Z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 436 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="158" height="148" viewBox="21 36 158 148"><path d="M25,50 l150,0 0,100 -150,0 z" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></path><path d="m 75,85 50,30 m -50,0 50,-30" stroke-width="4" stroke="black" fill="none" ></path><path d="M85,48 85,40 115,40 115,48 100,46 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M25,155 l150,0 0,25 -150,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 537 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="158" height="148" viewBox="21 36 158 148"><path d="M25,50 l150,0 0,100 -150,0 z" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></path><path d="m 75,85 50,30 m -50,0 50,-30" stroke-width="4" stroke="black" fill="none" ></path><path d="M85,48 85,40 115,40 115,48 100,46 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M25,155 l150,0 0,25 -150,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 535 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="162" viewBox="24 14 152 162"><path d="M 100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="m 75,85 50,30 m -50,0 50,-30" stroke-width="4" stroke="black" fill="none" ></path><path d="M85,40 85,18 115,18 115,40 100,24 Z" stroke-width="4" stroke="black" fill="black" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 447 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="192" viewBox="24 14 152 192"><path d="M 100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="m 75,85 50,30 m -50,0 50,-30" stroke-width="4" stroke="black" fill="none" ></path><path d="M85,40 85,18 115,18 115,40 100,24 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 548 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="192" viewBox="24 14 152 192"><path d="M 100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="m 75,85 50,30 m -50,0 50,-30" stroke-width="4" stroke="black" fill="none" ></path><path d="M85,40 85,18 115,18 115,40 100,24 Z" stroke-width="4" stroke="black" fill="black" ></path><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 546 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="128" viewBox="36 36 128 128"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text></svg>
|
|
||||||
|
Before Width: | Height: | Size: 394 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="158" viewBox="36 36 128 158"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text><path d="M40,165 l120,0 0,25 -120,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 495 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="128" viewBox="36 36 128 128"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><circle cx="100" cy="100" r="60" stroke-width="5" stroke-dasharray="8,12" stroke="rgb(239, 239, 239)" fill="none" ></circle><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text></svg>
|
|
||||||
|
Before Width: | Height: | Size: 518 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="128" height="158" viewBox="36 36 128 158"><circle cx="100" cy="100" r="60" stroke-width="4" stroke="black" fill="rgb(0,107,140)" fill-opacity="1" ></circle><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text><path d="M40,165 l120,0 0,25 -120,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 493 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="152" viewBox="24 24 152 152"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text></svg>
|
|
||||||
|
Before Width: | Height: | Size: 408 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="182" viewBox="24 24 152 182"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,255,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 509 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="152" viewBox="24 24 152 152"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="5" stroke-dasharray="8,12" stroke="rgb(239, 239, 239)" fill="none" ></path><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text></svg>
|
|
||||||
|
Before Width: | Height: | Size: 548 B |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="152" height="182" viewBox="24 24 152 182"><path d="M100,28 L172,100 100,172 28,100 100,28 Z" stroke-width="4" stroke="black" fill="rgb(200,0,0)" fill-opacity="1" ></path><text x="100" y="110" text-anchor="middle" font-size="35" font-family="Arial" font-weight="bold" stroke-width="4" stroke="none" fill="black" >LHA</text><path d="M28,177 l144,0 0,25 -144,0 z" stroke-width="4" stroke="black" fill="rgb(255,0,0)" ></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 507 B |
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
<link rel="stylesheet" href="lib/leaflet-ruler/leaflet-ruler.css">
|
<link rel="stylesheet" href="lib/leaflet-ruler/leaflet-ruler.css">
|
||||||
<script src="lib/leaflet-ruler/leaflet-ruler.js"></script>
|
<script src="lib/leaflet-ruler/leaflet-ruler.js"></script>
|
||||||
|
|
||||||
|
<script src="lib/milsymbol/milsymbol.js"></script>
|
||||||
|
|
||||||
<script src="map.js" defer="defer"></script>
|
<script src="map.js" defer="defer"></script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
29606
resources/ui/map/lib/milsymbol/milsymbol.development.js
Normal file
29424
resources/ui/map/lib/milsymbol/milsymbol.esm.js
Normal file
27
resources/ui/map/lib/milsymbol/milsymbol.js
Normal file
1
resources/ui/map/lib/milsymbol/milsymbol.js.map
Normal file
@ -61,36 +61,6 @@ const UnitState = Object.freeze({
|
|||||||
Destroyed: "destroyed",
|
Destroyed: "destroyed",
|
||||||
});
|
});
|
||||||
|
|
||||||
class CpIcons {
|
|
||||||
constructor() {
|
|
||||||
this.icons = {};
|
|
||||||
for (const player of [true, false]) {
|
|
||||||
this.icons[player] = {};
|
|
||||||
for (const state of Object.values(UnitState)) {
|
|
||||||
this.icons[player][state] = {
|
|
||||||
airfield: this.loadIcon("airfield", player, state),
|
|
||||||
cv: this.loadIcon("cv", player, state),
|
|
||||||
fob: this.loadIcon("fob", player, state),
|
|
||||||
lha: this.loadIcon("lha", player, state),
|
|
||||||
offmap: this.loadIcon("airfield", player, state),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
icon(category, player, state) {
|
|
||||||
return this.icons[player][state][category];
|
|
||||||
}
|
|
||||||
|
|
||||||
loadIcon(category, player, state) {
|
|
||||||
const color = player ? "blue" : "red";
|
|
||||||
return new L.Icon({
|
|
||||||
iconUrl: `../ground_assets/${category}_${color}_${state}.svg`,
|
|
||||||
iconSize: [32, 32],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TgoIcons {
|
class TgoIcons {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.icons = {};
|
this.icons = {};
|
||||||
@ -163,7 +133,6 @@ class AirIcons {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Icons = Object.freeze({
|
const Icons = Object.freeze({
|
||||||
ControlPoints: new CpIcons(),
|
|
||||||
Objectives: new TgoIcons(),
|
Objectives: new TgoIcons(),
|
||||||
AirIcons: new AirIcons(),
|
AirIcons: new AirIcons(),
|
||||||
});
|
});
|
||||||
@ -458,11 +427,14 @@ class ControlPoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
icon() {
|
icon() {
|
||||||
return Icons.ControlPoints.icon(
|
const symbol = new ms.Symbol(this.cp.sidc, {
|
||||||
this.cp.category,
|
size: 24,
|
||||||
this.cp.blue,
|
colorMode: "Dark",
|
||||||
this.cp.status
|
});
|
||||||
);
|
return L.icon({
|
||||||
|
iconUrl: symbol.toDataURL(),
|
||||||
|
iconAnchor: L.point(symbol.getAnchor().x, symbol.getAnchor().y),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDestination() {
|
hasDestination() {
|
||||||
|
|||||||