Added warning regarding maximized option

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-11-25 16:48:51 +02:00
parent 81c5866fa9
commit 0f42f3cc5c
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
6 changed files with 31 additions and 3 deletions

View File

@ -411,3 +411,8 @@ void BaseInstance::updateRuntimeContext()
{ {
// NOOP // NOOP
} }
bool BaseInstance::isLegacy()
{
return traits().contains("legacyLaunch") || traits().contains("alphaLaunch");
}

View File

@ -269,6 +269,8 @@ class BaseInstance : public QObject, public std::enable_shared_from_this<BaseIns
bool removeLinkedInstanceId(const QString& id); bool removeLinkedInstanceId(const QString& id);
bool isLinkedToInstanceId(const QString& id) const; bool isLinkedToInstanceId(const QString& id) const;
bool isLegacy();
protected: protected:
void changeStatus(Status newStatus); void changeStatus(Status newStatus);

View File

@ -533,7 +533,7 @@ QStringList MinecraftInstance::javaArguments()
QString MinecraftInstance::getLauncher() QString MinecraftInstance::getLauncher()
{ {
// use legacy launcher if the traits are set // use legacy launcher if the traits are set
if (traits().contains("legacyLaunch") || traits().contains("alphaLaunch")) if (isLegacy())
return "legacy"; return "legacy";
return "standard"; return "standard";
@ -757,7 +757,7 @@ QString MinecraftInstance::createLaunchScript(AuthSessionPtr session, MinecraftT
QString windowParams; QString windowParams;
if (settings()->get("LaunchMaximized").toBool()) { if (settings()->get("LaunchMaximized").toBool()) {
// FIXME doesn't support maximisation // FIXME doesn't support maximisation
if (getLauncher() == "standard") { if (!isLegacy()) {
auto screen = QGuiApplication::primaryScreen(); auto screen = QGuiApplication::primaryScreen();
auto screenGeometry = screen->availableSize(); auto screenGeometry = screen->availableSize();

View File

@ -55,6 +55,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="maximizedWarning">
<property name="toolTip">
<string>On newer versions the game only supports resolution. In order to simulate the maximized behaviour the current implementation approximates the maximum display size.</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#f5c211;&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot; color:#f5c211;&quot;&gt;: On the newer Minecraft versions the start maximized option is not fully supported.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item> <item>
<layout class="QGridLayout" name="gridLayoutWindowSize"> <layout class="QGridLayout" name="gridLayoutWindowSize">
<item row="1" column="0"> <item row="1" column="0">

View File

@ -323,6 +323,7 @@ void InstanceSettingsPage::loadSettings()
// Window Size // Window Size
ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool()); ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool());
ui->maximizedCheckBox->setChecked(m_settings->get("LaunchMaximized").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->windowWidthSpinBox->setValue(m_settings->get("MinecraftWinWidth").toInt());
ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt()); ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt());

View File

@ -36,7 +36,7 @@
<item> <item>
<widget class="QTabWidget" name="settingsTabs"> <widget class="QTabWidget" name="settingsTabs">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="minecraftPage"> <widget class="QWidget" name="minecraftPage">
<attribute name="title"> <attribute name="title">
@ -285,6 +285,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="maximizedWarning">
<property name="toolTip">
<string>The base game only supports resolution. In order to simulate the maximized behaviour the current implementation approximates the maximum display size..</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#f5c211;&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot; color:#f5c211;&quot;&gt;: The maximized option may not be fully supported for the current minecraft version.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item> <item>
<layout class="QGridLayout" name="gridLayoutWindowSize"> <layout class="QGridLayout" name="gridLayoutWindowSize">
<item row="1" column="0"> <item row="1" column="0">