fixed icon importing
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -43,5 +43,5 @@ void ATLauncher::loadIndexedPack(ATLauncher::IndexedPack& m, QJsonObject& obj)
|
||||
m.system = Json::ensureBoolean(obj, QString("system"), false);
|
||||
m.description = Json::ensureString(obj, "description", "");
|
||||
|
||||
m.safeName = Json::requireString(obj, "name").replace(QRegularExpression("[^A-Za-z0-9]"), "");
|
||||
m.safeName = "atl_" + Json::requireString(obj, "name").replace(QRegularExpression("[^A-Za-z0-9]"), "").toLower() + ".png";
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "FlamePackIndex.h"
|
||||
#include <QFileInfo>
|
||||
#include <QUrl>
|
||||
|
||||
#include "Json.h"
|
||||
|
||||
@ -9,8 +11,8 @@ void Flame::loadIndexedPack(Flame::IndexedPack& pack, QJsonObject& obj)
|
||||
pack.description = Json::ensureString(obj, "summary", "");
|
||||
|
||||
auto logo = Json::requireObject(obj, "logo");
|
||||
pack.logoName = Json::requireString(logo, "title");
|
||||
pack.logoUrl = Json::requireString(logo, "thumbnailUrl");
|
||||
pack.logoName = Json::requireString(obj, "slug") + "." + QFileInfo(QUrl(pack.logoUrl).fileName()).suffix();
|
||||
|
||||
auto authors = Json::requireArray(obj, "authors");
|
||||
for (auto authorIter : authors) {
|
||||
|
@ -35,6 +35,7 @@
|
||||
*/
|
||||
|
||||
#include "ModrinthPackManifest.h"
|
||||
#include <QFileInfo>
|
||||
#include "Json.h"
|
||||
|
||||
#include "modplatform/modrinth/ModrinthAPI.h"
|
||||
@ -56,8 +57,8 @@ void loadIndexedPack(Modpack& pack, QJsonObject& obj)
|
||||
pack.description = Json::ensureString(obj, "description");
|
||||
auto temp_author_name = Json::ensureString(obj, "author");
|
||||
pack.author = std::make_tuple(temp_author_name, api.getAuthorURL(temp_author_name));
|
||||
pack.iconName = QString("modrinth_%1").arg(Json::ensureString(obj, "slug"));
|
||||
pack.iconUrl = Json::ensureString(obj, "icon_url");
|
||||
pack.iconName = QString("modrinth_%1.%2").arg(Json::ensureString(obj, "slug"), QFileInfo(pack.iconUrl.fileName()).suffix());
|
||||
}
|
||||
|
||||
void loadIndexedInfo(Modpack& pack, QJsonObject& obj)
|
||||
|
Reference in New Issue
Block a user