2021-03-10 09:57:54 +13:00
|
|
|
import os
|
2021-06-21 07:55:31 +12:00
|
|
|
import platform
|
2021-11-11 07:00:15 +13:00
|
|
|
from logging import getLogger
|
2021-10-11 21:41:01 +13:00
|
|
|
from typing import Tuple
|
2021-03-10 09:57:54 +13:00
|
|
|
|
2021-11-23 05:32:11 +13:00
|
|
|
from PyQt5.QtCore import QSettings, QThreadPool, Qt
|
2021-11-22 05:08:43 +13:00
|
|
|
from PyQt5.QtWidgets import QWidget, QFileDialog, QMessageBox, QLabel, QPushButton, QSizePolicy
|
2021-11-04 10:18:03 +13:00
|
|
|
from qtawesome import icon
|
2021-11-11 07:00:15 +13:00
|
|
|
|
2021-09-07 07:10:18 +12:00
|
|
|
from legendary.core import LegendaryCore
|
|
|
|
from legendary.models.game import InstalledGame, Game
|
2021-04-08 08:42:30 +12:00
|
|
|
from rare.components.tabs.settings.linux import LinuxSettings
|
2021-04-30 20:05:35 +12:00
|
|
|
from rare.ui.components.tabs.games.game_info.game_settings import Ui_GameSettings
|
2021-04-08 08:39:23 +12:00
|
|
|
from rare.utils.extra_widgets import PathEdit
|
2021-11-11 07:00:15 +13:00
|
|
|
from rare.utils.utils import WineResolver, get_raw_save_path
|
2021-03-10 09:57:54 +13:00
|
|
|
|
|
|
|
|
2021-04-29 09:31:25 +12:00
|
|
|
def find_proton_wrappers():
|
|
|
|
possible_proton_wrappers = []
|
2021-05-02 02:15:43 +12:00
|
|
|
compatibilitytools_dirs = [
|
|
|
|
os.path.expanduser("~/.steam/steam/steamapps/common"),
|
2021-06-04 22:03:27 +12:00
|
|
|
"/usr/share/steam/compatibilitytools.d",
|
2021-06-25 09:38:08 +12:00
|
|
|
os.path.expanduser("~/.steam/compatibilitytools.d"),
|
|
|
|
os.path.expanduser("~/.steam/root/compatibilitytools.d")
|
2021-05-02 02:15:43 +12:00
|
|
|
]
|
|
|
|
for c in compatibilitytools_dirs:
|
|
|
|
if os.path.exists(c):
|
2021-04-29 09:31:25 +12:00
|
|
|
for i in os.listdir(c):
|
|
|
|
proton = os.path.join(c, i, "proton")
|
2021-05-01 10:02:12 +12:00
|
|
|
compatibilitytool = os.path.join(c, i, "compatibilitytool.vdf")
|
|
|
|
toolmanifest = os.path.join(c, i, "toolmanifest.vdf")
|
|
|
|
if os.path.exists(proton) and (os.path.exists(compatibilitytool) or os.path.exists(toolmanifest)):
|
2021-04-29 09:31:25 +12:00
|
|
|
wrapper = '"' + proton + '" run'
|
|
|
|
possible_proton_wrappers.append(wrapper)
|
2021-05-02 02:15:43 +12:00
|
|
|
if not possible_proton_wrappers:
|
2021-04-29 09:31:25 +12:00
|
|
|
print("Unable to find any Proton version")
|
|
|
|
return possible_proton_wrappers
|
|
|
|
|
|
|
|
|
2021-11-11 07:00:15 +13:00
|
|
|
logger = getLogger("GameSettings")
|
|
|
|
|
|
|
|
|
2021-04-30 09:30:42 +12:00
|
|
|
class GameSettings(QWidget, Ui_GameSettings):
|
2021-03-10 09:57:54 +13:00
|
|
|
game: Game
|
|
|
|
igame: InstalledGame
|
2021-04-10 21:27:40 +12:00
|
|
|
|
2021-03-14 23:00:06 +13:00
|
|
|
# variable to no update when changing game
|
2021-03-11 23:59:12 +13:00
|
|
|
change = False
|
|
|
|
|
2021-04-18 04:58:18 +12:00
|
|
|
def __init__(self, core: LegendaryCore, parent):
|
|
|
|
super(GameSettings, self).__init__(parent=parent)
|
2021-04-30 09:30:42 +12:00
|
|
|
self.setupUi(self)
|
|
|
|
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core = core
|
2021-04-10 21:27:40 +12:00
|
|
|
self.settings = QSettings()
|
2021-10-24 12:47:49 +13:00
|
|
|
|
|
|
|
self.cloud_save_path_edit = PathEdit("", file_type=QFileDialog.DirectoryOnly,
|
|
|
|
ph_text=self.tr("Cloud save path"),
|
|
|
|
edit_func=lambda text: (os.path.exists(text), text),
|
|
|
|
save_func=self.save_save_path)
|
2021-11-22 05:08:43 +13:00
|
|
|
self.cloud_gb.layout().addRow(QLabel(self.tr("Save path")), self.cloud_save_path_edit)
|
2021-11-04 10:18:03 +13:00
|
|
|
|
|
|
|
self.compute_save_path_button = QPushButton(icon("fa.magic"), self.tr("Auto compute save path"))
|
2021-11-22 05:08:43 +13:00
|
|
|
self.compute_save_path_button.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Fixed)
|
2021-11-04 10:18:03 +13:00
|
|
|
self.compute_save_path_button.clicked.connect(self.compute_save_path)
|
2021-11-22 05:08:43 +13:00
|
|
|
self.cloud_gb.layout().addRow(None, self.compute_save_path_button)
|
2021-10-24 12:47:49 +13:00
|
|
|
|
2021-04-30 09:30:42 +12:00
|
|
|
self.offline.currentIndexChanged.connect(
|
|
|
|
lambda x: self.update_combobox(x, "offline")
|
|
|
|
)
|
|
|
|
self.skip_update.currentIndexChanged.connect(
|
|
|
|
lambda x: self.update_combobox(x, "skip_update_check")
|
|
|
|
)
|
|
|
|
self.cloud_sync.stateChanged.connect(
|
|
|
|
lambda: self.settings.setValue(f"{self.game.app_name}/auto_sync_cloud", self.cloud_sync.isChecked())
|
|
|
|
)
|
2021-05-06 02:44:27 +12:00
|
|
|
self.launch_params.textChanged.connect(lambda: self.launch_params_button.setEnabled(True))
|
|
|
|
self.launch_params_button.clicked.connect(
|
|
|
|
lambda: self.save_line_edit("start_params", self.launch_params.text())
|
|
|
|
)
|
|
|
|
self.launch_params_button.setEnabled(False)
|
|
|
|
self.wrapper.textChanged.connect(lambda: self.wrapper_button.setEnabled(True))
|
2021-04-30 09:30:42 +12:00
|
|
|
self.wrapper_button.clicked.connect(
|
|
|
|
lambda: self.save_line_edit("wrapper", self.wrapper.text())
|
|
|
|
)
|
2021-05-06 02:44:27 +12:00
|
|
|
self.wrapper_button.setEnabled(False)
|
2021-03-27 06:04:29 +13:00
|
|
|
|
2021-06-21 07:55:31 +12:00
|
|
|
if platform.system() != "Windows":
|
2021-04-29 09:31:25 +12:00
|
|
|
self.possible_proton_wrappers = find_proton_wrappers()
|
2021-03-27 06:04:29 +13:00
|
|
|
|
2021-04-30 09:30:42 +12:00
|
|
|
self.proton_wrapper.addItems(self.possible_proton_wrappers)
|
|
|
|
self.proton_wrapper.currentIndexChanged.connect(self.change_proton)
|
2021-03-28 05:51:38 +13:00
|
|
|
|
2021-10-13 08:11:52 +13:00
|
|
|
self.proton_prefix = PathEdit(
|
|
|
|
file_type=QFileDialog.DirectoryOnly,
|
|
|
|
edit_func=self.proton_prefix_edit,
|
|
|
|
save_func=self.proton_prefix_save
|
|
|
|
)
|
2021-04-30 09:30:42 +12:00
|
|
|
self.proton_prefix_layout.addWidget(self.proton_prefix)
|
2021-04-30 08:07:28 +12:00
|
|
|
|
2021-10-08 07:19:24 +13:00
|
|
|
self.linux_settings = LinuxAppSettings()
|
2021-11-23 05:32:11 +13:00
|
|
|
# FIXME: Remove the spacerItem and margins from the linux settings
|
2021-11-22 05:29:44 +13:00
|
|
|
# FIXME: This should be handled differently at soem point in the future
|
2021-11-23 05:32:11 +13:00
|
|
|
self.linux_settings.layout().setContentsMargins(0, 0, 0, 0)
|
2021-11-22 05:29:44 +13:00
|
|
|
for item in [self.linux_settings.layout().itemAt(idx) for idx in range(self.linux_settings.layout().count())]:
|
|
|
|
if item.spacerItem():
|
|
|
|
self.linux_settings.layout().removeItem(item)
|
|
|
|
del item
|
|
|
|
# FIXME: End of FIXME
|
2021-11-23 05:32:11 +13:00
|
|
|
self.linux_settings_contents_layout.addWidget(self.linux_settings)
|
|
|
|
self.linux_settings_contents_layout.setAlignment(Qt.AlignTop)
|
2021-05-22 02:22:30 +12:00
|
|
|
else:
|
|
|
|
self.proton_groupbox.setVisible(False)
|
2021-03-10 09:57:54 +13:00
|
|
|
|
2021-10-24 12:47:49 +13:00
|
|
|
# skip_update_check
|
|
|
|
|
2021-11-04 10:18:03 +13:00
|
|
|
def compute_save_path(self):
|
|
|
|
if self.core.is_installed(self.game.app_name) and self.game.supports_cloud_saves:
|
|
|
|
try:
|
|
|
|
new_path = self.core.get_save_path(self.game.app_name)
|
|
|
|
except Exception as e:
|
2021-11-11 07:00:15 +13:00
|
|
|
logger.warning(str(e))
|
|
|
|
self.cloud_save_path_edit.setText(self.tr("Loading"))
|
|
|
|
self.cloud_save_path_edit.setDisabled(True)
|
|
|
|
self.compute_save_path_button.setDisabled(True)
|
|
|
|
resolver = WineResolver(get_raw_save_path(self.game), self.game.app_name, self.core)
|
2021-11-17 10:54:23 +13:00
|
|
|
app_name = self.game.app_name[:]
|
|
|
|
resolver.signals.result_ready.connect(lambda x: self.wine_resolver_finished(x, app_name))
|
2021-11-11 07:00:15 +13:00
|
|
|
QThreadPool.globalInstance().start(resolver)
|
2021-11-04 10:18:03 +13:00
|
|
|
return
|
|
|
|
self.cloud_save_path_edit.setText(new_path)
|
|
|
|
|
2021-11-17 10:54:23 +13:00
|
|
|
def wine_resolver_finished(self, path, app_name):
|
|
|
|
if app_name == self.game.app_name:
|
|
|
|
self.cloud_save_path_edit.setDisabled(False)
|
|
|
|
self.compute_save_path_button.setDisabled(False)
|
|
|
|
if path and not os.path.exists(path):
|
|
|
|
try:
|
|
|
|
os.makedirs(path)
|
|
|
|
except PermissionError:
|
|
|
|
self.cloud_save_path_edit.setText("")
|
|
|
|
QMessageBox.warning(None, "Error", self.tr(
|
|
|
|
"Error while launching {}. No permission to create {}").format(
|
|
|
|
self.game.app_title, path))
|
|
|
|
return
|
|
|
|
if not path:
|
2021-11-11 07:00:15 +13:00
|
|
|
return
|
2021-11-17 10:54:23 +13:00
|
|
|
self.cloud_save_path_edit.setText(path)
|
|
|
|
else:
|
|
|
|
igame = self.core.get_installed_game(app_name)
|
|
|
|
igame.save_path = path
|
|
|
|
self.core.lgd.set_installed_game(app_name, igame)
|
2021-11-11 07:00:15 +13:00
|
|
|
|
2021-10-24 12:47:49 +13:00
|
|
|
def save_save_path(self, text):
|
2021-11-11 07:00:15 +13:00
|
|
|
if self.game.supports_cloud_saves and self.change:
|
2021-10-24 12:47:49 +13:00
|
|
|
self.igame.save_path = text
|
|
|
|
self.core.lgd.set_installed_game(self.igame.app_name, self.igame)
|
2021-03-10 09:57:54 +13:00
|
|
|
|
2021-04-10 22:34:45 +12:00
|
|
|
def save_line_edit(self, option, value):
|
2021-05-06 02:44:27 +12:00
|
|
|
if value:
|
|
|
|
if self.game.app_name not in self.core.lgd.config.sections():
|
2021-04-10 22:34:45 +12:00
|
|
|
self.core.lgd.config.add_section(self.game.app_name)
|
|
|
|
self.core.lgd.config.set(self.game.app_name, option, value)
|
2021-03-27 06:04:29 +13:00
|
|
|
else:
|
2021-06-16 09:50:51 +12:00
|
|
|
if self.core.lgd.config.has_section(self.game.app_name) and self.core.lgd.config.get(
|
2021-05-06 02:44:27 +12:00
|
|
|
f"{self.game.app_name}", option, fallback=None) is not None:
|
2021-04-10 22:34:45 +12:00
|
|
|
self.core.lgd.config.remove_option(self.game.app_name, option)
|
2021-06-16 09:50:51 +12:00
|
|
|
if not self.core.lgd.config[self.game.app_name]:
|
|
|
|
self.core.lgd.config.remove_section(self.game.app_name)
|
2021-03-27 06:04:29 +13:00
|
|
|
self.core.lgd.save_config()
|
2021-05-06 02:44:27 +12:00
|
|
|
self.sender().setEnabled(False)
|
2021-03-27 06:04:29 +13:00
|
|
|
|
2021-11-11 07:00:15 +13:00
|
|
|
if option == "wine_prefix":
|
|
|
|
if self.game.supports_cloud_saves:
|
|
|
|
self.compute_save_path()
|
|
|
|
|
2021-04-08 21:09:17 +12:00
|
|
|
def update_combobox(self, i, option):
|
2021-03-14 23:00:06 +13:00
|
|
|
if self.change:
|
|
|
|
# remove section
|
2021-04-30 09:30:42 +12:00
|
|
|
if i:
|
2021-05-06 02:44:27 +12:00
|
|
|
if self.game.app_name not in self.core.lgd.config.sections():
|
2021-04-30 09:30:42 +12:00
|
|
|
self.core.lgd.config.add_section(self.game.app_name)
|
|
|
|
if i == 1:
|
|
|
|
self.core.lgd.config.set(self.game.app_name, option, "true")
|
|
|
|
if i == 2:
|
|
|
|
self.core.lgd.config.set(self.game.app_name, option, "false")
|
|
|
|
else:
|
2021-03-14 23:00:06 +13:00
|
|
|
if self.game.app_name in self.core.lgd.config.sections():
|
2021-05-08 20:07:00 +12:00
|
|
|
if self.core.lgd.config.get(f"{self.game.app_name}", option, fallback=False):
|
2021-04-08 21:09:17 +12:00
|
|
|
self.core.lgd.config.remove_option(self.game.app_name, option)
|
2021-05-06 02:44:27 +12:00
|
|
|
if not self.core.lgd.config[self.game.app_name]:
|
2021-03-14 23:00:06 +13:00
|
|
|
self.core.lgd.config.remove_section(self.game.app_name)
|
|
|
|
self.core.lgd.save_config()
|
|
|
|
|
2021-03-10 09:57:54 +13:00
|
|
|
def change_proton(self, i):
|
2021-03-11 23:59:12 +13:00
|
|
|
if self.change:
|
2021-03-14 23:00:06 +13:00
|
|
|
# Dont use Proton
|
2021-03-10 09:57:54 +13:00
|
|
|
if i == 0:
|
|
|
|
if f"{self.game.app_name}" in self.core.lgd.config.sections():
|
2021-05-08 20:07:00 +12:00
|
|
|
if self.core.lgd.config.get(f"{self.game.app_name}", "wrapper", fallback=False):
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config.remove_option(self.game.app_name, "wrapper")
|
2021-05-08 20:07:00 +12:00
|
|
|
if self.core.lgd.config.get(f"{self.game.app_name}", "no_wine", fallback=False):
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config.remove_option(self.game.app_name, "no_wine")
|
2021-05-08 20:07:00 +12:00
|
|
|
if not self.core.lgd.config[self.game.app_name]:
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config.remove_section(self.game.app_name)
|
|
|
|
if f"{self.game.app_name}.env" in self.core.lgd.config.sections():
|
2021-05-08 20:07:00 +12:00
|
|
|
if self.core.lgd.config.get(f"{self.game.app_name}.env", "STEAM_COMPAT_DATA_PATH", fallback=False):
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config.remove_option(f"{self.game.app_name}.env", "STEAM_COMPAT_DATA_PATH")
|
2021-05-08 20:07:00 +12:00
|
|
|
if not self.core.lgd.config[self.game.app_name + ".env"]:
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config.remove_section(self.game.app_name + ".env")
|
2021-06-08 07:42:37 +12:00
|
|
|
self.proton_prefix.setEnabled(False)
|
|
|
|
# lk: TODO: This has to be fixed properly.
|
|
|
|
# lk: It happens because of the widget update. Mask it for now behind disabling the save button
|
|
|
|
self.wrapper.setText(self.core.lgd.config.get(f"{self.game.app_name}", "wrapper", fallback=""))
|
|
|
|
self.wrapper_button.setDisabled(True)
|
|
|
|
self.wrapper_widget.setEnabled(True)
|
|
|
|
self.linux_settings.wine_groupbox.setEnabled(True)
|
2021-03-10 09:57:54 +13:00
|
|
|
else:
|
2021-04-30 09:30:42 +12:00
|
|
|
self.proton_prefix.setEnabled(True)
|
|
|
|
self.wrapper_widget.setEnabled(False)
|
2021-05-06 02:44:27 +12:00
|
|
|
self.linux_settings.wine_groupbox.setEnabled(False)
|
2021-03-11 23:59:12 +13:00
|
|
|
wrapper = self.possible_proton_wrappers[i - 1]
|
2021-05-08 20:07:00 +12:00
|
|
|
if self.game.app_name not in self.core.lgd.config.sections():
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config[self.game.app_name] = {}
|
2021-05-08 20:07:00 +12:00
|
|
|
if self.game.app_name + ".env" not in self.core.lgd.config.sections():
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.config[self.game.app_name + ".env"] = {}
|
|
|
|
self.core.lgd.config.set(self.game.app_name, "wrapper", wrapper)
|
|
|
|
self.core.lgd.config.set(self.game.app_name, "no_wine", "true")
|
2021-03-11 23:59:12 +13:00
|
|
|
self.core.lgd.config.set(self.game.app_name + ".env", "STEAM_COMPAT_DATA_PATH",
|
|
|
|
os.path.expanduser("~/.proton"))
|
2021-10-10 00:33:54 +13:00
|
|
|
self.proton_prefix.setText(os.path.expanduser("~/.proton"))
|
2021-03-11 23:59:12 +13:00
|
|
|
|
|
|
|
# Dont use Wine
|
2021-10-10 00:33:54 +13:00
|
|
|
self.linux_settings.wine_exec.setText("")
|
|
|
|
self.linux_settings.wine_prefix.setText("")
|
2021-03-11 23:59:12 +13:00
|
|
|
|
|
|
|
self.core.lgd.save_config()
|
2021-03-10 09:57:54 +13:00
|
|
|
|
2021-10-11 21:41:01 +13:00
|
|
|
def proton_prefix_edit(self, text: str) -> Tuple[bool, str]:
|
2021-05-08 20:07:00 +12:00
|
|
|
if not text:
|
2021-03-10 09:57:54 +13:00
|
|
|
text = os.path.expanduser("~/.proton")
|
2021-10-11 21:41:01 +13:00
|
|
|
return True, text
|
2021-11-10 09:31:25 +13:00
|
|
|
parent = os.path.dirname(text)
|
|
|
|
return os.path.exists(parent), text
|
2021-03-10 09:57:54 +13:00
|
|
|
|
2021-10-11 21:41:01 +13:00
|
|
|
def proton_prefix_save(self, text: str):
|
2021-03-11 23:59:12 +13:00
|
|
|
self.core.lgd.config.set(self.game.app_name + ".env", "STEAM_COMPAT_DATA_PATH", text)
|
2021-03-10 09:57:54 +13:00
|
|
|
self.core.lgd.save_config()
|
|
|
|
|
2021-09-16 08:16:50 +12:00
|
|
|
def update_game(self, game: Game):
|
2021-03-11 23:59:12 +13:00
|
|
|
self.change = False
|
2021-09-16 08:16:50 +12:00
|
|
|
self.game = game
|
|
|
|
self.igame = self.core.get_installed_game(game.app_name)
|
|
|
|
app_name = game.app_name
|
|
|
|
if self.igame:
|
|
|
|
if self.igame.can_run_offline:
|
|
|
|
offline = self.core.lgd.config.get(self.game.app_name, "offline", fallback="unset")
|
|
|
|
if offline == "true":
|
|
|
|
self.offline.setCurrentIndex(1)
|
|
|
|
elif offline == "false":
|
|
|
|
self.offline.setCurrentIndex(2)
|
|
|
|
else:
|
|
|
|
self.offline.setCurrentIndex(0)
|
|
|
|
|
|
|
|
self.offline.setEnabled(True)
|
2021-03-14 23:00:06 +13:00
|
|
|
else:
|
2021-09-16 08:16:50 +12:00
|
|
|
self.offline.setEnabled(False)
|
2021-03-14 23:00:06 +13:00
|
|
|
else:
|
2021-04-30 09:30:42 +12:00
|
|
|
self.offline.setEnabled(False)
|
2021-03-14 23:00:06 +13:00
|
|
|
|
|
|
|
skip_update = self.core.lgd.config.get(self.game.app_name, "skip_update_check", fallback="unset")
|
|
|
|
if skip_update == "true":
|
|
|
|
self.skip_update.setCurrentIndex(1)
|
|
|
|
elif skip_update == "false":
|
|
|
|
self.skip_update.setCurrentIndex(2)
|
|
|
|
else:
|
|
|
|
self.skip_update.setCurrentIndex(0)
|
|
|
|
|
2021-03-27 06:04:29 +13:00
|
|
|
wrapper = self.core.lgd.config.get(self.game.app_name, "wrapper", fallback="")
|
|
|
|
self.wrapper.setText(wrapper)
|
|
|
|
|
2021-09-11 02:36:26 +12:00
|
|
|
self.game_title.setText(f"<h2>{self.game.app_title}</h2>")
|
2021-06-21 07:55:31 +12:00
|
|
|
if platform.system() != "Windows":
|
2021-03-10 09:57:54 +13:00
|
|
|
self.linux_settings.update_game(app_name)
|
2021-10-24 12:47:49 +13:00
|
|
|
|
2021-03-10 09:57:54 +13:00
|
|
|
proton = self.core.lgd.config.get(f"{app_name}", "wrapper", fallback="").replace('"', "")
|
|
|
|
if proton != "":
|
2021-04-30 09:30:42 +12:00
|
|
|
self.proton_prefix.setEnabled(True)
|
|
|
|
self.proton_wrapper.setCurrentText(f'"{proton.replace(" run", "")}" run')
|
2021-03-10 09:57:54 +13:00
|
|
|
proton_prefix = self.core.lgd.config.get(f"{app_name}.env", "STEAM_COMPAT_DATA_PATH",
|
2021-03-11 23:59:12 +13:00
|
|
|
fallback=self.tr(
|
|
|
|
"Please select path for proton prefix"))
|
2021-10-10 00:33:54 +13:00
|
|
|
self.proton_prefix.setText(proton_prefix)
|
2021-04-30 09:30:42 +12:00
|
|
|
self.wrapper_widget.setEnabled(False)
|
2021-03-10 09:57:54 +13:00
|
|
|
else:
|
2021-04-30 09:30:42 +12:00
|
|
|
self.proton_wrapper.setCurrentIndex(0)
|
|
|
|
self.proton_prefix.setEnabled(False)
|
|
|
|
self.wrapper_widget.setEnabled(True)
|
2021-04-10 21:27:40 +12:00
|
|
|
|
|
|
|
if not self.game.supports_cloud_saves:
|
2021-10-24 12:47:49 +13:00
|
|
|
self.cloud_gb.setEnabled(False)
|
|
|
|
self.cloud_save_path_edit.setText("")
|
2021-04-10 21:27:40 +12:00
|
|
|
else:
|
2021-10-24 12:47:49 +13:00
|
|
|
self.cloud_gb.setEnabled(True)
|
2021-04-10 21:27:40 +12:00
|
|
|
sync_cloud = self.settings.value(f"{self.game.app_name}/auto_sync_cloud", True, bool)
|
|
|
|
self.cloud_sync.setChecked(sync_cloud)
|
2021-10-24 12:47:49 +13:00
|
|
|
if self.igame.save_path:
|
|
|
|
self.cloud_save_path_edit.setText(self.igame.save_path)
|
|
|
|
else:
|
|
|
|
self.cloud_save_path_edit.setText("")
|
2021-04-10 22:34:45 +12:00
|
|
|
|
|
|
|
self.launch_params.setText(self.core.lgd.config.get(self.game.app_name, "start_params", fallback=""))
|
2021-03-11 23:59:12 +13:00
|
|
|
self.change = True
|
2021-03-10 09:57:54 +13:00
|
|
|
|
|
|
|
|
|
|
|
class LinuxAppSettings(LinuxSettings):
|
2021-10-08 07:19:24 +13:00
|
|
|
def __init__(self):
|
|
|
|
super(LinuxAppSettings, self).__init__("app")
|
2021-03-10 09:57:54 +13:00
|
|
|
|
|
|
|
def update_game(self, app_name):
|
|
|
|
self.name = app_name
|
2021-11-23 04:07:50 +13:00
|
|
|
self.wine_prefix.setText(self.load_prefix())
|
|
|
|
self.wine_exec.setText(self.load_setting(self.name, "wine_executable"))
|
2021-10-24 12:47:49 +13:00
|
|
|
|
2021-04-28 03:40:10 +12:00
|
|
|
self.dxvk.name = app_name
|
2021-10-24 12:47:49 +13:00
|
|
|
self.dxvk.load_settings()
|