From 0f42f3cc5ca269b4e4002d74299e9aa9713a08c5 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sat, 25 Nov 2023 16:48:51 +0200 Subject: [PATCH] Added warning regarding maximized option Signed-off-by: Trial97 --- launcher/BaseInstance.cpp | 5 +++++ launcher/BaseInstance.h | 2 ++ launcher/minecraft/MinecraftInstance.cpp | 4 ++-- launcher/ui/pages/global/MinecraftPage.ui | 10 ++++++++++ launcher/ui/pages/instance/InstanceSettingsPage.cpp | 1 + launcher/ui/pages/instance/InstanceSettingsPage.ui | 12 +++++++++++- 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/launcher/BaseInstance.cpp b/launcher/BaseInstance.cpp index 69cf95e3c..ccfd0b847 100644 --- a/launcher/BaseInstance.cpp +++ b/launcher/BaseInstance.cpp @@ -411,3 +411,8 @@ void BaseInstance::updateRuntimeContext() { // NOOP } + +bool BaseInstance::isLegacy() +{ + return traits().contains("legacyLaunch") || traits().contains("alphaLaunch"); +} diff --git a/launcher/BaseInstance.h b/launcher/BaseInstance.h index 2be28d1ec..9827a08b4 100644 --- a/launcher/BaseInstance.h +++ b/launcher/BaseInstance.h @@ -269,6 +269,8 @@ class BaseInstance : public QObject, public std::enable_shared_from_thisget("LaunchMaximized").toBool()) { // FIXME doesn't support maximisation - if (getLauncher() == "standard") { + if (!isLegacy()) { auto screen = QGuiApplication::primaryScreen(); auto screenGeometry = screen->availableSize(); diff --git a/launcher/ui/pages/global/MinecraftPage.ui b/launcher/ui/pages/global/MinecraftPage.ui index 7d2741250..3a28c92c7 100644 --- a/launcher/ui/pages/global/MinecraftPage.ui +++ b/launcher/ui/pages/global/MinecraftPage.ui @@ -55,6 +55,16 @@ + + + + On newer versions the game only supports resolution. In order to simulate the maximized behaviour the current implementation approximates the maximum display size. + + + <html><head/><body><p><span style=" font-weight:600; color:#f5c211;">Warning</span><span style=" color:#f5c211;">: On the newer Minecraft versions the start maximized option is not fully supported.</span></p></body></html> + + + diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.cpp b/launcher/ui/pages/instance/InstanceSettingsPage.cpp index cf8d86cd4..1a5be050f 100644 --- a/launcher/ui/pages/instance/InstanceSettingsPage.cpp +++ b/launcher/ui/pages/instance/InstanceSettingsPage.cpp @@ -323,6 +323,7 @@ void InstanceSettingsPage::loadSettings() // Window Size ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool()); ui->maximizedCheckBox->setChecked(m_settings->get("LaunchMaximized").toBool()); + ui->maximizedWarning->setVisible(m_settings->get("LaunchMaximized").toBool() && !m_instance->isLegacy()); ui->windowWidthSpinBox->setValue(m_settings->get("MinecraftWinWidth").toInt()); ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt()); diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.ui b/launcher/ui/pages/instance/InstanceSettingsPage.ui index 4905eae87..e5ef98b00 100644 --- a/launcher/ui/pages/instance/InstanceSettingsPage.ui +++ b/launcher/ui/pages/instance/InstanceSettingsPage.ui @@ -36,7 +36,7 @@ - 0 + 1 @@ -285,6 +285,16 @@ + + + + The base game only supports resolution. In order to simulate the maximized behaviour the current implementation approximates the maximum display size.. + + + <html><head/><body><p><span style=" font-weight:600; color:#f5c211;">Warning</span><span style=" color:#f5c211;">: The maximized option may not be fully supported for the current minecraft version.</span></p></body></html> + + +