Added display settings to the toolbar.
@ -230,7 +230,7 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
self.stances: Dict[int, CombatStance] = {}
|
self.stances: Dict[int, CombatStance] = {}
|
||||||
self.pending_unit_deliveries: Optional[UnitsDeliveryEvent] = None
|
self.pending_unit_deliveries: Optional[UnitsDeliveryEvent] = None
|
||||||
|
|
||||||
self.target_position = None
|
self.target_position: Point = None
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"<{__class__}: {self.name}>"
|
return f"<{__class__}: {self.name}>"
|
||||||
|
|||||||
@ -50,7 +50,6 @@ class DisplayOptions:
|
|||||||
ground_objects = DisplayRule("Ground Objects", True)
|
ground_objects = DisplayRule("Ground Objects", True)
|
||||||
control_points = DisplayRule("Control Points", True)
|
control_points = DisplayRule("Control Points", True)
|
||||||
lines = DisplayRule("Lines", True)
|
lines = DisplayRule("Lines", True)
|
||||||
events = DisplayRule("Events", True)
|
|
||||||
sam_ranges = DisplayRule("Ally SAM Threat Range", False)
|
sam_ranges = DisplayRule("Ally SAM Threat Range", False)
|
||||||
enemy_sam_ranges = DisplayRule("Enemy SAM Threat Range", True)
|
enemy_sam_ranges = DisplayRule("Enemy SAM Threat Range", True)
|
||||||
detection_range = DisplayRule("SAM Detection Range", False)
|
detection_range = DisplayRule("SAM Detection Range", False)
|
||||||
|
|||||||
@ -78,6 +78,24 @@ def load_icons():
|
|||||||
ICONS["New"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/new.png")
|
ICONS["New"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/new.png")
|
||||||
ICONS["Open"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/open.png")
|
ICONS["Open"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/open.png")
|
||||||
ICONS["Save"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/save.png")
|
ICONS["Save"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/save.png")
|
||||||
|
ICONS["Discord"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/discord.png")
|
||||||
|
ICONS["Github"] = QPixmap("./resources/ui/misc/"+get_theme_icons()+"/github.png")
|
||||||
|
|
||||||
|
|
||||||
|
ICONS["Control Points"] = QPixmap("./resources/ui/misc/" + get_theme_icons() + "/circle.png")
|
||||||
|
ICONS["Ground Objects"] = QPixmap("./resources/ui/misc/" + get_theme_icons() + "/industry.png")
|
||||||
|
ICONS["Lines"] = QPixmap("./resources/ui/misc/" + get_theme_icons() + "/arrows-h.png")
|
||||||
|
ICONS["Waypoint Information"] = QPixmap("./resources/ui/misc/" + get_theme_icons() + "/info.png")
|
||||||
|
ICONS["Map Polygon Debug Mode"] = QPixmap("./resources/ui/misc/" + get_theme_icons() + "/map.png")
|
||||||
|
ICONS["Ally SAM Threat Range"] = QPixmap("./resources/ui/misc/blue-sam.png")
|
||||||
|
ICONS["Enemy SAM Threat Range"] = QPixmap("./resources/ui/misc/red-sam.png")
|
||||||
|
ICONS["SAM Detection Range"] = QPixmap("./resources/ui/misc/detection-sam.png")
|
||||||
|
ICONS["Display Culling Zones"] = QPixmap("./resources/ui/misc/" + get_theme_icons() + "/eraser.png")
|
||||||
|
ICONS["Hide Flight Paths"] = QPixmap("./resources/ui/misc/hide-flight-path.png")
|
||||||
|
ICONS["Show Selected Flight Path"] = QPixmap("./resources/ui/misc/flight-path.png")
|
||||||
|
ICONS["Show All Flight Paths"] = QPixmap("./resources/ui/misc/all-flight-paths.png")
|
||||||
|
|
||||||
|
|
||||||
ICONS["Hangar"] = QPixmap("./resources/ui/misc/hangar.png")
|
ICONS["Hangar"] = QPixmap("./resources/ui/misc/hangar.png")
|
||||||
|
|
||||||
ICONS["Terrain_Caucasus"] = QPixmap("./resources/ui/terrain_caucasus.gif")
|
ICONS["Terrain_Caucasus"] = QPixmap("./resources/ui/terrain_caucasus.gif")
|
||||||
|
|||||||
@ -52,8 +52,8 @@ class QLiberationWindow(QMainWindow):
|
|||||||
|
|
||||||
self.initUi()
|
self.initUi()
|
||||||
self.initActions()
|
self.initActions()
|
||||||
self.initMenuBar()
|
|
||||||
self.initToolbar()
|
self.initToolbar()
|
||||||
|
self.initMenuBar()
|
||||||
self.connectSignals()
|
self.connectSignals()
|
||||||
|
|
||||||
screen = QDesktopWidget().screenGeometry()
|
screen = QDesktopWidget().screenGeometry()
|
||||||
@ -120,12 +120,27 @@ class QLiberationWindow(QMainWindow):
|
|||||||
self.showLiberationPrefDialogAction.setIcon(QIcon.fromTheme("help-about"))
|
self.showLiberationPrefDialogAction.setIcon(QIcon.fromTheme("help-about"))
|
||||||
self.showLiberationPrefDialogAction.triggered.connect(self.showLiberationDialog)
|
self.showLiberationPrefDialogAction.triggered.connect(self.showLiberationDialog)
|
||||||
|
|
||||||
|
self.openDiscordAction = QAction("&Discord Server", self)
|
||||||
|
self.openDiscordAction.setIcon(CONST.ICONS["Discord"])
|
||||||
|
self.openDiscordAction.triggered.connect(lambda: webbrowser.open_new_tab("https://" + "discord.gg" + "/" + "bKrt" + "rkJ"))
|
||||||
|
|
||||||
|
self.openGithubAction = QAction("&Github Repo", self)
|
||||||
|
self.openGithubAction.setIcon(CONST.ICONS["Github"])
|
||||||
|
self.openGithubAction.triggered.connect(lambda: webbrowser.open_new_tab("https://github.com/khopa/dcs_liberation"))
|
||||||
|
|
||||||
def initToolbar(self):
|
def initToolbar(self):
|
||||||
self.tool_bar = self.addToolBar("File")
|
self.tool_bar = self.addToolBar("File")
|
||||||
self.tool_bar.addAction(self.newGameAction)
|
self.tool_bar.addAction(self.newGameAction)
|
||||||
self.tool_bar.addAction(self.openAction)
|
self.tool_bar.addAction(self.openAction)
|
||||||
self.tool_bar.addAction(self.saveGameAction)
|
self.tool_bar.addAction(self.saveGameAction)
|
||||||
|
|
||||||
|
self.links_bar = self.addToolBar("Links")
|
||||||
|
self.links_bar.addAction(self.openDiscordAction)
|
||||||
|
self.links_bar.addAction(self.openGithubAction)
|
||||||
|
|
||||||
|
self.display_bar = self.addToolBar("Display")
|
||||||
|
|
||||||
|
|
||||||
def initMenuBar(self):
|
def initMenuBar(self):
|
||||||
self.menu = self.menuBar()
|
self.menu = self.menuBar()
|
||||||
|
|
||||||
@ -145,20 +160,26 @@ class QLiberationWindow(QMainWindow):
|
|||||||
last_was_group = True
|
last_was_group = True
|
||||||
for item in DisplayOptions.menu_items():
|
for item in DisplayOptions.menu_items():
|
||||||
if isinstance(item, DisplayRule):
|
if isinstance(item, DisplayRule):
|
||||||
displayMenu.addAction(self.make_display_rule_action(item))
|
action = self.make_display_rule_action(item)
|
||||||
|
displayMenu.addAction(action)
|
||||||
|
if action.icon():
|
||||||
|
self.display_bar.addAction(action)
|
||||||
last_was_group = False
|
last_was_group = False
|
||||||
elif isinstance(item, DisplayGroup):
|
elif isinstance(item, DisplayGroup):
|
||||||
if not last_was_group:
|
if not last_was_group:
|
||||||
displayMenu.addSeparator()
|
displayMenu.addSeparator()
|
||||||
|
self.display_bar.addSeparator()
|
||||||
group = QActionGroup(displayMenu)
|
group = QActionGroup(displayMenu)
|
||||||
for display_rule in item:
|
for display_rule in item:
|
||||||
displayMenu.addAction(
|
action = self.make_display_rule_action(display_rule, group)
|
||||||
self.make_display_rule_action(display_rule, group))
|
displayMenu.addAction(action)
|
||||||
|
if action.icon():
|
||||||
|
self.display_bar.addAction(action)
|
||||||
last_was_group = True
|
last_was_group = True
|
||||||
|
|
||||||
help_menu = self.menu.addMenu("&Help")
|
help_menu = self.menu.addMenu("&Help")
|
||||||
help_menu.addAction("&Discord Server", lambda: webbrowser.open_new_tab("https://" + "discord.gg" + "/" + "bKrt" + "rkJ"))
|
help_menu.addAction(self.openDiscordAction)
|
||||||
help_menu.addAction("&Github Repository", lambda: webbrowser.open_new_tab("https://github.com/khopa/dcs_liberation"))
|
help_menu.addAction(self.openGithubAction)
|
||||||
help_menu.addAction("&Releases", lambda: webbrowser.open_new_tab("https://github.com/Khopa/dcs_liberation/releases"))
|
help_menu.addAction("&Releases", lambda: webbrowser.open_new_tab("https://github.com/Khopa/dcs_liberation/releases"))
|
||||||
help_menu.addAction("&Online Manual", lambda: webbrowser.open_new_tab(URLS["Manual"]))
|
help_menu.addAction("&Online Manual", lambda: webbrowser.open_new_tab(URLS["Manual"]))
|
||||||
help_menu.addAction("&ED Forum Thread", lambda: webbrowser.open_new_tab(URLS["ForumThread"]))
|
help_menu.addAction("&ED Forum Thread", lambda: webbrowser.open_new_tab(URLS["ForumThread"]))
|
||||||
@ -177,6 +198,10 @@ class QLiberationWindow(QMainWindow):
|
|||||||
return closure
|
return closure
|
||||||
|
|
||||||
action = QAction(f"&{display_rule.menu_text}", group)
|
action = QAction(f"&{display_rule.menu_text}", group)
|
||||||
|
|
||||||
|
if display_rule.menu_text in CONST.ICONS.keys():
|
||||||
|
action.setIcon(CONST.ICONS[display_rule.menu_text])
|
||||||
|
|
||||||
action.setCheckable(True)
|
action.setCheckable(True)
|
||||||
action.setChecked(display_rule.value)
|
action.setChecked(display_rule.value)
|
||||||
action.toggled.connect(make_check_closure())
|
action.toggled.connect(make_check_closure())
|
||||||
|
|||||||
@ -48,6 +48,21 @@ QMenuBar::item:pressed {
|
|||||||
background: #1D2731;
|
background: #1D2731;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QToolButton:checked {
|
||||||
|
border-color: #435466;
|
||||||
|
background: #14202B;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:hover {
|
||||||
|
background: #536476;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolBar::separator {
|
||||||
|
background:white;
|
||||||
|
width:1px;
|
||||||
|
height:1px;
|
||||||
|
}
|
||||||
|
|
||||||
QMenu::item:selected {
|
QMenu::item:selected {
|
||||||
background: #435466;
|
background: #435466;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
resources/ui/misc/all-flight-paths.png
Normal file
|
After Width: | Height: | Size: 761 B |
BIN
resources/ui/misc/blue-sam.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
resources/ui/misc/dark/discord.png
Normal file
|
After Width: | Height: | Size: 804 B |
BIN
resources/ui/misc/dark/github.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
resources/ui/misc/detection-sam.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
resources/ui/misc/discord.png
Normal file
|
After Width: | Height: | Size: 817 B |
BIN
resources/ui/misc/flight-path.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
resources/ui/misc/github.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
resources/ui/misc/hide-flight-path.png
Normal file
|
After Width: | Height: | Size: 760 B |
BIN
resources/ui/misc/light/arrows-h.png
Normal file
|
After Width: | Height: | Size: 206 B |
BIN
resources/ui/misc/light/bullseye.png
Normal file
|
After Width: | Height: | Size: 677 B |
BIN
resources/ui/misc/light/circle-o-notch.png
Normal file
|
After Width: | Height: | Size: 598 B |
BIN
resources/ui/misc/light/circle-o.png
Normal file
|
After Width: | Height: | Size: 540 B |
BIN
resources/ui/misc/light/circle-thin.png
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
resources/ui/misc/light/circle.png
Normal file
|
After Width: | Height: | Size: 417 B |
BIN
resources/ui/misc/light/discord.png
Normal file
|
After Width: | Height: | Size: 817 B |
BIN
resources/ui/misc/light/dot-circle-o.png
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
resources/ui/misc/light/eraser.png
Normal file
|
After Width: | Height: | Size: 352 B |
BIN
resources/ui/misc/light/fighter-jet.png
Normal file
|
After Width: | Height: | Size: 391 B |
BIN
resources/ui/misc/light/flag.png
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
resources/ui/misc/light/github.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
resources/ui/misc/light/industry.png
Normal file
|
After Width: | Height: | Size: 233 B |
BIN
resources/ui/misc/light/info.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
resources/ui/misc/light/map-marker.png
Normal file
|
After Width: | Height: | Size: 407 B |
BIN
resources/ui/misc/light/map-o.png
Normal file
|
After Width: | Height: | Size: 400 B |
BIN
resources/ui/misc/light/map.png
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
resources/ui/misc/light/object-group.png
Normal file
|
After Width: | Height: | Size: 157 B |
BIN
resources/ui/misc/light/object-ungroup.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
resources/ui/misc/light/plane.png
Normal file
|
After Width: | Height: | Size: 465 B |
BIN
resources/ui/misc/medium/discord.png
Normal file
|
After Width: | Height: | Size: 803 B |
BIN
resources/ui/misc/medium/github.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
resources/ui/misc/red-sam.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |