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

Moving out all PInvoke Methods to its Independent Hi3Helper.Win32 assembly #606

Merged
merged 16 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "H.NotifyIcon"]
path = H.NotifyIcon
url = https://github.com/CollapseLauncher/H.NotifyIcon
[submodule "Hi3Helper.Win32"]
path = Hi3Helper.Win32
url = https://github.com/CollapseLauncher/Hi3Helper.Win32
4 changes: 4 additions & 0 deletions CollapseLauncher.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
<BuildType Solution="Publish|*" Project="Release" />
<Platform Project="x64" />
</Project>
<Project Path="Hi3Helper.Win32/Hi3Helper.Win32.csproj">
<BuildType Solution="Publish|*" Project="Debug" />
<Platform Project="x64" />
</Project>
<Project Path="ImageEx\ImageEx\ImageEx.csproj" Id="9c7abc1d-504e-45c4-ae76-98a9f6e28c80">
<BuildType Solution="Publish|*" Project="Release" />
<Platform Project="x64" />
Expand Down
5 changes: 3 additions & 2 deletions CollapseLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
using Hi3Helper;
using Hi3Helper.SentryHelper;
using Hi3Helper.Shared.Region;
using Hi3Helper.Win32.Native;
using Hi3Helper.Win32.Native.Enums;
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using PhotoSauce.MagicScaler;
using PhotoSauce.NativeCodecs.Libwebp;
using System;
using System.Linq;

Check warning on line 14 in CollapseLauncher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Redundant using directive

Using directive is not required by the code and can be safely removed
using Windows.UI;
using static CollapseLauncher.InnerLauncherConfig;
using static Hi3Helper.InvokeProp;
using static Hi3Helper.Logger;

namespace CollapseLauncher
Expand Down Expand Up @@ -64,7 +65,7 @@
}

RequestedTheme = IsAppThemeLight ? ApplicationTheme.Light : ApplicationTheme.Dark;
SetPreferredAppMode(ShouldAppsUseDarkMode() ? PreferredAppMode.AllowDark : PreferredAppMode.Default);
PInvoke.SetPreferredAppMode(PInvoke.ShouldAppsUseDarkMode() ? PreferredAppMode.AllowDark : PreferredAppMode.Default);

this.InitializeComponent();
}
Expand Down
176 changes: 0 additions & 176 deletions CollapseLauncher/Classes/CoCreateInstance.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using CollapseLauncher.Dialogs;
using CollapseLauncher.Extension;

Check warning on line 2 in CollapseLauncher/Classes/FileDialog/FileDialogHelper.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Redundant using directive

Using directive is not required by the code and can be safely removed
using CollapseLauncher.FileDialogCOM;
using CollapseLauncher.Helper;
using Hi3Helper;
using Hi3Helper.Data;

Check warning on line 5 in CollapseLauncher/Classes/FileDialog/FileDialogHelper.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Redundant using directive

Using directive is not required by the code and can be safely removed
using Hi3Helper.Shared.Region;
using Hi3Helper.Win32.FileDialogCOM;
using Microsoft.UI.Text;
using Microsoft.UI.Xaml.Controls;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

#nullable enable
namespace CollapseLauncher.Classes.FileDialogCOM
namespace CollapseLauncher.FileDialogCOM
{
internal static class FileDialogHelper
{
Expand Down Expand Up @@ -95,7 +94,7 @@
return dirPath;


async Task SpawnInvalidDialog(string title, string message, string selectedPath, bool isUseLegacyFormatting = false)
async Task SpawnInvalidDialog(string dialogTitle, string message, string selectedPath, bool isUseLegacyFormatting = false)
{
TextBlock textBlock = new TextBlock()
{
Expand All @@ -113,7 +112,7 @@
}

await SimpleDialogs.SpawnDialog(
isUseLegacyFormatting ? title : string.Format(Locale.Lang._Dialogs.InvalidGameDirNewTitleFormat, title),
isUseLegacyFormatting ? dialogTitle : string.Format(Locale.Lang._Dialogs.InvalidGameDirNewTitleFormat, dialogTitle),
textBlock,
(WindowUtility.CurrentWindow as MainWindow)?.Content,
Locale.Lang._Misc.Okay,
Expand Down
49 changes: 0 additions & 49 deletions CollapseLauncher/Classes/FileDialogCOM/Enums.cs

This file was deleted.

Loading
Loading