Skip to content

Commit

Permalink
transition customizer
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Feb 13, 2024
1 parent 627b634 commit 73f1d16
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- ~~Added Noclip Deaths and Noclip Accuracy~~ it's delayed because this shits annoying to fix
- Added Alerts to the text bypasses to let the user know that they can crash
- Added Instant Restart
- Added Transition Customizer
- Fixed Solid Wave Trail white being broken
- Temporarily removed thicker hitboxes due to lag :(

Expand Down
2 changes: 0 additions & 2 deletions src/Client/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -1267,8 +1267,6 @@ class Universal : public Window

auto pos = ccp(menu->getContentSize().width, 0) + ccp(-58, 22);

return;

auto btnS = ButtonSprite::create("Transition\nCustomizer", 90, false, "bigFont.fnt", "GJ_button_05.png", 35, 0.75f);
as<CCNode*>(btnS->getChildren()->objectAtIndex(0))->setScale(0.375f);
as<CCLabelBMFont*>(btnS->getChildren()->objectAtIndex(0))->setAlignment(CCTextAlignment::kCCTextAlignmentCenter);
Expand Down
6 changes: 4 additions & 2 deletions src/Hacks/TransitionTimeCustomiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

using namespace geode::prelude;

//{"Fade", "Cross Fade", "Fade Bottom Left", "Fade Top Right", "Fade Up", "Fade Down", "Flip Angular", "Flip X", "Flip Y", "Zoom Flip Angular" "Zoom Flip X", "Zoom Flip Y", "Jump Zoom", "Move In Top", "Move In Bottom", "Move In Left", "Move In Right", "Rotate Zoom", "Shrink Grow", "Slide In Top", "Slide In Bottom", "Slide In Left", "Slide In Right", "Split Rows", "Split Columns", "Tiles"}

CCScene* getSceneForSel(int i, float f, CCScene* s)
{
AppDelegate::get()->willSwitchToScene(s);
Expand Down Expand Up @@ -77,6 +79,6 @@ class $modify (cocos2d::CCTransitionFade)
mod = 0;
}

return as<CCTransitionFade*>(getSceneForSel(0, duration * mod, scene));// /*base_cast<CCTransitionFade*>(CCTransitionFlipY::create(duration * mod, scene)); */CCTransitionFade::create(duration * mod, scene);
return as<CCTransitionFade*>(getSceneForSel(Mod::get()->getSavedValue<int>("transition", 0), duration * mod, scene));// /*base_cast<CCTransitionFade*>(CCTransitionFlipY::create(duration * mod, scene)); */CCTransitionFade::create(duration * mod, scene);
}
};
};
60 changes: 56 additions & 4 deletions src/Layers/SetupTransitionCustomizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ using namespace geode::prelude;
class SetupTransCustom : public FLAlertLayer
{
public:
std::vector<std::string> transNames = {"Fade", "Cross Fade", "Fade Bottom Left", "Fade Top Right", "Fade Up", "Fade Down", "Flip Angular", "Flip X", "Flip Y", "Zoom Flip Angular", "Zoom Flip X", "Zoom Flip Y", "Jump Zoom", "Move In Top", "Move In Bottom", "Move In Left", "Move In Right", "Rotate Zoom", "Shrink Grow", "Slide In Top", "Slide In Bottom", "Slide In Left", "Slide In Right", "Split Rows", "Split Columns", "Tiles"};

CCMenuItemSpriteExtra* left;
CCMenuItemSpriteExtra* right;
CCLabelBMFont* label;

int selMode;

void onClose(CCObject*)
{
this->removeFromParent();
Expand All @@ -18,11 +26,37 @@ class SetupTransCustom : public FLAlertLayer
onClose(nullptr);
}

void onLeft(CCObject*)
{
selMode--;

left->setVisible(selMode != 0);
right->setVisible(selMode != transNames.size() - 1);
label->setString(transNames[selMode].c_str());
label->limitLabelWidth(235, 1, 0.1f);

Mod::get()->setSavedValue<int>("transition", selMode);
}

void onRight(CCObject*)
{
selMode++;

left->setVisible(selMode != 0);
right->setVisible(selMode != transNames.size() - 1);
label->setString(transNames[selMode].c_str());
label->limitLabelWidth(235, 1, 0.1f);

Mod::get()->setSavedValue<int>("transition", selMode);
}

bool init()
{
if (!FLAlertLayer::init(0))
return false;

selMode = Mod::get()->getSavedValue<int>("transition", 0);

this->runAction(CCFadeTo::create(1, 100));
//this->setTouchEnabled(true);
this->setKeypadEnabled(true);
Expand All @@ -44,7 +78,7 @@ class SetupTransCustom : public FLAlertLayer
panel->setID("panel");
l->addChild(panel);

auto title = CCLabelBMFont::create("Setup Transition Customizer", "bigFont.fnt");
auto title = CCLabelBMFont::create("Transition Customizer", "bigFont.fnt");
title->setPosition(l->getContentSize() / 2 + ccp(0, 90));
title->setOpacity(100);
title->setScale(0.5f);
Expand All @@ -54,9 +88,27 @@ class SetupTransCustom : public FLAlertLayer
ok->setPosition(l->getContentSize() / 2 + ccp(0, -82));
l->addChild(ok);

auto dd = Dropdown::create({130, 30}, {"Fade", "Cross Fade", "Fade Bottom Left", "Fade Top Right", "Fade Up", "Fade Down", "Flip Angular", "Flip X", "Flip Y", "Jump Zoom", "Move In Top", "Move In Bottom", "Move In Left", "Move In Right", "Rotate Zoom", "Shrink Grow", "Slide In Top", "Slide In Bottom", "Slide In Left", "Slide In Right", "Split Rows", "Split Columns", "Tiles"}, nullptr);
dd->setTouchPriority(-550);
l->addChild(dd);
auto leftSpr = CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
left = CCMenuItemSpriteExtra::create(leftSpr, this, menu_selector(SetupTransCustom::onLeft));
left->setPosition(l->getContentSize() / 2 + ccp(-140, 0));
left->setVisible(selMode != 0);
l->addChild(left);

auto rightSpr = CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
rightSpr->setFlipX(true);
right = CCMenuItemSpriteExtra::create(rightSpr, this, menu_selector(SetupTransCustom::onRight));
right->setPosition(l->getContentSize() / 2 + ccp(140, 0));
right->setVisible(selMode != transNames.size() - 1);
l->addChild(right);

label = CCLabelBMFont::create(transNames[selMode].c_str(), "bigFont.fnt");
label->setPosition(l->getContentSize() / 2);
label->limitLabelWidth(235, 1, 0.1f);
l->addChild(label);

//auto dd = Dropdown::create({130, 30}, , nullptr);
//dd->setTouchPriority(-550);
//l->addChild(dd);

this->addChild(l);

Expand Down

0 comments on commit 73f1d16

Please sign in to comment.