Compare commits

...

28 Commits

Author SHA1 Message Date
TheKodeToad
baa988ec81
Merge pull request #1739 from Trial97/mod_icons
fixed squished mod icons
2023-11-06 20:49:05 +00:00
Alexandru Ionut Tripon
8eac0d34bd
Merge pull request #1796 from Trial97/dep_global_toggle
Added Global Dependenicies toggle
2023-11-06 20:48:51 +00:00
Alexandru Ionut Tripon
0b1dcb3ea7
Merge pull request #1760 from LocalSpook/sorting
Localize sorting options for resource and shader packs
2023-11-06 20:45:52 +00:00
Alexandru Ionut Tripon
3d529b0c3e
Merge pull request #1772 from Trial97/pixmap_crash
Fix crash with mod icon caching
2023-11-06 20:44:27 +00:00
seth
a2ab4804dd
Merge pull request #1788 from Trial97/readme
Updated the readme
2023-11-06 16:41:56 +00:00
Trial97
ca226d2ab5
Fixed comparation warning
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-06 11:24:19 +02:00
Trial97
670e91cb60
Increased the step to around 10MB
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-06 11:08:18 +02:00
Trial97
cc291219f9
apply suggested changes
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-06 10:51:34 +02:00
Sefa Eyeoglu
0eda2447dc
Merge pull request #1797 from Trial97/fix_mangohub
[Linux] Fix loading MangoHud
2023-11-06 08:14:55 +01:00
Trial97
867e6223ce
Fixed mangoHub loading
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-05 23:48:26 +02:00
Alexandru Ionut Tripon
3e7f9083ca
Update launcher/ui/pages/instance/ModFolderPage.cpp
Co-authored-by: seth <getchoo@tuta.io>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
2023-11-05 23:41:54 +02:00
Alexandru Ionut Tripon
902e861fc6
Apply suggestions from code review
Co-authored-by: seth <getchoo@tuta.io>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
2023-11-05 23:41:26 +02:00
seth
36d2109a15
Merge pull request #1792 from PrismLauncher/renovate/korthout-backport-action-2.x
chore(deps): update korthout/backport-action action to v2.1.0
2023-11-05 21:29:01 +00:00
TheKodeToad
bd9d5e0990
Reword
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2023-11-05 20:31:48 +00:00
Trial97
9a8667e99c
Added Global Dependenicies toggle
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-05 22:22:49 +02:00
Trial97
710a48fcaf
changed type form double long to long long
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-05 21:41:10 +02:00
TheKodeToad
52807ab279
Merge pull request #1793 from Edgars-Cirulis/develop
visual: Fix spacing.
2023-11-05 17:50:01 +00:00
Edgars Cīrulis
d2a85cb580 visual: Fix spacing.
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-11-05 17:43:12 +00:00
Alexandru Ionut Tripon
d13db1109f
Merge pull request #1789 from acdpsn/develop
Fixed link to Fulmine's website
2023-11-05 16:15:36 +00:00
renovate[bot]
64bbcb2834
chore(deps): update korthout/backport-action action to v2.1.0 2023-11-05 15:57:06 +00:00
Alexandru Ionut Tripon
070d83d887
Merge pull request #1791 from PrismLauncher/update_flake_lock_action
chore(nix): update lockfile
2023-11-05 07:03:37 +00:00
Alex
cf4144cb50 Fixed link to Fulmine's website
Signed-off-by: Alex <akim8@emich.edu>
2023-11-05 00:46:05 -04:00
Trial97
0f95bf1e42
Updated readme
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-04 12:08:49 +02:00
Trial97
220a1de99a
made sure that we do not relay for undefined behavior
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-02 22:41:56 +02:00
Trial97
2349f29be0
jsut a overflow protection
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-11-02 01:26:04 +02:00
LocalSpook
54305397e4 Localize sorting options for resource and shader packs
Signed-off-by: LocalSpook <56512186+LocalSpook@users.noreply.github.com>
2023-10-28 12:50:40 -07:00
Trial97
5d926582c7
added Image column size hint
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-10-20 19:08:56 +03:00
Trial97
7b62d14683
fixed squished mod icons
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2023-10-20 17:15:12 +03:00
17 changed files with 93 additions and 40 deletions

