chore: ensure the setting is saved as string
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
492769aea6
commit
ca54971499
5 changed files with 36 additions and 5 deletions
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "Application.h"
|
||||
#include "BuildConfig.h"
|
||||
#include "Json.h"
|
||||
#include "minecraft/PackProfile.h"
|
||||
#include "minecraft/WorldList.h"
|
||||
#include "minecraft/auth/AccountList.h"
|
||||
|
@ -242,7 +243,7 @@ void MinecraftSettingsWidget::loadSettings()
|
|||
m_ui->liteLoader->blockSignals(true);
|
||||
auto instLoaders = m_instance->getPackProfile()->getSupportedModLoaders().value();
|
||||
m_ui->loaderGroup->setChecked(settings->get("OverrideModDownloadLoaders").toBool());
|
||||
auto loaders = settings->get("ModDownloadLoaders").toStringList();
|
||||
auto loaders = Json::toStringList(settings->get("ModDownloadLoaders").toString());
|
||||
if (loaders.isEmpty()) {
|
||||
m_ui->neoForge->setChecked(instLoaders & ModPlatform::NeoForge);
|
||||
m_ui->forge->setChecked(instLoaders & ModPlatform::Forge);
|
||||
|
@ -499,5 +500,5 @@ void MinecraftSettingsWidget::selectedLoadersChanged()
|
|||
loaders << getModLoaderAsString(ModPlatform::Quilt);
|
||||
if (m_ui->liteLoader->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::LiteLoader);
|
||||
m_instance->settings()->set("ModDownloadLoaders", loaders);
|
||||
m_instance->settings()->set("ModDownloadLoaders", Json::fromStringList(loaders));
|
||||
}
|
|
@ -40,6 +40,7 @@
|
|||
#include <algorithm>
|
||||
#include <list>
|
||||
#include "BaseVersionList.h"
|
||||
#include "Json.h"
|
||||
#include "Version.h"
|
||||
#include "meta/Index.h"
|
||||
#include "modplatform/ModIndex.h"
|
||||
|
@ -220,7 +221,7 @@ void ModFilterWidget::prepareBasicFilter()
|
|||
m_filter->side = ""; // or "both"
|
||||
ModPlatform::ModLoaderTypes loaders;
|
||||
if (m_instance->settings()->get("OverrideModDownloadLoaders").toBool()) {
|
||||
for (auto loader : m_instance->settings()->get("ModDownloadLoaders").toStringList()) {
|
||||
for (auto loader : Json::toStringList(m_instance->settings()->get("ModDownloadLoaders").toString())) {
|
||||
loaders |= ModPlatform::getModLoaderFromString(loader);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue