Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.5.0.2407 #460

Merged
merged 14 commits into from
Jul 7, 2024
2 changes: 1 addition & 1 deletion CreateZip.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
mkdir Zip

xcopy Gavilya\bin\Release\net6.0-windows\ Zip /s /e /y
xcopy Gavilya\bin\Release\net8.0-windows\ Zip /s /e /y
xcopy Gavilya.Fps\bin\Release\ Zip /s /e /y

pause
44 changes: 43 additions & 1 deletion Gavilya/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,49 @@
<SolidColorBrush x:Key="SliderThumb.Static.Background" Color="#FFF0F0F0" />
<SolidColorBrush x:Key="SliderThumb.Disabled.Background" Color="#FFF0F0F0" />
<SolidColorBrush x:Key="SliderThumb.Disabled.Border" Color="#FFD9D9D9" />

<Style x:Key="{x:Type ToolTip}" TargetType="ToolTip">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="HasDropShadow" Value="True" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Background" Value="{DynamicResource Background}" />
<Setter Property="Foreground" Value="{DynamicResource Foreground}" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<Border
Name="Border"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Margin="5"
Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource DarkAccent}"
BorderThickness="1">
<Border.Effect>
<DropShadowEffect
BlurRadius="10"
Direction="270"
Opacity="0.1"
ShadowDepth="0"
Color="Black" />
</Border.Effect>
<ContentPresenter
Margin="4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
TextBlock.FontSize="12" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="HasDropShadow" Value="true">
<Setter TargetName="Border" Property="CornerRadius" Value="4" />
<Setter TargetName="Border" Property="SnapsToDevicePixels" Value="true" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
</Application.Resources>
Expand Down
6 changes: 3 additions & 3 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.4.0.2403</Version>
<Version>4.5.0.2407</Version>
<Authors>Léo Corporation</Authors>
<Description>Gavilya is a simple game launcher for Windows.</Description>
<Copyright>© 2024</Copyright>
Expand Down Expand Up @@ -51,11 +51,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="PeyrSharp.Core" Version="2.1.0.2312" />
<PackageReference Include="PeyrSharp.Env" Version="2.1.0.2312" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="RestSharp" Version="111.3.0" />
</ItemGroup>

<ItemGroup>
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.4.0.2403";
public static string Version => "4.5.0.2407";
public static string LastVersionLink => "https://raw.githubusercontent.com/Leo-Corporation/LeoCorp-Docs/master/Liens/Update%20System/Gavilya/Version.txt";
}
35 changes: 32 additions & 3 deletions Gavilya/Models/GameList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public GameList SortByPlayTime(bool sortByMostPlayed, bool showHiddenGames)
return new GameList(sortedGames);
}

public List<GameList> GetSortedGameLists()
public List<GameList> GetSortedGameLists(bool groupGames)
{
DateTime now = DateTime.Now;
DateTime todayStart = now.Date;
Expand All @@ -98,6 +98,10 @@ public List<GameList> GetSortedGameLists()
GameList thisMonthList = new(Properties.Resources.ThisMonth);
GameList otherList = new(Properties.Resources.LongTimeAgo);

// Dictionary to hold games for specific dates outside of today, yesterday, this week, and this month.
Dictionary<DateTime, GameList> otherDateLists = [];


foreach (Game game in this)
{
DateTime lastPlayTime = DateTimeOffset.FromUnixTimeSeconds(game.LastTimePlayed).DateTime;
Expand All @@ -120,7 +124,22 @@ public List<GameList> GetSortedGameLists()
}
else
{
otherList.Add(game);
if (!groupGames)
{
otherList.Add(game);
}
else
{
// Create a key based on the date part only (ignoring time).
DateTime otherDate = lastPlayTime.Date;

if (!otherDateLists.ContainsKey(otherDate))
{
// Create a new list for the specific date.
otherDateLists[otherDate] = new GameList(otherDate.ToString("D"));
}
otherDateLists[otherDate].Add(game);
}
}
}

Expand All @@ -130,7 +149,17 @@ public List<GameList> GetSortedGameLists()
if (yesterdayList.Count > 0) sortedGames.Add(yesterdayList);
if (thisWeekList.Count > 0) sortedGames.Add(thisWeekList);
if (thisMonthList.Count > 0) sortedGames.Add(thisMonthList);
if (otherList.Count > 0) sortedGames.Add(otherList);
if (!groupGames && otherList.Count > 0) sortedGames.Add(otherList);

if (groupGames)
{
var sorted = otherDateLists.OrderByDescending(x => x.Key);
// Add the dynamically created date-specific lists in descending order.
foreach (var dateList in sorted)
{
sortedGames.Add(dateList.Value);
}
}

return sortedGames;
}
Expand Down
9 changes: 9 additions & 0 deletions Gavilya/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,16 @@ public class Settings
/// </summary>
public bool ShowHiddenGames { get; set; }

/// <summary>
/// True if the search keyboard shortcut is enabled.
/// </summary>
public bool? EnableSearchShortcut { get; set; }

/// <summary>
/// True if games should be displayed using dates instead of "A long time ago".
/// </summary>
public bool? GroupGamesByDate { get; set; }

