Skip to content

Commit d77ac73

Browse files
authored
fix(catpacks): split catpacks (#112)
2 parents c497c4d + 1d4274e commit d77ac73

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

launcher/ui/themes/CatPack.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ class BasicCatPack : public CatPack {
6363
QString m_name;
6464
};
6565

66+
/// For cat packs that do not have holiday specializations
67+
class FreesmCatPack : public BasicCatPack {
68+
public:
69+
FreesmCatPack(QString id, QString name) : BasicCatPack(std::move(id), std::move(name)) {}
70+
explicit FreesmCatPack(QString id) : BasicCatPack(std::move(id)) {}
71+
72+
QString path() override { return QString(":/backgrounds/%1").arg(m_id); }
73+
};
74+
6675
class FileCatPack : public BasicCatPack {
6776
public:
6877
FileCatPack(QString id, QFileInfo& fileInfo) : BasicCatPack(id), m_path(fileInfo.absoluteFilePath()) {}

launcher/ui/themes/ThemeManager.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
#include "ui/themes/CatPack.h"
3131
#include "ui/themes/CustomTheme.h"
3232
#include "ui/themes/DarkTheme.h"
33+
#include "ui/themes/FreesmLightTheme.h"
3334
#include "ui/themes/FreesmTheme.h"
3435
#include "ui/themes/GruvboxTheme.h"
35-
#include "ui/themes/FreesmLightTheme.h"
3636
#include "ui/themes/SystemTheme.h"
3737

3838
#include "Application.h"
@@ -300,16 +300,21 @@ QString ThemeManager::addCatPack(std::unique_ptr<CatPack> catPack)
300300
void ThemeManager::initializeCatPacks()
301301
{
302302
QList<std::pair<QString, QString>> defaultCats{ { "kitteh", QObject::tr("Background Cat (from MultiMC)") },
303-
{ "typescript", QObject::tr("You should have used Typescript") },
304-
{ "miside-screenshot", QObject::tr("MiSide Screenshot") },
305-
{ "maxwell-christmas-gif", QObject::tr("Maxwell Christmas Cat") },
306-
{ "konata-gif", QObject::tr("Low-poly Konata") },
307303
{ "rory", QObject::tr("Rory ID 11 (drawn by Ashtaka)") },
308304
{ "rory-flat", QObject::tr("Rory ID 11 (flat edition, drawn by Ashtaka)") },
309305
{ "teawie", QObject::tr("Teawie (drawn by SympathyTea)") } };
310306
for (auto [id, name] : defaultCats) {
311307
addCatPack(std::unique_ptr<CatPack>(new BasicCatPack(id, name)));
312308
}
309+
310+
QList<std::pair<QString, QString>> freesmCats{ { "typescript", QObject::tr("You should have used Typescript") },
311+
{ "miside-screenshot", QObject::tr("MiSide Screenshot") },
312+
{ "maxwell-christmas-gif", QObject::tr("Maxwell Christmas Cat") },
313+
{ "konata-gif", QObject::tr("Low-poly Konata") } };
314+
for (const auto& [id, name] : freesmCats) {
315+
addCatPack(std::make_unique<FreesmCatPack>(id, name));
316+
}
317+
313318
if (!m_catPacksFolder.mkpath("."))
314319
themeWarningLog() << "Couldn't create catpacks folder";
315320
themeDebugLog() << "CatPacks Folder Path:" << m_catPacksFolder.absolutePath();

0 commit comments

Comments
 (0)