mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
Only allow chat shortcuts when chat is open
This commit is contained in:
1 parent
aa8ed57e21
commit
6aea28e9e9
1 file changed
+20
-16
@@ -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
|
||||
|
||||
Reference in new issue
Block a user