Skip to content

Commit

Permalink
Merge pull request #432 from Leo-Corporation/vNext
Browse files Browse the repository at this point in the history
Version 4.2.0.2311
  • Loading branch information
lpeyr committed Nov 5, 2023
2 parents c27a300 + f5a9df8 commit 2521c2c
Show file tree
Hide file tree
Showing 23 changed files with 562 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Gavilya/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ protected override void OnStartup(StartupEventArgs e)
Language.zh_CN => "zh-CN",
});

currentProfile.Settings.EnableSearchShortcut ??= true;

if (currentProfile.Settings.MakeAutoSave && IsSaveDay(currentProfile.Settings.AutoSaveDay) && !File.Exists($@"{currentProfile.Settings.SavePath}\GavilyaProfiles_{DateTime.Now:yyyy_MM_dd}.g4v"))
{
profiles.Backup(currentProfile.Settings.SavePath);
Expand Down
32 changes: 32 additions & 0 deletions Gavilya/Components/ExecutableSelectorComponent.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<UserControl
x:Class="Gavilya.Components.ExecutableSelectorComponent"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Gavilya.Components"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="..\Fonts\#Hauora"
Foreground="{DynamicResource Foreground}"
mc:Ignorable="d">
<Button
Padding="5"
Background="{DynamicResource Background2}"
Command="{Binding ClickCommand}"
Cursor="Hand"
Style="{DynamicResource RegularButton2}">
<StackPanel
Grid.Column="1"
Width="380"
VerticalAlignment="Center">
<TextBlock
x:Name="GameNameTxt"
FontSize="18"
FontWeight="ExtraBold"
Text="{Binding Name}" />
<TextBlock
x:Name="FilePathTxt"
FontSize="10"
Text="{Binding FilePath}" />
</StackPanel>
</Button>
</UserControl>
39 changes: 39 additions & 0 deletions Gavilya/Components/ExecutableSelectorComponent.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
MIT License
Copyright (c) Léo Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

using System.Windows.Controls;

namespace Gavilya.Components
{
/// <summary>
/// Interaction logic for ExecutableSelectorComponent.xaml
/// </summary>
public partial class ExecutableSelectorComponent : UserControl
{
public ExecutableSelectorComponent()
{
InitializeComponent();
}
}
}
4 changes: 2 additions & 2 deletions Gavilya/Gavilya.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UseWindowsForms>True</UseWindowsForms>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Title>Gavilya</Title>
<Version>4.1.0.2310</Version>
<Version>4.2.0.2311</Version>
<Authors>Léo Corporation</Authors>
<Description>Gavilya is a simple game launcher for Windows.</Description>
<Copyright>© 2023</Copyright>
Expand Down Expand Up @@ -51,7 +51,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="PeyrSharp.Core" Version="1.10.0.2310" />
<PackageReference Include="PeyrSharp.Env" Version="1.10.0.2310" />
Expand Down
2 changes: 1 addition & 1 deletion Gavilya/Helpers/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
namespace Gavilya.Helpers;
public static class Context
{
public static string Version => "4.1.0.2310";
public static string Version => "4.2.0.2311";
public static string LastVersionLink => "https://raw.githubusercontent.com/Leo-Corporation/LeoCorp-Docs/master/Liens/Update%20System/Gavilya/Version.txt";
}
29 changes: 25 additions & 4 deletions Gavilya/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
x:Name="SearchBtn"
Expand Down Expand Up @@ -104,8 +105,28 @@
Foreground="{DynamicResource Foreground}" />
</Button.ToolTip>
</Button>
<TextBlock
<Button
Name="PinBtn"
Grid.Column="9"
Width="32"
Height="32"
Background="Transparent"
BorderThickness="0"
Command="{Binding PinCommand}"
Content="{Binding PinIcon}"
FontFamily="Fonts\#FluentSystemIcons-Regular"
FontSize="14"
Foreground="{DynamicResource Foreground}"
Style="{StaticResource TitleBarButtonStyle}">
<Button.ToolTip>
<ToolTip
Background="{DynamicResource Background}"
Content="{x:Static lang:Resources.PinUnpinWindow}"
Foreground="{DynamicResource Foreground}" />
</Button.ToolTip>
</Button>
<TextBlock
Grid.Column="10"
VerticalAlignment="Center"
FontFamily="Fonts\#FluentSystemIcons-Regular"
FontSize="30"
Expand All @@ -114,7 +135,7 @@

<Button
x:Name="MinimizeBtn"
Grid.Column="10"
Grid.Column="11"
Width="46"
Height="32"
Background="Transparent"
Expand All @@ -126,7 +147,7 @@
Style="{StaticResource TitleBarButtonStyle}" />
<Button
x:Name="MaximizeBtn"
Grid.Column="11"
Grid.Column="12"
Width="46"
Height="32"
Background="Transparent"
Expand All @@ -137,7 +158,7 @@
Style="{StaticResource TitleBarButtonStyle}" />
<Button
x:Name="CloseBtn"
Grid.Column="12"
Grid.Column="13"
Width="46"
Height="32"
Command="{Binding CloseCommand}"
Expand Down
7 changes: 7 additions & 0 deletions Gavilya/Models/GameList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,11 @@ public GameList GetRecommandedGames()
return new();
}
}

