Skip to content

Commit

Permalink
Release 1.9.0
Browse files Browse the repository at this point in the history
Release 1.9.0
  • Loading branch information
Yelo420 committed Apr 13, 2024
2 parents 780f378 + 57137fc commit 48644e3
Show file tree
Hide file tree
Showing 95 changed files with 4,532 additions and 951 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
github: phalcode
ko_fi: phalcode
liberapay: phalcode
custom: "https://paypal.me/phalcode"
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# GameVault App Changelog

## 1.9.0
- Added GameVault Plus infrastructure
- Added GameVault Client APIs (+)
- Added GIF support for user profile pictures (+)
- Added Theming and custom theme loader (+)
- All buttons have now icons and effects
- Applies new brand design
- Added refresh button to library. Can also be triggered by F5 Key
- Added F5 Key refresh to Community Tab and Admin Panel
- Added About Setting Page
- Display freshly installed games first in Installed Games View
- Added text trimming to game settings archive file path
- The library is now updated when reindexing
- Improved error messages
- Extended Windows context menu
- Bug fix: Edge case where image was shown as not found
- Bug fix: Game website link no longer clickable if empty
- Bug fix: Redownload icon not appearing on library card
- Bug fix: Bring window of running instance to foreground if you start gamevault
- Bug fix: Center user background image on window resize
- Bug fix: Game settings form data flies in from outside the window
## 1.8.3
Recommended Gamevault Server Version: `v10.2.0`
### Changes
- Bug fix: Re-Download icon not appearing on library cards. Also improved loading times by create library cards content only by hover over.
- Bug fix: Game webite text no longer has the clickable style if no value has been set on GameView
## 1.8.2
Recommended Gamevault Server Version: `v10.1.0`
### Changes
Expand Down
2 changes: 0 additions & 2 deletions gamevault.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "gamevault", "gamevault\game
EndProject
#Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ReleasePackage", "ReleasePackage\ReleasePackage.wapproj", "{99E693F8-6B95-4CA0-8A1C-6A72B820A434}"
#EndProject
#Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "DeveloperEditionPackage", "DeveloperEditionPackage\DeveloperEditionPackage.wapproj", "{B17D6950-2AB2-424E-BCE9-86D987E2B71A}"
#EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
6 changes: 2 additions & 4 deletions gamevault/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="pack://application:,,,/gamevault;component/Resources/Assets/Themes/ThemeGameVaultDark.xaml" />
<ResourceDictionary Source="pack://application:,,,/gamevault;component/Resources/Assets/Base.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Dark.Purple.xaml" />
<ResourceDictionary Source="pack://application:,,,/gamevault;component/Resources/Assets/Styles.xaml" />
<ResourceDictionary Source="pack://application:,,,/gamevault;component/Resources/Assets/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/gamevault;component/Resources/Assets/Icons.xaml" />

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
150 changes: 86 additions & 64 deletions gamevault/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
using Application = System.Windows.Application;
using System.Linq;
using gamevault.Helper;
using System.Windows.Media.Imaging;
using System.Windows.Media;
using System.Threading.Tasks;
using System.IO.Pipes;
using System.Windows.Threading;
using System.Text.Json;
using System.Diagnostics;
using System.Collections.Generic;
using System.Drawing;

