From b873fa4cf3a911d8cc98bb7bf3e8524bd59f9b14 Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 18 Dec 2024 21:16:17 +0100 Subject: [PATCH] Updated dependencies --- gamevault/Helper/CacheHelper.cs | 8 ++++---- gamevault/Helper/GifHelper.cs | 2 +- .../UserControls/GameSettingsUserControl.xaml.cs | 5 +---- gamevault/ViewModels/MainWindowViewModel.cs | 2 +- gamevault/gamevault.csproj | 14 +++++++------- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/gamevault/Helper/CacheHelper.cs b/gamevault/Helper/CacheHelper.cs index eb8ede1..8a9208f 100644 --- a/gamevault/Helper/CacheHelper.cs +++ b/gamevault/Helper/CacheHelper.cs @@ -188,13 +188,13 @@ await Task.Run(() => { if (GifHelper.IsGif(file)) { - int maxGifHeightWidth = 400; + uint maxGifHeightWidth = 400; GifHelper.OptimizeGIF(file, maxGifHeightWidth); image.Refresh(); continue; } } - ResizeImage(file, Convert.ToInt32(maxHeight)); + ResizeImage(file, Convert.ToUInt32(maxHeight)); image.Refresh(); } else @@ -231,7 +231,7 @@ internal static Dictionary GetImageCacheForGame(Game game) imageCache.Add("gbg", background); return imageCache; } - private static void ResizeImage(string path, int maxHeight) + private static void ResizeImage(string path, uint maxHeight) { using (var imageMagick = new MagickImage(path)) { @@ -245,7 +245,7 @@ private static void ResizeImage(string path, int maxHeight) } else if (imageMagick.Height > SystemParameters.FullPrimaryScreenHeight) { - var size = new MagickGeometry((int)SystemParameters.FullPrimaryScreenWidth, (int)SystemParameters.FullPrimaryScreenHeight); + var size = new MagickGeometry((uint)SystemParameters.FullPrimaryScreenWidth, (uint)SystemParameters.FullPrimaryScreenHeight); size.IgnoreAspectRatio = false; imageMagick.Resize(size); imageMagick.Write(path); diff --git a/gamevault/Helper/GifHelper.cs b/gamevault/Helper/GifHelper.cs index 0945572..5386aef 100644 --- a/gamevault/Helper/GifHelper.cs +++ b/gamevault/Helper/GifHelper.cs @@ -158,7 +158,7 @@ await Task.Run(() => } }); } - internal static void OptimizeGIF(string path, int maxHeightWidth) + internal static void OptimizeGIF(string path, uint maxHeightWidth) { Tuple? dimensions = GetGifDimensions(path); if (dimensions != null && (dimensions.Item1 > maxHeightWidth || dimensions.Item2 > maxHeightWidth)) diff --git a/gamevault/UserControls/GameSettingsUserControl.xaml.cs b/gamevault/UserControls/GameSettingsUserControl.xaml.cs index fa87199..3948b2c 100644 --- a/gamevault/UserControls/GameSettingsUserControl.xaml.cs +++ b/gamevault/UserControls/GameSettingsUserControl.xaml.cs @@ -21,11 +21,8 @@ using System.Windows.Media; using LiveChartsCore.SkiaSharpView.Painting; using gamevault.Models.Mapping; -using Windows.Gaming.Input; -using System.Runtime.Serialization.Formatters.Binary; using IO.Swagger.Model; -using gamevault.Windows; -using Microsoft.Extensions.Primitives; + namespace gamevault.UserControls { diff --git a/gamevault/ViewModels/MainWindowViewModel.cs b/gamevault/ViewModels/MainWindowViewModel.cs index 484a25f..b0d24b0 100644 --- a/gamevault/ViewModels/MainWindowViewModel.cs +++ b/gamevault/ViewModels/MainWindowViewModel.cs @@ -144,7 +144,7 @@ public FrameworkElement Popup } public void OpenPopup(FrameworkElement userControl) { - if (MainWindowViewModel.Instance.ActiveControl?.GetType() == typeof(GameViewUserControl))//Else the popup would be rendered below the media slider because of the airspace problem + if (MainWindowViewModel.Instance.ActiveControl?.GetType() == typeof(GameViewUserControl) && userControl?.GetType() != typeof(MediaSlider))//Else the popup would be rendered below the media slider because of the airspace problem { ((GameViewUserControl)MainWindowViewModel.Instance.ActiveControl).uiMediaSlider.UnloadMediaSlider(); } diff --git a/gamevault/gamevault.csproj b/gamevault/gamevault.csproj index d82ada0..9ec570b 100644 --- a/gamevault/gamevault.csproj +++ b/gamevault/gamevault.csproj @@ -54,19 +54,19 @@ - + - + - - - - - + + + + +