forked from liza/Questionable
Remove extra whitespace from copied QW values
This commit is contained in:
parent
51816a2c8b
commit
02ad56a96c
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
@ -17,8 +18,11 @@ using Questionable.Model.Questing;
|
|||||||
|
|
||||||
namespace Questionable.Windows.QuestComponents;
|
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 QuestController _questController;
|
||||||
private readonly MovementController _movementController;
|
private readonly MovementController _movementController;
|
||||||
private readonly CombatController _combatController;
|
private readonly CombatController _combatController;
|
||||||
@ -183,8 +187,9 @@ internal sealed class ActiveQuestComponent
|
|||||||
|
|
||||||
if (ImGui.IsItemClicked())
|
if (ImGui.IsItemClicked())
|
||||||
{
|
{
|
||||||
ImGui.SetClipboardText(questWork.ToString());
|
string progressText = MultipleWhitespaceRegex().Replace(questWork.ToString(), " ");
|
||||||
_chatGui.Print($"Copied '{questWork}' to clipboard");
|
ImGui.SetClipboardText(progressText);
|
||||||
|
_chatGui.Print($"Copied '{progressText}' to clipboard");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
|
Loading…
Reference in New Issue
Block a user