From c9525cca8924b2dc2d3ad3a273466408476f449e Mon Sep 17 00:00:00 2001 From: Scighost Date: Sun, 14 Jan 2024 00:13:05 +0800 Subject: [PATCH] optimize start game area --- src/Starward/Pages/LauncherPage.xaml | 2 +- src/Starward/Pages/LauncherPage.xaml.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Starward/Pages/LauncherPage.xaml b/src/Starward/Pages/LauncherPage.xaml index cd64701ea..764a4a18a 100644 --- a/src/Starward/Pages/LauncherPage.xaml +++ b/src/Starward/Pages/LauncherPage.xaml @@ -649,7 +649,7 @@ BorderThickness="0" Command="{x:Bind RepairGameCommand}" CornerRadius="0,18,18,0" - IsEnabled="{x:Bind IsGameSupportRepair}" + IsEnabled="{x:Bind IsSettingGameRepairButtonEnabled}" Style="{ThemeResource AccentButtonStyle}"> diff --git a/src/Starward/Pages/LauncherPage.xaml.cs b/src/Starward/Pages/LauncherPage.xaml.cs index 75704ce07..fc3de47d1 100644 --- a/src/Starward/Pages/LauncherPage.xaml.cs +++ b/src/Starward/Pages/LauncherPage.xaml.cs @@ -429,7 +429,8 @@ private void UpdateGameButtonStyle() [NotifyPropertyChangedFor(nameof(IsUpdateGameButtonEnable))] [NotifyPropertyChangedFor(nameof(IsPreInstallButtonEnable))] [NotifyPropertyChangedFor(nameof(IsRepairGameButtonEnable))] - [NotifyPropertyChangedFor(nameof(IsGameSupportRepair))] + [NotifyPropertyChangedFor(nameof(IsGameSupportCompleteRepair))] + [NotifyPropertyChangedFor(nameof(IsSettingGameRepairButtonEnabled))] private Version? localGameVersion; [ObservableProperty] @@ -445,16 +446,17 @@ private void UpdateGameButtonStyle() [NotifyPropertyChangedFor(nameof(IsStartGameButtonEnable))] [NotifyPropertyChangedFor(nameof(IsDownloadGameButtonEnable))] [NotifyPropertyChangedFor(nameof(IsRepairGameButtonEnable))] + [NotifyPropertyChangedFor(nameof(IsSettingGameRepairButtonEnabled))] private bool isGameExeExists; - public bool IsGameSupportRepair => CurrentGameBiz.ToGame() != GameBiz.None && CurrentGameBiz != GameBiz.hk4e_cloud && (InstallPath != null || LocalGameVersion != null); + public bool IsGameSupportCompleteRepair => CurrentGameBiz.ToGame() != GameBiz.None && CurrentGameBiz != GameBiz.hk4e_cloud && (CurrentGameBiz.ToGame() != GameBiz.Honkai3rd || (CurrentGameBiz.ToGame() == GameBiz.Honkai3rd && IsGameExeExists)); public bool IsStartGameButtonEnable => LocalGameVersion != null && LocalGameVersion >= LatestGameVersion && IsGameExeExists && !IsGameRunning; - public bool IsDownloadGameButtonEnable => (LocalGameVersion == null && !IsGameExeExists) || ((LocalGameVersion == null || !IsGameExeExists) && !IsGameSupportRepair); + public bool IsDownloadGameButtonEnable => (LocalGameVersion == null && !IsGameExeExists) || ((LocalGameVersion == null || !IsGameExeExists) && !IsGameSupportCompleteRepair); public bool IsUpdateGameButtonEnable => LocalGameVersion != null && LatestGameVersion > LocalGameVersion; @@ -463,7 +465,7 @@ private void UpdateGameButtonStyle() public bool IsPreInstallButtonEnable => LocalGameVersion != null && PreInstallGameVersion != null; - public bool IsRepairGameButtonEnable => IsGameSupportRepair && ((LocalGameVersion != null && !IsGameExeExists) || (LocalGameVersion == null && IsGameExeExists)); + public bool IsRepairGameButtonEnable => IsGameSupportCompleteRepair && ((LocalGameVersion != null && !IsGameExeExists) || (LocalGameVersion == null && IsGameExeExists)); @@ -1228,6 +1230,8 @@ private async Task UninstallGameAsync() + public bool IsSettingGameRepairButtonEnabled => CurrentGameBiz.ToGame() != GameBiz.None && CurrentGameBiz != GameBiz.hk4e_cloud && LocalGameVersion != null && IsGameExeExists; + [ObservableProperty] private string? installPath;