Improve netplay setup dialog UX

* Focus "Hash Code" / "IP address" text box by default in "Connect"
* Focus game list in "Host" tab
* RETURN keypress now host/join depending on selected tab
* Remember last hosted game
* Remove PanicAlertT:
	* Simply log message to netplay window
	* Remove them when they are useless
* Show some netplay message in OSD
	* Chat messages
	* Pad buffer changes
	* Desync alerts
* Stop the game consistently when another player disconnects / crashes
* Prettify chat textbox
* Log netplay ping to OSD

Join scenario:
* Copy netplay code
* Open netplay
* Paste code
* Press enter

Host scenario:
* Open netplay
* Go to host tab
* Press enter
This commit is contained in:
Aestek 2016-02-02 16:35:27 +01:00
commit 6a0fc4c438
13 changed files with 428 additions and 178 deletions

View file

@ -32,6 +32,10 @@ public:
virtual void OnMsgChangeGame(const std::string& filename) = 0;
virtual void OnMsgStartGame() = 0;
virtual void OnMsgStopGame() = 0;
virtual void OnPadBufferChanged(u32 buffer) = 0;
virtual void OnDesync(u32 frame, const std::string& player) = 0;
virtual void OnConnectionLost() = 0;
virtual void OnTraversalError(int error) = 0;
virtual bool IsRecording() = 0;
virtual std::string FindGame(const std::string& game) = 0;
virtual void ShowMD5Dialog(const std::string& file_identifier) = 0;
@ -157,6 +161,8 @@ private:
void Disconnect();
bool Connect();
void ComputeMD5(const std::string& file_identifier);
void DisplayPlayersPing();
u32 GetPlayersMaxPing() const;
bool m_is_connected = false;
ConnectionState m_connection_state = ConnectionState::Failure;