diff --git a/rare/components/dialogs/install_dialog.py b/rare/components/dialogs/install_dialog.py index 681cdbad..a3042281 100644 --- a/rare/components/dialogs/install_dialog.py +++ b/rare/components/dialogs/install_dialog.py @@ -78,9 +78,7 @@ class InstallDialog(QDialog): elif rgame.is_installed: base_path = rgame.install_path else: - base_path = self.core.get_default_install_dir( - self.core.default_platform if self.core.default_platform in rgame.platforms else "Windows" - ) + base_path = self.core.get_default_install_dir(rgame.default_platform) self.install_dir_edit = PathEdit( path=base_path, @@ -103,13 +101,7 @@ class InstallDialog(QDialog): self.error_box() self.ui.platform_combo.addItems(reversed(rgame.platforms)) - combo_text = ( - rgame.igame.platform - if rgame.is_installed - else self.core.default_platform - if self.core.default_platform in rgame.platforms - else "Windows" - ) + combo_text = rgame.igame.platform if rgame.is_installed else rgame.default_platform self.ui.platform_combo.setCurrentIndex(self.ui.platform_combo.findText(combo_text)) self.ui.platform_combo.currentIndexChanged.connect(lambda i: self.option_changed(None)) self.ui.platform_combo.currentIndexChanged.connect(self.check_incompatible_platform) diff --git a/rare/components/tabs/games/game_info/game_info.py b/rare/components/tabs/games/game_info/game_info.py index 44e5b691..f0507021 100644 --- a/rare/components/tabs/games/game_info/game_info.py +++ b/rare/components/tabs/games/game_info/game_info.py @@ -286,7 +286,7 @@ class GameInfo(QWidget, SideTabContents): self.ui.platform.setText( self.rgame.igame.platform if self.rgame.is_installed and not self.rgame.is_non_asset - else self.core.default_platform + else self.rgame.default_platform ) self.ui.lbl_grade.setDisabled( diff --git a/rare/components/tabs/games/integrations/import_group.py b/rare/components/tabs/games/integrations/import_group.py index e56aee0d..ae4eede6 100644 --- a/rare/components/tabs/games/integrations/import_group.py +++ b/rare/components/tabs/games/integrations/import_group.py @@ -253,10 +253,10 @@ class ImportGroup(QGroupBox): def set_game(self, app_name: str): if app_name: - game = self.rcore.get_game(app_name) - folder = game.folder_name - platform = self.core.default_platform if self.core.default_platform in game.platforms else "Windows" - self.path_edit.setText(os.path.join(self.core.get_default_install_dir(platform), folder)) + rgame = self.rcore.get_game(app_name) + self.path_edit.setText( + os.path.join(self.core.get_default_install_dir(rgame.default_platform), rgame.folder_name) + ) self.app_name_edit.setText(app_name) def path_edit_callback(self, path) -> Tuple[bool, str, int]: diff --git a/rare/models/base_game.py b/rare/models/base_game.py index 77885347..0a1ee7ab 100644 --- a/rare/models/base_game.py +++ b/rare/models/base_game.py @@ -121,6 +121,10 @@ class RareGameBase(QObject): """ return tuple(self.game.asset_infos.keys()) + @property + def default_platform(self) -> str: + return self.core.default_platform if self.core.default_platform in self.platforms else "Windows" + @property def is_mac(self) -> bool: """! @@ -169,7 +173,7 @@ class RareGameBase(QObject): @return str The current version of the game """ - return self.igame.version if self.igame is not None else self.game.app_version(self.core.default_platform) + return self.igame.version if self.igame is not None else self.game.app_version(self.default_platform) @property def install_path(self) -> Optional[str]: diff --git a/rare/models/game.py b/rare/models/game.py index 0bca4d91..e3b19044 100644 --- a/rare/models/game.py +++ b/rare/models/game.py @@ -167,7 +167,7 @@ class RareGame(RareGameSlim): def update_game(self): self.game = self.core.get_game( self.app_name, update_meta=False, - platform=self.igame.platform if self.igame else self.core.default_platform + platform=self.igame.platform if self.igame else self.default_platform ) def update_igame(self): @@ -229,7 +229,7 @@ class RareGame(RareGameSlim): if self.igame is not None: return self.game.app_version(self.igame.platform) else: - return self.game.app_version(self.core.default_platform) + return self.game.app_version(self.default_platform) @property def has_update(self) -> bool: