From 56eff572b7f658eb0a16df84a7cdc201e96577ad Mon Sep 17 00:00:00 2001 From: Infi Date: Mon, 18 Nov 2024 20:06:29 +0100 Subject: [PATCH] Fix #107 --- ChatTwo/GameFunctions/Chat.cs | 7 ++++--- ChatTwo/Ui/ChatLogWindow.cs | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChatTwo/GameFunctions/Chat.cs b/ChatTwo/GameFunctions/Chat.cs index d1308d8..6bc2a17 100755 --- a/ChatTwo/GameFunctions/Chat.cs +++ b/ChatTwo/GameFunctions/Chat.cs @@ -359,6 +359,7 @@ internal sealed unsafe class Chat : IDisposable { if (rotate == RotateMode.None) return null; + var delta = rotate switch { RotateMode.Forward => 1, @@ -382,9 +383,9 @@ internal sealed unsafe class Chat : IDisposable { case InputChannel.Linkshell1 or InputChannel.CrossLinkshell1 when rotate != RotateMode.None: { - // If we're activating for the first time, start at the beginning - // or end of the linkshell list depending on the rotate mode. - var currentIndex = rotate == RotateMode.Forward ? 7u : 0u; + var module = UIModule.Instance(); + + var currentIndex = channel is InputChannel.Linkshell1 ? (uint) module->LinkshellCycle : (uint) module->CrossWorldLinkshellCycle; if (currentTempChannel != null) { switch (channel) diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs index 817af5c..d3e0eda 100644 --- a/ChatTwo/Ui/ChatLogWindow.cs +++ b/ChatTwo/Ui/ChatLogWindow.cs @@ -631,6 +631,7 @@ public sealed class ChatLogWindow : Window if (activeTab.CurrentChannel.UseTempChannel) { activeTab.CurrentChannel.UseTempChannel = false; + activeTab.CurrentChannel.TempChannel = InputChannel.Invalid; SetChannel(activeTab.CurrentChannel.Channel); } } @@ -643,6 +644,7 @@ public sealed class ChatLogWindow : Window if (activeTab.CurrentChannel.UseTempChannel) { activeTab.CurrentChannel.UseTempChannel = false; + activeTab.CurrentChannel.TempChannel = InputChannel.Invalid; SetChannel(activeTab.CurrentChannel.Channel); } } @@ -667,6 +669,7 @@ public sealed class ChatLogWindow : Window if (Plugin.CurrentTab.CurrentChannel.UseTempChannel) { Plugin.CurrentTab.CurrentChannel.UseTempChannel = false; + activeTab.CurrentChannel.TempChannel = InputChannel.Invalid; SetChannel(Plugin.CurrentTab.CurrentChannel.Channel); } } @@ -900,6 +903,7 @@ public sealed class ChatLogWindow : Window activeTab.CurrentChannel.UseTempChannel = false; if (activeTab.CurrentChannel.TempChannel is InputChannel.Tell) activeTab.CurrentChannel.TellTarget = null; + activeTab.CurrentChannel.TempChannel = InputChannel.Invalid; Chat = string.Empty; return;