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.
This commit is contained in:
Dan Albert 2022-02-27 19:06:21 -08:00
parent e1cdbed2e1
commit e7398af877
37 changed files with 59121 additions and 82 deletions

View File

@ -27,12 +27,21 @@ from dcs.ships import Forrestal, KUZNECOW, LHA_Tarawa, Stennis, Type_071
from dcs.terrain.terrain import Airport, ParkingSlot
from dcs.unitgroup import ShipGroup, StaticGroup
from game.ato.closestairfields import ObjectiveDistanceCache
from game.ground_forces.combat_stance import CombatStance
from game.point_with_heading import PointWithHeading
from game.runways import RunwayAssigner, RunwayData
from game.scenery_group import SceneryGroup
from game.sidc import (
Entity,
LandInstallationEntity,
SeaSurfaceEntity,
StandardIdentity,
Status,
SymbolIdentificationCode,
SymbolSet,
)
from game.utils import Heading
from game.ato.closestairfields import ObjectiveDistanceCache
from .base import Base
from .missiontarget import MissionTarget
from .theatergroundobject import (
@ -342,6 +351,29 @@ class ControlPoint(MissionTarget, ABC):
def captured(self) -> bool:
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
def ground_objects(self) -> List[TheaterGroundObject]:
return list(self.connected_objectives)
@ -875,6 +907,9 @@ class Airfield(ControlPoint):
self.airport = airport
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:
# TODO: Allow helicopters.
# 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,
)
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
return SymbolSet.SEA_SURFACE, SeaSurfaceEntity.CARRIER
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
from game.ato import FlightType
@ -1099,6 +1137,9 @@ class Lha(NavalControlPoint):
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:
raise RuntimeError("LHAs cannot be captured")
@ -1133,6 +1174,9 @@ class OffMapSpawn(ControlPoint):
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:
raise RuntimeError("Off map control points cannot be captured")
@ -1195,6 +1239,9 @@ class Fob(ControlPoint):
)
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:
return self.has_helipads

View File

@ -7,7 +7,7 @@ from dcs import Point
from dcs.mapping import LatLng
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 qt_ui.dialogs import Dialog
from qt_ui.models import GameModel
@ -22,8 +22,7 @@ class ControlPointJs(QObject):
positionChanged = Signal()
mobileChanged = Signal()
destinationChanged = Signal(list)
categoryChanged = Signal()
statusChanged = Signal()
sidcChanged = Signal()
def __init__(
self,
@ -45,20 +44,9 @@ class ControlPointJs(QObject):
def blue(self) -> bool:
return self.control_point.captured
@Property(str, notify=categoryChanged)
def category(self) -> str:
return self.control_point.category
@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(str, notify=sidcChanged)
def sidc(self) -> str:
return str(self.control_point.sidc())
@Property(list, notify=positionChanged)
def position(self) -> LeafletLatLon:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,6 +19,8 @@
<link rel="stylesheet" href="lib/leaflet-ruler/leaflet-ruler.css">
<script src="lib/leaflet-ruler/leaflet-ruler.js"></script>
<script src="lib/milsymbol/milsymbol.js"></script>
<script src="map.js" defer="defer"></script>
<style>
body { padding: 0; margin: 0; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -61,36 +61,6 @@ const UnitState = Object.freeze({
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 {
constructor() {
this.icons = {};
@ -163,7 +133,6 @@ class AirIcons {
}
const Icons = Object.freeze({
ControlPoints: new CpIcons(),
Objectives: new TgoIcons(),
AirIcons: new AirIcons(),
});
@ -458,11 +427,14 @@ class ControlPoint {
}
icon() {
return Icons.ControlPoints.icon(
this.cp.category,
this.cp.blue,
this.cp.status
);
const symbol = new ms.Symbol(this.cp.sidc, {
size: 24,
colorMode: "Dark",
});
return L.icon({
iconUrl: symbol.toDataURL(),
iconAnchor: L.point(symbol.getAnchor().x, symbol.getAnchor().y),
});
}
hasDestination() {