public Game GetRandomGame()
{
Random random = new();
int i = random.Next(0, Count);
return this[i];
}
}
3 changes: 3 additions & 0 deletions Gavilya/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public class Settings
/// </summary>
public bool ShowHiddenGames { get; set; }

public bool? EnableSearchShortcut { get; set; }

public Settings()
{
IsFirstRun = true;
Expand All @@ -117,6 +119,7 @@ public Settings()
DefaultView = View.Card;
CurrentTheme = "";
ShowHiddenGames = false;
EnableSearchShortcut = true;
}
}

Expand Down
47 changes: 46 additions & 1 deletion Gavilya/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Gavilya/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1008,4 +1008,19 @@
<data name="MigrateFromV3" xml:space="preserve">
<value>Migrate from v3</value>
</data>
<data name="KeybordShortcut" xml:space="preserve">
<value>Keyboard shortcut</value>
</data>
<data name="EnableSearchShortcut" xml:space="preserve">
<value>Enable search keyboard shortcut</value>
</data>
<data name="SearchKeyboardShortcutDesc" xml:space="preserve">
<value>Keyboard shortcut related settings.</value>
</data>
<data name="PinUnpinWindow" xml:space="preserve">
<value>Pin/Unpin window</value>
</data>
<data name="ScanDirectory" xml:space="preserve">
<value>Scan a directory</value>
</data>
</root>
15 changes: 15 additions & 0 deletions Gavilya/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1008,4 +1008,19 @@
<data name="MigrateFromV3" xml:space="preserve">
<value>Migrer depuis la v3</value>
</data>
<data name="KeybordShortcut" xml:space="preserve">
<value>Raccourci clavier</value>
</data>
<data name="EnableSearchShortcut" xml:space="preserve">
<value>Activer le raccourci clavier de recherche</value>
</data>
<data name="SearchKeyboardShortcutDesc" xml:space="preserve">
<value>Paramètres liés aux raccourcis clavier.</value>
</data>
<data name="PinUnpinWindow" xml:space="preserve">
<value>Epingler/Désépingler la fenêtre</value>
</data>
<data name="ScanDirectory" xml:space="preserve">
<value>Scanner un dossier</value>
</data>
</root>
15 changes: 15 additions & 0 deletions Gavilya/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1009,4 +1009,19 @@
<data name="MigrateFromV3" xml:space="preserve">
<value>Migrate from v3</value>
</data>
<data name="KeybordShortcut" xml:space="preserve">
<value>Keyboard shortcut</value>
</data>
<data name="EnableSearchShortcut" xml:space="preserve">
<value>Enable search keyboard shortcut</value>
</data>
<data name="SearchKeyboardShortcutDesc" xml:space="preserve">
<value>Keyboard shortcut related settings.</value>
</data>
<data name="PinUnpinWindow" xml:space="preserve">
<value>Pin/Unpin window</value>
</data>
<data name="ScanDirectory" xml:space="preserve">
<value>Scan a directory</value>
</data>
</root>
15 changes: 15 additions & 0 deletions Gavilya/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1008,4 +1008,19 @@
<data name="MigrateFromV3" xml:space="preserve">
<value>从 v3 迁移</value>
</data>
<data name="KeybordShortcut" xml:space="preserve">
<value>键盘快捷键</value>
</data>
<data name="EnableSearchShortcut" xml:space="preserve">
<value>启用搜索快捷键</value>
</data>
<data name="SearchKeyboardShortcutDesc" xml:space="preserve">
<value>键盘快捷键相关设置</value>
</data>
<data name="PinUnpinWindow" xml:space="preserve">
<value>插针/解针窗口</value>
</data>
<data name="ScanDirectory" xml:space="preserve">
<value>扫描目录</value>
</data>
</root>
Loading

0 comments on commit 2521c2c

Please sign in to comment.