From fa158bd4aaf4f2d4d76d30c3b26ec521fa69731e Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Sun, 31 Dec 2023 14:53:48 +0200 Subject: [PATCH] Launcher: Rename Console to ConsoleDialog Add more games to be launched as detached processes. Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com> --- rare/launcher/__init__.py | 18 +++++++++++------- .../launcher/{console.py => console_dialog.py} | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) rename rare/launcher/{console.py => console_dialog.py} (97%) diff --git a/rare/launcher/__init__.py b/rare/launcher/__init__.py index 8d6c992d..ef1d5a53 100644 --- a/rare/launcher/__init__.py +++ b/rare/launcher/__init__.py @@ -19,13 +19,17 @@ from rare.models.base_game import RareGameSlim from rare.models.launcher import ErrorModel, Actions, FinishedModel, BaseModel, StateChangedModel from rare.widgets.rare_app import RareApp, RareAppException from .cloud_sync_dialog import CloudSyncDialog, CloudSyncDialogResult -from .console import Console +from .console_dialog import ConsoleDialog from .lgd_helper import get_launch_args, InitArgs, get_configured_process, LaunchArgs, GameArgsError -DETACHED_APP_NAMES = [ - "0a2d9f6403244d12969e11da6713137b" # Fall Guys - "Fortnite" -] +DETACHED_APP_NAMES = { + "0a2d9f6403244d12969e11da6713137b", # Fall Guys + "Fortnite", + "afdb5a85efcc45d8ae8e406e2121d81c", # Fortnite Battle Royale + "09e442f830a341f698b4da42abd98c9b", # Fortnite Festival + "d8f7763e07d74c209d760a679f9ed6ac", # Lego Fortnite + "Fortnite_Studio", # Unreal Editor for Fortnite +} class PreLaunchThread(QRunnable): @@ -120,7 +124,7 @@ class RareLauncher(RareApp): def __init__(self, args: InitArgs): super(RareLauncher, self).__init__(args, f"{type(self).__name__}_{args.app_name}_{{0}}.log") self.socket: Optional[QLocalSocket] = None - self.console: Optional[Console] = None + self.console: Optional[ConsoleDialog] = None self.game_process: QProcess = QProcess(self) self.server: QLocalServer = QLocalServer(self) @@ -141,7 +145,7 @@ class RareLauncher(RareApp): self.load_translator(lang) if QSettings().value("show_console", False, bool): - self.console = Console() + self.console = ConsoleDialog() self.console.show() self.game_process.finished.connect(self.__process_finished) diff --git a/rare/launcher/console.py b/rare/launcher/console_dialog.py similarity index 97% rename from rare/launcher/console.py rename to rare/launcher/console_dialog.py index 44d3797b..24f45274 100644 --- a/rare/launcher/console.py +++ b/rare/launcher/console_dialog.py @@ -17,13 +17,13 @@ from PyQt5.QtWidgets import ( from rare.ui.launcher.console_env import Ui_ConsoleEnv -class Console(QDialog): +class ConsoleDialog(QDialog): term = pyqtSignal() kill = pyqtSignal() env: QProcessEnvironment def __init__(self, parent=None): - super(Console, self).__init__(parent=parent) + super(ConsoleDialog, self).__init__(parent=parent) self.setAttribute(Qt.WA_DeleteOnClose, True) self.setWindowTitle("Rare - Console") self.setGeometry(0, 0, 640, 480) @@ -68,7 +68,7 @@ class Console(QDialog): self.accept_close = False def show(self) -> None: - super(Console, self).show() + super(ConsoleDialog, self).show() self.center_window() def center_window(self): @@ -131,7 +131,7 @@ class Console(QDialog): def closeEvent(self, a0: QCloseEvent) -> None: if self.accept_close: - super(Console, self).closeEvent(a0) + super(ConsoleDialog, self).closeEvent(a0) a0.accept() else: self.showMinimized()