From 9eb78c72a9696b173b9ba8324171d977af7e6e69 Mon Sep 17 00:00:00 2001 From: Kaede Date: Sun, 19 May 2024 13:06:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B1=D0=BB=D1=8F=D1=82=D1=8C=20=D1=87=D1=82?= =?UTF-8?q?=D0=BE=20=D1=8D=D1=82=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Packages.props | 46 ++++++++++--------- Marsey.Tests/Marsey.Tests.csproj | 4 +- Marsey/Marsey.csproj | 9 ++-- SS14.Launcher/Helpers.cs | 5 +- SS14.Launcher/SS14.Launcher.csproj | 19 +++++--- SS14.Launcher/VcRedistCheck.cs | 12 ++--- .../MainWindowTabs/PatchesTabViewModel.cs | 2 + .../Views/MainWindowTabs/OptionsTabView.xaml | 2 +- .../Views/MainWindowTabs/PatchesTabView.xaml | 26 +++++------ 9 files changed, 65 insertions(+), 60 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 18bc132..b7c3ef1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,31 +4,33 @@ - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/Marsey.Tests/Marsey.Tests.csproj b/Marsey.Tests/Marsey.Tests.csproj index 14a4781..09ce129 100644 --- a/Marsey.Tests/Marsey.Tests.csproj +++ b/Marsey.Tests/Marsey.Tests.csproj @@ -10,7 +10,7 @@ - + @@ -33,5 +33,5 @@ - + diff --git a/Marsey/Marsey.csproj b/Marsey/Marsey.csproj index 5cef2d6..33e91c7 100644 --- a/Marsey/Marsey.csproj +++ b/Marsey/Marsey.csproj @@ -4,16 +4,13 @@ net8.0 enable enable + false - - + + - - - - diff --git a/SS14.Launcher/Helpers.cs b/SS14.Launcher/Helpers.cs index 9481e8b..df9f38d 100644 --- a/SS14.Launcher/Helpers.cs +++ b/SS14.Launcher/Helpers.cs @@ -139,7 +139,7 @@ public static unsafe void MarkDirectoryCompress(string path) fixed (char* pPath = path) { var handle = Windows.CreateFileW( - (ushort*)pPath, + pPath, // Cast char* to ushort* Windows.GENERIC_ALL, FILE.FILE_SHARE_READ, null, @@ -164,6 +164,7 @@ public static unsafe void MarkDirectoryCompress(string path) } } + public static void ChmodPlusX(string path) { var f = new UnixFileInfo(path); @@ -176,7 +177,7 @@ public static unsafe int MessageBoxHelper(string text, string caption, uint type fixed (char* pText = text) fixed (char* pCaption = caption) { - return Windows.MessageBoxW(HWND.NULL, (ushort*)pText, (ushort*)pCaption, type); + return Windows.MessageBoxW(HWND.NULL, pText, pCaption, type); } } } diff --git a/SS14.Launcher/SS14.Launcher.csproj b/SS14.Launcher/SS14.Launcher.csproj index 429858d..a30db04 100644 --- a/SS14.Launcher/SS14.Launcher.csproj +++ b/SS14.Launcher/SS14.Launcher.csproj @@ -3,6 +3,7 @@ Exe WinExe + true enable @@ -30,17 +31,18 @@ - - - - - + + + + + - + + @@ -54,7 +56,7 @@ - + @@ -88,5 +90,8 @@ + + + diff --git a/SS14.Launcher/VcRedistCheck.cs b/SS14.Launcher/VcRedistCheck.cs index 7e4b564..6b799fb 100644 --- a/SS14.Launcher/VcRedistCheck.cs +++ b/SS14.Launcher/VcRedistCheck.cs @@ -25,15 +25,13 @@ public static unsafe void Check() // We could show this dialog all fancy with Avalonia but I'm lazy so. int ret; - fixed (char* title = - "The game needs the VC++ 2015 redistributable installed, which you do not have.\nWould you like to download the installer for it?") + + var text = "The game needs the VC++ 2015 redistributable installed, which you do not have.\nWould you like to download the installer for it?"; + var caption = "VC++ 2015 redistributable not installed"; + uint type = MB.MB_ICONERROR | MB.MB_YESNO; { - fixed (char* caption = "VC++ 2015 redistributable not installed") { - ret = Windows.MessageBoxW(HWND.NULL, - (ushort*)title, - (ushort*)caption, - MB.MB_ICONERROR | MB.MB_YESNO); + ret = Helpers.MessageBoxHelper(text, caption, type); } } diff --git a/SS14.Launcher/ViewModels/MainWindowTabs/PatchesTabViewModel.cs b/SS14.Launcher/ViewModels/MainWindowTabs/PatchesTabViewModel.cs index 3b1d3f7..b5643e3 100644 --- a/SS14.Launcher/ViewModels/MainWindowTabs/PatchesTabViewModel.cs +++ b/SS14.Launcher/ViewModels/MainWindowTabs/PatchesTabViewModel.cs @@ -24,6 +24,7 @@ public class PatchesTabViewModel : MainWindowTabViewModel public ObservableCollection SubverterPatches { get; } = new ObservableCollection(); public ObservableCollection ResourcePacks { get; } = new ObservableCollection(); public ICommand OpenPatchDirectoryCommand { get; } + public ICommand ReloadModsCommand { get; } #if DEBUG public bool ShowRPacks => true; @@ -34,6 +35,7 @@ public class PatchesTabViewModel : MainWindowTabViewModel public PatchesTabViewModel() { OpenPatchDirectoryCommand = new RelayCommand(() => OpenPatchDirectory(MarseyVars.MarseyFolder)); + ReloadModsCommand = new RelayCommand(ReloadMods); ReloadMods(); } diff --git a/SS14.Launcher/Views/MainWindowTabs/OptionsTabView.xaml b/SS14.Launcher/Views/MainWindowTabs/OptionsTabView.xaml index 3771928..a575a5a 100644 --- a/SS14.Launcher/Views/MainWindowTabs/OptionsTabView.xaml +++ b/SS14.Launcher/Views/MainWindowTabs/OptionsTabView.xaml @@ -60,7 +60,7 @@ Sets degree to which Marsey hides itself. - + diff --git a/SS14.Launcher/Views/MainWindowTabs/PatchesTabView.xaml b/SS14.Launcher/Views/MainWindowTabs/PatchesTabView.xaml index 2f6b4b8..912a2c6 100644 --- a/SS14.Launcher/Views/MainWindowTabs/PatchesTabView.xaml +++ b/SS14.Launcher/Views/MainWindowTabs/PatchesTabView.xaml @@ -11,7 +11,7 @@ - + @@ -24,8 +24,8 @@ - - + + @@ -35,7 +35,7 @@ Margin="8" /> - @@ -44,14 +44,14 @@ - + - - + + @@ -59,7 +59,7 @@ - @@ -68,14 +68,14 @@ - + - - + + @@ -83,7 +83,7 @@ - @@ -97,7 +97,7 @@