From e0a04c50316089b9a443355394c5babf39a1771d Mon Sep 17 00:00:00 2001 From: bexnoss <82064510+bexnoss@users.noreply.github.com> Date: Mon, 17 Jan 2022 12:27:48 +0100 Subject: [PATCH] Lock offline mode support behind insertion of at least one Minecraft account Co-Authored-By: Naomi Calabretta --- launcher/ui/pages/global/AccountListPage.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index b9aa7628..396d320f 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -156,6 +156,19 @@ void AccountListPage::on_actionAddMicrosoft_triggered() void AccountListPage::on_actionAddOffline_triggered() { + if (!m_accounts->anyAccountIsValid()) { + QMessageBox::warning( + this, + tr("Error"), + tr( + "You must add a Microsoft or Mojang account that owns Minecraft before you can add an offline account." + "

" + "If you have lost your account you can contact Microsoft for support." + ) + ); + return; + } + MinecraftAccountPtr account = OfflineLoginDialog::newAccount( this, tr("Please enter your desired username to add your offline account.")