diff --git a/misc/ui2py.sh b/misc/ui2py.sh index 1853fdbf..b89f1215 100755 --- a/misc/ui2py.sh +++ b/misc/ui2py.sh @@ -1,6 +1,10 @@ #!/bin/sh if [ -n "${1}" ]; then + if [ ! -f "${1}" ]; then + echo "${1} does not exist" + exit 0 + fi echo "Generating python file for ${1}" pyuic5 "${1}" -x -o "${1%.ui}.py" sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${1%.ui}.py" @@ -13,6 +17,10 @@ cd "$(dirname "$0")"/.. || exit changed="$(git diff --name-only HEAD | grep '\.ui')" for ui in $changed; do + if [ ! -f "$ui" ]; then + echo "$ui does not exist. Skipping" + continue + fi echo "Generating python file for ${ui}" pyuic5 "${ui}" -x -o "${ui%.ui}.py" sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${ui%.ui}.py" diff --git a/rare/components/tabs/games/game_widgets/game_widget.py b/rare/components/tabs/games/game_widgets/game_widget.py index 3390a3ac..e5cf3d24 100644 --- a/rare/components/tabs/games/game_widgets/game_widget.py +++ b/rare/components/tabs/games/game_widgets/game_widget.py @@ -3,7 +3,7 @@ import random from logging import getLogger from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot, QObject, QEvent, QTimer -from PyQt5.QtGui import QMouseEvent, QShowEvent +from PyQt5.QtGui import QMouseEvent, QShowEvent, QPaintEvent from PyQt5.QtWidgets import QMessageBox, QAction from rare.models.game import RareGame @@ -106,11 +106,21 @@ class GameWidget(LibraryWidget): # lk: attributes as `GameWidgetUi` class __slots__ = "ui" + def paintEvent(self, a0: QPaintEvent) -> None: + if not self.visibleRegion().isNull() and self.rgame.pixmap.isNull(): + self.startTimer(random.randrange(42, 2361, 129), Qt.CoarseTimer) + # self.startTimer(random.randrange(42, 2361, 363), Qt.VeryCoarseTimer) + # self.rgame.load_pixmap() + # QTimer.singleShot(random.randrange(42, 2361, 7), Qt.VeryCoarseTimer, self.rgame.load_pixmap) + super().paintEvent(a0) + + def timerEvent(self, a0): + self.killTimer(a0.timerId()) + self.rgame.load_pixmap() + def showEvent(self, a0: QShowEvent) -> None: if a0.spontaneous(): return super().showEvent(a0) - if self.rgame.pixmap.isNull(): - QTimer.singleShot(random.randrange(42, 361, 7), self.rgame.load_pixmap) super().showEvent(a0) @pyqtSlot() diff --git a/rare/components/tabs/games/integrations/egl_sync_group.py b/rare/components/tabs/games/integrations/egl_sync_group.py index fcacaf2a..31ff8637 100644 --- a/rare/components/tabs/games/integrations/egl_sync_group.py +++ b/rare/components/tabs/games/integrations/egl_sync_group.py @@ -65,6 +65,10 @@ class EGLSyncGroup(QGroupBox): self.ui.egl_sync_check.setChecked(self.core.egl_sync_enabled) self.ui.egl_sync_check.stateChanged.connect(self.egl_sync_changed) + # lk: Temporarily disable automatic sync with EGL + self.ui.egl_sync_check_label.setHidden(True) + self.ui.egl_sync_check.setHidden(True) + self.import_list = EGLSyncImportGroup(parent=self) self.ui.import_export_layout.addWidget(self.import_list) self.export_list = EGLSyncExportGroup(parent=self) diff --git a/rare/lgndr/core.py b/rare/lgndr/core.py index 251267c7..03f6b739 100644 --- a/rare/lgndr/core.py +++ b/rare/lgndr/core.py @@ -31,7 +31,7 @@ class LegendaryCore(LegendaryCoreReal): def __init__(self, *args, **kwargs): super(LegendaryCore, self).__init__(*args, **kwargs) self.log.info("Using Rare's LegendaryCore monkey") - self.log.info("Using config in %s", self.lgd.path.replace(os.getlogin(), "")) + self.log.info("Using config in %s", self.lgd.path) self.handler = LgndrLogHandler(logging.CRITICAL) self.log.addHandler(self.handler) diff --git a/rare/shared/rare_core.py b/rare/shared/rare_core.py index 5b7301af..25c46bf3 100644 --- a/rare/shared/rare_core.py +++ b/rare/shared/rare_core.py @@ -165,9 +165,14 @@ class RareCore(QObject): self.__core.lgd.config.set( "Legendary", "mac_install_dir", self.__core.get_default_install_dir(self.__core.default_platform) ) + # Always set these options - # Avoid falling back to Windows games on macOS - self.__core.lgd.config.set("Legendary", "install_platform_fallback", 'false') + # Avoid implicitly falling back to Windows games on macOS + self.__core.lgd.config.set("Legendary", "install_platform_fallback", str(False)) + # Force-disable automatic use of crossover on macOS (remove this when we support crossover) + self.__core.lgd.config.set("Legendary", "disable_auto_crossover", str(True)) + # Force-disable automatic sync with EGL, it seems to have issues + self.__core.lgd.config.set("Legendary", "egl_sync", str(False)) # workaround if egl sync enabled, but no programdata_path # programdata_path might be unset if logging in through the browser