Skip to content

Commit

Permalink
optimize start game area
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Jan 13, 2024
1 parent 9f92282 commit c9525cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Starward/Pages/LauncherPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon Glyph="&#xE90F;" />
Expand Down
12 changes: 8 additions & 4 deletions src/Starward/Pages/LauncherPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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;
Expand All @@ -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));



Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c9525cc

Please sign in to comment.