View File

@ -24,7 +24,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Create backport PRs
uses: korthout/backport-action@v2.0.0
uses: korthout/backport-action@v2.1.0
with:
# Config README: https://github.com/korthout/backport-action#backport-action
pull_description: |-

View File

@ -18,11 +18,18 @@
</a>
- All downloads and instructions for Prism Launcher can be found on our [Website](https://prismlauncher.org/download).
- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions).
- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) tab (this also includes the pull requests status).
### Development Builds
There are development builds available [here](https://github.com/PrismLauncher/PrismLauncher/actions). These have debug information in the binaries, so their file sizes are relatively larger.
Please understand that these builds are not intended for most users. There may be bugs, and other instabilities. You have been warned.
There are development builds available through:
- [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) (includes builds from pull requests opened by contribuitors)
- [nightly.link](https://nightly.link/PrismLauncher/PrismLauncher/workflows/trigger_builds/develop) (this will always point only to the latest version of develop)
These have debug information in the binaries, so their file sizes are relatively larger.
Prebuilt Development builds are provided for **Linux**, **Windows** and **macOS**.

View File

@ -644,6 +644,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
// Minecraft mods
m_settings->registerSetting("ModMetadataDisabled", false);
m_settings->registerSetting("ModDependenciesDisabled", false);
// Minecraft offline player name
m_settings->registerSetting("LastOfflinePlayerName", "");

View File

@ -89,7 +89,7 @@ void LaunchController::decideAccount()
// Tell the user they need to log in at least one account in order to play.
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."
"account which owns Minecraft logged in. "
"Would you like to open the account manager to add an account now?"),
QMessageBox::Information, QMessageBox::Yes | QMessageBox::No)
->exec();

View File

