From 02ad56a96c2cbc5aeacbb980020128e4d931674f Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Wed, 14 Aug 2024 20:12:57 +0200 Subject: [PATCH] Remove extra whitespace from copied QW values --- .../Windows/QuestComponents/ActiveQuestComponent.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs index e3695a33c..5d746a693 100644 --- a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs +++ b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Numerics; +using System.Text.RegularExpressions; using Dalamud.Game.Text; using Dalamud.Interface; using Dalamud.Interface.Colors; @@ -17,8 +18,11 @@ using Questionable.Model.Questing; namespace Questionable.Windows.QuestComponents; -internal sealed class ActiveQuestComponent +internal sealed partial class ActiveQuestComponent { + [GeneratedRegex(@"\s\s+", RegexOptions.IgnoreCase, "en-US")] + private static partial Regex MultipleWhitespaceRegex(); + private readonly QuestController _questController; private readonly MovementController _movementController; private readonly CombatController _combatController; @@ -183,8 +187,9 @@ internal sealed class ActiveQuestComponent if (ImGui.IsItemClicked()) { - ImGui.SetClipboardText(questWork.ToString()); - _chatGui.Print($"Copied '{questWork}' to clipboard"); + string progressText = MultipleWhitespaceRegex().Replace(questWork.ToString(), " "); + ImGui.SetClipboardText(progressText); + _chatGui.Print($"Copied '{progressText}' to clipboard"); } if (ImGui.IsItemHovered())