From 3aca09d0fb7fa94c769a898b68d96f7d6e630983 Mon Sep 17 00:00:00 2001 From: RedworkDE <10944644+RedworkDE@users.noreply.github.com> Date: Mon, 22 Dec 2025 22:28:44 +0100 Subject: [PATCH] review --- Dalamud/Game/Chat/LogMessage.cs | 10 ++++++---- Dalamud/Game/Gui/ChatGui.cs | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dalamud/Game/Chat/LogMessage.cs b/Dalamud/Game/Chat/LogMessage.cs index cf423bd6e..92217e1c6 100644 --- a/Dalamud/Game/Chat/LogMessage.cs +++ b/Dalamud/Game/Chat/LogMessage.cs @@ -12,7 +12,7 @@ using Lumina.Excel; using System.Diagnostics.CodeAnalysis; -using TerraFX.Interop.Windows; +using Lumina.Text.ReadOnly; namespace Dalamud.Game.Chat; @@ -72,7 +72,7 @@ public interface ILogMessage : IEquatable /// /// This can cause side effects such as playing sound effects and thus should only be used for debugging. /// The formatted string. - SeString FormatLogMessageForDebugging(); + ReadOnlySeString FormatLogMessageForDebugging(); } /// @@ -144,7 +144,7 @@ internal unsafe readonly struct LogMessage(LogMessageQueueItem* ptr) : ILogMessa } /// - public SeString FormatLogMessageForDebugging() + public ReadOnlySeString FormatLogMessageForDebugging() { var logModule = RaptureLogModule.Instance(); @@ -155,7 +155,9 @@ internal unsafe readonly struct LogMessage(LogMessageQueueItem* ptr) : ILogMessa SetName(logModule, this.TargetEntity); logModule->RaptureTextModule->FormatString(this.GameData.Value.Text.ToDalamudString().EncodeWithNullTerminator(), &ptr->Parameters, &utf8); - return SeString.Parse(utf8.AsSpan()); + var result = new ReadOnlySeString(utf8.AsSpan()); + utf8.Dtor(); + return result; void SetName(RaptureLogModule* self, LogMessageEntity item) { diff --git a/Dalamud/Game/Gui/ChatGui.cs b/Dalamud/Game/Gui/ChatGui.cs index 5208c019b..c6405fb35 100644 --- a/Dalamud/Game/Gui/ChatGui.cs +++ b/Dalamud/Game/Gui/ChatGui.cs @@ -42,7 +42,7 @@ internal sealed unsafe class ChatGui : IInternalDisposableService, IChatGui private readonly Queue chatQueue = new(); private readonly Dictionary<(string PluginName, uint CommandId), Action> dalamudLinkHandlers = new(); - private readonly List seenLogMessageObjects = new(); + private readonly List seenLogMessageObjects = new(); private readonly Hook printMessageHook; private readonly Hook inventoryItemCopyHook; @@ -534,7 +534,7 @@ internal sealed unsafe class ChatGui : IInternalDisposableService, IChatGui this.seenLogMessageObjects.Clear(); foreach (ref var item in thisPtr->LogMessageQueue) { - this.seenLogMessageObjects.Add((IntPtr)Unsafe.AsPointer(ref item)); + this.seenLogMessageObjects.Add((nint)Unsafe.AsPointer(ref item)); } } catch (Exception ex)