From 2af0e325f5b583653148e8a19478444dc54f42a7 Mon Sep 17 00:00:00 2001 From: itsMeRaj69 Date: Sun, 13 Jul 2025 16:42:49 +0530 Subject: [PATCH] Fixed more logic which breaks OM (Offline Mode) --- launcher/LaunchController.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 26f539e15..25697a7e9 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -87,25 +87,25 @@ void LaunchController::decideAccount() // Find an account to use. auto accounts = APPLICATION->accounts(); - if (accounts->count() <= 0 || !accounts->anyAccountIsValid()) { - // Tell the user they need to log in at least one account in order to play. + + // If no accounts exist, show prompt to add one + if (accounts->count() <= 0) { auto reply = CustomMessageBox::selectable(m_parentWidget, tr("No Accounts"), - tr("In order to play Minecraft, you must have at least one Microsoft " - "account which owns Minecraft logged in. " - "Would you like to open the account manager to add an account now?"), + tr("No accounts found. Would you like to open the account manager to add one now?"), QMessageBox::Information, QMessageBox::Yes | QMessageBox::No) ->exec(); if (reply == QMessageBox::Yes) { - // Open the account manager. APPLICATION->ShowGlobalSettings(m_parentWidget, "accounts"); - } else if (reply == QMessageBox::No) { - // Do not open "profile select" dialog. - return; } + + return; } - // Select the account to use. If the instance has a specific account set, that will be used. Otherwise, the default account will be used + // Skipping Microsoft account validity check to allow offline/local use + // Removed: anyAccountIsValid() check +} +// Select the account to use. If the instance has a specific account set, that will be used. Otherwise, the default account will be used auto instanceAccountId = m_instance->settings()->get("InstanceAccountId").toString(); auto instanceAccountIndex = accounts->findAccountByProfileId(instanceAccountId); if (instanceAccountIndex == -1 || instanceAccountId.isEmpty()) {