diff --git a/loader/resources/tag-featured.png b/loader/resources/tag-featured.png new file mode 100644 index 00000000..15cce42c Binary files /dev/null and b/loader/resources/tag-featured.png differ diff --git a/loader/resources/tag-paid.png b/loader/resources/tag-paid.png new file mode 100644 index 00000000..5e16735b Binary files /dev/null and b/loader/resources/tag-paid.png differ diff --git a/loader/src/ui/mods/GeodeStyle.cpp b/loader/src/ui/mods/GeodeStyle.cpp index 3dd71067..497002a5 100644 --- a/loader/src/ui/mods/GeodeStyle.cpp +++ b/loader/src/ui/mods/GeodeStyle.cpp @@ -20,7 +20,7 @@ $on_mod(Loaded) { ColorProvider::get()->define("mod-list-tab-deselected-bg"_spr, { 26, 24, 29, 255 }); ColorProvider::get()->define("mod-list-tab-selected-bg"_spr, { 168, 147, 185, 255 }); ColorProvider::get()->define("mod-list-tab-selected-bg-alt"_spr, { 147, 163, 185, 255 }); - ColorProvider::get()->define("mod-list-featured-color"_spr, { 255, 255, 120, 255 }); + ColorProvider::get()->define("mod-list-featured-color"_spr, { 240, 211, 42, 255 }); ColorProvider::get()->define("mod-list-enabled"_spr, { 120, 255, 100, 255 }); ColorProvider::get()->define("mod-list-disabled"_spr, { 255, 120, 100, 255 }); ColorProvider::get()->define("mod-list-recommended-bg"_spr, ccc3(25, 255, 167)); @@ -28,6 +28,7 @@ $on_mod(Loaded) { ColorProvider::get()->define("mod-list-recommended-by-2"_spr, ccc3(47, 255, 255)); ColorProvider::get()->define("mod-problems-item-bg"_spr, { 255, 255, 255, 15 }); ColorProvider::get()->define("mod-developer-item-bg"_spr, { 255, 255, 255, 15 }); + ColorProvider::get()->define("mod-list-paid-color"_spr, { 0, 255, 63, 255 }); // Only used when GD theme is active ColorProvider::get()->define("mods-layer-gd-bg"_spr, { 0, 102, 255, 255 }); diff --git a/loader/src/ui/mods/list/ModItem.cpp b/loader/src/ui/mods/list/ModItem.cpp index 589a0932..08a27fa0 100644 --- a/loader/src/ui/mods/list/ModItem.cpp +++ b/loader/src/ui/mods/list/ModItem.cpp @@ -53,6 +53,7 @@ bool ModItem::init(ModSource&& source) { m_titleLabel = CCLabelBMFont::create(m_source.getMetadata().getName().c_str(), "bigFont.fnt"); m_titleLabel->setID("title-label"); + m_titleLabel->setLayoutOptions(AxisLayoutOptions::create()->setScalePriority(1)); m_titleContainer->addChild(m_titleLabel); m_versionLabel = CCLabelBMFont::create("", "bigFont.fnt"); @@ -182,16 +183,14 @@ bool ModItem::init(ModSource&& source) { }, [this](server::ServerModMetadata const& metadata) { if (metadata.featured) { - auto starBG = CCScale9Sprite::createWithSpriteFrameName("GJ_colorBtn_001.png"); - starBG->setContentSize({ 50, 38 }); - starBG->setColor(to3B(ColorProvider::get()->color("mod-list-featured-color"_spr))); - starBG->setOpacity(45); - - auto star = CCSprite::createWithSpriteFrameName("GJ_starsIcon_001.png"); - starBG->addChildAtPosition(star, Anchor::Center); - starBG->setID("star-bg"); - - m_titleContainer->addChild(starBG); + auto star = CCSprite::createWithSpriteFrameName("tag-featured.png"_spr); + star->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(.1f, .8f)); + m_titleContainer->addChild(star); + } + if (metadata.tags.contains("paid")) { + auto paidModLabel = CCSprite::createWithSpriteFrameName("tag-paid.png"_spr); + paidModLabel->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(.1f, .8f)); + m_titleContainer->addChild(paidModLabel); } // Show mod download count here already so people can make informed decisions @@ -338,9 +337,15 @@ void ModItem::updateState() { [this](server::ServerModMetadata const& metadata) { m_bg->setColor(isGeodeTheme() ? ccWHITE : ccBLACK); m_bg->setOpacity(isGeodeTheme() ? 25 : 90); + + if (metadata.tags.contains("paid")) { + m_bg->setColor("mod-list-paid-color"_cc3b); + m_bg->setOpacity(55); + } + if (isGeodeTheme() && metadata.featured) { m_bg->setColor("mod-list-featured-color"_cc3b); - m_bg->setOpacity(40); + m_bg->setOpacity(65); } }, [this](ModSuggestion const& suggestion) { @@ -449,6 +454,22 @@ void ModItem::onCheckUpdates(typename server::ServerRequesttags.contains("paid") && !shownPaidNotif) { + shownPaidNotif = true; + return FLAlertLayer::create( + nullptr, + "Paid Content", + "This mod contains Paid Content. This means that some or all " + "features of the mod require money to use.\n\n" + "Geode does not handle any payments. The mod handles all transactions in their own way.\n\n" + "The paid content may not be available in your country.", + "OK", nullptr, 360 + )->show(); + } + // Always open up the popup for the installed mod page if that is possible ModPopup::create(m_source.convertForPopup())->show(); }