diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a3898ae..ce24e091d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## [Unreleased](https://github.com/LostArtefacts/TR-Rando/compare/V1.9.3...master) - xxxx-xx-xx +- added (experimental) support for Linux (#143) - changed the number of secrets in TR3R Coastal Village to four to match the statistics (#775) - fixed unreachable item locations in Coastal Village (#774) diff --git a/Deps/TRGE.Coord.dll b/Deps/TRGE.Coord.dll index 006dcf6c6..eb2d0af89 100644 Binary files a/Deps/TRGE.Coord.dll and b/Deps/TRGE.Coord.dll differ diff --git a/Deps/TRGE.Core.dll b/Deps/TRGE.Core.dll index c9c5474b5..19bb4c021 100644 Binary files a/Deps/TRGE.Core.dll and b/Deps/TRGE.Core.dll differ diff --git a/TRRandomizerView/Controls/FolderLoadControl.xaml b/TRRandomizerView/Controls/FolderLoadControl.xaml index 313a5990a..3143c40ed 100644 --- a/TRRandomizerView/Controls/FolderLoadControl.xaml +++ b/TRRandomizerView/Controls/FolderLoadControl.xaml @@ -47,7 +47,7 @@ - + - - - + + diff --git a/TRRandomizerView/Controls/FolderLoadControl.xaml.cs b/TRRandomizerView/Controls/FolderLoadControl.xaml.cs index 4a8775c38..05201216a 100644 --- a/TRRandomizerView/Controls/FolderLoadControl.xaml.cs +++ b/TRRandomizerView/Controls/FolderLoadControl.xaml.cs @@ -62,7 +62,6 @@ public FolderLoadControl() AppTitle = app.Title; } _content.DataContext = this; - _historyIcon.Source = ControlUtils.DefaultIcons.FolderSmall.ToImageSource(); } private void HistoryListView_SelectionChanged(object sender, SelectionChangedEventArgs e) diff --git a/TRRandomizerView/Resources/folder.png b/TRRandomizerView/Resources/folder.png new file mode 100644 index 000000000..6b88bd492 Binary files /dev/null and b/TRRandomizerView/Resources/folder.png differ diff --git a/TRRandomizerView/TRRandomizerView.csproj b/TRRandomizerView/TRRandomizerView.csproj index 8dcaea8db..66b8c2833 100644 --- a/TRRandomizerView/TRRandomizerView.csproj +++ b/TRRandomizerView/TRRandomizerView.csproj @@ -49,6 +49,7 @@ + @@ -88,6 +89,7 @@ + diff --git a/TRRandomizerView/Utilities/ControlUtils.cs b/TRRandomizerView/Utilities/ControlUtils.cs index 2359ad503..c656b400c 100644 --- a/TRRandomizerView/Utilities/ControlUtils.cs +++ b/TRRandomizerView/Utilities/ControlUtils.cs @@ -1,21 +1,12 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows; +using System.Windows; using System.Windows.Controls; -using System.Windows.Interop; using System.Windows.Media; -using System.Windows.Media.Imaging; namespace TRRandomizerView.Utilities; public static class ControlUtils { - [DllImport("gdi32.dll", SetLastError = true)] - private static extern bool DeleteObject(IntPtr hObject); - - public static ListViewItem GetItemAt(this ListView listView, System.Windows.Point clientRelativePosition) + public static ListViewItem GetItemAt(this ListView listView, Point clientRelativePosition) { HitTestResult hitTestResult = VisualTreeHelper.HitTest(listView, clientRelativePosition); DependencyObject selectedItem = null; @@ -33,68 +24,4 @@ public static ListViewItem GetItemAt(this ListView listView, System.Windows.Poin } return selectedItem == null ? null : selectedItem as ListViewItem; } - - public static ImageSource ToImageSource(this Icon icon) - { - Bitmap bitmap = icon.ToBitmap(); - IntPtr hBitmap = bitmap.GetHbitmap(); - - ImageSource wpfBitmap = Imaging.CreateBitmapSourceFromHBitmap - ( - hBitmap, - IntPtr.Zero, - Int32Rect.Empty, - BitmapSizeOptions.FromEmptyOptions() - ); - - if (!DeleteObject(hBitmap)) - { - throw new Win32Exception(); - } - - return wpfBitmap; - } - - public static class DefaultIcons - { - private static Icon _largeFolderIcon, _smallFolderIcon; - - public static Icon FolderLarge => _largeFolderIcon ??= GetStockIcon(SHSIID_FOLDER, SHGSI_LARGEICON); - public static Icon FolderSmall => _smallFolderIcon ??= GetStockIcon(SHSIID_FOLDER, SHGSI_SMALLICON); - - [DllImport("shell32.dll")] - private static extern int SHGetStockIconInfo(uint siid, uint uFlags, ref SHSTOCKICONINFO psii); - - [DllImport("user32.dll")] - private static extern bool DestroyIcon(IntPtr handle); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - private struct SHSTOCKICONINFO - { - public uint cbSize; - public IntPtr hIcon; - public int iSysIconIndex; - public int iIcon; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - public string szPath; - } - - private const uint SHSIID_FOLDER = 0x3; - private const uint SHGSI_ICON = 0x100; - private const uint SHGSI_LARGEICON = 0x0; - private const uint SHGSI_SMALLICON = 0x1; - - private static Icon GetStockIcon(uint type, uint size) - { - SHSTOCKICONINFO info = new(); - info.cbSize = (uint)Marshal.SizeOf(info); - - _ = SHGetStockIconInfo(type, SHGSI_ICON | size, ref info); - - Icon icon = (Icon)Icon.FromHandle(info.hIcon).Clone(); - DestroyIcon(info.hIcon); - - return icon; - } - } } diff --git a/TRRandomizerView/Utilities/ProcessUtils.cs b/TRRandomizerView/Utilities/ProcessUtils.cs index 57eee6095..1fab46c18 100644 --- a/TRRandomizerView/Utilities/ProcessUtils.cs +++ b/TRRandomizerView/Utilities/ProcessUtils.cs @@ -19,11 +19,16 @@ public static void OpenFile(string fileName, string arguments = null) public static void OpenFolder(string folder) { + folder = Path.GetFullPath(folder); + if (!Path.EndsInDirectorySeparator(folder)) + { + folder += Path.DirectorySeparatorChar; + } Process.Start(new ProcessStartInfo { - FileName = "explorer.exe", - Arguments = Path.GetFullPath(folder), - UseShellExecute = true + FileName = folder, + UseShellExecute = true, + Verb = "open", }); } diff --git a/TRRandomizerView/Windows/AboutWindow.xaml b/TRRandomizerView/Windows/AboutWindow.xaml index 1518bc422..d19eebcf5 100644 --- a/TRRandomizerView/Windows/AboutWindow.xaml +++ b/TRRandomizerView/Windows/AboutWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" ResizeMode="NoResize" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" FontFamily="Segoe UI" FontSize="13" WindowStartupLocation="CenterOwner" @@ -29,7 +29,7 @@ Width="120" Margin="0,5,10,0" HorizontalAlignment="Center" - Source="..\Resources\rando.png"/> + Source="../Resources/rando.png"/> + Source="../Resources/Darkness/0.jpg"/> diff --git a/TRRandomizerView/Windows/EnemyWindow.xaml b/TRRandomizerView/Windows/EnemyWindow.xaml index 97d979405..c05bd73a7 100644 --- a/TRRandomizerView/Windows/EnemyWindow.xaml +++ b/TRRandomizerView/Windows/EnemyWindow.xaml @@ -4,7 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" diff --git a/TRRandomizerView/Windows/GlobalSeedWindow.xaml b/TRRandomizerView/Windows/GlobalSeedWindow.xaml index 8059d0844..b66e78868 100644 --- a/TRRandomizerView/Windows/GlobalSeedWindow.xaml +++ b/TRRandomizerView/Windows/GlobalSeedWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ctrl="clr-namespace:TRRandomizerView.Controls" mc:Ignorable="d" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" diff --git a/TRRandomizerView/Windows/GlobalSettingsWindow.xaml b/TRRandomizerView/Windows/GlobalSettingsWindow.xaml index 70e443998..4de01537c 100644 --- a/TRRandomizerView/Windows/GlobalSettingsWindow.xaml +++ b/TRRandomizerView/Windows/GlobalSettingsWindow.xaml @@ -6,7 +6,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cvt="clr-namespace:TRRandomizerView.Converters" mc:Ignorable="d" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" diff --git a/TRRandomizerView/Windows/MainWindow.xaml b/TRRandomizerView/Windows/MainWindow.xaml index 7e06c2258..97e578dc1 100644 --- a/TRRandomizerView/Windows/MainWindow.xaml +++ b/TRRandomizerView/Windows/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:ctrl="clr-namespace:TRRandomizerView.Controls" xmlns:vm="clr-namespace:TRRandomizerView.Model" mc:Ignorable="d" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen" Closing="Window_Closing" diff --git a/TRRandomizerView/Windows/MessageWindow.xaml b/TRRandomizerView/Windows/MessageWindow.xaml index 4a400d04c..73ec13b4c 100644 --- a/TRRandomizerView/Windows/MessageWindow.xaml +++ b/TRRandomizerView/Windows/MessageWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" ResizeMode="NoResize" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" Loaded="Window_Loaded" diff --git a/TRRandomizerView/Windows/OpenProgressWindow.xaml b/TRRandomizerView/Windows/OpenProgressWindow.xaml index 9e6961aa9..acf72aed8 100644 --- a/TRRandomizerView/Windows/OpenProgressWindow.xaml +++ b/TRRandomizerView/Windows/OpenProgressWindow.xaml @@ -9,7 +9,7 @@ ResizeMode="NoResize" Loaded="Window_Loaded" Closing="Window_Closing" - Icon="..\Resources\rando.ico" + Icon="../Resources/rando.ico" Title="Opening Data Folder" Height="100" Width="400"> @@ -29,7 +29,7 @@ @@ -36,7 +36,7 @@ @@ -29,7 +29,7 @@