summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
diff options
context:
space:
mode:
authorZexaron <20824154+Zexaron@users.noreply.github.com>2018-10-10 00:52:19 +0200
committerZexaron <20824154+Zexaron@users.noreply.github.com>2018-10-13 10:35:42 +0200
commit550aa93ed050af73016e77fd6176d98c91a5f2d4 (patch)
tree4c1efa10c75945549d0259edd0ecd8a0ee4a9904 /Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
parent480972612c17912b58d4a3163101baa9735efbf2 (diff)
NetPlay: Properly save Hosting GUI settings
Diffstat (limited to 'Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp')
-rw-r--r--Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp53
1 files changed, 52 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
index 5edd279c9d..dc6b847b61 100644
--- a/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
+++ b/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
@@ -71,6 +71,25 @@ NetPlayDialog::NetPlayDialog(QWidget* parent)
CreateChatLayout();
CreatePlayersLayout();
CreateMainLayout();
+
+ const int buffer_size = Config::Get(Config::NETPLAY_BUFFER_SIZE);
+ const bool write_save_sdcard_data = Config::Get(Config::NETPLAY_WRITE_SAVE_SDCARD_DATA);
+ const bool load_wii_save = Config::Get(Config::NETPLAY_LOAD_WII_SAVE);
+ const bool sync_saves = Config::Get(Config::NETPLAY_SYNC_SAVES);
+ const bool record_inputs = Config::Get(Config::NETPLAY_RECORD_INPUTS);
+ const bool reduce_polling_rate = Config::Get(Config::NETPLAY_REDUCE_POLLING_RATE);
+ const bool strict_settings_sync = Config::Get(Config::NETPLAY_STRICT_SETTINGS_SYNC);
+ const bool host_input_authority = Config::Get(Config::NETPLAY_HOST_INPUT_AUTHORITY);
+
+ m_buffer_size_box->setValue(buffer_size);
+ m_save_sd_box->setChecked(write_save_sdcard_data);
+ m_load_wii_box->setChecked(load_wii_save);
+ m_sync_save_data_box->setChecked(sync_saves);
+ m_record_input_box->setChecked(record_inputs);
+ m_reduce_polling_rate_box->setChecked(reduce_polling_rate);
+ m_strict_settings_sync_box->setChecked(strict_settings_sync);
+ m_host_input_authority_box->setChecked(host_input_authority);
+
ConnectWidgets();
auto& settings = Settings::Instance().GetQSettings();
@@ -306,6 +325,18 @@ void NetPlayDialog::ConnectWidgets()
DisplayMessage(tr("Stopped game"), "red");
}
});
+
+ // SaveSettings() - Save Hosting-Dialog Settings
+
+ connect(m_buffer_size_box, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
+ &NetPlayDialog::SaveSettings);
+ connect(m_save_sd_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
+ connect(m_load_wii_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
+ connect(m_sync_save_data_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
+ connect(m_record_input_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
+ connect(m_reduce_polling_rate_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
+ connect(m_strict_settings_sync_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
+ connect(m_host_input_authority_box, &QCheckBox::stateChanged, this, &NetPlayDialog::SaveSettings);
}
void NetPlayDialog::OnChat()
@@ -802,7 +833,7 @@ void NetPlayDialog::OnHostInputAuthorityChanged(bool enabled)
m_buffer_label->setHidden(!enable_buffer);
if (enabled)
- m_buffer_size_box->setValue(1);
+ m_buffer_size_box->setValue(Config::Get(Config::NETPLAY_CLIENT_BUFFER_SIZE));
}
});
DisplayMessage(enabled ? tr("Host input authority enabled") : tr("Host input authority disabled"),
@@ -910,6 +941,26 @@ std::shared_ptr<const UICommon::GameFile> NetPlayDialog::FindGameFile(const std:
return nullptr;
}
+void NetPlayDialog::SaveSettings()
+{
+ if (m_host_input_authority)
+ {
+ if (!IsHosting())
+ Config::SetBase(Config::NETPLAY_CLIENT_BUFFER_SIZE, m_buffer_size_box->value());
+ }
+ else
+ {
+ Config::SetBase(Config::NETPLAY_BUFFER_SIZE, m_buffer_size_box->value());
+ }
+ Config::SetBase(Config::NETPLAY_WRITE_SAVE_SDCARD_DATA, m_save_sd_box->isChecked());
+ Config::SetBase(Config::NETPLAY_LOAD_WII_SAVE, m_load_wii_box->isChecked());
+ Config::SetBase(Config::NETPLAY_SYNC_SAVES, m_sync_save_data_box->isChecked());
+ Config::SetBase(Config::NETPLAY_RECORD_INPUTS, m_record_input_box->isChecked());
+ Config::SetBase(Config::NETPLAY_REDUCE_POLLING_RATE, m_reduce_polling_rate_box->isChecked());
+ Config::SetBase(Config::NETPLAY_STRICT_SETTINGS_SYNC, m_strict_settings_sync_box->isChecked());
+ Config::SetBase(Config::NETPLAY_HOST_INPUT_AUTHORITY, m_host_input_authority_box->isChecked());
+}
+
void NetPlayDialog::ShowMD5Dialog(const std::string& file_identifier)
{
QueueOnObject(this, [this, file_identifier] {