Skip to content

Commit 9a94163

Browse files
committed
Added Go to Game buttion after successful installation
1 parent e7eac6d commit 9a94163

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

gamevault/UserControls/GameDownloadUserControl.xaml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<Border Background="{DynamicResource MahApps.Brushes.ThemeBackground2}" Margin="1" Height="80" CornerRadius="2">
2020
<Grid>
21-
<Button Style="{StaticResource ButtonWrapper}" HorizontalAlignment="Left" VerticalAlignment="Top" MaxWidth="52" Margin="2,2,120,2" Cursor="Hand" Click="GameImage_Click">
21+
<Button Style="{StaticResource ButtonWrapper}" HorizontalAlignment="Left" VerticalAlignment="Top" MaxWidth="52" Margin="2,2,120,2" Cursor="Hand" Click="GoToGame_Click">
2222
<local:CacheImage ImageCacheType="GameCover" Stretch="Fill" Data="{Binding Path=Game}" CornerRadius="2"/>
2323
</Button>
2424
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="56,2,0,0" MaxWidth="106" FontSize="6" FontWeight="Bold" TextTrimming="CharacterEllipsis">
@@ -154,7 +154,32 @@
154154
</Ellipse.Style>
155155
</Ellipse>
156156
</StackPanel>
157-
<local:IconButton x:Name="uiBtnInstall" Kind="Primary" IsEnabled="False" Text="Install" FontSize="5" Icon="{StaticResource IconInstalledGamesSettings}" IconScale="0.29" IconMargin="-9,-7,-5.5,-7" CornerRadius="2" Height="9" Width="34" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="64,62,1,0" ToolTip="Install Game" Click="OpenInstallOptions_Click"/>
157+
<Grid HorizontalAlignment="Left" VerticalAlignment="Center" Margin="64,62,1,0">
158+
<local:IconButton x:Name="uiBtnInstall" Kind="Primary" IsEnabled="False" Text="Install" FontSize="5" Icon="{StaticResource IconInstalledGamesSettings}" IconScale="0.29" IconMargin="-9,-7,-5.5,-7" CornerRadius="2" Height="9" Width="34" ToolTip="Install Game" Click="OpenInstallOptions_Click">
159+
<local:IconButton.Style>
160+
<Style TargetType="local:IconButton" BasedOn="{StaticResource {x:Type local:IconButton}}">
161+
<Setter Property="Visibility" Value="Visible"/>
162+
<Style.Triggers>
163+
<DataTrigger Binding="{Binding InstallationStepperProgress}" Value="2">
164+
<Setter Property="Visibility" Value="Collapsed"/>
165+
</DataTrigger>
166+
</Style.Triggers>
167+
</Style>
168+
</local:IconButton.Style>
169+
</local:IconButton>
170+
<local:IconButton Kind="Primary" Text="Go to Game" FontSize="5" CornerRadius="2" Height="9" Width="34" Click="GoToGame_Click">
171+
<local:IconButton.Style>
172+
<Style TargetType="local:IconButton" BasedOn="{StaticResource {x:Type local:IconButton}}">
173+
<Setter Property="Visibility" Value="Collapsed"/>
174+
<Style.Triggers>
175+
<DataTrigger Binding="{Binding InstallationStepperProgress}" Value="2">
176+
<Setter Property="Visibility" Value="Visible"/>
177+
</DataTrigger>
178+
</Style.Triggers>
179+
</Style>
180+
</local:IconButton.Style>
181+
</local:IconButton>
182+
</Grid>
158183
<Grid x:Name="uiInstallOptions" Visibility="Collapsed" Margin="56,10,1,2" Width="122" Background="{DynamicResource MahApps.Brushes.ThemeBackground2}">
159184
<Grid>
160185
<Grid.Style>

gamevault/UserControls/GameDownloadUserControl.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ private void OpenDirectory_Click(object sender, RoutedEventArgs e)
420420
Process.Start("explorer.exe", m_DownloadPath);
421421
}
422422

423-
private void GameImage_Click(object sender, RoutedEventArgs e)
423+
private void GoToGame_Click(object sender, RoutedEventArgs e)
424424
{
425425
MainWindowViewModel.Instance.SetActiveControl(new GameViewUserControl(ViewModel.Game, LoginManager.Instance.IsLoggedIn()));
426426
}
@@ -831,7 +831,7 @@ public void MoveFromRootPath(string sourceDir, string destinationDir)
831831
}
832832

833833
// Do not attempt to delete source since it is on a read-only ISO.
834-
}
834+
}
835835
private void CopyInstallPathToClipboard_Click(object sender, System.Windows.Input.MouseButtonEventArgs e)
836836
{
837837
try
@@ -864,7 +864,6 @@ private void InitOverwriteGameType_Click(object sender, RoutedEventArgs e)
864864
temp.Type = GameType.UNDETECTABLE;
865865
ViewModel.Game = null;
866866
ViewModel.Game = temp;
867-
}
868-
867+
}
869868
}
870869
}

0 commit comments

Comments
 (0)