From 25dcb16964779a07be97800ab4311ddab30b8538 Mon Sep 17 00:00:00 2001 From: SpoinkyNL Date: Mon, 1 Feb 2021 19:36:29 +0100 Subject: [PATCH] Plugins - Check main entry DLL casing to avoid weird namespace issues Editor - Removed limit on zooming with mouseswheel, closes #528 --- src/Artemis.Core/Services/PluginManagementService.cs | 5 ++++- src/Artemis.UI/Screens/Shared/PanZoomViewModel.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Artemis.Core/Services/PluginManagementService.cs b/src/Artemis.Core/Services/PluginManagementService.cs index c15122d1d..30e085d6e 100644 --- a/src/Artemis.Core/Services/PluginManagementService.cs +++ b/src/Artemis.Core/Services/PluginManagementService.cs @@ -270,7 +270,10 @@ namespace Artemis.Core.Services string? mainFile = plugin.ResolveRelativePath(plugin.Info.Main); if (!File.Exists(mainFile)) throw new ArtemisPluginException(plugin, "Couldn't find the plugins main entry at " + mainFile); - + FileInfo[] fileInfos = directory.GetFiles(); + if (!fileInfos.Any(f => string.Equals(f.Name, plugin.Info.Main, StringComparison.InvariantCulture))) + throw new ArtemisPluginException(plugin, "Plugin main entry casing mismatch at " + plugin.Info.Main); + // Load the plugin, all types implementing Plugin and register them with DI plugin.PluginLoader = PluginLoader.CreateFromAssemblyFile(mainFile!, configure => { diff --git a/src/Artemis.UI/Screens/Shared/PanZoomViewModel.cs b/src/Artemis.UI/Screens/Shared/PanZoomViewModel.cs index 45638755c..e751e5e51 100644 --- a/src/Artemis.UI/Screens/Shared/PanZoomViewModel.cs +++ b/src/Artemis.UI/Screens/Shared/PanZoomViewModel.cs @@ -94,7 +94,7 @@ namespace Artemis.UI.Screens.Shared Zoom *= 0.9; // Limit to a min of 0.1 and a max of 2.5 (10% - 250% in the view) - Zoom = Math.Max(0.1, Math.Min(2.5, Zoom)); + Zoom = Math.Max(0.1, Zoom); // Update the PanX/Y to enable zooming relative to cursor if (LimitToZero)