diff --git a/game/theater/theatergroundobject.py b/game/theater/theatergroundobject.py index 04c44f84..f768992d 100644 --- a/game/theater/theatergroundobject.py +++ b/game/theater/theatergroundobject.py @@ -5,9 +5,9 @@ import logging from typing import Iterator, List, TYPE_CHECKING from dcs.mapping import Point +from dcs.triggers import TriggerZone from dcs.unit import Unit from dcs.unitgroup import Group -from dcs.triggers import TriggerZone, Triggers from .. import db from ..data.radar_db import UNITS_WITH_RADAR @@ -20,78 +20,25 @@ if TYPE_CHECKING: from .missiontarget import MissionTarget NAME_BY_CATEGORY = { - "power": "Power plant", - "ammo": "Ammo depot", - "fuel": "Fuel depot", + "ewr": "Early Warning Radar", "aa": "AA Defense Site", - "ware": "Warehouse", - "farp": "FARP", - "fob": "FOB", - "factory": "Factory", - "comms": "Comms. tower", - "oil": "Oil platform", - "derrick": "Derrick", - "ww2bunker": "Bunker", - "village": "Village", "allycamp": "Camp", - "EWR": "EWR", -} - -ABBREV_NAME = { - "power": "PLANT", - "ammo": "AMMO", - "fuel": "FUEL", - "aa": "AA", - "ware": "WARE", + "ammo": "Ammo depot", + "armor": "Armor group", + "coastal": "Coastal defense", + "comms": "Communications tower", + "derrick": "Derrick", + "factory": "Factory", "farp": "FARP", "fob": "FOB", - "factory": "FACTORY", - "comms": "COMMST", - "oil": "OILP", - "derrick": "DERK", - "ww2bunker": "BUNK", - "village": "VLG", - "allycamp": "CMP", -} - -CATEGORY_MAP = { - # Special cases - "CARRIER": ["CARRIER"], - "LHA": ["LHA"], - "aa": ["AA"], - # Buildings - "power": [ - "Workshop A", - "Electric power box", - "Garage small A", - "Farm B", - "Repair workshop", - "Garage B", - ], - "ware": ["Warehouse", "Hangar A"], - "fuel": ["Tank", "Tank 2", "Tank 3", "Fuel tank"], - "ammo": [".Ammunition depot", "Hangar B"], - "farp": [ - "FARP Tent", - "FARP Ammo Dump Coating", - "FARP Fuel Depot", - "FARP Command Post", - "FARP CP Blindage", - ], - "fob": ["Bunker 2", "Bunker 1", "Garage small B", ".Command Center", "Barracks 2"], - "factory": ["Tech combine", "Tech hangar A"], - "comms": ["TV tower", "Comms tower M"], - "oil": ["Oil platform"], - "derrick": ["Oil derrick", "Pump station", "Subsidiary structure 2"], - "ww2bunker": [ - "Siegfried Line", - "Fire Control Bunker", - "SK_C_28_naval_gun", - "Concertina Wire", - "Czech hedgehogs 1", - ], - "village": ["Small house 1B", "Small House 1A", "Small warehouse 1"], - "allycamp": [], + "fuel": "Fuel depot", + "missile": "Missile site", + "oil": "Oil platform", + "power": "Power plant", + "ship": "Ship", + "village": "Village", + "ware": "Warehouse", + "ww2bunker": "Bunker", } @@ -414,7 +361,7 @@ class MissileSiteGroundObject(TheaterGroundObject): ) -> None: super().__init__( name=name, - category="aa", + category="missile", group_id=group_id, position=position, heading=0, @@ -436,7 +383,7 @@ class CoastalSiteGroundObject(TheaterGroundObject): ) -> None: super().__init__( name=name, - category="aa", + category="coastal", group_id=group_id, position=position, heading=heading, @@ -510,7 +457,7 @@ class VehicleGroupGroundObject(BaseDefenseGroundObject): ) -> None: super().__init__( name=name, - category="aa", + category="armor", group_id=group_id, position=position, heading=0, @@ -532,7 +479,7 @@ class EwrGroundObject(BaseDefenseGroundObject): ) -> None: super().__init__( name=name, - category="EWR", + category="ewr", group_id=group_id, position=position, heading=0, @@ -565,7 +512,7 @@ class ShipGroundObject(NavalGroundObject): ) -> None: super().__init__( name=name, - category="aa", + category="ship", group_id=group_id, position=position, heading=0, diff --git a/qt_ui/uiconstants.py b/qt_ui/uiconstants.py index 52b9300f..b8d4f36c 100644 --- a/qt_ui/uiconstants.py +++ b/qt_ui/uiconstants.py @@ -3,10 +3,9 @@ from typing import Dict from PySide2.QtGui import QColor, QFont, QPixmap -from game.theater.theatergroundobject import CATEGORY_MAP +from game.theater.theatergroundobject import NAME_BY_CATEGORY from .liberation_theme import get_theme_icons - URLS: Dict[str, str] = { "Manual": "https://github.com/dcs-liberation/dcs_liberation/wiki", "Repository": "https://github.com/dcs-liberation/dcs_liberation", @@ -141,22 +140,14 @@ def load_icons(): ICONS["target"] = QPixmap("./resources/ui/ground_assets/target.png") ICONS["cleared"] = QPixmap("./resources/ui/ground_assets/cleared.png") - for category in CATEGORY_MAP.keys(): + for category in NAME_BY_CATEGORY.keys(): ICONS[category] = QPixmap("./resources/ui/ground_assets/" + category + ".png") ICONS[category + "_blue"] = QPixmap( "./resources/ui/ground_assets/" + category + "_blue.png" ) ICONS["destroyed"] = QPixmap("./resources/ui/ground_assets/destroyed.png") - ICONS["EWR"] = QPixmap("./resources/ui/ground_assets/ewr.png") - ICONS["EWR_blue"] = QPixmap("./resources/ui/ground_assets/ewr_blue.png") - ICONS["ship"] = QPixmap("./resources/ui/ground_assets/ship.png") - ICONS["ship_blue"] = QPixmap("./resources/ui/ground_assets/ship_blue.png") - ICONS["missile"] = QPixmap("./resources/ui/ground_assets/missile.png") - ICONS["missile_blue"] = QPixmap("./resources/ui/ground_assets/missile_blue.png") ICONS["nothreat"] = QPixmap("./resources/ui/ground_assets/nothreat.png") ICONS["nothreat_blue"] = QPixmap("./resources/ui/ground_assets/nothreat_blue.png") - ICONS["coastal"] = QPixmap("./resources/ui/ground_assets/coastal.png") - ICONS["coastal_blue"] = QPixmap("./resources/ui/ground_assets/coastal_blue.png") ICONS["Generator"] = QPixmap( "./resources/ui/misc/" + get_theme_icons() + "/generator.png" diff --git a/qt_ui/widgets/map/QMapGroundObject.py b/qt_ui/widgets/map/QMapGroundObject.py index 10c52d09..a93a566c 100644 --- a/qt_ui/widgets/map/QMapGroundObject.py +++ b/qt_ui/widgets/map/QMapGroundObject.py @@ -84,12 +84,6 @@ class QMapGroundObject(QMapObject): painter.save() cat = self.ground_object.category - if cat == "aa" and self.ground_object.sea_object: - cat = "ship" - if isinstance(self.ground_object, MissileSiteGroundObject): - cat = "missile" - if isinstance(self.ground_object, CoastalSiteGroundObject): - cat = "coastal" rect = QRect( option.rect.x() + 2, diff --git a/resources/ui/ground_assets/armor.png b/resources/ui/ground_assets/armor.png new file mode 100644 index 00000000..6034304c Binary files /dev/null and b/resources/ui/ground_assets/armor.png differ diff --git a/resources/ui/ground_assets/armor_blue.png b/resources/ui/ground_assets/armor_blue.png new file mode 100644 index 00000000..6034304c Binary files /dev/null and b/resources/ui/ground_assets/armor_blue.png differ