Only allow chat shortcuts when chat is open

This commit is contained in:
D1GQ committed 2026-07-25 01:02:14 -05:00
1 parent aa8ed57e21
commit 6aea28e9e9
1 file changed
+20 -16
+20 -16
View File
@@ -169,25 +169,29 @@ internal static class ChatPatch
__instance.freeChatField.textArea.compoText.Color(Color.black);
__instance.freeChatField.textArea.outputText.color = Color.black;
}
// Ctrl+x to cut text to clipboard
if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) && Input.GetKeyDown(KeyCode.X))
if (__instance.IsOpenOrOpening)
{
ClipboardHelper.PutClipboardString(__instance.freeChatField.textArea.text);
__instance.freeChatField.textArea.SetText("");
}
// Up arrow for chat history navigation
if (Input.GetKeyDown(KeyCode.UpArrow) && ChatHistory.Any())
{
CurrentHistorySelection = Mathf.Clamp(--CurrentHistorySelection, 0, ChatHistory.Count - 1);
__instance.freeChatField.textArea.SetText(ChatHistory[CurrentHistorySelection]);
}
// Down arrow for chat history navigation
if (Input.GetKeyDown(KeyCode.DownArrow) && ChatHistory.Any())
{
CurrentHistorySelection++;
if (CurrentHistorySelection < ChatHistory.Count)
if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) && Input.GetKeyDown(KeyCode.X))
{
ClipboardHelper.PutClipboardString(__instance.freeChatField.textArea.text);
__instance.freeChatField.textArea.SetText("");
}
// Up arrow for chat history navigation
if (Input.GetKeyDown(KeyCode.UpArrow) && ChatHistory.Any())
{
CurrentHistorySelection = Mathf.Clamp(--CurrentHistorySelection, 0, ChatHistory.Count - 1);
__instance.freeChatField.textArea.SetText(ChatHistory[CurrentHistorySelection]);
else __instance.freeChatField.textArea.SetText("");
}
// Down arrow for chat history navigation
if (Input.GetKeyDown(KeyCode.DownArrow) && ChatHistory.Any())
{
CurrentHistorySelection++;
if (CurrentHistorySelection < ChatHistory.Count)
__instance.freeChatField.textArea.SetText(ChatHistory[CurrentHistorySelection]);
else __instance.freeChatField.textArea.SetText("");
}
}
}
// Log chat messages to console