Skip to content

Commit 2ff906e

Browse files
committed
Added Community Themes link to the settings + another try to fix open theme folder on ms store + Bug fix: Crash on saving user details
1 parent 63c0a39 commit 2ff906e

File tree

7 files changed

+43
-12
lines changed

7 files changed

+43
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ Recommended Gamevault Server Version: `v14.0.0`
55
### Changes
66

77
- Cloud Saves (+)
8+
- Added Community Themes link to the settings
89
- Bug fix: Youtube url not loading in gameview
910
- Bug fix: Game window sometimes started in the background when launched via gamevault uri
11+
- Bug fix: Crash on saving user details
1012

1113
## 1.14.0
1214
Recommended Gamevault Server Version: `v13.1.2`

gamevault/Models/AppInfo.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34
using System.Linq;
45
using System.Reflection;
56
using System.Text;
@@ -57,7 +58,7 @@ public static class AppFilePath
5758
internal static string OfflineProgress = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/cache/prgs";
5859
internal static string OfflineCache = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/cache/local";
5960
internal static string ConfigDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/config";
60-
internal static string ThemesLoadDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\GameVault\\themes";
61+
internal static string ThemesLoadDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "GameVault", "themes");
6162
internal static string WebConfigDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/config/web";
6263
internal static string UserFile = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/config/user";
6364
internal static string IgnoreList = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/cache/ignorelist";
@@ -70,7 +71,7 @@ internal static void InitDebugPaths()
7071
OfflineProgress = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/debug/cache/prgs";
7172
OfflineCache = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/debug/cache/local";
7273
ConfigDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/debug/config";
73-
ThemesLoadDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\GameVault\\debug\\themes";
74+
ThemesLoadDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "GameVault", "debug", "themes");
7475
WebConfigDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/debug/config/web";
7576
UserFile = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/debug/config/user";
7677
IgnoreList = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/GameVault/debug/cache/ignorelist";

gamevault/Resources/Assets/Icons.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<Geometry x:Key="IconGameSettingsFolder">
100100
M10.59 4.59C10.21 4.21 9.7 4 9.17 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-1.41-1.41z
101101
</Geometry>
102+
<Geometry x:Key="IconGameSettingsColorPalette">
103+
m441 336.2l-.06-.05c-9.93-9.18-22.78-11.34-32.16-12.92l-.69-.12c-9.05-1.49-10.48-2.5-14.58-6.17c-2.44-2.17-5.35-5.65-5.35-9.94s2.91-7.77 5.34-9.94l30.28-26.87c25.92-22.91 40.2-53.66 40.2-86.59s-14.25-63.68-40.2-86.6c-35.89-31.59-85-49-138.37-49C223.72 48 162 71.37 116 112.11c-43.87 38.77-68 90.71-68 146.24s24.16 107.47 68 146.23c21.75 19.24 47.49 34.18 76.52 44.42a266.2 266.2 0 0 0 86.87 15h1.81c61 0 119.09-20.57 159.39-56.4c9.7-8.56 15.15-20.83 15.34-34.56c.21-14.17-5.37-27.95-14.93-36.84M112 208a32 32 0 1 1 32 32a32 32 0 0 1-32-32m40 135a32 32 0 1 1 32-32a32 32 0 0 1-32 32m40-199a32 32 0 1 1 32 32a32 32 0 0 1-32-32m64 271a48 48 0 1 1 48-48a48 48 0 0 1-48 48m72-239a32 32 0 1 1 32-32a32 32 0 0 1-32 32
104+
</Geometry>
102105
<Geometry x:Key="IconGameSettingsLaunchOptions">
103106
M9.19 6.35c-2.04 2.29-3.44 5.58-3.57 5.89l-2.26-.97c-.65-.28-.81-1.13-.31-1.63l3.01-3.01c.47-.47 1.15-.68 1.81-.55l1.32.27zm1.49 10.16c.3.3.74.38 1.12.2c1.16-.54 3.65-1.81 5.26-3.42c4.59-4.59 4.63-8.33 4.36-9.93a.979.979 0 0 0-.79-.79c-1.6-.27-5.34-.23-9.93 4.36c-1.61 1.61-2.87 4.1-3.42 5.26c-.18.38-.09.83.2 1.12l3.2 3.2zm6.97-1.7c-2.29 2.04-5.58 3.44-5.89 3.57l.97 2.26c.28.65 1.13.81 1.63.31l3.01-3.01c.47-.47.68-1.15.55-1.81l-.27-1.32zm-8.71 2.6a3 3 0 0 1-.82 2.71c-.77.77-3.16 1.34-4.71 1.64c-.69.13-1.3-.48-1.17-1.17c.3-1.55.86-3.94 1.64-4.71a3 3 0 0 1 2.71-.82c1.17.22 2.13 1.18 2.35 2.35zM13 9c0-1.1.9-2 2-2s2 .9 2 2s-.9 2-2 2s-2-.9-2-2z
104107
</Geometry>

