Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed May 22, 2024
1 parent 22637b6 commit 7adb29a
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 115 deletions.
4 changes: 3 additions & 1 deletion src/nodes/CCMenuItemSpriteExtra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ void EventCCMenuItemSpriteExtra::activate(){

CCMenuItemSpriteExtra* EventCCMenuItemSpriteExtra::create(cocos2d::CCNode* p0, cocos2d::CCNode* p1, cocos2d::CCObject* p2, cocos2d::SEL_MenuHandler p3){
auto ret = CCMenuItemSpriteExtra::create(p0, p1, p2, p3);
if(UIModding::get()->doModify){
#ifndef GEODE_IS_ANDROID
ret->schedule(schedule_selector(EventCCMenuItemSpriteExtra::checkTouch), 1/30);
ret->schedule(schedule_selector(EventCCMenuItemSpriteExtra::checkTouch), 1/30);
#endif
}
return ret;
}

Expand Down
92 changes: 47 additions & 45 deletions src/nodes/CommentCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,60 @@ class $modify(CommentCell) {
void updateBGColor(int p0) {

CommentCell::updateBGColor(p0);
CCLayerColor* child = getChildOfType<CCLayerColor>(this, 0);
CCLayer* layer = getChildOfType<CCLayer>(this, 1);
CCScale9Sprite* bg = getChildOfType<CCScale9Sprite>(layer, 0);
if(UIModding::get()->doModify){
CCLayerColor* child = getChildOfType<CCLayerColor>(this, 0);
CCLayer* layer = getChildOfType<CCLayer>(this, 1);
CCScale9Sprite* bg = getChildOfType<CCScale9Sprite>(layer, 0);

if(child->getColor() == ccColor3B{161,88,44}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-odd");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
if(bg){
std::optional<ColorData> dataOpt2 = UIModding::get()->getColors("comment-cell-bg-odd");
if(dataOpt2.has_value()){
ColorData data = dataOpt2.value();
bg->setColor(data.color);
bg->setOpacity(data.alpha);
if(child->getColor() == ccColor3B{161,88,44}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-odd");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
if(bg){
std::optional<ColorData> dataOpt2 = UIModding::get()->getColors("comment-cell-bg-odd");
if(dataOpt2.has_value()){
ColorData data = dataOpt2.value();
bg->setColor(data.color);
bg->setOpacity(data.alpha);
}
}
}
}
else if(child->getColor() == ccColor3B{194,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-even");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
if(bg){
std::optional<ColorData> dataOpt2 = UIModding::get()->getColors("comment-cell-bg-even");
if(dataOpt2.has_value()){
ColorData data = dataOpt2.value();
bg->setColor(data.color);
bg->setOpacity(data.alpha);
else if(child->getColor() == ccColor3B{194,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-even");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
if(bg){
std::optional<ColorData> dataOpt2 = UIModding::get()->getColors("comment-cell-bg-even");
if(dataOpt2.has_value()){
ColorData data = dataOpt2.value();
bg->setColor(data.color);
bg->setOpacity(data.alpha);
}
}
}
}
else if(child->getColor() == ccColor3B{156,85,42}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-small-odd");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
else if(child->getColor() == ccColor3B{156,85,42}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-small-odd");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
}
}
else if(child->getColor() == ccColor3B{144,79,39}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-small-even");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
else if(child->getColor() == ccColor3B{144,79,39}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-cell-small-even");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
}
}
}
}
};

Expand Down
16 changes: 9 additions & 7 deletions src/nodes/GJCommentListLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ class $modify(MyGJCommentListLayer, GJCommentListLayer) {

static GJCommentListLayer* create(BoomListView* p0, char const* p1, cocos2d::ccColor4B p2, float p3, float p4, bool p5) {
auto ret = GJCommentListLayer::create(p0, p1, p2, p3, p4, p5);
if(ret->getColor() == ccColor3B{191,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-list-layer-bg");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
ret->setColor(data.color);
ret->setOpacity(data.alpha);
}
if(UIModding::get()->doModify){
if(ret->getColor() == ccColor3B{191,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("comment-list-layer-bg");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
ret->setColor(data.color);
ret->setOpacity(data.alpha);
}
}
}
return ret;
}
Expand Down
24 changes: 13 additions & 11 deletions src/nodes/GJDropDownLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ class $modify(MyGJDropDownLayer, GJDropDownLayer){

void showLayer(bool p0){
GJDropDownLayer::showLayer(p0);
removeFromParent();
CCScene* currentScene = CCDirector::get()->getRunningScene();
currentScene->addChild(this);
if(UIModding::get()->doModify){
removeFromParent();
CCScene* currentScene = CCDirector::get()->getRunningScene();
currentScene->addChild(this);

CCMoveTo* moveTo = CCMoveTo::create(0.5, m_endPosition);
CCEaseInOut* easeInOut = CCEaseInOut::create(moveTo, 2.0);
CCSequence* sequence = CCSequence::create(easeInOut, 0);
CCMoveTo* moveTo = CCMoveTo::create(0.5, m_endPosition);
CCEaseInOut* easeInOut = CCEaseInOut::create(moveTo, 2.0);
CCSequence* sequence = CCSequence::create(easeInOut, 0);

m_mainLayer->runAction(sequence);
m_mainLayer->runAction(sequence);

CCFadeTo* fadeTo = CCFadeTo::create(0.5, 125);
runAction(fadeTo);
CCFadeTo* fadeTo = CCFadeTo::create(0.5, 125);
runAction(fadeTo);

if(UIModding::get()->doModify){
UIModding::get()->doUICheck(this);
if(UIModding::get()->doModify){
UIModding::get()->doUICheck(this);
}
}
}
};
Expand Down
16 changes: 9 additions & 7 deletions src/nodes/GJListLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ class $modify(MyGJListLayer, GJListLayer) {

static GJListLayer* create(BoomListView* p0, char const* p1, cocos2d::ccColor4B p2, float p3, float p4, int p5) {
auto ret = GJListLayer::create(p0, p1, p2, p3, p4, p5);
if(ret->getColor() == ccColor3B{191,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("list-layer-bg");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
ret->setColor(data.color);
ret->setOpacity(data.alpha);
}
if(UIModding::get()->doModify){
if(ret->getColor() == ccColor3B{191,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("list-layer-bg");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
ret->setColor(data.color);
ret->setOpacity(data.alpha);
}
}
}
return ret;
}
Expand Down
35 changes: 19 additions & 16 deletions src/nodes/LevelCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,27 @@ class $modify(MyLevelCell, LevelCell) {
void updateBGColor(int p0) {

LevelCell::updateBGColor(p0);
CCLayerColor* child = getChildOfType<CCLayerColor>(this, 0);

if(child->getColor() == ccColor3B{161,88,44}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("list-cell-odd");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);

if(UIModding::get()->doModify){
CCLayerColor* child = getChildOfType<CCLayerColor>(this, 0);

if(child->getColor() == ccColor3B{161,88,44}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("list-cell-odd");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
}
}
else if(child->getColor() == ccColor3B{194,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("list-cell-even");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
else if(child->getColor() == ccColor3B{194,114,62}){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("list-cell-even");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
}
}
}
}
};

Expand Down
59 changes: 31 additions & 28 deletions src/nodes/MenuGameLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,40 @@ class $modify(MyMenuGameLayer, MenuGameLayer){
void update(float p0){
MenuGameLayer::update(p0);

CCSprite* bg = getChildOfType<CCSprite>(this, 0);
GJGroundLayer* ground = getChildOfType<GJGroundLayer>(this, 0);

if(bg){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("main-menu-bg");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
bg->setColor(data.color);
bg->setOpacity(data.alpha);
if(UIModding::get()->doModify){

CCSprite* bg = getChildOfType<CCSprite>(this, 0);
GJGroundLayer* ground = getChildOfType<GJGroundLayer>(this, 0);

if(bg){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("main-menu-bg");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
bg->setColor(data.color);
bg->setOpacity(data.alpha);
}
}
}
if(ground){
CCSpriteBatchNode* groundBatch = getChildOfType<CCSpriteBatchNode>(ground, 0);
if(groundBatch){
CCSprite* groundSprite = getChildOfType<CCSprite>(groundBatch, 0);
if(groundSprite){
for(CCNode* node : CCArrayExt<CCNode*>(groundSprite->getChildren())){
if(CCSprite* child = dynamic_cast<CCSprite*>(node)){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("main-menu-ground");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
if(ground){
CCSpriteBatchNode* groundBatch = getChildOfType<CCSpriteBatchNode>(ground, 0);
if(groundBatch){
CCSprite* groundSprite = getChildOfType<CCSprite>(groundBatch, 0);
if(groundSprite){
for(CCNode* node : CCArrayExt<CCNode*>(groundSprite->getChildren())){
if(CCSprite* child = dynamic_cast<CCSprite*>(node)){
std::optional<ColorData> dataOpt = UIModding::get()->getColors("main-menu-ground");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
child->setColor(data.color);
child->setOpacity(data.alpha);
}
}
}
}
std::optional<ColorData> dataOpt = UIModding::get()->getColors("main-menu-ground");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
groundSprite->setColor(data.color);
groundSprite->setOpacity(data.alpha);
std::optional<ColorData> dataOpt = UIModding::get()->getColors("main-menu-ground");
if(dataOpt.has_value()){
ColorData data = dataOpt.value();
groundSprite->setColor(data.color);
groundSprite->setOpacity(data.alpha);
}
}
}
}
Expand Down

0 comments on commit 7adb29a

Please sign in to comment.