Skip to content

Commit

Permalink
Release 1.8.1
Browse files Browse the repository at this point in the history
Release 1.8.1
  • Loading branch information
Yelo420 authored Dec 27, 2023
2 parents f5a300a + cc9fe8d commit ba1eb90
Show file tree
Hide file tree
Showing 22 changed files with 350 additions and 244 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# GameVault App Changelog

## 1.8.1
Recommended Gamevault Server Version: `v10.0.2`
### Changes
- Implemented to display whether and how many filters are active
- Added clear all filters Button
- Added Early Access Flag to the Game View
- Library outer Scrollbar is now scrolling if inner Scrollbar has zero offset
- Bug fix: Standard release date filters did not work if no release year was set in existing games
- Bug fix: If the profile picture of another user has been changed, the profile picture has been changed in the top left-hand corner.
- Bug fix: Game Type is now displayed in more user friendly values
- Bug fix: Crash when searching in the installed games search bar while the list was empty
- Bug fix: Installed Games executable auto picker only worked if you were in the game settings at least once
- Bug fix: It was possible to save an image while it was not fully loaded
- Bug fix: Crash if you click on the Download or Settings button before the GameView has fully loaded
- Bug fix: Progesses from other users were cut off in GameView
- Bug fix: Lower boxart quality in the GameView

## 1.8.0
Recommended Gamevault Server Version: `v10.0.0`
### Changes
Expand Down
35 changes: 29 additions & 6 deletions gamevault/Helper/BitmapHelper.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using gamevault.Models;
using gamevault.ViewModels;
using SkiaSharp;
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Net.Http;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

