diff --git a/ImageMap4.CMD/Program.cs b/ImageMap4.CMD/Program.cs index 7561a51..87c461b 100644 --- a/ImageMap4.CMD/Program.cs +++ b/ImageMap4.CMD/Program.cs @@ -5,8 +5,10 @@ using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.ImageSharp.Processing.Processors.Transforms; using System.Diagnostics; +using System.Text; using TryashtarUtils.Utility; +Console.OutputEncoding = Encoding.UTF8; if (args.Length == 0) { Console.WriteLine( diff --git a/ImageMap4/ImageMap4.csproj b/ImageMap4/ImageMap4.csproj index 9cd2993..d80c62f 100644 --- a/ImageMap4/ImageMap4.csproj +++ b/ImageMap4/ImageMap4.csproj @@ -19,10 +19,11 @@ Copyright © 2022 tryashtar https://github.com/tryashtar/image-map https://github.com/tryashtar/image-map - 4.2.0.0 - 4.2.0.0 - 4.2.0 + 4.2.1.0 + 4.2.1.0 + 4.2.1 false + x64 diff --git a/ImageMap4/MainWindow.xaml.cs b/ImageMap4/MainWindow.xaml.cs index d47e033..ea4714c 100644 --- a/ImageMap4/MainWindow.xaml.cs +++ b/ImageMap4/MainWindow.xaml.cs @@ -205,12 +205,21 @@ private void GenerateStructureButton_Click(object sender, RoutedEventArgs e) StructureWindow = new(new StructureViewModel(new GridMakerViewModel(this.ViewModel, this.ViewModel.ExistingMaps))); StructureWindow.Owner = this; StructureWindow.ViewModel.JavaMode = ViewModel.SelectedWorld is JavaWorld; - StructureWindow.ViewModel.OnConfirmed += (s, e) => ViewModel.SelectedWorld.AddStructures(new[] { e.grid }, e.inventory); + StructureWindow.ViewModel.OnConfirmed += (s, e) => Try(() => ViewModel.SelectedWorld.AddStructures(new[] { e.grid }, e.inventory)); } StructureWindow.Show(); StructureWindow.Activate(); } + private void Try(Action action) + { + try { action(); } + catch (Exception ex) + { + MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } + } + void IDropTarget.DragOver(IDropInfo dropInfo) { GetDropAction(dropInfo);