mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
NetPlay: Refactor game boot code path to allow passing BootSessionData through it.
This commit is contained in:
@ -3,6 +3,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMenuBar>
|
||||
|
||||
@ -11,6 +15,7 @@
|
||||
#include "DolphinQt/GameList/GameListModel.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
|
||||
class BootSessionData;
|
||||
class ChunkedProgressDialog;
|
||||
class MD5Dialog;
|
||||
class PadMappingDialog;
|
||||
@ -30,14 +35,19 @@ class NetPlayDialog : public QDialog, public NetPlay::NetPlayUI
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NetPlayDialog(const GameListModel& game_list_model, QWidget* parent = nullptr);
|
||||
using StartGameCallback = std::function<void(const std::string& path,
|
||||
std::unique_ptr<BootSessionData> boot_session_data)>;
|
||||
|
||||
explicit NetPlayDialog(const GameListModel& game_list_model,
|
||||
StartGameCallback start_game_callback, QWidget* parent = nullptr);
|
||||
~NetPlayDialog();
|
||||
|
||||
void show(std::string nickname, bool use_traversal);
|
||||
void reject() override;
|
||||
|
||||
// NetPlayUI methods
|
||||
void BootGame(const std::string& filename) override;
|
||||
void BootGame(const std::string& filename,
|
||||
std::unique_ptr<BootSessionData> boot_session_data) override;
|
||||
void StopGame() override;
|
||||
bool IsHosting() const override;
|
||||
|
||||
@ -85,7 +95,6 @@ public:
|
||||
void HideChunkedProgressDialog() override;
|
||||
void SetChunkedProgress(int pid, u64 progress) override;
|
||||
signals:
|
||||
void Boot(const QString& filename);
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
@ -162,4 +171,6 @@ private:
|
||||
int m_player_count = 0;
|
||||
int m_old_player_count = 0;
|
||||
bool m_host_input_authority = false;
|
||||
|
||||
StartGameCallback m_start_game_callback;
|
||||
};
|
||||
|
Reference in New Issue
Block a user