diff --git a/src/MyLayerGradient.cpp b/src/MyLayerGradient.cpp index bda3a9a..8995c99 100644 --- a/src/MyLayerGradient.cpp +++ b/src/MyLayerGradient.cpp @@ -1,4 +1,4 @@ -#include "MyLayerGradient.h" +/*#include "MyLayerGradient.h" bool MyLayerGradient::init() { @@ -78,35 +78,5 @@ void MyLayerGradient::draw() glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - /*CC_NODE_DRAW_SETUP(); - - ccColor3B start = _startColor; - ccColor3B end = _endColor; - - CCPoint vertices[] = { - ccp(0, 0), - ccp(getContentSize().width, 0), - ccp(0, getContentSize().height), - ccp(getContentSize().width, getContentSize().height), - }; - - for (int i = 0; i < 4; ++i) - { - CCPoint dir = ccpMult(_vector, ccpDot(vertices[i], _vector)); - vertices[i] = dir; - } - - GLfloat colors[] = { - start.r / 255.0f, start.g / 255.0f, start.b / 255.0f, _startOpacity / 255.0f * (this->getOpacity() / 255.0f), - end.r / 255.0f, end.g / 255.0f, end.b / 255.0f, _endOpacity / 255.0f * (this->getOpacity() / 255.0f), - start.r / 255.0f, start.g / 255.0f, start.b / 255.0f, _startOpacity / 255.0f * (this->getOpacity() / 255.0f), - end.r / 255.0f, end.g / 255.0f, end.b / 255.0f, _endOpacity / 255.0f * (this->getOpacity() / 255.0f), - }; - - glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); - glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_FLOAT, GL_FALSE, 0, colors); - - //ccGLBlendFunc(this->getBlendFunc().src, this->getBlendFunc().dst); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);*/ } +*/ \ No newline at end of file diff --git a/src/MyLayerGradient.h b/src/MyLayerGradient.h index f6e3da3..b1aeb16 100644 --- a/src/MyLayerGradient.h +++ b/src/MyLayerGradient.h @@ -1,4 +1,4 @@ -#include +/*#include using namespace geode::prelude; @@ -24,4 +24,4 @@ class MyLayerGradient : public cocos2d::CCLayerColor GLubyte _startOpacity; GLubyte _endOpacity; cocos2d::CCPoint _vector; -}; \ No newline at end of file +};*/ \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index b7e9bba..a67e2e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,12 +17,19 @@ using namespace geode::prelude; -#include "MyLayerGradient.h" +//#include "CCLayerGradient.h" class GradientPages { public: static inline GJUserScore* score = nullptr; + + static CCNode* createGradientWithSize(CCPoint size) + { + + + return nullptr; + } }; class $modify(ProfilePage) { @@ -44,8 +51,8 @@ class $modify(ProfilePage) { auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); - //auto gradient = MyLayerGradient::create(); - auto gradient = MyLayerGradient::create(); + //auto gradient = CCLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -98,8 +105,10 @@ class $modify(ProfilePage) { virtual void loadPageFromUserInfo(GJUserScore* score) { GradientPages::score = score; + //score->m_commentHistoryStatus = 0; ProfilePage::loadPageFromUserInfo(score); + //score->m_commentHistoryStatus = 0; if (!Mod::get()->getSettingValue("apply-profiles") || Loader::get()->getLoadedMod("bitz.customprofiles")) return; @@ -113,7 +122,7 @@ class $modify(ProfilePage) { if (l) { - auto g = reinterpret_cast(l->getChildByID("gradient"_spr)); + auto g = reinterpret_cast(l->getChildByID("gradient"_spr)); auto d = reinterpret_cast(l->getChildByID("darken"_spr)); if (g) @@ -161,7 +170,7 @@ class $modify (GJAccountSettingsLayer) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -225,7 +234,7 @@ class $modify(FRequestProfilePage) { auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -290,7 +299,7 @@ class $modify(MessagesProfilePage) { auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -355,7 +364,7 @@ class $modify(FriendsProfilePage) { auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -420,7 +429,7 @@ class $modify(InfoLayer) { auto l = reinterpret_cast(this->getChildren()->objectAtIndex(0)); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -521,7 +530,7 @@ class $modify (ItemInfoPopup) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -587,7 +596,7 @@ class $modify (ShardsPage) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -653,7 +662,7 @@ class $modify (CommunityCreditsPage) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -719,7 +728,7 @@ class $modify (DemonFilterSelectLayer) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -785,7 +794,7 @@ class $modify (MoreSearchLayer) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -851,7 +860,7 @@ class $modify (ChallengesPage) l->sortAllChildren(); reinterpret_cast(l->getChildren()->objectAtIndex(0))->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0}); @@ -918,7 +927,7 @@ class $modify (SetIDPopup) auto v = reinterpret_cast(l->getChildren()->objectAtIndex(0)); v->setVisible(false); - auto gradient = MyLayerGradient::create(); + auto gradient = CCLayerGradient::create(); gradient->setStartColor({255, 0, 0}); gradient->setEndColor({0, 255, 0});