summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/NetPlayChatUI.cpp
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2019-03-26 22:35:26 +0100
committerGitHub <noreply@github.com>2019-03-26 22:35:26 +0100
commite222b9195380a6967a101806bbac451a6cb2454f (patch)
tree1b1bc761883448d7d120e72bda7fc8594ea001b8 /Source/Core/VideoCommon/NetPlayChatUI.cpp
parente636b3e7120a9f6e8899425ec668e1f1f8e40b17 (diff)
parentf7897778ff3fc752e217de27d6d8fa76984beb3e (diff)
Merge pull request #7929 from spycrab/np_chat_toggle
NetPlayChatUI: Add activate chat hotkey
Diffstat (limited to 'Source/Core/VideoCommon/NetPlayChatUI.cpp')
-rw-r--r--Source/Core/VideoCommon/NetPlayChatUI.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/NetPlayChatUI.cpp b/Source/Core/VideoCommon/NetPlayChatUI.cpp
index 2388d94b91..7587229ee0 100644
--- a/Source/Core/VideoCommon/NetPlayChatUI.cpp
+++ b/Source/Core/VideoCommon/NetPlayChatUI.cpp
@@ -60,7 +60,12 @@ void NetPlayChatUI::Display()
ImGuiInputTextFlags_EnterReturnsTrue))
{
SendMessage();
+ }
+
+ if (m_activate)
+ {
ImGui::SetKeyboardFocusHere(-1);
+ m_activate = false;
}
ImGui::PopItemWidth();
@@ -97,3 +102,11 @@ void NetPlayChatUI::SendMessage()
m_message_buf[0] = '\0';
}
}
+
+void NetPlayChatUI::Activate()
+{
+ if (ImGui::IsItemFocused())
+ ImGui::SetWindowFocus(NULL);
+ else
+ m_activate = true;
+}