diff --git a/game/game.py b/game/game.py index 57fabfd6..dcac8220 100644 --- a/game/game.py +++ b/game/game.py @@ -421,6 +421,13 @@ class Game: return False return True + def get_culling_points(self): + """ + Check culling points + :return: List of culling points + """ + return self.__culling_points + # 1 = red, 2 = blue def get_player_coalition_id(self): return 2 diff --git a/qt_ui/displayoptions.py b/qt_ui/displayoptions.py index c92f1577..bec194fb 100644 --- a/qt_ui/displayoptions.py +++ b/qt_ui/displayoptions.py @@ -56,6 +56,7 @@ class DisplayOptions: detection_range = DisplayRule("SAM Detection Range", False) map_poly = DisplayRule("Map Polygon Debug Mode", False) waypoint_info = DisplayRule("Waypoint Information", True) + culling = DisplayRule("Display Culling Zones", False) flight_paths = FlightPathOptions() @classmethod diff --git a/qt_ui/uiconstants.py b/qt_ui/uiconstants.py index c138cf34..31e4901f 100644 --- a/qt_ui/uiconstants.py +++ b/qt_ui/uiconstants.py @@ -50,6 +50,7 @@ COLORS: Dict[str, QColor] = { "green": QColor(128, 186, 128), "light_green": QColor(223, 255, 173), + "light_green_transparent": QColor(180, 255, 140, 50), "bright_green": QColor(64, 200, 64), "black": QColor(0, 0, 0), diff --git a/qt_ui/widgets/map/QLiberationMap.py b/qt_ui/widgets/map/QLiberationMap.py index cd61d310..568d66ac 100644 --- a/qt_ui/widgets/map/QLiberationMap.py +++ b/qt_ui/widgets/map/QLiberationMap.py @@ -152,6 +152,17 @@ class QLiberationMap(QGraphicsView): # text = scene.addText(str(r), font=QFont("Trebuchet MS", 10, weight=5, italic=False)) # text.setPos(0, i * 24) + # Display Culling + if DisplayOptions.culling and self.game.settings.perf_culling: + culling_points = self.game_model.game.get_culling_points() + culling_distance = self.game_model.game.settings.perf_culling_distance + for point in culling_points: + culling_distance_point = Point(point.x + culling_distance*1000, point.y + culling_distance*1000) + distance_point = self._transform_point(culling_distance_point) + transformed = self._transform_point(point) + diameter = distance_point[0] - transformed[0] + scene.addEllipse(transformed[0]-diameter/2, transformed[1]-diameter/2, diameter, diameter, CONST.COLORS["transparent"], CONST.COLORS["light_green_transparent"]) + for cp in self.game.theater.controlpoints: pos = self._transform_point(cp.position)