Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
v2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
arcaneblaze committed Nov 7, 2024
1 parent 82d89df commit a02e671
Show file tree
Hide file tree
Showing 44 changed files with 122 additions and 770 deletions.
4 changes: 2 additions & 2 deletions src/Dionysus.App/Dionysus.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<AssemblyName>Dionysus</AssemblyName>
<RootNamespace>Dionysus</RootNamespace>
<ApplicationIcon>icon.ico</ApplicationIcon>
<Version>2.3</Version>
<AssemblyVersion>2.3</AssemblyVersion>
<Version>2.4</Version>
<AssemblyVersion>2.4</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
132 changes: 78 additions & 54 deletions src/Dionysus.App/Helpers/AppHelper.cs
Original file line number Diff line number Diff line change
@@ -1,55 +1,79 @@
using System.Runtime.InteropServices;
using Microsoft.Win32;

namespace Dionysus.App.Helpers;

public class AppHelper
{

[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr window, int index, int value);
public const int GWL_EXSTYLE = -20;
public const int WS_EX_TOOLWINDOW = 0x00000080;
[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr window, int index);

public static void HideFromAltTab(IntPtr windowHandle)
{
SetWindowLong(windowHandle, GWL_EXSTYLE,
GetWindowLong(windowHandle, GWL_EXSTYLE) |
WS_EX_TOOLWINDOW);
}

public static void Logic(bool value)
{
if (value) AddToStartup();
else RemoveFromStartup();
}

static void AddToStartup()
{
string appPath = Application.ExecutablePath;

RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
registryKey.SetValue("Dionysus", $"\"{appPath}\"");
registryKey.Close();
}

static void RemoveFromStartup()
{
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
if (registryKey != null)
{
registryKey.DeleteValue("Dionysus", false);
registryKey.Close();
}
}

public static bool AddedToStartup()
{
return (Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
true).GetValueNames().Contains("Dionysus"));
}
using System.Runtime.InteropServices;
using Microsoft.Win32;

namespace Dionysus.App.Helpers;

public class AppHelper
{

[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr window, int index, int value);
public const int GWL_EXSTYLE = -20;
public const int WS_EX_TOOLWINDOW = 0x00000080;
[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr window, int index);

public static void HideFromAltTab(IntPtr windowHandle)
{
SetWindowLong(windowHandle, GWL_EXSTYLE,
GetWindowLong(windowHandle, GWL_EXSTYLE) |
WS_EX_TOOLWINDOW);
}

public static void Logic(bool value)
{
if (value) AddToStartup();
else RemoveFromStartup();
}

static void AddToStartup()
{
string appPath = Application.ExecutablePath;

RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
registryKey.SetValue("Dionysus", $"\"{appPath}\"");
registryKey.Close();
}

static void RemoveFromStartup()
{
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
if (registryKey != null)
{
registryKey.DeleteValue("Dionysus", false);
registryKey.Close();
}
}

public static bool AddedToStartup()
{
return (Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
true).GetValueNames().Contains("Dionysus"));
}

