From 7e535b28554145c9497853c0255d7db088ceb126 Mon Sep 17 00:00:00 2001 From: JDV Date: Wed, 3 Aug 2016 14:20:38 -0600 Subject: Make Dolphin remember the NetPlay window size/position The default size might be too big for some screens. This allows the user to modify the window as they see fit and has Dolphin remember those settings. People who are happy with the default size and position will not be affected --- Source/Core/DolphinWX/NetPlay/NetWindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/NetPlay/NetWindow.cpp') diff --git a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp index 200597b9ca..7013beef06 100644 --- a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp +++ b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp @@ -243,13 +243,22 @@ NetPlayDialog::NetPlayDialog(wxWindow* const parent, const CGameListCtrl* const panel->SetSizerAndFit(main_szr); main_szr->SetSizeHints(this); - SetSize(768, 768 - 128); - - Center(); } NetPlayDialog::~NetPlayDialog() { + IniFile inifile; + const std::string dolphin_ini = File::GetUserPath(F_DOLPHINCONFIG_IDX); + inifile.Load(dolphin_ini); + IniFile::Section& netplay_config = *inifile.GetOrCreateSection("NetPlay"); + + netplay_config.Set("NetWindowPosX", GetPosition().x); + netplay_config.Set("NetWindowPosY", GetPosition().y); + netplay_config.Set("NetWindowWidth", GetSize().GetWidth()); + netplay_config.Set("NetWindowHeight", GetSize().GetHeight()); + + inifile.Save(dolphin_ini); + if (netplay_client) { delete netplay_client; -- cgit v1.2.3