Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# GameVault App Changelog

##1.17.1
Recommended Gamevault Server Version: `v15.0.2`
### Changes
- User registration has also been added to the Admin Panel.
- Better handling of the game settings early access check box
- Added 'getallgames' to the clients query API

## 1.17.0
Recommended Gamevault Server Version: `v15.0.0`
### Changes
Expand Down
2 changes: 1 addition & 1 deletion gamevault/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
[assembly: AssemblyVersion("1.17.0.0")]
[assembly: AssemblyVersion("1.17.1.0")]
[assembly: AssemblyCopyright("© Phalcode™. All Rights Reserved.")]
#if DEBUG
[assembly: XmlnsDefinition("debug-mode", "Namespace")]
Expand Down
27 changes: 27 additions & 0 deletions gamevault/Converter/GameSettingsEarlyAccessContentConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 GameSettingsEarlyAccessContentConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values[1]!=null)
{
return values[1];
}
return values[0];
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
return null;
}
}
}
27 changes: 22 additions & 5 deletions gamevault/PipeServiceHandler.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
using System;
using gamevault.Helper;
using gamevault.Models;
using gamevault.UserControls;
using gamevault.ViewModels;
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows;
using gamevault.Helper;
using gamevault.Models;
using gamevault.UserControls;
using gamevault.ViewModels;
using Windows.Devices.Sms;

namespace gamevault
Expand Down Expand Up @@ -697,6 +699,11 @@ public enum ActionQueryEnum
/// </summary>
IsLoggedIn,

/// <summary>
/// Returns all Games of the server the current profile is connected to
/// </summary>
GetAllGames

}

/// <summary>
Expand Down Expand Up @@ -773,6 +780,16 @@ private async Task<string> HandleQuery(CommandOptions options)

return installDirectory ?? "";
}
case ActionQueryEnum.GetAllGames:
{
try
{
string result = await WebHelper.GetAsync(@$"{SettingsViewModel.Instance.ServerUrl}/api/games?limit=-1");
return Convert.ToBase64String(Encoding.UTF8.GetBytes(result));
}
catch { }
return "";
}
case ActionQueryEnum.GetServerUrl:
return SettingsViewModel.Instance.ServerUrl;
case ActionQueryEnum.GetAppVersion:
Expand Down
14 changes: 13 additions & 1 deletion gamevault/UserControls/AdminConsoleUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<ScaleTransform ScaleX="0.05" ScaleY="0.05"/>
</mah:ToggleSwitch.RenderTransform>
</mah:ToggleSwitch>
<Grid x:Name="uiBtnReload" Style="{DynamicResource HoverEffect}" Background="Transparent" Cursor="Hand" Width="2" Height="2" Margin="-287,2,0,0" ToolTip="Refresh admin console (F5)" MouseLeftButtonUp="Reload_Click">
<Grid x:Name="uiBtnReload" Style="{DynamicResource HoverEffect}" Background="Transparent" Cursor="Hand" Width="2" Height="2" Margin="-286.59,2,0,0" ToolTip="Refresh admin console (F5)" MouseLeftButtonUp="Reload_Click">
<Path Data="{StaticResource IconReload}" Fill="{DynamicResource MahApps.Brushes.ThemeForeground}" RenderTransformOrigin="0.49,0.49" Margin="-9,-9,-9,-9">
<Path.RenderTransform>
<ScaleTransform ScaleX="0.1" ScaleY="0.1"/>
Expand All @@ -90,6 +90,18 @@
<Border Background="{DynamicResource MahApps.Brushes.ThemeBackground2}" Margin="0,0.5,0,0" CornerRadius="1">
<Grid>
<TextBlock Text="Users" FontSize="1.5" FontWeight="Bold" VerticalAlignment="Top" Margin="1,0,0,0"/>
<Button Style="{StaticResource ButtonWrapper}" VerticalAlignment="Top" HorizontalAlignment="Right" Cursor="Hand" Width="2.5" Height="2.5" Margin="0,0.5,1,0" Click="RegistrateUser_Click" ToolTip="Registrate new User">
<Grid Style="{DynamicResource HoverEffect}" Background="Transparent" RenderTransformOrigin="0.5,0.5">
<Path Data="{StaticResource IconAddSimple}" Fill="{DynamicResource MahApps.Brushes.ThemeForeground}" Stroke="{DynamicResource MahApps.Brushes.ThemeForeground}" Margin="0.13,0.13,-22,-22">
<Path.RenderTransform>
<ScaleTransform ScaleX="0.09" ScaleY="0.09"/>
</Path.RenderTransform>
</Path>
<Grid.RenderTransform>
<ScaleTransform/>
</Grid.RenderTransform>
</Grid>
</Button>
<ItemsControl ItemsSource="{Binding Path=Users}" Margin="0,1.4,0,1" >
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand Down
5 changes: 4 additions & 1 deletion gamevault/UserControls/AdminConsoleUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ private void ServerUpdate_Navigate(object sender, RequestNavigateEventArgs e)
e.Handled = true;
}


