Skip to content

Commit

Permalink
ui progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelo420 committed Dec 6, 2023
1 parent 177a341 commit c3144a0
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 23 deletions.
4 changes: 2 additions & 2 deletions gamevault/UserControls/GameDownloadUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private void DownloadCompleted()
{
Directory.CreateDirectory(ViewModel.InstallPath);
}
//MainWindowViewModel.Instance.Installs.AddSystemFileWatcher(ViewModel.InstallPath);
MainWindowViewModel.Instance.NewLibrary.GetGameInstalls().AddSystemFileWatcher(ViewModel.InstallPath);
if (SettingsViewModel.Instance.AutoExtract)
{
App.Current.Dispatcher.Invoke((Action)async delegate
Expand Down Expand Up @@ -441,7 +441,7 @@ await Task.Run(async () =>
{
try
{
setupProcess = ProcessHelper.StartApp(setupEexecutable, "",true);
setupProcess = ProcessHelper.StartApp(setupEexecutable, "", true);
}
catch
{
Expand Down
42 changes: 29 additions & 13 deletions gamevault/UserControls/GameSettingsUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@
<Grid Grid.Column="1" Background="{DynamicResource DarkBackground3}">
<mah:MetroAnimatedTabControl x:Name="uiSettingsContent" Background="Transparent">
<mah:MetroTabItem>
<StackPanel Margin="20,50,0,0">
<TextBlock Text="Here you can manage your Game Installation" FontSize="15"/>
<StackPanel Margin="20,20,0,0">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<Path Data="{DynamicResource IconGameSettingsFolder}" Fill="White" Margin="0,2,0,0"/>
<TextBlock Text="Installation" FontSize="20" FontWeight="Bold" Margin="5,0,0,0"/>
</StackPanel>
<TextBlock Text="Here you can manage your Game Installation" FontSize="15" Margin="0,5,0,0"/>
<TextBlock Text="Installation" FontSize="15" FontWeight="Bold" TextDecorations="Underline" Margin="0,20,0,0"/>
<TextBlock Text="This Game was installed to:" FontSize="15" FontWeight="Bold" Margin="0,20,0,0"/>
<Border CornerRadius="5" Background="{DynamicResource DarkBackground2}" Margin="0,5,20,10" Padding="10">
Expand All @@ -141,15 +145,19 @@
</StackPanel>
<TextBlock Text="Disk Usage" FontSize="15" FontWeight="Bold" TextDecorations="Underline" Margin="0,20,0,0"/>
<lvc:PieChart x:Name="uiDiscUsagePieChart" Width="300" Height="200" InitialRotation="0" IsClockwise="True" HorizontalAlignment="Left" Margin="0,20,0,0">

</lvc:PieChart>
<TextBlock Text="Installed Games" FontSize="15" FontWeight="Bold" Margin="35,0,0,0"/>
<TextBlock x:Name="uiTxtAllInstalledGamesSize" FontSize="15" FontWeight="Bold" Margin="35,0,0,0"/>
</StackPanel>
</mah:MetroTabItem>
<mah:MetroTabItem>
<StackPanel Margin="20,80,0,0">
<TextBlock Text="Here you can manage you launch options" FontSize="15"/>
<StackPanel Margin="20,20,0,0">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<Path Data="{DynamicResource IconGameSettingsLaunchOptions}" Fill="White" Margin="0,1,0,0"/>
<TextBlock Text="Launch Options" FontSize="20" FontWeight="Bold" Margin="5,0,0,0"/>
</StackPanel>
<TextBlock Text="Here you can manage you launch options" FontSize="15" Margin="0,5,0,0"/>
<TextBlock Text="Game Executable" FontSize="15" FontWeight="Bold" TextDecorations="Underline" Margin="0,20,0,0"/>
<ComboBox x:Name="uiCbExecutables" ItemsSource="{Binding Executables}" DisplayMemberPath="Value" Margin="0,10,150,0" SelectionChanged="Executable_SelectionChanged" DropDownOpened="ExecutableSelection_Opened"/>
<TextBlock Text="Launch Parameter" FontSize="15" FontWeight="Bold" TextDecorations="Underline" Margin="0,20,0,0"/>
Expand All @@ -159,9 +167,13 @@
</StackPanel>
</mah:MetroTabItem>
<mah:MetroTabItem>
<Grid>
<TextBlock Text="Here, you can update the background and box images of your game." VerticalAlignment="Top" FontSize="15" Margin="10,10,0,0"/>
<Border CornerRadius="5" Margin="10,50,0,50" Width="425" HorizontalAlignment="Left" Background="{DynamicResource DarkBackground}">
<Grid Margin="0,20,0,0">
<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<Path Data="{DynamicResource IconGameSettingsEditImages}" Fill="White" Margin="0,1,0,0"/>
<TextBlock Text="Edit Images" FontSize="20" FontWeight="Bold" Margin="5,0,0,0"/>
</StackPanel>
<TextBlock Text="Here, you can update the background and box images of your game." VerticalAlignment="Top" FontSize="15" Margin="10,35,0,0"/>
<Border CornerRadius="5" Margin="10,70,0,50" Width="425" HorizontalAlignment="Left" Background="{DynamicResource DarkBackground}">
<StackPanel>
<TextBlock Text="Background" HorizontalAlignment="Center" FontSize="15" Margin="0,5,0,0"/>
<Grid>
Expand Down Expand Up @@ -212,7 +224,7 @@
</Button>
</StackPanel>
</Border>
<Border CornerRadius="5" Margin="0,50,10,50" Width="425" HorizontalAlignment="Right" Background="{DynamicResource DarkBackground}">
<Border CornerRadius="5" Margin="0,70,10,50" Width="425" HorizontalAlignment="Right" Background="{DynamicResource DarkBackground}">
<StackPanel>
<TextBlock Text="Box Art" HorizontalAlignment="Center" FontSize="15" Margin="0,5,0,0"/>
<Grid>
Expand Down Expand Up @@ -266,8 +278,12 @@
</Grid>
</mah:MetroTabItem>
<mah:MetroTabItem>
<StackPanel Margin="20,80,0,0">
<TextBlock Text="Here, you can remap your games to other RAWG games or recache all information for them from the RAWG database." FontSize="15"/>
<StackPanel Margin="20,20,0,0">
<StackPanel Orientation="Horizontal">
<Path Data="{DynamicResource IconGameSettingsRemap}" Fill="White" VerticalAlignment="Center"/>
<TextBlock Text="Remap Game" FontSize="20" FontWeight="Bold" Margin="5,0,0,0"/>
</StackPanel>
<TextBlock Text="Here, you can remap your games to other RAWG games or recache all information for them from the RAWG database." FontSize="15" Margin="0,5,0,0"/>
<StackPanel Margin="0,10,0,0">
<TextBlock Text="Your Game File" FontSize="15" FontWeight="Bold" TextDecorations="Underline"/>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
Expand All @@ -285,8 +301,8 @@
<TextBlock Text="Currently Mapped RAWG Game" FontSize="15" FontWeight="Bold" TextDecorations="Underline" Margin="0,20,0,0"/>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Text="RAWG ID" FontSize="15" FontWeight="Bold"/>
<TextBlock Text="RAWG Title" FontSize="15" FontWeight="Bold" Margin="30,0,0,0"/>
<TextBlock Text="RAWG Release Date" FontSize="15" FontWeight="Bold" Margin="235,0,0,0"/>
<TextBlock Text="RAWG Title" FontSize="15" FontWeight="Bold" Margin="25,0,0,0"/>
<TextBlock Text="RAWG Release Date" FontSize="15" FontWeight="Bold" Margin="240,0,0,0"/>
<TextBlock Text="Last Cached" FontSize="15" FontWeight="Bold" Margin="63,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
Expand Down
5 changes: 3 additions & 2 deletions gamevault/UserControls/GameSettingsUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal GameSettingsUserControl(Game game)
ViewModel.LaunchParameter = Preferences.Get(AppConfigKey.LaunchParameter, $"{ViewModel.Directory}\\gamevault-exec");
}
InitDiscUsagePieChart();
}
}
this.DataContext = ViewModel;
}
private bool IsGameInstalled(Game game)
Expand Down Expand Up @@ -117,6 +117,7 @@ private async void Uninstall_Click(object sender, MouseButtonEventArgs e)
Directory.Delete(ViewModel.Directory, true);

NewInstallViewModel.Instance.InstalledGames.Remove(NewInstallViewModel.Instance.InstalledGames.Where(g => g.Key.ID == ViewModel.Game.ID).First());
MainWindowViewModel.Instance.ClosePopup();
}
catch
{
Expand Down Expand Up @@ -168,7 +169,7 @@ private async void Uninstall_Click(object sender, MouseButtonEventArgs e)
}
}
}
else if(ViewModel.Game.Type == GameType.UNDETECTABLE)
else if (ViewModel.Game.Type == GameType.UNDETECTABLE)
{
MainWindowViewModel.Instance.AppBarText = "Game Type cannot be determined";
}
Expand Down
6 changes: 3 additions & 3 deletions gamevault/UserControls/NewGameViewUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</TextBlock>
<local:CacheImage Data="{Binding Game}" ImageCacheType="BoxArt" CornerRadius="5" VerticalAlignment="Top" HorizontalAlignment="Left" Height="600" Width="400" Margin="0,70,0,0"/>

