NetPlay: Refactor game boot code path to allow passing BootSessionData through it.

This commit is contained in:
Admiral H. Curtiss
2021-11-20 19:59:14 +01:00
parent 83ad84061e
commit 7b776f3769
5 changed files with 33 additions and 12 deletions

View File

@ -31,6 +31,7 @@
#include "Common/Logging/Log.h"
#include "Common/TraversalClient.h"
#include "Core/Boot/Boot.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/NetplaySettings.h"
@ -62,8 +63,10 @@
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoConfig.h"
NetPlayDialog::NetPlayDialog(const GameListModel& game_list_model, QWidget* parent)
: QDialog(parent), m_game_list_model(game_list_model)
NetPlayDialog::NetPlayDialog(const GameListModel& game_list_model,
StartGameCallback start_game_callback, QWidget* parent)
: QDialog(parent), m_game_list_model(game_list_model),
m_start_game_callback(std::move(start_game_callback))
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@ -682,10 +685,11 @@ void NetPlayDialog::UpdateGUI()
// NetPlayUI methods
void NetPlayDialog::BootGame(const std::string& filename)
void NetPlayDialog::BootGame(const std::string& filename,
std::unique_ptr<BootSessionData> boot_session_data)
{
m_got_stop_request = false;
emit Boot(QString::fromStdString(filename));
m_start_game_callback(filename, std::move(boot_session_data));
}
void NetPlayDialog::StopGame()