Skip to content

Commit

Permalink
2.2074 port
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Nov 15, 2024
1 parent 8365e8d commit e172931
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"geode": "3.4.0",
"geode": "4.0.0-alpha.1",
"gd": {
"win": "2.206",
"android": "2.206"
"win": "2.2074",
"android": "2.2074"
},
"version": "v0.9.7",
"version": "v0.9.8-alpha.1",
"id": "zalphalaneous.minecraft",
"name": "Minecraftify!",
"developer": "Alphalaneous",
Expand Down
22 changes: 11 additions & 11 deletions src/ui/hooks/FLAlertLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class $modify(MyFLAlertLayer, FLAlertLayer){
newBackground->setVisible(background->isVisible());
newBackground->setZOrder(background->getZOrder());

CCSpriteBatchNode* batchNode = getChildOfType<CCSpriteBatchNode>(newBackground, 0);
CCSpriteBatchNode* batchNode = newBackground->getChildByType<CCSpriteBatchNode>(0);
ccTexParams params = {GL_NEAREST, GL_NEAREST, GL_REPEAT, GL_REPEAT};
batchNode->getTexture()->setTexParameters(&params);

Expand All @@ -51,7 +51,7 @@ class $modify(MyFLAlertLayer, FLAlertLayer){
CCSize textBGSize = {newBackground->getContentSize().width - 8 / scale, newBackground->getContentSize().height - 24 / scale};

CCScale9Sprite* textBackground = CCScale9Sprite::create("text_field.png"_spr);
CCSpriteBatchNode* batchNodeA = getChildOfType<CCSpriteBatchNode>(textBackground, 0);
CCSpriteBatchNode* batchNodeA = textBackground->getChildByType<CCSpriteBatchNode>(0);
ccTexParams paramsA = {GL_NEAREST, GL_NEAREST, GL_REPEAT, GL_REPEAT};
batchNodeA->getTexture()->setTexParameters(&paramsA);

Expand All @@ -66,7 +66,7 @@ class $modify(MyFLAlertLayer, FLAlertLayer){
if(CCNode* contentTextArea = mainLayer->getChildByID("content-text-area")) {
contentTextArea->setPosition({mainLayer->getContentSize().width/2, mainLayer->getContentSize().height/2});
contentTextArea->setZOrder(7);
for(CCLabelBMFont* text : CCArrayExt<CCLabelBMFont*>(getChildOfType<MultilineBitmapFont>(contentTextArea, 0)->getChildren())){
for(CCLabelBMFont* text : CCArrayExt<CCLabelBMFont*>(contentTextArea->getChildByType<MultilineBitmapFont>(0)->getChildren())){
text->setFntFile("minecraft.fnt"_spr);
text->setAnchorPoint({0.5, 0});
text->setScale(0.6f);
Expand All @@ -79,14 +79,14 @@ class $modify(MyFLAlertLayer, FLAlertLayer){

if(CCNode* scrollingLayer = mainLayer->getChildByID("scroll-layer")) {

if(CCLayer* contentLayer = getChildOfType<CCLayer>(scrollingLayer, 1)) {
if(CCLayer* contentLayer = scrollingLayer->getChildByType<CCLayer>(1)) {

if(CCNode* textArea = contentLayer->getChildByID("content-text-area")){
textArea->ignoreAnchorPointForPosition(false);
textArea->setAnchorPoint({0.5, 0});
textArea->setPosition({textArea->getPosition().x, 0});

for(CCLabelBMFont* text : CCArrayExt<CCLabelBMFont*>(getChildOfType<MultilineBitmapFont>(textArea, 0)->getChildren())){
for(CCLabelBMFont* text : CCArrayExt<CCLabelBMFont*>(textArea->getChildByType<MultilineBitmapFont>(0)->getChildren())){
text->setFntFile("minecraft.fnt"_spr);
text->setAnchorPoint({0.5, 1});
text->setScale(0.6f);
Expand Down Expand Up @@ -152,11 +152,11 @@ class $modify(MyFLAlertLayer, FLAlertLayer){
}


if(MyCCMenuItemSpriteExtra* button = static_cast<MyCCMenuItemSpriteExtra*>(getChildOfType<CCMenuItemSpriteExtra>(menu, 0))){
if(MyCCMenuItemSpriteExtra* button = static_cast<MyCCMenuItemSpriteExtra*>(menu->getChildByType<CCMenuItemSpriteExtra>(0))){
std::string text = "";

if(ButtonSprite* spr = getChildOfType<ButtonSprite>(button, 0)) {
if(CCLabelBMFont* label = getChildOfType<CCLabelBMFont>(spr, 0)) {
if(ButtonSprite* spr = button->getChildByType<ButtonSprite>(0)) {
if(CCLabelBMFont* label = spr->getChildByType<CCLabelBMFont>(0)) {
text = std::string(label->getString());
}
}
Expand All @@ -166,11 +166,11 @@ class $modify(MyFLAlertLayer, FLAlertLayer){
button->setVisible(false);
innerButtonMenu->addChild(btn1);
}
if(MyCCMenuItemSpriteExtra* button = static_cast<MyCCMenuItemSpriteExtra*>(getChildOfType<CCMenuItemSpriteExtra>(menu, 1))){
if(MyCCMenuItemSpriteExtra* button = static_cast<MyCCMenuItemSpriteExtra*>(menu->getChildByType<CCMenuItemSpriteExtra>(1))){
std::string text = "";

if(ButtonSprite* spr = getChildOfType<ButtonSprite>(button, 0)) {
if(CCLabelBMFont* label = getChildOfType<CCLabelBMFont>(spr, 0)) {
if(ButtonSprite* spr = button->getChildByType<ButtonSprite>(0)) {
if(CCLabelBMFont* label = spr->getChildByType<CCLabelBMFont>(0)) {
text = std::string(label->getString());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/hooks/MenuLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class $modify(MyMenuLayer, MenuLayer) {
MCButton* modsButton = MCButton::create("Mods", 24.0f, this, menu_selector(MyMenuLayer::onMods));
MCButton* skinButton = MCButton::create("Skins", 24.0f, this, menu_selector(MenuLayer::onGarage));

MCButton* optionsButton = MCButton::create("Options...", 24.0f, this, menu_selector(MenuLayer::onOptions));
MCButton* optionsButton = MCButton::create("Options...", 24.0f, this, menu_selector(MyMenuLayer::onOptions));
MCButton* quitButton = MCButton::create("Quit Game", 24.0f, this, menu_selector(MenuLayer::onQuit));

MCButton* profileButton = MCButton::create("", 5.0f, this, menu_selector(MyMenuLayer::onMyProfile));
Expand Down
2 changes: 1 addition & 1 deletion src/ui/hooks/PlayLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class $modify(MyPlayLayer, PlayLayer){
CCLayerColor* createTextLayer(std::string id, CCNode* node, std::string text){

if(CCLayerColor* bg0 = typeinfo_cast<CCLayerColor*>(node->getChildByID(id))){
if(MCLabel* label = getChildOfType<MCLabel>(bg0, 0)){
if(MCLabel* label = bg0->getChildByType<MCLabel>(0)){
label->setString(text.c_str());
bg0->setContentSize({label->getScaledContentSize().width + 2, label->getScaledContentSize().height-1});
}
Expand Down

0 comments on commit e172931

Please sign in to comment.