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
parent aa34e5e20e
commit 6a0fc4c438
13 changed files with 428 additions and 178 deletions

View File

@ -23,12 +23,22 @@ public:
~NetPlaySetupFrame();
private:
static constexpr int CONNECT_TAB = 0;
static constexpr int HOST_TAB = 1;
static constexpr int DIRECT_CHOICE = 0;
static constexpr int TRAVERSAL_CHOICE = 1;
void OnJoin(wxCommandEvent& event);
void OnHost(wxCommandEvent& event);
void DoJoin();
void DoHost();
void OnQuit(wxCommandEvent& event);
void OnChoice(wxCommandEvent& event);
void OnDirectTraversalChoice(wxCommandEvent& event);
void OnResetTraversal(wxCommandEvent& event);
void OnTraversalListenPortChanged(wxCommandEvent& event);
void OnKeyDown(wxKeyEvent& event);
void DispatchFocus();
void MakeNetPlayDiag(int port, const std::string& game, bool is_hosting);
@ -39,11 +49,13 @@ private:
wxTextCtrl* m_host_port_text;
wxTextCtrl* m_connect_port_text;
wxTextCtrl* m_connect_ip_text;
wxTextCtrl* m_connect_hashcode_text;
wxChoice* m_direct_traversal;
wxStaticText* m_traversal_lbl;
wxButton* m_trav_reset_btn;
wxCheckBox* m_traversal_listen_port_enabled;
wxSpinCtrl* m_traversal_listen_port;
wxNotebook* m_notebook;
wxListBox* m_game_lbox;
#ifdef USE_UPNP