- 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"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Version>1.29.14</Version> <Version>1.29.15</Version>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
+5 -2
View File
@@ -605,7 +605,8 @@ public sealed class PayloadHandler
if (!isFriend && ImGui.Selectable(Language.Context_SendFriendRequest)) if (!isFriend && ImGui.Selectable(Language.Context_SendFriendRequest))
LogWindow.Plugin.Functions.SendFriendRequest(player.PlayerName, (ushort) world.RowId); LogWindow.Plugin.Functions.SendFriendRequest(player.PlayerName, (ushort) world.RowId);
using var menuBlockFunctions = ImGuiUtil.Menu(Language.Context_BlockFunctions); using (var menuBlockFunctions = ImGuiUtil.Menu(Language.Context_BlockFunctions))
{
if (menuBlockFunctions.Success) if (menuBlockFunctions.Success)
{ {
if (ImGui.Selectable(Language.Context_AddToBlacklist)) if (ImGui.Selectable(Language.Context_AddToBlacklist))
@@ -614,13 +615,15 @@ public sealed class PayloadHandler
if (chunk.Message != null) if (chunk.Message != null)
{ {
var message = chunk.Message; var message = chunk.Message;
if (ImGui.Selectable(Language.Context_AddToMuteList))
if (message.AccountId != 0 && ImGui.Selectable(Language.Context_AddToMuteList))
LogWindow.Plugin.Functions.AddToMuteList(message.AccountId, message.ContentId, player.PlayerName, (short) world.RowId); LogWindow.Plugin.Functions.AddToMuteList(message.AccountId, message.ContentId, player.PlayerName, (short) world.RowId);
if (ImGui.Selectable(Language.Context_AddToTermsFilter)) if (ImGui.Selectable(Language.Context_AddToTermsFilter))
LogWindow.Plugin.Functions.AddToTermsList(message.ContentSource); LogWindow.Plugin.Functions.AddToTermsList(message.ContentSource);
} }
} }
}
if (GameFunctions.GameFunctions.IsMentor() && ImGui.Selectable(Language.Context_InviteToNoviceNetwork)) if (GameFunctions.GameFunctions.IsMentor() && ImGui.Selectable(Language.Context_InviteToNoviceNetwork))
GameFunctions.Context.InviteToNoviceNetwork(player.PlayerName, (ushort) world.RowId); GameFunctions.Context.InviteToNoviceNetwork(player.PlayerName, (ushort) world.RowId);
+11
View File
@@ -169,8 +169,18 @@ public sealed class ChatLogWindow : Window
{ {
Plugin.CurrentTab.CurrentChannel.TellTarget = null; Plugin.CurrentTab.CurrentChannel.TellTarget = null;
if (target != null) if (target != null)
{
if (info.Permanent)
{
Plugin.CurrentTab.CurrentChannel.TellTarget = target; Plugin.CurrentTab.CurrentChannel.TellTarget = target;
} }
else
{
Plugin.CurrentTab.CurrentChannel.UseTempChannel = true;
Plugin.CurrentTab.CurrentChannel.TempTellTarget = target;
}
}
}
} }
else else
{ {
@@ -356,6 +366,7 @@ public sealed class ChatLogWindow : Window
private void TabChannelSwitch(Tab newTab, Tab previousTab) 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 // 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) if (newTab.Channel is not null)
newTab.CurrentChannel.Channel = newTab.Channel.Value; newTab.CurrentChannel.Channel = newTab.Channel.Value;
+19
View File
@@ -175,4 +175,23 @@ internal static class ChunkUtil
return BitConverter.ToUInt32(numArray, 0); 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());
}
} }