diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index 77b9f2e..b4c3974 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,6 +1,6 @@ - 1.29.14 + 1.29.15 net8.0-windows enable enable diff --git a/ChatTwo/PayloadHandler.cs b/ChatTwo/PayloadHandler.cs index 5bc05fc..280724b 100755 --- a/ChatTwo/PayloadHandler.cs +++ b/ChatTwo/PayloadHandler.cs @@ -605,20 +605,23 @@ public sealed class PayloadHandler if (!isFriend && ImGui.Selectable(Language.Context_SendFriendRequest)) LogWindow.Plugin.Functions.SendFriendRequest(player.PlayerName, (ushort) world.RowId); - using var menuBlockFunctions = ImGuiUtil.Menu(Language.Context_BlockFunctions); - if (menuBlockFunctions.Success) + using (var menuBlockFunctions = ImGuiUtil.Menu(Language.Context_BlockFunctions)) { - if (ImGui.Selectable(Language.Context_AddToBlacklist)) - LogWindow.Plugin.Functions.AddToBlacklist(player.PlayerName, (ushort)world.RowId); - - if (chunk.Message != null) + if (menuBlockFunctions.Success) { - var message = chunk.Message; - if (ImGui.Selectable(Language.Context_AddToMuteList)) - LogWindow.Plugin.Functions.AddToMuteList(message.AccountId, message.ContentId, player.PlayerName, (short) world.RowId); + if (ImGui.Selectable(Language.Context_AddToBlacklist)) + LogWindow.Plugin.Functions.AddToBlacklist(player.PlayerName, (ushort)world.RowId); - if (ImGui.Selectable(Language.Context_AddToTermsFilter)) - LogWindow.Plugin.Functions.AddToTermsList(message.ContentSource); + if (chunk.Message != null) + { + var message = chunk.Message; + + if (message.AccountId != 0 && ImGui.Selectable(Language.Context_AddToMuteList)) + LogWindow.Plugin.Functions.AddToMuteList(message.AccountId, message.ContentId, player.PlayerName, (short) world.RowId); + + if (ImGui.Selectable(Language.Context_AddToTermsFilter)) + LogWindow.Plugin.Functions.AddToTermsList(message.ContentSource); + } } } diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs index ec23bfa..1ea75e8 100644 --- a/ChatTwo/Ui/ChatLogWindow.cs +++ b/ChatTwo/Ui/ChatLogWindow.cs @@ -169,7 +169,17 @@ public sealed class ChatLogWindow : Window { Plugin.CurrentTab.CurrentChannel.TellTarget = null; if (target != null) - Plugin.CurrentTab.CurrentChannel.TellTarget = target; + { + if (info.Permanent) + { + Plugin.CurrentTab.CurrentChannel.TellTarget = target; + } + else + { + Plugin.CurrentTab.CurrentChannel.UseTempChannel = true; + Plugin.CurrentTab.CurrentChannel.TempTellTarget = target; + } + } } } else @@ -356,6 +366,7 @@ public sealed class ChatLogWindow : Window private void TabChannelSwitch(Tab newTab, Tab previousTab) { + Plugin.Log.Information("Channel switch"); // Use the fixed channel if set by the user, or set it to the current tabs channel if this tab wasn't accessed before if (newTab.Channel is not null) newTab.CurrentChannel.Channel = newTab.Channel.Value; diff --git a/ChatTwo/Util/ChunkUtil.cs b/ChatTwo/Util/ChunkUtil.cs index ededc4a..5db9802 100755 --- a/ChatTwo/Util/ChunkUtil.cs +++ b/ChatTwo/Util/ChunkUtil.cs @@ -175,4 +175,23 @@ internal static class ChunkUtil return BitConverter.ToUInt32(numArray, 0); } + + public static unsafe void PrintMemoryArea(nint address, int length) + { + var ptr = (byte*)address; + var str = new StringBuilder("\n"); + for(var i = 0; i < length; i++) + { + str.Append($"{ptr![i]:X02}"); + + if (i == 0) + continue; + + if ((i+1) % 16 == 0) + str.Append('\n'); + else if ((i+1) % 4 == 0) + str.Append(' '); + } + Plugin.Log.Information(str.ToString()); + } }