From 2e2c73f707afd589aeea3e5de11835b9d4dbde53 Mon Sep 17 00:00:00 2001 From: bleatbot <106497096+bleatbot@users.noreply.github.com> Date: Wed, 12 Mar 2025 23:27:12 +0100 Subject: [PATCH] [net9] Rollup changes from master (#2193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: handle UNC paths in FileDialog (#2191) * Remove command from assembly map when removed from command map (#2183) --------- Co-authored-by: Alex Vallière <6031413+AlexValliere@users.noreply.github.com> Co-authored-by: Blair Co-authored-by: github-actions[bot] --- Dalamud/Game/Command/CommandManager.cs | 6 ++++++ .../Interface/ImGuiFileDialog/FileDialog.Files.cs | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Dalamud/Game/Command/CommandManager.cs b/Dalamud/Game/Command/CommandManager.cs index 078ce8c50..fdaa5833b 100644 --- a/Dalamud/Game/Command/CommandManager.cs +++ b/Dalamud/Game/Command/CommandManager.cs @@ -10,6 +10,7 @@ using Dalamud.IoC.Internal; using Dalamud.Logging.Internal; using Dalamud.Plugin.Internal.Types; using Dalamud.Plugin.Services; +using Dalamud.Utility; using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.UI; @@ -149,6 +150,11 @@ internal sealed unsafe class CommandManager : IInternalDisposableService, IComma /// public bool RemoveHandler(string command) { + if (this.commandAssemblyNameMap.FindFirst(c => c.Key.Item1 == command, out var assemblyKeyValuePair)) + { + this.commandAssemblyNameMap.TryRemove(assemblyKeyValuePair.Key, out _); + } + return this.commandMap.Remove(command, out _); } diff --git a/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs b/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs index 121ec8890..705c0f100 100644 --- a/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs +++ b/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs @@ -36,6 +36,20 @@ public partial class FileDialog private static string ComposeNewPath(List decomp) { + // Handle UNC paths (network paths) + if (decomp.Count >= 2 && string.IsNullOrEmpty(decomp[0]) && string.IsNullOrEmpty(decomp[1])) + { + var pathParts = new List(decomp); + pathParts.RemoveRange(0, 2); + // Can not access server level or UNC root + if (pathParts.Count <= 1) + { + return string.Empty; + } + + return $"\\\\{string.Join('\\', pathParts)}"; + } + if (decomp.Count == 1) { var drivePath = decomp[0];