mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-03 08:07:45 +00:00
NetPlayChatUI: Add activate chat hotkey
This commit is contained in:
parent
eaa1874875
commit
f7897778ff
8 changed files with 33 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -22,10 +22,12 @@ public:
|
|||
void Display();
|
||||
void AppendChat(const std::string& message, Color color);
|
||||
void SendMessage();
|
||||
void Activate();
|
||||
|
||||
private:
|
||||
char m_message_buf[256] = {};
|
||||
bool m_scroll_to_bottom = false;
|
||||
bool m_activate = false;
|
||||
bool m_is_scrolled_to_bottom = true;
|
||||
|
||||
std::deque<std::pair<std::string, Color>> m_messages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue