- Fix /r issues

- Scope the block functions menu entry
- Don't show MuteList if accountId is unset
This commit is contained in:
Infi
2024-12-19 18:48:06 +01:00
parent 7cbaf77fe2
commit 70971d7b8a
4 changed files with 46 additions and 13 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.29.14</Version>
<Version>1.29.15</Version>
<TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
+14 -11
View File
@@ -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);
}
}
}
+12 -1
View File
@@ -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;
+19
View File
@@ -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());
}
}