Expand All @@ -24,6 +20,33 @@ public static BitmapImage GetBitmapImage(string uri)
image.EndInit();
return image;
}
public static async Task<BitmapImage> GetBitmapImageAsync(string uri)
{
BitmapImage bitmap = null;

var httpclient = new HttpClient();

using (var response = await httpclient.GetAsync(uri))
{
if (response.IsSuccessStatusCode)
{
using (var stream = new MemoryStream())
{
await response.Content.CopyToAsync(stream);
stream.Seek(0, SeekOrigin.Begin);

bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.CacheOption = BitmapCacheOption.OnLoad;
bitmap.StreamSource = stream;
bitmap.EndInit();
bitmap.Freeze();
}
}
}

return bitmap;
}
public static MemoryStream BitmapSourceToMemoryStream(BitmapSource src)
{
System.Drawing.Bitmap bitmap;
Expand Down
2 changes: 1 addition & 1 deletion gamevault/Helper/CacheHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ internal static async Task OptimizeCache()
{
await Task.Run(() =>
{
double maxHeight = SystemParameters.FullPrimaryScreenHeight / 4;
double maxHeight = SystemParameters.FullPrimaryScreenHeight / 2;
var files = Directory.GetFiles(AppFilePath.ImageCache, "*.*", SearchOption.AllDirectories);
foreach (string file in files)
{
Expand Down
1 change: 1 addition & 0 deletions gamevault/Models/Genre_Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ public struct Genre_Tag
public int? RawgId { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
public string? OriginName { get; set; }
}
}
2 changes: 1 addition & 1 deletion gamevault/Resources/Assets/Icons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
M17.59 3.59c-.38-.38-.89-.59-1.42-.59H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7.83c0-.53-.21-1.04-.59-1.41l-2.82-2.83zM12 19c-1.66 0-3-1.34-3-3s1.34-3 3-3s3 1.34 3 3s-1.34 3-3 3zm1-10H7c-1.1 0-2-.9-2-2s.9-2 2-2h6c1.1 0 2 .9 2 2s-.9 2-2 2z
</Geometry>
<Geometry x:Key="IconGameSettingsGoogle">
M15.545 6.558a9.42 9.42 0 0 1 .139 1.626c0 2.434-.87 4.492-2.384 5.885h.002C11.978 15.292 10.158 16 8 16A8 8 0 1 1 8 0a7.689 7.689 0 0 1 5.352 2.082l-2.284 2.284A4.347 4.347 0 0 0 8 3.166c-2.087 0-3.86 1.408-4.492 3.304a4.792 4.792 0 0 0 0 3.063h.003c.635 1.893 2.405 3.301 4.492 3.301c1.078 0 2.004-.276 2.722-.764h-.003a3.702 3.702 0 0 0 1.599-2.431H8v-3.08h7.545z
M6 12a6 6 0 0 0 11.659 2H12v-4h9.805v4H21.8c-.927 4.564-4.962 8-9.8 8c-5.523 0-10-4.477-10-10S6.477 2 12 2a9.99 9.99 0 0 1 8.282 4.393l-3.278 2.295A6 6 0 0 0 6 12
</Geometry>
<!--EndGameSettings-->

Expand Down
31 changes: 25 additions & 6 deletions gamevault/UserControls/GameSettingsUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,26 @@ private void FindGameExecutables(string directory, bool checkForSavedExecutable)
}
}
}
private bool ContainsValueFromIgnoreList(string value)
public static bool TryPrepareLaunchExecutable(string directory)
{
foreach (string entry in Directory.GetFiles(directory, "*", SearchOption.AllDirectories))
{
string fileType = Path.GetExtension(entry).TrimStart('.');
if (Globals.SupportedExecutables.Contains(fileType.ToUpper()))
{
if (!ContainsValueFromIgnoreList(entry))
{
if (File.Exists($"{directory}\\gamevault-exec"))
{
Preferences.Set(AppConfigKey.Executable, entry, $"{directory}\\gamevault-exec");
return true;
}
}
}
}
return false;
}
private static bool ContainsValueFromIgnoreList(string value)
{
return (NewInstallViewModel.Instance.IgnoreList != null && NewInstallViewModel.Instance.IgnoreList.Any(s => Path.GetFileNameWithoutExtension(value).Contains(s, StringComparison.OrdinalIgnoreCase)));
}
Expand Down Expand Up @@ -391,7 +410,7 @@ private void LaunchParameter_Changed(object sender, RoutedEventArgs e)
#endregion
#region EDIT IMAGE

private void Image_Drop(object sender, DragEventArgs e)
private async void Image_Drop(object sender, DragEventArgs e)
{
string tag = ((FrameworkElement)sender).Tag as string;
if (e.Data.GetDataPresent(DataFormats.FileDrop))
Expand Down Expand Up @@ -422,7 +441,7 @@ private void Image_Drop(object sender, DragEventArgs e)
{
try
{
BitmapImage bitmap = new BitmapImage(new Uri(imagePath));
BitmapImage bitmap = await BitmapHelper.GetBitmapImageAsync(imagePath);
if (tag == "box")
{
ViewModel.BoxArtImageSource = bitmap;
Expand Down Expand Up @@ -476,17 +495,17 @@ private void ChooseImage(object sender, MouseButtonEventArgs e)
MainWindowViewModel.Instance.AppBarText = ex.Message;
}
}
private void LoadImageUrl(string url, string tag)
private async void LoadImageUrl(string url, string tag)
{
try
{
if (tag == "box")
{
ViewModel.BoxArtImageSource = BitmapHelper.GetBitmapImage(url);
ViewModel.BoxArtImageSource = await BitmapHelper.GetBitmapImageAsync(url);
}
else
{
ViewModel.BackgroundImageSource = BitmapHelper.GetBitmapImage(url);
ViewModel.BackgroundImageSource = await BitmapHelper.GetBitmapImageAsync(url);
}
}
catch (Exception ex)
Expand Down
17 changes: 17 additions & 0 deletions gamevault/UserControls/GeneralControls/DateRangeSelector.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<UserControl x:Class="gamevault.UserControls.DateRangeSelector"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:gamevault.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<StackPanel Orientation="Horizontal" LostFocus="StackPanel_LostFocus">
<TextBox x:Name="uiFilterYearFrom" mah:ControlsHelper.CornerRadius="5" BorderThickness="2" mah:TextBoxHelper.Watermark="{Binding YearFromPlaceholder}" Background="{DynamicResource MainColor}" Width="42" MaxLength="4" PreviewTextInput="YearSelector_Changed"/>
<Rectangle Fill="White" Stroke="White" StrokeThickness="4" Height="3" Width="7" Margin="5"/>
<TextBox x:Name="uiFilterYearTo" mah:ControlsHelper.CornerRadius="5" BorderThickness="2" mah:TextBoxHelper.Watermark="{Binding YearToPlaceholder}" Background="{DynamicResource MainColor}" Width="42" MaxLength="4" PreviewTextInput="YearSelector_Changed"/>
</StackPanel>
</Grid>
</UserControl>
60 changes: 60 additions & 0 deletions gamevault/UserControls/GeneralControls/DateRangeSelector.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace gamevault.UserControls
{
/// <summary>
/// Interaction logic for DateRangeSelector.xaml
/// </summary>
public partial class DateRangeSelector : UserControl
{
public string YearToPlaceholder { get; set; }
public string YearFromPlaceholder { get; set; } = "1980";
public event EventHandler EntriesUpdated;
public DateRangeSelector()
{
InitializeComponent();
YearToPlaceholder = DateTime.Now.Year.ToString();
this.DataContext = this;
}
public bool IsValid()
{
return uiFilterYearFrom.Text != string.Empty && uiFilterYearTo.Text != string.Empty;
}
public string GetYearFrom()
{
return uiFilterYearFrom.Text;
}
public string GetYearTo()
{
return uiFilterYearTo.Text;
}
public void ClearSelection()
{
uiFilterYearFrom.Text = string.Empty; uiFilterYearTo.Text = string.Empty;
}
private void StackPanel_LostFocus(object sender, RoutedEventArgs e)
{
if (EntriesUpdated != null && IsValid())
EntriesUpdated(this, e);
}
private void YearSelector_Changed(object sender, TextCompositionEventArgs e)
{
Regex regex = new Regex("[^0-9]+");
e.Handled = (((TextBox)e.Source).Text == "" && e.Text == "0") || regex.IsMatch(e.Text);
}
}
}
4 changes: 2 additions & 2 deletions gamevault/UserControls/GeneralControls/TagSelector.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border CornerRadius="5" Background="{Binding Name,Converter={StaticResource colorConv}}" Margin="0,2,5,0" Width="145">
<Grid Margin="5,2,2,2">
<Grid Margin="5,2,2,2" Background="Transparent" Cursor="Hand" ToolTip="Remove" MouseLeftButtonUp="RemoveEntry_Click">
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center" MaxWidth="125"/>
<Path Data="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5" Stroke="White" StrokeThickness="2" HorizontalAlignment="Right" Margin="0,0,2,0" Cursor="Hand" ToolTip="Remove" MouseLeftButtonUp="RemoveEntry_Click"/>
<Path Data="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5" Stroke="White" StrokeThickness="2" HorizontalAlignment="Right" Margin="0,0,2,0"/>
</Grid>
</Border>
</DataTemplate>
Expand Down
42 changes: 22 additions & 20 deletions gamevault/UserControls/GeneralControls/TagSelector.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
using ControlzEx.Standard;
using gamevault.Converter;
using gamevault.Converter;
using gamevault.Helper;
using gamevault.Models;
using gamevault.ViewModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace gamevault.UserControls
{
Expand All @@ -39,7 +30,6 @@ public Selection SelectionType
public event EventHandler EntriesUpdated;
private bool loaded = false;
private InputTimer debounceTimer { get; set; }
private Genre_Tag[] selectionEntries { get; set; }
private List<Genre_Tag> selectedEntries = new List<Genre_Tag>();
public TagSelector()
{
Expand Down Expand Up @@ -67,8 +57,20 @@ private void InitTimer()
}
public string GetSelectedEntries()
{
if (SelectionType == Selection.GameType)
return string.Join(",", selectedEntries.Select(o => o.OriginName));

return string.Join(",", selectedEntries.Select(o => o.Name));
}
public bool HasEntries()
{
return selectedEntries.Any();
}
public void ClearEntries()
{
selectedEntries.Clear();
uiSelectedEntries.ItemsSource = null;
}
private async void DebounceTimerElapsed(object? sender, EventArgs e)
{
debounceTimer.Stop();
Expand Down Expand Up @@ -106,16 +108,16 @@ await Task.Run(() =>
}
else
{
//EnumDescriptionConverter conv = new EnumDescriptionConverter();
//List<Genre_Tag> list = new List<Genre_Tag>();
//foreach (GameType type in Enum.GetValues(typeof(GameType)))
//{
// if (type == GameType.UNDETECTABLE)
// continue;
EnumDescriptionConverter conv = new EnumDescriptionConverter();
List<Genre_Tag> list = new List<Genre_Tag>();
foreach (GameType type in Enum.GetValues(typeof(GameType)))
{
if (type == GameType.UNDETECTABLE)
continue;

// list.Add(new Genre_Tag() { DisplayName = type.ToString(), Name = (string)conv.Convert(type, null, null, null) });
//}
data = new Genre_Tag[3] { new Genre_Tag() { Name = "WINDOWS_SETUP" }, new Genre_Tag() { Name = "WINDOWS_PORTABLE" }, new Genre_Tag() { Name = "LINUX_PORTABLE" } };
list.Add(new Genre_Tag() { OriginName = type.ToString(), Name = (string)conv.Convert(type, null, null, null) });
}
data = list.ToArray();
data = data.Where(x => x.Name.Contains(debounceTimer.Data, StringComparison.OrdinalIgnoreCase)).ToArray();
}
uiSelectionEntries.ItemsSource = data;
Expand Down
32 changes: 0 additions & 32 deletions gamevault/UserControls/GeneralControls/UserEditUserControl.xaml

This file was deleted.

Loading

0 comments on commit ba1eb90

Please sign in to comment.