<TextBlock Text="{Binding Path=Game.Size,Converter={StaticResource sizeConv}}" Margin="0,3,0,0.8" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="50" FontWeight="Bold"/>

<StackPanel Background="Transparent" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="420,70,0,0" Orientation="Horizontal">
<Grid Style="{DynamicResource HoverEffect}" VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="{Binding ScrollToTopVisibility}" Background="Transparent" Cursor="Hand" Width="50" Height="50" Margin="00,0,0,0" RenderTransformOrigin="0.5,0.5" MouseLeftButtonUp="GamePlay_Click">
<Path Data="{StaticResource IconInstalledGamesPlay}" Fill="White" RenderTransformOrigin="0.12,0.11">
Expand Down Expand Up @@ -214,8 +214,8 @@
</Grid>
</StackPanel>


<StackPanel HorizontalAlignment="Right" Margin="0,80,0,0">
<TextBlock Text="{Binding Path=Game.Size,Converter={StaticResource sizeConv}}" Margin="0,-15,0,0.8" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="50" FontWeight="Bold"/>
<StackPanel HorizontalAlignment="Right" Margin="0,135,0,0">
<TextBlock Text="State" FontSize="15" FontWeight="Bold"/>
<ComboBox ItemsSource="{Binding GameStates}" SelectedValue="{Binding Path=Progress.State}" FontSize="30" SelectionChanged="GameState_SelectionChanged">
<ComboBox.ItemContainerStyle>
Expand Down
39 changes: 37 additions & 2 deletions gamevault/UserControls/NewGameViewUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
Expand Down Expand Up @@ -72,7 +73,41 @@ private void Back_Click(object sender, MouseButtonEventArgs e)
}
private void GamePlay_Click(object sender, MouseButtonEventArgs e)
{
MainWindowViewModel.Instance.AppBarText = "Hentai Game detected. FBI was alerted!";
string path = "";
KeyValuePair<Game, string> result = NewInstallViewModel.Instance.InstalledGames.Where(g => g.Key.ID == ViewModel.Game.ID).FirstOrDefault();
if (!result.Equals(default(KeyValuePair<Game, string>)))
{
path = result.Value;
}
string savedExecutable = Preferences.Get(AppConfigKey.Executable, $"{path}\\gamevault-exec");
string parameter = Preferences.Get(AppConfigKey.LaunchParameter, $"{path}\\gamevault-exec");
if (savedExecutable == string.Empty)
{
MainWindowViewModel.Instance.AppBarText = $"No Executable set";
}
else if (File.Exists(savedExecutable))
{
try
{
ProcessHelper.StartApp(savedExecutable, parameter);
}
catch
{

try
{
ProcessHelper.StartApp(savedExecutable, parameter, true);
}
catch
{
MainWindowViewModel.Instance.AppBarText = $"Can not execute '{savedExecutable}'";
}
}
}
else
{
MainWindowViewModel.Instance.AppBarText = $"Could not find Executable '{savedExecutable}'";
}
}
private void GameSettings_Click(object sender, MouseButtonEventArgs e)
{
Expand Down Expand Up @@ -120,6 +155,6 @@ await Task.Run(() =>
catch { }
});
}
}
}
}
}
2 changes: 1 addition & 1 deletion gamevault/Windows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</Viewbox>
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Background" Value="#33FFFFFF"/>
<Setter Property="Background" Value="#4CFFFFFF"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Popup}" Value="{x:Null}">
<Setter Property="Background" Value="{x:Null}"/>
Expand Down

0 comments on commit c3144a0

Please sign in to comment.