From 12435010675d21edbef8a3939745a1251650452f Mon Sep 17 00:00:00 2001 From: Infi Date: Thu, 11 Apr 2024 15:31:36 +0200 Subject: [PATCH] Fix unfocused in eureka --- ChatTwo/GameFunctions/Chat.cs | 3 +-- ChatTwo/Ui/ChatLogWindow.cs | 37 +++++++++++++++++------------------ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/ChatTwo/GameFunctions/Chat.cs b/ChatTwo/GameFunctions/Chat.cs index 4813428..a35002a 100755 --- a/ChatTwo/GameFunctions/Chat.cs +++ b/ChatTwo/GameFunctions/Chat.cs @@ -10,7 +10,6 @@ using Dalamud.Memory; using Dalamud.Plugin.Services; using Dalamud.Utility.Signatures; using FFXIVClientStructs.FFXIV.Client.System.Framework; -using FFXIVClientStructs.FFXIV.Client.System.Memory; using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI.Agent; @@ -565,7 +564,7 @@ internal sealed unsafe class Chat : IDisposable { { playerName = MemoryHelper.ReadStringNullTerminated(agent + 0xDA); worldId = *(ushort*) (agent + 0x120); - Plugin.Log.Debug($"Detected tell target '{playerName}'@{worldId:X}"); + Plugin.Log.Debug($"Detected tell target '{playerName}'@{worldId}"); } Channel = ((InputChannel) channel, nameChunks, playerName, worldId); diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs index c2a1a55..f751aba 100644 --- a/ChatTwo/Ui/ChatLogWindow.cs +++ b/ChatTwo/Ui/ChatLogWindow.cs @@ -676,13 +676,11 @@ public sealed class ChatLogWindow : Window, IUiComponent { HandleKeybinds(true); } - // 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) { + // Only trigger unfocused if we are currently not calling the auto complete + if (!Activate && !ImGui.IsItemActive() && _autoCompleteInfo == null) + { + if (_tempChannel is InputChannel.Tell) _tellTarget = null; - } _tempChannel = null; if (Plugin.Functions.Chat.UsesTellTempChannel) @@ -692,36 +690,37 @@ public sealed class ChatLogWindow : Window, IUiComponent { } } - if (ImGui.BeginPopupContextItem()) { + if (ImGui.BeginPopupContextItem()) + { ImGui.PushStyleColor(ImGuiCol.Text, normalColour); - try { - if (ImGui.Selectable(Language.ChatLog_HideChat)) { + try + { + if (ImGui.Selectable(Language.ChatLog_HideChat)) UserHide(); - } - } finally { + } + finally + { ImGui.PopStyleColor(); } ImGui.EndPopup(); } - if (inputColour != null) { + if (inputColour != null) ImGui.PopStyleColor(); - } ImGui.SameLine(); - if (ImGuiUtil.IconButton(FontAwesomeIcon.Cog)) { - Plugin.SettingsWindow.IsOpen ^= true; - } + if (ImGuiUtil.IconButton(FontAwesomeIcon.Cog)) + Plugin.SettingsWindow.Toggle(); - if (showNovice) { + if (showNovice) + { ImGui.SameLine(); - if (ImGuiUtil.IconButton(FontAwesomeIcon.Leaf)) { + if (ImGuiUtil.IconButton(FontAwesomeIcon.Leaf)) Plugin.Functions.ClickNoviceNetworkButton(); - } } }