summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-08-04 00:33:12 +0200
committerGitHub <noreply@github.com>2016-08-04 00:33:12 +0200
commitf30cc4f0224a261f53a83b4084da830bc6bc0408 (patch)
tree97bd0235e215db473a11cae107a3f625c033b930 /Source/Core
parent3683840602cc178ace2d3afe0af7f5dfd4bb4eb8 (diff)
parent7e535b28554145c9497853c0255d7db088ceb126 (diff)
Merge pull request #4083 from clinchergt/remember-netplaywindow-size
Make Dolphin remember the NetPlay window size/position
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp18
-rw-r--r--Source/Core/DolphinWX/NetPlay/NetWindow.cpp15
2 files changed, 30 insertions, 3 deletions
diff --git a/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp b/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
index a1126429d6..c20ebdde92 100644
--- a/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
+++ b/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
@@ -324,6 +324,24 @@ void NetPlaySetupFrame::MakeNetPlayDiag(int port, const std::string& game, bool
trav, centralServer, (u16)centralPort);
if (netplay_client->IsConnected())
{
+ int winPosX, winPosY, winWidth, winHeight;
+
+ // Remember the window size and position for NetWindow
+ netplay_section.Get("NetWindowPosX", &winPosX, -1);
+ netplay_section.Get("NetWindowPosY", &winPosY, -1);
+ netplay_section.Get("NetWindowWidth", &winWidth, 768);
+ netplay_section.Get("NetWindowHeight", &winHeight, 768 - 128);
+
+ if (winPosX == -1 || winPosY == -1)
+ {
+ npd->SetSize(768, 768 - 128);
+ npd->Center();
+ }
+ else
+ {
+ npd->SetSize(winPosX, winPosY, winWidth, winHeight);
+ }
+
npd->Show();
Destroy();
}
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;