public static async Task<(bool updNeed, string url)> NeedUpdate(string currentVersion)
{
using var _httpClient = new HttpClient();
var _html = await _httpClient.GetStringAsync("https://github.com/blazor911/Dionysus/tags");
var _htmlDocument = new HtmlAgilityPack.HtmlDocument();
_htmlDocument.LoadHtml(_html);

var versionNode = _htmlDocument.DocumentNode.SelectSingleNode("//h2/a[@href and contains(text(),'v')]");

if (versionNode != null)
{
var latestVersion = versionNode.InnerText.Trim().Replace("v", "");
var latestVersionUrl = "https://github.com" + versionNode.Attributes["href"].Value;

if (Version.TryParse(latestVersion, out var parsedLatestVersion) &&
Version.TryParse(currentVersion, out var parsedCurrentVersion))
{
bool needsUpdate = parsedLatestVersion > parsedCurrentVersion;
return (needsUpdate, needsUpdate ? latestVersionUrl : string.Empty);
}
}
return (false, string.Empty);
}
}
2 changes: 1 addition & 1 deletion src/Dionysus.App/Web/LibraryPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@foreach (var game in _gamesList.OrderByDescending(g => ParseTimeInfo(g.TimeInfo)))
{
<div class="libraryPage_game-card" style="@(game.Id == _currentGameId ? _onGameStyle : _defaultStyle)">
<div class="libraryPage_game-image" style="background-image: url('@game.ImageUrl');"></div>
<div class="libraryPage_game-image" style="background-image: url('@game.ImageUrl'); @(GamesMonitor.GameIsDeletedFromDesktop(game) ? "opacity: 0.24" : "")"></div>
<div class="libraryPage_topRightContainer">
@if (_currentGameId != game.Id)
{
Expand Down
17 changes: 16 additions & 1 deletion src/Dionysus.App/Web/SettingsPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@

<button class="settingsPage_saveButton" @onclick="Save"><i class="fa-solid fa-floppy-disk"></i></button>
<label class="settingsPage_versionLabel">v@_versionString
</label>
@if (_isUpdateAvailable)
{
<label class="settingsPage_versionLabel">
| <label class="settingsPage_versionLabel" @onclick="() => LibraryPage.OpenUrl(_updateUrl)"
style="text-decoration: underline; cursor: pointer">
Update
</label>
</label>
}
</label>
</div>

@code {
Expand All @@ -136,13 +145,19 @@
static Version _version = Assembly.GetExecutingAssembly().GetName().Version;
static string _versionString = $"{_version.Major}.{_version.Minor} \"{Program._appCodeName}\"";
static Logger _logger = new Logger();
private bool _isUpdateAvailable = false;
private string _updateUrl = string.Empty;

private string GOGStatus = "fa-solid fa-hourglass-start";
private string XatabStatus = "fa-solid fa-hourglass-start";
private string FitGirlStatus = "fa-solid fa-hourglass-start";

protected override async Task OnInitializedAsync()
{
var updateCheck = await AppHelper.NeedUpdate($"{_version.Major}.{_version.Minor}");
_isUpdateAvailable = updateCheck.updNeed;
_updateUrl = updateCheck.url;

GOGStatus = await GOG.GetStatus() ? "fa-solid fa-circle-check" : "fa-solid fa-circle-xmark";
XatabStatus = await Xatab.GetStatus() ? "fa-solid fa-circle-check" : "fa-solid fa-circle-xmark";
FitGirlStatus = await FitGirl.GetStatus() ? "fa-solid fa-circle-check" : "fa-solid fa-circle-xmark";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ a, .btn-link {
top: 7px;
right: 7px;
display: none;
gap: 0.2rem;
gap: 0.3rem;
z-index: 2;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.4")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.4+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.4")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
382009481810ed02f68b093cde34fd7b1b0327badd77e1148ca2e7cfaca9ec92
51d36010ba54091312e638ee54fb870e3ffc4fac525ef55a098d5350e9ea56d3
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"D:\\C# projects\\Dionysus\\*":"https://raw.githubusercontent.com/blazor911/Dionysus/59a2b71f7e74d4f90b7e35e60f3a685574363650/*"}}
{"documents":{"D:\\C# projects\\Dionysus\\*":"https://raw.githubusercontent.com/blazor911/Dionysus/82d89df58f2acfa0fc092c5fe16ad73145f6fd14/*"}}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Debug/net8.0-windows/Dionysus.dll
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Debug/net8.0-windows/Dionysus.pdb
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Debug/net8.0-windows/apphost.exe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyCopyrightAttribute(" ")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.4")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.4+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.4.0.0")]
[assembly: System.Reflection.AssemblyCultureAttribute("de")]

// Создано классом WriteCodeFragment MSBuild.
Expand Down
Binary file modified src/Dionysus.App/obj/Debug/net8.0-windows/de/Dionysus.resources.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyCopyrightAttribute(" ")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.4")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.4+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.4.0.0")]
[assembly: System.Reflection.AssemblyCultureAttribute("fr")]

// Создано классом WriteCodeFragment MSBuild.
Expand Down
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Debug/net8.0-windows/ref/Dionysus.dll
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Debug/net8.0-windows/refint/Dionysus.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyCopyrightAttribute(" ")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.4")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.4+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.4.0.0")]
[assembly: System.Reflection.AssemblyCultureAttribute("uk")]

// Создано классом WriteCodeFragment MSBuild.
Expand Down
Binary file not shown.
5 changes: 0 additions & 5 deletions src/Dionysus.App/obj/Dionysus.App.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.403/PortableRuntimeIdentifierGraph.json"
}
},
"runtimes": {
"win-x64": {
"#import": []
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dionysus.App/obj/Dionysus.App.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Kirusha\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.1</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Kirusha\.nuget\packages\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bfb108870cf0f229f3863e3c50c35875ae1b691f86a9a34fc7caaea986ab7586
547e0a8c358e495a6b24158170e109832d544c3ac7df2aee215d0073d532a99b
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"D:\\C# projects\\Dionysus\\*":"https://raw.githubusercontent.com/blazor911/Dionysus/59a2b71f7e74d4f90b7e35e60f3a685574363650/*"}}
{"documents":{"D:\\C# projects\\Dionysus\\*":"https://raw.githubusercontent.com/blazor911/Dionysus/82d89df58f2acfa0fc092c5fe16ad73145f6fd14/*"}}
Binary file modified src/Dionysus.App/obj/Release/net8.0-windows/win-x64/Dionysus.dll
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Release/net8.0-windows/win-x64/Dionysus.pdb
Binary file not shown.
Binary file modified src/Dionysus.App/obj/Release/net8.0-windows/win-x64/apphost.exe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyCopyrightAttribute(" ")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0.0")]
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyCopyrightAttribute(" ")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0.0")]
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyCopyrightAttribute(" ")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+59a2b71f7e74d4f90b7e35e60f3a685574363650")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.3+82d89df58f2acfa0fc092c5fe16ad73145f6fd14")]
[assembly: System.Reflection.AssemblyProductAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Dionysus")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0.0")]
Expand Down
Binary file not shown.
Loading

0 comments on commit a02e671

Please sign in to comment.