NetPlayChatUI: Add activate chat hotkey

This commit is contained in:
spycrab
2019-03-24 15:57:36 +01:00
parent eaa1874875
commit f7897778ff
8 changed files with 33 additions and 2 deletions

View File

@ -196,6 +196,10 @@ void HotkeyScheduler::Run()
auto& settings = Settings::Instance();
// Toggle Chat
if (IsHotkey(HK_ACTIVATE_CHAT))
emit ActivateChat();
// Recording
if (IsHotkey(HK_START_RECORDING))
emit StartRecording();

View File

@ -26,6 +26,7 @@ signals:
void ChangeDisc();
void ExitHotkey();
void ActivateChat();
void FullScreenHotkey();
void StopHotkey();
void ResetHotkey();

View File

@ -106,6 +106,7 @@
#include "UICommon/UICommon.h"
#include "VideoCommon/NetPlayChatUI.h"
#include "VideoCommon/VideoConfig.h"
#if defined(HAVE_XRANDR) && HAVE_XRANDR
@ -482,6 +483,7 @@ void MainWindow::ConnectHotkeys()
connect(m_hotkey_scheduler, &HotkeyScheduler::EjectDisc, this, &MainWindow::EjectDisc);
connect(m_hotkey_scheduler, &HotkeyScheduler::ExitHotkey, this, &MainWindow::close);
connect(m_hotkey_scheduler, &HotkeyScheduler::TogglePauseHotkey, this, &MainWindow::TogglePause);
connect(m_hotkey_scheduler, &HotkeyScheduler::ActivateChat, this, &MainWindow::OnActivateChat);
connect(m_hotkey_scheduler, &HotkeyScheduler::RefreshGameListHotkey, this,
&MainWindow::RefreshGameList);
connect(m_hotkey_scheduler, &HotkeyScheduler::StopHotkey, this, &MainWindow::RequestStop);
@ -1587,6 +1589,12 @@ void MainWindow::OnExportRecording()
Core::SetState(Core::State::Running);
}
void MainWindow::OnActivateChat()
{
if (g_netplay_chat_ui)
g_netplay_chat_ui->Activate();
}
void MainWindow::ShowTASInput()
{
for (int i = 0; i < num_gc_controllers; i++)

View File

@ -168,6 +168,7 @@ private:
void OnStartRecording();
void OnStopRecording();
void OnExportRecording();
void OnActivateChat();
void ShowTASInput();
void ChangeDisc();