namespace gamevault
{
Expand All @@ -28,38 +27,25 @@ public partial class App : Application
public static bool ShowToastMessage = true;
public static bool IsWindowsPackage = false;

public static CommandOptions? CommandLineOptions { get; internal set; } = null;

private NotifyIcon m_Icon;

private GameTimeTracker m_gameTimeTracker;

private async void Application_Startup(object sender, StartupEventArgs e)
{

Application.Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(AppDispatcherUnhandledException);

#if DEBUG
AppFilePath.InitDebugPaths();
CreateDirectories();
RestoreTheme();
await CacheHelper.OptimizeCache();
#else
try
{
int pcount = Process.GetProcessesByName(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name).Count();
if (pcount != 1)
{
var client = new NamedPipeClientStream("GameVault");
client.Connect();
StreamWriter writer = new StreamWriter(client);
writer.WriteLine("ShowMainWindow");
writer.Flush();
ShutdownApp();
}
else
{
StartServer();
}
}
catch (Exception ex) { MainWindowViewModel.Instance.AppBarText = "Could not connect to background pipe due to UAC remote restrictions"; }
try
{
CreateDirectories();
RestoreTheme();
UpdateWindow updateWindow = new UpdateWindow();
updateWindow.ShowDialog();
}
Expand All @@ -69,27 +55,38 @@ private async void Application_Startup(object sender, StartupEventArgs e)
//m_StoreHelper.NoInternetException();
}
#endif
#region DirectoryCreation
if (!Directory.Exists(AppFilePath.ImageCache))
{
Directory.CreateDirectory(AppFilePath.ImageCache);
}
if (!Directory.Exists(AppFilePath.ConfigDir))
{
Directory.CreateDirectory(AppFilePath.ConfigDir);
}
#endregion
await LoginManager.Instance.StartupLogin();
await LoginManager.Instance.PhalcodeLogin(true);
m_gameTimeTracker = new GameTimeTracker();
await m_gameTimeTracker.Start();

if (false == SettingsViewModel.Instance.BackgroundStart && MainWindow == null)
bool startMinimizedByPreferences = false;
bool startMinimizedByCLI = false;

if ((CommandLineOptions?.Minimized).HasValue)
startMinimizedByCLI = CommandLineOptions!.Minimized!.Value;
else if (SettingsViewModel.Instance.BackgroundStart)
startMinimizedByPreferences = true;

if (!startMinimizedByPreferences && MainWindow == null)
{
MainWindow = new MainWindow();
MainWindow.Show();
}
if (startMinimizedByCLI && MainWindow != null)
{
MainWindow.Hide();
}

InitNotifyIcon();

// After the app is created and most things are instantiated, handle any special command line stuff
if (PipeServiceHandler.Instance != null)
{
// Strictly speaking we should hold up all commands until we have a confirmed login & setup is complete, but for now we'll assume that auto-login has worked
PipeServiceHandler.Instance.IsReadyForCommands = true;
await PipeServiceHandler.Instance.HandleCommand(App.CommandLineOptions);
}
}

private void AppDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
Expand All @@ -101,6 +98,7 @@ private void AppDispatcherUnhandledException(object sender, DispatcherUnhandledE
LogUnhandledException(e.Exception);
#endif
}

public void LogUnhandledException(Exception e)
{
Application.Current.DispatcherUnhandledException -= new DispatcherUnhandledExceptionEventHandler(AppDispatcherUnhandledException);
Expand All @@ -121,44 +119,39 @@ public void LogUnhandledException(Exception e)
}
ShutdownApp();
}
private void StartServer()
{
Task.Factory.StartNew(() =>
{
while (true)
{
using (var server = new NamedPipeServerStream("GameVault"))
{
server.WaitForConnection();
StreamReader reader = new StreamReader(server);
var line = reader.ReadLine();
if (line == "ShowMainWindow")
{
Dispatcher.Invoke(() =>
{
if (MainWindow == null)
{
MainWindow = new MainWindow();
}
MainWindow.Show();
});
}
}
}
});
}

private void InitNotifyIcon()
{
m_Icon = new NotifyIcon();
m_Icon.Text = "GameVault";
m_Icon.MouseDoubleClick += NotifyIcon_DoubleClick;
Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/gamevault;component/Resources/Images/icon.ico")).Stream;
m_Icon.Icon = new System.Drawing.Icon(iconStream);
m_Icon.ContextMenuStrip = new ContextMenuStrip();
m_Icon.ContextMenuStrip.Items.Add("Show", null, NotifyIcon_DoubleClick);
m_Icon.ContextMenuStrip.Items.Add("Exit", null, NotifyIcon_Exit_Click);
m_Icon.ContextMenuStrip = new ContextMenuStrip();
m_Icon.ContextMenuStrip.Items.Add("Library", new Bitmap(Application.GetResourceStream(new Uri("pack://application:,,,/gamevault;component/Resources/Images/ContextMenuIcon_Library.png")).Stream), Navigate_Tab_Click);
m_Icon.ContextMenuStrip.Items.Add("Downloads", new Bitmap(Application.GetResourceStream(new Uri("pack://application:,,,/gamevault;component/Resources/Images/ContextMenuIcon_Downloads.png")).Stream), Navigate_Tab_Click);
m_Icon.ContextMenuStrip.Items.Add("Community", new Bitmap(Application.GetResourceStream(new Uri("pack://application:,,,/gamevault;component/Resources/Images/ContextMenuIcon_Community.png")).Stream), Navigate_Tab_Click);
m_Icon.ContextMenuStrip.Items.Add("Settings", new Bitmap(Application.GetResourceStream(new Uri("pack://application:,,,/gamevault;component/Resources/Images/ContextMenuIcon_Settings.png")).Stream), Navigate_Tab_Click);
m_Icon.ContextMenuStrip.Items.Add("Exit", new Bitmap(Application.GetResourceStream(new Uri("pack://application:,,,/gamevault;component/Resources/Images/ContextMenuIcon_Exit.png")).Stream), NotifyIcon_Exit_Click);
m_Icon.Visible = true;
}
private void RestoreTheme()
{
try
{
string currentThemeString = Preferences.Get(AppConfigKey.Theme, AppFilePath.UserFile, true);
if (currentThemeString != string.Empty)
{
ThemeItem currentTheme = JsonSerializer.Deserialize<ThemeItem>(currentThemeString);

if (App.Current.Resources.MergedDictionaries[0].Source.OriginalString != currentTheme.Value)
{
App.Current.Resources.MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri(currentTheme.Value) };
}
}
}
catch { }
}
private void NotifyIcon_DoubleClick(Object sender, EventArgs e)
{
if (MainWindow == null)
Expand All @@ -175,6 +168,7 @@ private void NotifyIcon_DoubleClick(Object sender, EventArgs e)
MainWindow.WindowState = WindowState.Normal;
}
}

