From 037aa2192fa9b3de481e2acf125180bab16d6084 Mon Sep 17 00:00:00 2001 From: Techjar Date: Wed, 21 Nov 2018 00:15:44 -0500 Subject: NetPlay: Limit nickname length Ridiculously long nicknames cause UI silliness, so 30 characters seems like a reasonable limit, as it's the same as the forum. --- Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp') diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp index d35970288d..a9e31f5ed4 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp @@ -17,9 +17,11 @@ #include #include "Core/Config/NetplaySettings.h" +#include "Core/NetPlayProto.h" #include "DolphinQt/GameList/GameListModel.h" #include "DolphinQt/QtUtils/ModalMessageBox.h" +#include "DolphinQt/QtUtils/UTF8CodePointCountValidator.h" #include "DolphinQt/Settings.h" #include "UICommon/NetPlayIndex.h" @@ -87,6 +89,9 @@ void NetPlaySetupDialog::CreateMainLayout() m_reset_traversal_button = new QPushButton(tr("Reset Traversal Settings")); m_tab_widget = new QTabWidget; + m_nickname_edit->setValidator( + new UTF8CodePointCountValidator(NetPlay::MAX_NAME_LENGTH, m_nickname_edit)); + // Connection widget auto* connection_widget = new QWidget; auto* connection_layout = new QGridLayout; -- cgit v1.2.3