diff options
author | Vladislav Laetansky <vlaetansky@gmail.com> | 2022-03-28 15:40:34 +0300 |
---|---|---|
committer | DioEgizio <83089242+DioEgizio@users.noreply.github.com> | 2022-04-07 18:29:15 +0200 |
commit | 1811302debffb18e923871752750573092d4ed22 (patch) | |
tree | 1659243783fdc6f9b432bf51848d27b5a973909a /launcher/LaunchController.cpp | |
parent | e6564aa69fe60e41a77fc10a7c98484d5c0cd488 (diff) | |
download | PrismLauncher-1811302debffb18e923871752750573092d4ed22.tar.gz PrismLauncher-1811302debffb18e923871752750573092d4ed22.tar.bz2 PrismLauncher-1811302debffb18e923871752750573092d4ed22.zip |
NOISSUE save custom offline player name
Diffstat (limited to 'launcher/LaunchController.cpp')
-rw-r--r-- | launcher/LaunchController.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index cc1228f5..4cb62e69 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -169,13 +169,14 @@ void LaunchController::login() { if(!m_session->wants_online) { // we ask the user for a player name bool ok = false; - QString usedname = m_session->player_name; + QString lastOfflinePlayerName = APPLICATION->settings()->get("LastOfflinePlayerName").toString(); + QString usedname = lastOfflinePlayerName.isEmpty() ? m_session->player_name : lastOfflinePlayerName; QString name = QInputDialog::getText( m_parentWidget, tr("Player name"), tr("Choose your offline mode player name."), QLineEdit::Normal, - m_session->player_name, + usedname, &ok ); if (!ok) @@ -186,6 +187,7 @@ void LaunchController::login() { if (name.length()) { usedname = name; + APPLICATION->settings()->set("LastOfflinePlayerName", usedname); } m_session->MakeOffline(usedname); // offline flavored game from here :3 |