public Settings()
{
IsFirstRun = true;
Expand All @@ -120,6 +128,7 @@ public Settings()
CurrentTheme = "";
ShowHiddenGames = false;
EnableSearchShortcut = true;
GroupGamesByDate = true;
}
}

Expand Down
54 changes: 54 additions & 0 deletions Gavilya/Properties/Resources.Designer.cs

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

18 changes: 18 additions & 0 deletions Gavilya/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,4 +1041,22 @@
<data name="AppID" xml:space="preserve">
<value>App ID</value>
</data>
<data name="WindowsClassicGames" xml:space="preserve">
<value>Classic Windows games</value>
</data>
<data name="SteamGames" xml:space="preserve">
<value>Steam games</value>
</data>
<data name="MicrosoftStoreGames" xml:space="preserve">
<value>Microsoft Store games</value>
</data>
<data name="GetThemes" xml:space="preserve">
<value>Get themes</value>
</data>
<data name="GroupGamesByDate" xml:space="preserve">
<value>Group games by date</value>
</data>
<data name="RecentPageOptions" xml:space="preserve">
<value>Recently played games page options.</value>
</data>
</root>
18 changes: 18 additions & 0 deletions Gavilya/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,4 +1041,22 @@
<data name="AppID" xml:space="preserve">
<value>ID de l'application</value>
</data>
<data name="WindowsClassicGames" xml:space="preserve">
<value>Jeux Windows classiques</value>
</data>
<data name="SteamGames" xml:space="preserve">
<value>Jeux Steam</value>
</data>
<data name="MicrosoftStoreGames" xml:space="preserve">
<value>Jeux du Microsoft Store</value>
</data>
<data name="GetThemes" xml:space="preserve">
<value>Obtenir des thèmes</value>
</data>
<data name="GroupGamesByDate" xml:space="preserve">
<value>Regrouper les jeux par date</value>
</data>
<data name="RecentPageOptions" xml:space="preserve">
<value>Options de la page des jeux récemment joués.</value>
</data>
</root>
18 changes: 18 additions & 0 deletions Gavilya/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,4 +1041,22 @@
<data name="AppID" xml:space="preserve">
<value>App ID</value>
</data>
<data name="WindowsClassicGames" xml:space="preserve">
<value>Classic Windows games</value>
</data>
<data name="SteamGames" xml:space="preserve">
<value>Steam games</value>
</data>
<data name="MicrosoftStoreGames" xml:space="preserve">
<value>Microsoft Store games</value>
</data>
<data name="GetThemes" xml:space="preserve">
<value>Get themes</value>
</data>
<data name="GroupGamesByDate" xml:space="preserve">
<value>Group games by date</value>
</data>
<data name="RecentPageOptions" xml:space="preserve">
<value>Recently played games page options.</value>
</data>
</root>
18 changes: 18 additions & 0 deletions Gavilya/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,4 +1041,22 @@
<data name="AppID" xml:space="preserve">
<value>应用程序 ID</value>
</data>
<data name="WindowsClassicGames" xml:space="preserve">
<value>经典 Windows 游戏</value>
</data>
<data name="SteamGames" xml:space="preserve">
<value>Steam 游戏</value>
</data>
<data name="MicrosoftStoreGames" xml:space="preserve">
<value>Microsoft 商店游戏</value>
</data>
<data name="GetThemes" xml:space="preserve">
<value>获取主题</value>
</data>
<data name="GroupGamesByDate" xml:space="preserve">
<value>按日期分组比赛</value>
</data>
<data name="RecentPageOptions" xml:space="preserve">
<value>最近玩过的游戏页面选项。</value>
</data>
</root>
5 changes: 4 additions & 1 deletion Gavilya/Themes/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
<GradientStop Offset="0" Color="#7300ff" />
<GradientStop Offset="1" Color="#d300ff" />
</LinearGradientBrush>

<LinearGradientBrush x:Key="StatGradient" StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#9077d3" />
<GradientStop Offset="1" Color="#905cff" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="PlayGradientHover" SpreadMethod="Pad" StartPoint="0.5,0" EndPoint="0.5,1">
<LinearGradientBrush.RelativeTransform>
<TransformGroup>
Expand Down
3 changes: 3 additions & 0 deletions Gavilya/ViewModels/LibPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public bool IsCardSelected
private bool _isListSelected;
public bool IsListSelected { get => _isListSelected; set { _isListSelected = value; OnPropertyChanged(nameof(IsListSelected)); } }

private int _gamesCount=0;
public int GamesCount { get => _gamesCount; set { _gamesCount = value; OnPropertyChanged(nameof(_gamesCount)); } }

public ICommand CardViewCommand { get; }
public ICommand TagViewCommand { get; }
Expand All @@ -76,6 +78,7 @@ public LibPageViewModel(GameList games, List<Tag> tags, MainViewModel mainViewMo
_ => new CardPageViewModel(Games, _tags, _mainViewModel)
};

GamesCount = Games.Count;

IsCardSelected = _mainViewModel.CurrentSettings.DefaultView == View.Card;
IsTagSelected = _mainViewModel.CurrentSettings.DefaultView == View.Tag;
Expand Down
Loading
Loading