Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into refresh_cats
This commit is contained in:
@@ -666,6 +666,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
|
||||
// The cat
|
||||
m_settings->registerSetting("TheCat", false);
|
||||
m_settings->registerSetting("CatOpacity", 100);
|
||||
|
||||
m_settings->registerSetting("StatusBarVisible", true);
|
||||
|
||||
|
||||
@@ -157,20 +157,6 @@ void MojangVersionFormat::readVersionProperties(const QJsonObject& in, VersionFi
|
||||
Bits::readString(in, "id", out->minecraftVersion);
|
||||
Bits::readString(in, "mainClass", out->mainClass);
|
||||
Bits::readString(in, "minecraftArguments", out->minecraftArguments);
|
||||
if (out->minecraftArguments.isEmpty()) {
|
||||
QString processArguments;
|
||||
Bits::readString(in, "processArguments", processArguments);
|
||||
QString toCompare = processArguments.toLower();
|
||||
if (toCompare == "legacy") {
|
||||
out->minecraftArguments = " ${auth_player_name} ${auth_session}";
|
||||
} else if (toCompare == "username_session") {
|
||||
out->minecraftArguments = "--username ${auth_player_name} --session ${auth_session}";
|
||||
} else if (toCompare == "username_session_version") {
|
||||
out->minecraftArguments = "--username ${auth_player_name} --session ${auth_session} --version ${profile_name}";
|
||||
} else if (!toCompare.isEmpty()) {
|
||||
out->addProblem(ProblemSeverity::Error, QObject::tr("processArguments is set to unknown value '%1'").arg(processArguments));
|
||||
}
|
||||
}
|
||||
Bits::readString(in, "type", out->type);
|
||||
|
||||
Bits::readString(in, "assets", out->assets);
|
||||
|
||||
@@ -458,6 +458,7 @@ void InstanceView::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
QPainter painter(this->viewport());
|
||||
|
||||
if (m_catVisible) {
|
||||
painter.setOpacity(APPLICATION->settings()->get("CatOpacity").toFloat() / 100);
|
||||
int widWidth = this->viewport()->width();
|
||||
int widHeight = this->viewport()->height();
|
||||
if (m_catPixmap.width() < widWidth)
|
||||
@@ -468,6 +469,7 @@ void InstanceView::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
QRect rectOfPixmap = pixmap.rect();
|
||||
rectOfPixmap.moveBottomRight(this->viewport()->rect().bottomRight());
|
||||
painter.drawPixmap(rectOfPixmap.topLeft(), pixmap);
|
||||
painter.setOpacity(1.0);
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
@@ -221,6 +221,9 @@ void LauncherPage::applySettings()
|
||||
break;
|
||||
}
|
||||
|
||||
// Cat
|
||||
s->set("CatOpacity", ui->catOpacitySpinBox->value());
|
||||
|
||||
// Mods
|
||||
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
||||
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
||||
@@ -276,6 +279,9 @@ void LauncherPage::loadSettings()
|
||||
ui->sortByNameBtn->setChecked(true);
|
||||
}
|
||||
|
||||
// Cat
|
||||
ui->catOpacitySpinBox->setValue(s->get("CatOpacity").toInt());
|
||||
|
||||
// Mods
|
||||
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
|
||||
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="dependenciesDisableBtn">
|
||||
<property name="toolTip">
|
||||
<string>Disable the automatic detection, installation, and updating of mod dependencies.</string>
|
||||
@@ -300,6 +300,54 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="catBox">
|
||||
<property name="title">
|
||||
<string>Cat</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="catOpacityLabel">
|
||||
<property name="toolTip">
|
||||
<string>Set the cat's opacity. 0% is fully transparent and 100% is fully opaque.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Opacity</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QSpinBox" name="catOpacitySpinBox">
|
||||
<property name="specialValueText">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="toolsBox">
|
||||
<property name="sizePolicy">
|
||||
|
||||
@@ -346,7 +346,7 @@ void InstanceSettingsPage::loadSettings()
|
||||
#ifdef Q_OS_LINUX
|
||||
ui->lineEditOpenALPath->setPlaceholderText(APPLICATION->m_detectedOpenALPath);
|
||||
#else
|
||||
ui->lineEditGLFWPath->setPlaceholderText(tr("Path to %1 library file").arg(BuildConfig.OPENAL_LIBRARY_NAME));
|
||||
ui->lineEditOpenALPath->setPlaceholderText(tr("Path to %1 library file").arg(BuildConfig.OPENAL_LIBRARY_NAME));
|
||||
#endif
|
||||
|
||||
// Performance
|
||||
|
||||
Reference in New Issue
Block a user