@ -5,6 +5,7 @@
#include <QPixmapCache>
#include <QThread>
#include <QTime>
#include <limits>
#define GET_TYPE() \
Qt::ConnectionType type; \
@ -100,10 +101,14 @@ class PixmapCache final : public QObject {
*/
bool _markCacheMissByEviciton()
{
static constexpr uint maxInt = static_cast<uint>(std::numeric_limits<int>::max());
static constexpr uint step = 10240;
static constexpr int oneSecond = 1000;
auto now = QTime::currentTime();
if (!m_last_cache_miss_by_eviciton.isNull()) {
auto diff = m_last_cache_miss_by_eviciton.msecsTo(now);
if (diff < 1000) { // less than a second ago
if (diff < oneSecond) { // less than a second ago
++m_consecutive_fast_evicitons;
} else {
m_consecutive_fast_evicitons = 0;
@ -111,11 +116,17 @@ class PixmapCache final : public QObject {
}
m_last_cache_miss_by_eviciton = now;
if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) {
// double the cache size
auto newSize = _cacheLimit() * 2;
qDebug() << m_consecutive_fast_evicitons << "pixmap cache misses by eviction happened too fast, doubling cache size to"
<< newSize;
_setCacheLimit(newSize);
// increase the cache size
uint newSize = _cacheLimit() + step;
if (newSize >= maxInt) { // increase it until you overflow :D
newSize = maxInt;
qDebug() << m_consecutive_fast_evicitons
<< tr("pixmap cache misses by eviction happened too fast, doing nothing as the cache size reached it's limit");
} else {
qDebug() << m_consecutive_fast_evicitons
<< tr("pixmap cache misses by eviction happened too fast, increasing cache size to") << static_cast<int>(newSize);
}
_setCacheLimit(static_cast<int>(newSize));
m_consecutive_fast_evicitons = 0;
return true;
}

View File

@ -575,15 +575,20 @@ QProcessEnvironment MinecraftInstance::createLaunchEnvironment()
#ifdef Q_OS_LINUX
if (settings()->get("EnableMangoHud").toBool() && APPLICATION->capabilities() & Application::SupportsMangoHud) {
auto preloadList = env.value("LD_PRELOAD").split(QLatin1String(":"));
auto libPaths = env.value("LD_LIBRARY_PATH").split(QLatin1String(":"));
QStringList preloadList;
if (auto value = env.value("LD_PRELOAD"); !value.isEmpty())
preloadList = value.split(QLatin1String(":"));
QStringList libPaths;
if (auto value = env.value("LD_LIBRARY_PATH"); !value.isEmpty())
libPaths = value.split(QLatin1String(":"));
auto mangoHudLibString = MangoHud::getLibraryString();
if (!mangoHudLibString.isEmpty()) {
QFileInfo mangoHudLib(mangoHudLibString);
// dlsym variant is only needed for OpenGL and not included in the vulkan layer
preloadList << "libMangoHud_dlsym.so" << mangoHudLib.fileName();
preloadList << "libMangoHud_dlsym.so"
<< "libMangoHud_opengl.so" << mangoHudLib.fileName();
libPaths << mangoHudLib.absolutePath();
}

View File

@ -131,6 +131,11 @@ QVariant ModFolderModel::data(const QModelIndex& index, int role) const
}
return {};
}
case Qt::SizeHintRole:
if (column == ImageColumn) {
return QSize(32, 32);
}
return {};
case Qt::CheckStateRole:
switch (column) {
case ActiveColumn:

View File

@ -117,6 +117,11 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
}
return m_resources[row]->internal_id();
}
case Qt::SizeHintRole:
if (column == ImageColumn) {
return QSize(32, 32);
}
return {};
case Qt::CheckStateRole:
switch (column) {
case ActiveColumn:

View File

@ -104,6 +104,11 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const
}
return {};
}
case Qt::SizeHintRole:
if (column == ImageColumn) {
return QSize(32, 32);
}
return {};
case Qt::CheckStateRole:
if (column == ActiveColumn) {
return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;

View File

@ -208,17 +208,15 @@ Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std::
return netJob;
}
// https://docs.curseforge.com/?python#tocS_ModsSearchSortField
static QList<ResourceAPI::SortingMethod> s_sorts = { { 1, "Featured", QObject::tr("Sort by Featured") },
{ 2, "Popularity", QObject::tr("Sort by Popularity") },
{ 3, "LastUpdated", QObject::tr("Sort by Last Updated") },
{ 4, "Name", QObject::tr("Sort by Name") },
{ 5, "Author", QObject::tr("Sort by Author") },
{ 6, "TotalDownloads", QObject::tr("Sort by Downloads") },
{ 7, "Category", QObject::tr("Sort by Category") },
{ 8, "GameVersion", QObject::tr("Sort by Game Version") } };
QList<ResourceAPI::SortingMethod> FlameAPI::getSortingMethods() const
{
return s_sorts;
// https://docs.curseforge.com/?python#tocS_ModsSearchSortField
return { { 1, "Featured", QObject::tr("Sort by Featured") },
{ 2, "Popularity", QObject::tr("Sort by Popularity") },
{ 3, "LastUpdated", QObject::tr("Sort by Last Updated") },
{ 4, "Name", QObject::tr("Sort by Name") },
{ 5, "Author", QObject::tr("Sort by Author") },
{ 6, "TotalDownloads", QObject::tr("Sort by Downloads") },
{ 7, "Category", QObject::tr("Sort by Category") },
{ 8, "GameVersion", QObject::tr("Sort by Game Version") } };
}

View File

@ -111,14 +111,12 @@ Task::Ptr ModrinthAPI::getProjects(QStringList addonIds, std::shared_ptr<QByteAr
return netJob;
}
// https://docs.modrinth.com/api-spec/#tag/projects/operation/searchProjects
static QList<ResourceAPI::SortingMethod> s_sorts = { { 1, "relevance", QObject::tr("Sort by Relevance") },
{ 2, "downloads", QObject::tr("Sort by Downloads") },
{ 3, "follows", QObject::tr("Sort by Follows") },
{ 4, "newest", QObject::tr("Sort by Last Updated") },
{ 5, "updated", QObject::tr("Sort by Newest") } };
QList<ResourceAPI::SortingMethod> ModrinthAPI::getSortingMethods() const
{
return s_sorts;
// https://docs.modrinth.com/api-spec/#tag/projects/operation/searchProjects
return { { 1, "relevance", QObject::tr("Sort by Relevance") },
{ 2, "downloads", QObject::tr("Sort by Downloads") },
{ 3, "follows", QObject::tr("Sort by Follows") },
{ 4, "newest", QObject::tr("Sort by Last Updated") },
{ 5, "updated", QObject::tr("Sort by Newest") } };
}

View File

@ -101,7 +101,7 @@ QString getCreditsHtml()
stream << "<h3>" << QObject::tr("With thanks to", "About Credits") << "</h3>\n";
stream << QString("<p>Boba %1</p>\n").arg(getWebsite("https://bobaonline.neocities.org/"));
stream << QString("<p>Davi Rafael %1</p>\n").arg(getWebsite("https://auti.one/"));
stream << QString("<p>Fulmine %1</p>\n").arg(getWebsite("https://www.fulmine.xyz/"));
stream << QString("<p>Fulmine %1</p>\n").arg(getWebsite("https://fulmine.xyz/"));
stream << QString("<p>ely %1</p>\n").arg(getGitHub("elyrodso"));
stream << QString("<p>gon sawa %1</p>\n").arg(getGitHub("gonsawa"));
stream << QString("<p>Pankakes</p>\n");

View File

@ -186,7 +186,7 @@ void ModUpdateDialog::checkCandidates()
}
}
{ // dependencies
if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies
auto depTask = makeShared<GetModDependenciesTask>(this, m_instance, m_mod_model.get(), selectedVers);
connect(depTask.get(), &Task::failed, this,

View File

@ -270,13 +270,15 @@ QList<BasePage*> ModDownloadDialog::getPages()
GetModDependenciesTask::Ptr ModDownloadDialog::getModDependenciesTask()
{
if (auto model = dynamic_cast<ModFolderModel*>(getBaseModel().get()); model) {
QList<std::shared_ptr<GetModDependenciesTask::PackDependency>> selectedVers;
for (auto& selected : getTasks()) {
selectedVers.append(std::make_shared<GetModDependenciesTask::PackDependency>(selected->getPack(), selected->getVersion()));
}
if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies
if (auto model = dynamic_cast<ModFolderModel*>(getBaseModel().get()); model) {
QList<std::shared_ptr<GetModDependenciesTask::PackDependency>> selectedVers;
for (auto& selected : getTasks()) {
selectedVers.append(std::make_shared<GetModDependenciesTask::PackDependency>(selected->getPack(), selected->getVersion()));
}
return makeShared<GetModDependenciesTask>(this, m_instance, model, selectedVers);
return makeShared<GetModDependenciesTask>(this, m_instance, model, selectedVers);
}
}
return nullptr;
}

View File

@ -223,6 +223,7 @@ void LauncherPage::applySettings()
// Mods
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
}
void LauncherPage::loadSettings()
{
@ -278,6 +279,7 @@ void LauncherPage::loadSettings()
// Mods
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
}
void LauncherPage::refreshFontPreview()

View File

@ -186,6 +186,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dependenciesDisableBtn">
<property name="toolTip">
<string>Disable automatically checking and installation of mod dependencies.</string>
</property>
<property name="text">
<string>Do not install mod dependencies</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -214,6 +214,10 @@ void ModFolderPage::updateMods()
QMessageBox::critical(this, tr("Error"), tr("Please install a mod loader first!"));
return;
}
if (APPLICATION->settings()->get("ModMetadataDisabled").toBool()) {
QMessageBox::critical(this, tr("Error"), tr("Mod updates are unavailable when metadata is disabled!"));
return;
}
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
auto mods_list = m_model->selectedMods(selection);