Rare: be more explicit when checking for running platform
This commit is contained in:
parent
17066f9a67
commit
49ad79e871
|
@ -20,7 +20,7 @@ from rare.widgets.indicator_edit import PathEdit, IndicatorReasonsCommon
|
|||
if pf.system() != "Windows":
|
||||
from rare.components.tabs.settings.widgets.wine import WineSettings
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from rare.components.tabs.settings.widgets.proton import ProtonSettings
|
||||
from rare.components.tabs.settings.widgets.overlay import MangoHudSettings
|
||||
|
||||
|
@ -143,7 +143,7 @@ if pf.system() != "Windows":
|
|||
self.app_name = app_name
|
||||
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
|
||||
class GameProtonSettings(ProtonSettings):
|
||||
def load_settings(self, app_name: str):
|
||||
|
@ -166,7 +166,7 @@ class GameEnvVars(EnvVars):
|
|||
|
||||
class GameSettings(GameSettingsBase):
|
||||
def __init__(self, parent=None):
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
super(GameSettings, self).__init__(
|
||||
GameLaunchSettings, GameDxvkSettings, GameEnvVars,
|
||||
GameWineSettings, GameProtonSettings, GameMangoHudSettings,
|
||||
|
@ -190,7 +190,7 @@ class GameSettings(GameSettingsBase):
|
|||
self.launch.load_settings(rgame)
|
||||
if pf.system() != "Windows":
|
||||
self.wine.load_settings(rgame.app_name)
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.proton_tool.load_settings(rgame.app_name)
|
||||
self.mangohud.load_settings(rgame.app_name)
|
||||
self.dxvk.load_settings(rgame.app_name)
|
||||
|
|
|
@ -10,7 +10,7 @@ from .widgets.wrappers import WrapperSettings
|
|||
if pf.system() != "Windows":
|
||||
from .widgets.wine import WineSettings
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from .widgets.proton import ProtonSettings
|
||||
from .widgets.overlay import MangoHudSettings
|
||||
|
||||
|
@ -24,7 +24,7 @@ class LaunchSettings(LaunchSettingsBase):
|
|||
|
||||
class GameSettings(GameSettingsBase):
|
||||
def __init__(self, parent=None):
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
super(GameSettings, self).__init__(
|
||||
LaunchSettings, DxvkSettings, EnvVars,
|
||||
WineSettings, ProtonSettings, MangoHudSettings,
|
||||
|
|
|
@ -13,7 +13,7 @@ from rare.utils.misc import icon
|
|||
if platform.system() != "Windows":
|
||||
from rare.utils.runners.wine import get_wine_environment
|
||||
|
||||
if platform.system() not in {"Windows", "Darwin"}:
|
||||
if platform.system() in {"Linux", "FreeBSD"}:
|
||||
from rare.utils.runners.proton import get_steam_environment
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ class EnvVarsTableModel(QAbstractTableModel):
|
|||
]
|
||||
if platform.system() != "Windows":
|
||||
self.__readonly.extend(get_wine_environment().keys())
|
||||
if platform.system() not in {"Windows", "Darwin"}:
|
||||
if platform.system() in {"Linux", "FreeBSD"}:
|
||||
self.__readonly.extend(get_steam_environment().keys())
|
||||
|
||||
self.__default: str = "default"
|
||||
|
|
|
@ -18,7 +18,7 @@ from .overlay import DxvkSettings
|
|||
if pf.system() != "Windows":
|
||||
from .wine import WineSettings
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from .proton import ProtonSettings
|
||||
from .overlay import MangoHudSettings
|
||||
|
||||
|
@ -48,7 +48,7 @@ class GameSettingsBase(QWidget, SideTabContents):
|
|||
self.wine = wine_widget(self)
|
||||
self.wine.environ_changed.connect(self.env_vars.reset_model)
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.proton_tool = proton_widget(self)
|
||||
self.proton_tool.environ_changed.connect(self.env_vars.reset_model)
|
||||
self.proton_tool.tool_enabled.connect(self.wine.tool_enabled)
|
||||
|
@ -57,7 +57,7 @@ class GameSettingsBase(QWidget, SideTabContents):
|
|||
self.dxvk = dxvk_widget(self)
|
||||
self.dxvk.environ_changed.connect(self.env_vars.reset_model)
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.mangohud = mangohud_widget(self)
|
||||
self.mangohud.environ_changed.connect(self.env_vars.reset_model)
|
||||
|
||||
|
@ -65,10 +65,10 @@ class GameSettingsBase(QWidget, SideTabContents):
|
|||
self.main_layout.addWidget(self.launch)
|
||||
if pf.system() != "Windows":
|
||||
self.main_layout.addWidget(self.wine)
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.main_layout.addWidget(self.proton_tool)
|
||||
self.main_layout.addWidget(self.dxvk)
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
self.main_layout.addWidget(self.mangohud)
|
||||
self.main_layout.addWidget(self.env_vars)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ from rare.models.wrapper import Wrapper
|
|||
from rare.shared import RareCore
|
||||
from rare.utils.misc import icon
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
from rare.utils.runners import proton
|
||||
|
||||
logger = getLogger("WrapperSettings")
|
||||
|
@ -236,7 +236,7 @@ class WrapperSettings(QWidget):
|
|||
if not wrapper:
|
||||
return
|
||||
|
||||
if pf.system() not in {"Windows", "Darwin"}:
|
||||
if pf.system() in {"Linux", "FreeBSD"}:
|
||||
compat_cmds = [tool.command() for tool in proton.find_tools()]
|
||||
if wrapper.command in compat_cmds:
|
||||
QMessageBox.warning(
|
||||
|
|
Loading…
Reference in a new issue