1
0
Fork 0
mirror of synced 2024-05-18 19:42:54 +12:00

Launcher: Rename Console to ConsoleDialog

Add more games to be launched as detached processes.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
This commit is contained in:
loathingKernel 2023-12-31 14:53:48 +02:00
parent 80ac9296fc
commit fa158bd4aa
2 changed files with 15 additions and 11 deletions

View file

@ -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)

View file

@ -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()