gamevault/UserControls/AdminConsoleUserControl.xaml.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@ public async Task InitUserList()
5353
{
5454
try
5555
{
56-
ViewModel.Users = await Task<User[]>.Run(() =>
57-
{
58-
string userList = WebHelper.GetRequest(@$"{SettingsViewModel.Instance.ServerUrl}/api/users");
59-
return JsonSerializer.Deserialize<User[]>(userList);
60-
});
56+
string userList = await WebHelper.GetRequestAsync(@$"{SettingsViewModel.Instance.ServerUrl}/api/users");
57+
ViewModel.Users = JsonSerializer.Deserialize<User[]>(userList);
6158
}
6259
catch (Exception ex)
6360
{

gamevault/UserControls/SettingsUserControl.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
</ComboBox.ItemTemplate>
7979
</ComboBox>
8080
<local:IconButton Text="Open Theme Folder" FontSize="15" Icon="{StaticResource IconGameSettingsFolder}" IconMargin="0,0,5,2" Width="175" Margin="10,0,0,0" Click="OpenThemeFolder_Click"/>
81+
<local:IconButton Text="Community Themes" FontSize="15" Icon="{StaticResource IconGameSettingsColorPalette}" IconMargin="-225,-300,-215,-300" IconScale="0.04" Width="180" Margin="10,0,0,0" Click="OpenCommunityPage_Click"/>
8182
</StackPanel>
8283
</StackPanel>
8384
<StackPanel Margin="0,15,0,0">

gamevault/UserControls/SettingsUserControl.xaml.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,28 @@ private async Task LoadThemes()
321321

322322
private void OpenThemeFolder_Click(object sender, RoutedEventArgs e)
323323
{
324-
if (Directory.Exists(AppFilePath.ThemesLoadDir))
324+
try
325325
{
326-
Process.Start("explorer.exe", AppFilePath.ThemesLoadDir);
326+
if (Directory.Exists(AppFilePath.ThemesLoadDir))
327+
{
328+
Directory.CreateDirectory(AppFilePath.ThemesLoadDir);
329+
}
330+
Process.Start(new ProcessStartInfo
331+
{
332+
FileName = "explorer.exe",
333+
Arguments = $"\"{AppFilePath.ThemesLoadDir}\"",
334+
UseShellExecute = true
335+
});
327336
}
337+
catch { }
338+
}
339+
private void OpenCommunityPage_Click(object sender, RoutedEventArgs e)
340+
{
341+
try
342+
{
343+
Process.Start(new ProcessStartInfo("https://github.com/Phalcode/gamevault-community-themes") { UseShellExecute = true });
344+
}
345+
catch { }
328346
}
329347

330348
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
@@ -400,5 +418,6 @@ private void DevMode_Click(object sender, MouseButtonEventArgs e)
400418
ViewModel.DevModeEnabled = true;
401419
}
402420
}
421+
403422
}
404423
}

gamevault/UserControls/UserSettingsUserControl.xaml.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,17 @@ await Task.Run(() =>
386386
}
387387
});
388388
if (!error)
389-
{
390-
ViewModel.OriginUser.Password = newPassword;
391-
await HandleChangesOnCurrentUser(ViewModel.OriginUser);
389+
{
390+
try
391+
{
392+
ViewModel.OriginUser.Password = newPassword;
393+
await HandleChangesOnCurrentUser(ViewModel.OriginUser);
394+
}
395+
catch (Exception ex)
396+
{
397+
string msg = WebExceptionHelper.TryGetServerMessage(ex);
398+
MainWindowViewModel.Instance.AppBarText = msg;
399+
}
392400
}
393401
this.IsEnabled = true;
394402
}

0 commit comments

Comments
 (0)