Implement #10 with fixed payload byte[]

This commit is contained in:
Infi
2024-04-10 23:57:44 +02:00
parent 27e08064af
commit 9f771c37e3
3 changed files with 95 additions and 70 deletions
+7 -2
View File
@@ -654,7 +654,10 @@ public sealed class ChatLogWindow : Window, IUiComponent {
HandleKeybinds(true);
}
if (!Activate && !ImGui.IsItemActive()) {
// If we're currently using a temporary channel, switch back to the
// original channel when the input loses focus *unless* the
// auto-translate popup is open.
if (_tempChannel != null && !Activate && !ImGui.IsItemActive() && _autoCompleteInfo == null) {
if (_tempChannel is InputChannel.Tell) {
_tellTarget = null;
}
@@ -742,7 +745,9 @@ public sealed class ChatLogWindow : Window, IUiComponent {
reason = TellReason.Friend;
}
Plugin.Functions.Chat.SendTell(reason, target.ContentId, target.Name, (ushort) world.RowId, trimmed);
var tellBytes = Encoding.UTF8.GetBytes(trimmed);
AutoTranslate.ReplaceWithPayload(Plugin.DataManager, ref tellBytes);
Plugin.Functions.Chat.SendTell(reason, target.ContentId, target.Name, (ushort) world.RowId, tellBytes);
}
if (_tempChannel is InputChannel.Tell) {