private async void NotifyIcon_Exit_Click(Object sender, EventArgs e)
{
if ((DownloadsViewModel.Instance.DownloadedGames.Where(g => g.IsDownloading() == true)).Count() > 0)
Expand All @@ -195,6 +189,19 @@ private async void NotifyIcon_Exit_Click(Object sender, EventArgs e)
ShutdownApp();
}
}
private void Navigate_Tab_Click(Object sender, EventArgs e)
{
NotifyIcon_DoubleClick(null, null);
for (int count = 0; count < m_Icon.ContextMenuStrip.Items.Count; count++)
{
if (m_Icon.ContextMenuStrip.Items[count].Text == sender.ToString())
{
MainWindowViewModel.Instance.SetActiveControl((MainControl)count);
break;
}
}
}

private void ShutdownApp()
{
ShowToastMessage = false;
Expand All @@ -206,5 +213,20 @@ private void ShutdownApp()
}
Shutdown();
}
private void CreateDirectories()
{
if (!Directory.Exists(AppFilePath.ImageCache))
{
Directory.CreateDirectory(AppFilePath.ImageCache);
}
if (!Directory.Exists(AppFilePath.ConfigDir))
{
Directory.CreateDirectory(AppFilePath.ConfigDir);
}
if (!Directory.Exists(AppFilePath.ThemesLoadDir))
{
Directory.CreateDirectory(AppFilePath.ThemesLoadDir);
}
}
}
}
5 changes: 4 additions & 1 deletion gamevault/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;
using System.Reflection;
using System.Windows;
using System.Windows.Markup;

Expand All @@ -9,7 +11,8 @@
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyCopyright("© Phalcode™. All Rights Reserved.")]
#if DEBUG
[assembly: XmlnsDefinition("debug-mode", "Namespace")]
#endif
23 changes: 23 additions & 0 deletions gamevault/Converter/GreaterThanConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace gamevault.Converter
{
internal class GreaterThanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ((int)value > int.Parse((string)parameter));
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
29 changes: 29 additions & 0 deletions gamevault/Converter/IsGameDownloadedConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using gamevault.Models;
using gamevault.ViewModels;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace gamevault.Converter
{
internal class IsGameDownloadedConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//Debug.WriteLine("IsDownloaded");
if (value == null)
return false;
return DownloadsViewModel.Instance.DownloadedGames.Where(gameUC => gameUC.GetGameId() == (int)value).Count() > 0;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return false;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using gamevault.Helper;
using gamevault.Models;
using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
Expand All @@ -11,6 +12,7 @@ internal class LibraryPermissionRoleToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//Debug.WriteLine("PermRoleVis");
if ((LoginManager.Instance.GetCurrentUser() != null && LoginManager.Instance.GetCurrentUser().Role >= PERMISSION_ROLE.EDITOR))
{
return Visibility.Visible;
Expand Down

0 comments on commit 48644e3

Please sign in to comment.