mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Refactor Templates to Layouts, Review and Cleanup
- Fix tgogenerator - Fix UI for ForceGroup and Layouts - Fix ammo depot handling - Split bigger files in smaller meaningful files (TGO, layouts, forces) - Renamed Template to Layout - Renamed GroundGroup to TheaterGroup and GroundUnit to TheaterUnit - Reorganize Layouts and UnitGroups to a ArmedForces class and ForceGroup similar to the AirWing and Squadron - Reworded the UnitClass, GroupRole, GroupTask (adopted to PEP8) and reworked the connection from Role and Task - added comments - added missing unit classes - added temp workaround for missing classes - add repariable property to TheaterUnit - Review and Cleanup Added serialization for loaded templates Loading the templates from the .miz files takes a lot of computation time and in the future there will be more templates added to the system. Therefore a local pickle serialization for the loaded templates was re-added: - The pickle will be created the first time the TemplateLoader will be accessed - Pickle is stored in Liberation SaveDir - Added UI option to (re-)import templates
This commit is contained in:
@@ -18,7 +18,7 @@ from PySide2.QtWidgets import (
|
||||
)
|
||||
|
||||
import qt_ui.uiconstants as CONST
|
||||
from game import Game, VERSION, persistency
|
||||
from game import Game, VERSION, persistency, db
|
||||
from game.debriefing import Debriefing
|
||||
from game.server import EventStream, GameContext
|
||||
from game.server.security import ApiKeyManager
|
||||
@@ -178,6 +178,9 @@ class QLiberationWindow(QMainWindow):
|
||||
self.openNotesAction.setIcon(CONST.ICONS["Notes"])
|
||||
self.openNotesAction.triggered.connect(self.showNotesDialog)
|
||||
|
||||
self.importTemplatesAction = QAction("Import Layouts", self)
|
||||
self.importTemplatesAction.triggered.connect(self.import_templates)
|
||||
|
||||
self.enable_game_actions(False)
|
||||
|
||||
def enable_game_actions(self, enabled: bool):
|
||||
@@ -220,6 +223,9 @@ class QLiberationWindow(QMainWindow):
|
||||
file_menu.addSeparator()
|
||||
file_menu.addAction("E&xit", self.close)
|
||||
|
||||
tools_menu = self.menu.addMenu("&Developer tools")
|
||||
tools_menu.addAction(self.importTemplatesAction)
|
||||
|
||||
help_menu = self.menu.addMenu("&Help")
|
||||
help_menu.addAction(self.openDiscordAction)
|
||||
help_menu.addAction(self.openGithubAction)
|
||||
@@ -393,6 +399,9 @@ class QLiberationWindow(QMainWindow):
|
||||
self.dialog = QNotesWindow(self.game)
|
||||
self.dialog.show()
|
||||
|
||||
def import_templates(self):
|
||||
db.LAYOUTS.import_templates()
|
||||
|
||||
def showLogsDialog(self):
|
||||
self.dialog = QLogsWindow()
|
||||
self.dialog.show()
|
||||
|
||||
Reference in New Issue
Block a user