private void RegistrateUser_Click(object sender, RoutedEventArgs e)
{
MainWindowViewModel.Instance.OpenPopup(new RegistrationUserControl());
}
}
}
23 changes: 22 additions & 1 deletion gamevault/UserControls/GameSettingsUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<conv:InverseNullConverter x:Key="invNullConv"/>
<conv:StringToArrayConverter x:Key="stringToArrayConv"/>
<conv:IsGameMappedConverter x:Key="isGameMappedConv"/>
<conv:GameSettingsEarlyAccessContentConverter x:Key="earlyAccessContentConv"/>
</UserControl.Resources>
<UserControl.InputBindings>
<KeyBinding Key="Esc">
Expand Down Expand Up @@ -634,7 +635,27 @@
<TextBox Width="100" Margin="115,0,0,0" mah:TextBoxHelper.Watermark="{Binding Game.Metadata.AgeRating}" mah:TextBoxHelper.UseFloatingWatermark="True" Text="{Binding UpdateGame.UserMetadata.AgeRating,TargetNullValue='',FallbackValue={x:Null}}" mah:ControlsHelper.CornerRadius="5"/>
<DatePicker Width="100" Margin="69,0,0,0" SelectedDate="{Binding UpdateGame.UserMetadata.ReleaseDate}" mah:TextBoxHelper.Watermark="{Binding Path=Game.Metadata.ReleaseDate,StringFormat='{}{0:dd/MM/yyyy}'}" mah:ControlsHelper.CornerRadius="5" mah:TextBoxHelper.UseFloatingWatermark="True"/>
<TextBox Width="100" Margin="67,0,0,0" mah:TextBoxHelper.Watermark="{Binding Game.Metadata.Rating}" mah:TextBoxHelper.UseFloatingWatermark="True" Text="{Binding UpdateGame.UserMetadata.Rating}" mah:ControlsHelper.CornerRadius="5"/>
<CheckBox Content="{Binding Game.Metadata.EarlyAccess}" IsChecked="{Binding UpdateGame.UserMetadata.EarlyAccess}" Margin="68,0,0,0"/>
<Grid Margin="68,0,0,0">
<CheckBox Margin="0,0,0,0" mah:CheckBoxHelper.CheckCornerRadius="5">
<CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource MahApps.Styles.CheckBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding UpdateGame.UserMetadata.EarlyAccess}" Value="{x:Null}">
<Setter Property="IsChecked" Value="{Binding Game.Metadata.EarlyAccess}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
</CheckBox>
<CheckBox PreviewMouseLeftButtonDown="CheckBox_PreviewMouseLeftButtonDown" Click="CheckBox_Click" IsChecked="{Binding UpdateGame.UserMetadata.EarlyAccess}" mah:CheckBoxHelper.CheckCornerRadius="5" mah:CheckBoxHelper.CheckBackgroundFillIndeterminateMouseOver="Transparent" mah:CheckBoxHelper.CheckBackgroundFillIndeterminatePressed="Transparent" mah:CheckBoxHelper.CheckBackgroundFillChecked="Transparent" mah:CheckBoxHelper.CheckBackgroundFillUnchecked="Transparent" mah:CheckBoxHelper.CheckBackgroundFillIndeterminate="Transparent" mah:CheckBoxHelper.CheckGlyphForegroundIndeterminate="Transparent" mah:CheckBoxHelper.CheckGlyphForegroundIndeterminateMouseOver="Transparent" mah:CheckBoxHelper.CheckGlyphForegroundIndeterminatePressed="Transparent">
<CheckBox.Content>
<MultiBinding Converter="{StaticResource earlyAccessContentConv}">
<Binding Path="Game.Metadata.EarlyAccess"/>
<Binding Path="UpdateGame.UserMetadata.EarlyAccess"/>
</MultiBinding>
</CheckBox.Content>
</CheckBox>
</Grid>
</StackPanel>

<TextBlock Text="Default Launch Executable" FontSize="15" FontWeight="Bold" TextDecorations="Underline" Margin="0,5,0,5"/>
Expand Down
29 changes: 29 additions & 0 deletions gamevault/UserControls/GameSettingsUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,36 @@ private void KeepData_Click(object sender, RoutedEventArgs e)
}
catch { }
}

#endregion

#region EarlyAccessToggleFix
private bool needEarlyAccessToggleFix = false;
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
try
{
if (needEarlyAccessToggleFix)
{
needEarlyAccessToggleFix = false;
var checkBox = sender as CheckBox;
checkBox.IsChecked = true;
}
}
catch { }
}

private void CheckBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
if (ViewModel.UpdateGame?.UserMetadata?.EarlyAccess == null && ViewModel.Game?.Metadata?.EarlyAccess == false)
{
needEarlyAccessToggleFix = true;
}
}
catch { }
}
#endregion
}
}
6 changes: 3 additions & 3 deletions gamevault/UserControls/LibraryUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private async void InputTimerElapsed(object sender, EventArgs e)
inputTimer?.Stop();
await Search();
}

private async Task Search()
{
Guid currentSearchToken = Guid.NewGuid();
Expand Down Expand Up @@ -300,11 +300,11 @@ private string ApplyFilter(string filter)
}
if (uiFilterEarlyAccess.IsChecked == true)
{
filter += "&filter.early_access=$eq:true&filter.metadata.early_access=$eq:true";
filter += "&filter.metadata.early_access=$eq:true";
}
if (uiFilterReleaseDateRangeSelector.IsValid())
{
filter += $"&filter.release_date=$btw:{uiFilterReleaseDateRangeSelector.GetYearFrom()}-01-01,{uiFilterReleaseDateRangeSelector.GetYearTo()}-12-31";
filter += $"&filter.metadata.release_date=$btw:{uiFilterReleaseDateRangeSelector.GetYearFrom()}-01-01,{uiFilterReleaseDateRangeSelector.GetYearTo()}-12-31";
}
string genres = uiFilterGenreSelector.GetSelectedEntries();
if (genres != string.Empty)
Expand Down
Loading
Loading