diff --git a/changelog.md b/changelog.md index 388c366..4f59d27 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +# v2.1.0 + + * Added **ItemInfoPopup**, **ShardsPage**, **CommunityCreditsPage**, **DemonFilterSelectLayer**, **MoreSearchLayer** (Search filter page), **Go to page popup** and **ChallengesPage** (Quests) + * **Remember that if you don't like these you CAN disable pages in the mod options** + * Removed **Herobrine** + # v2.0.0 * Added Android Support :D diff --git a/mod.json b/mod.json index 84406f3..8094a17 100644 --- a/mod.json +++ b/mod.json @@ -4,7 +4,7 @@ "win": "2.204", "android": "2.200" }, - "version": "v1.1.0", + "version": "v2.1.0", "id": "TheSillyDoggo.GradientPages", "name": "Gradient Pages", "developer": "TheSillyDoggo", @@ -29,6 +29,48 @@ "description": "Should it apply a gradient to the level description?", "type": "bool", "default": true + }, + "apply-unlock": { + "name": "Apply to Item Unlock Page", + "description": "Should it apply a gradient to the popup shown when pressing a lock?", + "type": "bool", + "default": true + }, + "apply-shards": { + "name": "Apply to the Shards Page", + "description": "Should it apply a gradient to the shards of power page?", + "type": "bool", + "default": true + }, + "apply-credits": { + "name": "Apply to the Community shop Credits Page", + "description": "Should it apply a gradient to Potbor's shop credit page?", + "type": "bool", + "default": true + }, + "apply-demon": { + "name": "Apply to the Demon Filter Page", + "description": "Should it apply a gradient to the popup used to select a demon difficulty in the search page?", + "type": "bool", + "default": true + }, + "apply-filter": { + "name": "Apply to the Search Filter Page", + "description": "Should it apply a gradient to the Search filter page?", + "type": "bool", + "default": true + }, + "apply-pagesel": { + "name": "Apply to go to page popup", + "description": "Should it apply a gradient to the Search / Comment page select popup?", + "type": "bool", + "default": true + }, + "apply-quests": { + "name": "Apply to quests page", + "description": "Should it apply a gradient to the quests page", + "type": "bool", + "default": true }, "reverse-order": { "name": "Reverse Order", diff --git a/src/main.cpp b/src/main.cpp index 44a3fbd..4b4318f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,8 +5,15 @@ #include #include #include +#include +#include +#include +#include #include #include +#include +#include +#include using namespace geode::prelude; @@ -174,8 +181,19 @@ class $modify (GJAccountSettingsLayer) l->addChild(darken); l->addChild(gradient); - gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); - gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); gradient->setOpacity(255); bg->setOpacity(255); @@ -227,10 +245,19 @@ class $modify(FRequestProfilePage) { l->addChild(darken); l->addChild(gradient); - gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); - //gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->->getPlayerColor())); - gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); - //gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->getPlayerColor2())); + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); gradient->setOpacity(255); bg->setOpacity(255); @@ -283,10 +310,19 @@ class $modify(MessagesProfilePage) { l->addChild(darken); l->addChild(gradient); - gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); - //gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->->getPlayerColor())); - gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); - //gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->getPlayerColor2())); + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); gradient->setOpacity(255); bg->setOpacity(255); @@ -339,10 +375,19 @@ class $modify(FriendsProfilePage) { l->addChild(darken); l->addChild(gradient); - gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); - //gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->->getPlayerColor())); - gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); - //gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->getPlayerColor2())); + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); gradient->setOpacity(255); bg->setOpacity(255); @@ -445,3 +490,468 @@ class $modify (GJCommentListLayer) return a; } }; + +class $modify (ItemInfoPopup) +{ + bool init(int p0, UnlockType p1) + { + if (!ItemInfoPopup::init(p0, p1)) + return false; + + if (!Mod::get()->getSettingValue("apply-unlock")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(CCDirector::get()->getWinSize() / 2); + gradient->setContentSize(ccp(300, 230)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(CCDirector::get()->getWinSize() / 2); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +class $modify (ShardsPage) +{ + virtual bool init() + { + if (!ShardsPage::init()) + return false; + + if (!Mod::get()->getSettingValue("apply-shards")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(CCDirector::get()->getWinSize() / 2); + gradient->setContentSize(ccp(420, 280)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(CCDirector::get()->getWinSize() / 2); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +class $modify (CommunityCreditsPage) +{ + virtual bool init() + { + if (!CommunityCreditsPage::init()) + return false; + + if (!Mod::get()->getSettingValue("apply-credits")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(CCDirector::get()->getWinSize() / 2); + gradient->setContentSize(ccp(420, 280)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(CCDirector::get()->getWinSize() / 2); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +class $modify (DemonFilterSelectLayer) +{ + virtual bool init() + { + if (!DemonFilterSelectLayer::init()) + return false; + + if (!Mod::get()->getSettingValue("apply-demon")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(CCDirector::get()->getWinSize() / 2); + gradient->setContentSize(ccp(380, 180)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(CCDirector::get()->getWinSize() / 2); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +class $modify (MoreSearchLayer) +{ + virtual bool init() + { + if (!MoreSearchLayer::init()) + return false; + + if (!Mod::get()->getSettingValue("apply-filter")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(CCDirector::get()->getWinSize() / 2); + gradient->setContentSize(ccp(440, 290)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(CCDirector::get()->getWinSize() / 2); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +class $modify (ChallengesPage) +{ + virtual bool init() + { + if (!ChallengesPage::init()) + return false; + + if (!Mod::get()->getSettingValue("apply-quests")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(CCDirector::get()->getWinSize() / 2); + gradient->setContentSize(ccp(420, 280)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(CCDirector::get()->getWinSize() / 2); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +class $modify (SetIDPopup) +{ + bool init(int p0, int p1, int p2, gd::string p3, gd::string p4, bool p5, int p6, float p7, bool p8, bool p9) + { + if (!SetIDPopup::init(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) + return false; + + if (!Mod::get()->getSettingValue("apply-pagesel")) + return true; + + auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); + l->sortAllChildren(); + auto v = reinterpret_cast(l->getChildren()->objectAtIndex(0)); + v->setVisible(false); + + auto gradient = CCLayerGradient::create(); + + gradient->setStartColor({255, 0, 0}); + gradient->setEndColor({0, 255, 0}); + gradient->setZOrder(-3); + gradient->setID("gradient"_spr); + + gradient->setPosition(v->getPosition()); + gradient->setContentSize(ccp(220, 150)); + gradient->ignoreAnchorPointForPosition(false); + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + auto darken = CCScale9Sprite::createWithSpriteFrameName("square-fill.png"_spr); + darken->setID("darken"_spr); + darken->setContentSize(gradient->getContentSize() - ccp(15, 15)); + darken->setZOrder(-2); + darken->setPosition(gradient->getPosition()); + darken->setAnchorPoint(gradient->getAnchorPoint()); + + auto bg = CCScale9Sprite::createWithSpriteFrameName("square-outline.png"_spr); + bg->setPosition(v->getPosition()); + bg->setContentSize(gradient->getContentSize()); + bg->setZOrder(1); + bg->setID("bg"_spr); + + l->addChild(bg); + l->addChild(darken); + l->addChild(gradient); + + if (Mod::get()->getSettingValue("use-custom-colours")) + { + gradient->setStartColor(Mod::get()->getSettingValue("primary-colour")); + gradient->setEndColor(Mod::get()->getSettingValue("secondary-colour")); + } + else + { + gradient->setStartColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor.value())); + gradient->setEndColor(GameManager::get()->colorForIdx(GameManager::get()->m_playerColor2.value())); + } + + if (Mod::get()->getSettingValue("reverse-order")) + gradient->setScaleY(-1); + + gradient->setOpacity(255); + bg->setOpacity(255); + + return true; + } +}; + +