NOISSUE save custom offline player name
This commit is contained in:
parent
e6564aa69f
commit
1811302deb
@ -696,6 +696,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
// Minecraft launch method
|
// Minecraft launch method
|
||||||
m_settings->registerSetting("MCLaunchMethod", "LauncherPart");
|
m_settings->registerSetting("MCLaunchMethod", "LauncherPart");
|
||||||
|
|
||||||
|
// Minecraft offline player name
|
||||||
|
m_settings->registerSetting("LastOfflinePlayerName", "");
|
||||||
|
|
||||||
// Wrapper command for launch
|
// Wrapper command for launch
|
||||||
m_settings->registerSetting("WrapperCommand", "");
|
m_settings->registerSetting("WrapperCommand", "");
|
||||||
|
|
||||||
|
@ -169,13 +169,14 @@ void LaunchController::login() {
|
|||||||
if(!m_session->wants_online) {
|
if(!m_session->wants_online) {
|
||||||
// we ask the user for a player name
|
// we ask the user for a player name
|
||||||
bool ok = false;
|
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(
|
QString name = QInputDialog::getText(
|
||||||
m_parentWidget,
|
m_parentWidget,
|
||||||
tr("Player name"),
|
tr("Player name"),
|
||||||
tr("Choose your offline mode player name."),
|
tr("Choose your offline mode player name."),
|
||||||
QLineEdit::Normal,
|
QLineEdit::Normal,
|
||||||
m_session->player_name,
|
usedname,
|
||||||
&ok
|
&ok
|
||||||
);
|
);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
@ -186,6 +187,7 @@ void LaunchController::login() {
|
|||||||
if (name.length())
|
if (name.length())
|
||||||
{
|
{
|
||||||
usedname = name;
|
usedname = name;
|
||||||
|
APPLICATION->settings()->set("LastOfflinePlayerName", usedname);
|
||||||
}
|
}
|
||||||
m_session->MakeOffline(usedname);
|
m_session->MakeOffline(usedname);
|
||||||
// offline flavored game from here :3
|
// offline flavored game from here :3
|
||||||
|
Loading…
Reference in New Issue
Block a user