mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Show SAM range on map.
This commit is contained in:
parent
f698cb66b8
commit
f5a5fb765b
@ -771,6 +771,7 @@ FACTIONS = {
|
|||||||
|
|
||||||
AirDefence.AAA_Vulcan_M163,
|
AirDefence.AAA_Vulcan_M163,
|
||||||
AirDefence.SAM_Linebacker_M6,
|
AirDefence.SAM_Linebacker_M6,
|
||||||
|
AirDefence.SAM_Hawk_PCP,
|
||||||
|
|
||||||
CVN_74_John_C__Stennis,
|
CVN_74_John_C__Stennis,
|
||||||
LHA_1_Tarawa,
|
LHA_1_Tarawa,
|
||||||
@ -808,8 +809,7 @@ FACTIONS = {
|
|||||||
Unarmed.Transport_M818,
|
Unarmed.Transport_M818,
|
||||||
Infantry.Infantry_M4,
|
Infantry.Infantry_M4,
|
||||||
|
|
||||||
AirDefence.AAA_Vulcan_M163,
|
AirDefence.SAM_Hawk_PCP,
|
||||||
AirDefence.SAM_Linebacker_M6,
|
|
||||||
|
|
||||||
CVN_74_John_C__Stennis,
|
CVN_74_John_C__Stennis,
|
||||||
LHA_1_Tarawa,
|
LHA_1_Tarawa,
|
||||||
@ -847,6 +847,7 @@ FACTIONS = {
|
|||||||
Unarmed.Transport_M818,
|
Unarmed.Transport_M818,
|
||||||
Infantry.Infantry_M4,
|
Infantry.Infantry_M4,
|
||||||
|
|
||||||
|
AirDefence.SAM_Hawk_PCP,
|
||||||
AirDefence.SAM_Patriot_EPP_III,
|
AirDefence.SAM_Patriot_EPP_III,
|
||||||
|
|
||||||
CVN_74_John_C__Stennis,
|
CVN_74_John_C__Stennis,
|
||||||
@ -874,6 +875,7 @@ FACTIONS = {
|
|||||||
Infantry.Infantry_M4,
|
Infantry.Infantry_M4,
|
||||||
|
|
||||||
AirDefence.SAM_Roland_ADS,
|
AirDefence.SAM_Roland_ADS,
|
||||||
|
AirDefence.SAM_Hawk_PCP,
|
||||||
|
|
||||||
CVN_74_John_C__Stennis,
|
CVN_74_John_C__Stennis,
|
||||||
LHA_1_Tarawa,
|
LHA_1_Tarawa,
|
||||||
@ -905,6 +907,7 @@ FACTIONS = {
|
|||||||
|
|
||||||
AirDefence.SPAAA_Gepard,
|
AirDefence.SPAAA_Gepard,
|
||||||
AirDefence.SAM_Roland_ADS,
|
AirDefence.SAM_Roland_ADS,
|
||||||
|
AirDefence.SAM_Hawk_PCP,
|
||||||
|
|
||||||
CVN_74_John_C__Stennis,
|
CVN_74_John_C__Stennis,
|
||||||
LHA_1_Tarawa,
|
LHA_1_Tarawa,
|
||||||
|
|||||||
@ -54,6 +54,7 @@ def generate_anti_air_group(game, parent_cp, ground_object, faction:str):
|
|||||||
AirDefence.SPAAA_Gepard: GepardGenerator,
|
AirDefence.SPAAA_Gepard: GepardGenerator,
|
||||||
AirDefence.SAM_Roland_ADS: RolandGenerator,
|
AirDefence.SAM_Roland_ADS: RolandGenerator,
|
||||||
AirDefence.SAM_Patriot_LN_M901: PatriotGenerator,
|
AirDefence.SAM_Patriot_LN_M901: PatriotGenerator,
|
||||||
|
AirDefence.SAM_Patriot_EPP_III: PatriotGenerator,
|
||||||
AirDefence.SAM_Chaparral_M48: ChaparralGenerator,
|
AirDefence.SAM_Chaparral_M48: ChaparralGenerator,
|
||||||
|
|
||||||
AirDefence.SAM_SA_2_LN_SM_90: SA2Generator,
|
AirDefence.SAM_SA_2_LN_SM_90: SA2Generator,
|
||||||
|
|||||||
@ -28,7 +28,9 @@ COLORS: Dict[str, QColor] = {
|
|||||||
"green": QColor(128, 186, 128),
|
"green": QColor(128, 186, 128),
|
||||||
"bright_green": QColor(64, 200, 64),
|
"bright_green": QColor(64, 200, 64),
|
||||||
"black": QColor(0, 0, 0),
|
"black": QColor(0, 0, 0),
|
||||||
"black_transparent": QColor(0, 0, 0, 64)
|
"black_transparent": QColor(0, 0, 0, 64),
|
||||||
|
"blue_transparent": QColor(164, 164, 255, 64),
|
||||||
|
"red_transparent": QColor(255, 125, 125, 64)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import typing
|
import typing
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from PySide2.QtCore import Qt, QRect
|
from PySide2.QtCore import Qt, QRect, QPointF
|
||||||
from PySide2.QtGui import QPixmap, QBrush, QColor, QWheelEvent, QPen, QFont
|
from PySide2.QtGui import QPixmap, QBrush, QColor, QWheelEvent, QPen, QFont
|
||||||
from PySide2.QtWidgets import QGraphicsView, QFrame, QGraphicsOpacityEffect
|
from PySide2.QtWidgets import QGraphicsView, QFrame, QGraphicsOpacityEffect
|
||||||
from dcs import Point
|
from dcs import Point
|
||||||
|
|
||||||
import qt_ui.uiconstants as CONST
|
import qt_ui.uiconstants as CONST
|
||||||
from game import Game
|
from game import Game, db
|
||||||
from game.event import InfantryTransportEvent, StrikeEvent, BaseAttackEvent, UnitsDeliveryEvent, Event, \
|
from game.event import InfantryTransportEvent, StrikeEvent, BaseAttackEvent, UnitsDeliveryEvent, Event, \
|
||||||
FrontlineAttackEvent, FrontlinePatrolEvent, ConvoyStrikeEvent
|
FrontlineAttackEvent, FrontlinePatrolEvent, ConvoyStrikeEvent
|
||||||
from gen import Conflict
|
from gen import Conflict
|
||||||
@ -75,6 +75,7 @@ class QLiberationMap(QGraphicsView):
|
|||||||
for cp in self.game.theater.controlpoints:
|
for cp in self.game.theater.controlpoints:
|
||||||
|
|
||||||
pos = self._transform_point(cp.position)
|
pos = self._transform_point(cp.position)
|
||||||
|
|
||||||
scene.addItem(QMapControlPoint(self, pos[0] - CONST.CP_SIZE / 2, pos[1] - CONST.CP_SIZE / 2, CONST.CP_SIZE,
|
scene.addItem(QMapControlPoint(self, pos[0] - CONST.CP_SIZE / 2, pos[1] - CONST.CP_SIZE / 2, CONST.CP_SIZE,
|
||||||
CONST.CP_SIZE, cp, self.game))
|
CONST.CP_SIZE, cp, self.game))
|
||||||
|
|
||||||
@ -89,6 +90,23 @@ class QLiberationMap(QGraphicsView):
|
|||||||
go_pos = self._transform_point(ground_object.position)
|
go_pos = self._transform_point(ground_object.position)
|
||||||
scene.addItem(QMapGroundObject(self, go_pos[0], go_pos[1], 16, 16, cp, ground_object))
|
scene.addItem(QMapGroundObject(self, go_pos[0], go_pos[1], 16, 16, cp, ground_object))
|
||||||
|
|
||||||
|
if(ground_object.category == "aa"):
|
||||||
|
max_range = 0
|
||||||
|
if ground_object.groups:
|
||||||
|
for g in ground_object.groups:
|
||||||
|
for u in g.units:
|
||||||
|
unit = db.unit_type_from_name(u.type)
|
||||||
|
if unit.threat_range > max_range:
|
||||||
|
max_range = unit.threat_range
|
||||||
|
if cp.captured:
|
||||||
|
pen = QPen(brush=CONST.COLORS["blue"])
|
||||||
|
brush = CONST.COLORS["blue_transparent"]
|
||||||
|
else:
|
||||||
|
pen = QPen(brush=CONST.COLORS["red"])
|
||||||
|
brush = CONST.COLORS["red_transparent"]
|
||||||
|
scene.addEllipse(go_pos[0] - max_range/300.0 + 8, go_pos[1] - max_range/300.0 + 8, max_range/150.0, max_range/150.0, pen, brush)
|
||||||
|
|
||||||
|
|
||||||
if self.get_display_rule("lines"):
|
if self.get_display_rule("lines"):
|
||||||
self.scene_create_lines_for_cp(cp)
|
self.scene_create_lines_for_cp(cp)
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
|
from PySide2.QtCore import QPoint, QRect, QPointF
|
||||||
from PySide2.QtGui import QPainter
|
from PySide2.QtGui import QPainter
|
||||||
from PySide2.QtWidgets import QGraphicsRectItem
|
from PySide2.QtWidgets import QGraphicsRectItem
|
||||||
|
|
||||||
import qt_ui.uiconstants as CONST
|
import qt_ui.uiconstants as CONST
|
||||||
|
from game import db
|
||||||
from theater import TheaterGroundObject, ControlPoint
|
from theater import TheaterGroundObject, ControlPoint
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +35,6 @@ class QMapGroundObject(QGraphicsRectItem):
|
|||||||
|
|
||||||
def paint(self, painter, option, widget=None):
|
def paint(self, painter, option, widget=None):
|
||||||
#super(QMapControlPoint, self).paint(painter, option, widget)
|
#super(QMapControlPoint, self).paint(painter, option, widget)
|
||||||
|
|
||||||
if self.parent.get_display_rule("go"):
|
if self.parent.get_display_rule("go"):
|
||||||
painter.save()
|
painter.save()
|
||||||
if not self.model.is_dead and not self.cp.captured:
|
if not self.model.is_dead and not self.cp.captured:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user