Skip to content

Commit

Permalink
bug fix and incompat
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Nov 18, 2024
1 parent 627ae1c commit 29c3424
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
7 changes: 6 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"win": "2.2074",
"android": "2.2074"
},
"version": "v0.9.8",
"version": "v0.9.9",
"id": "zalphalaneous.minecraft",
"name": "Minecraftify!",
"developer": "Alphalaneous",
Expand Down Expand Up @@ -49,6 +49,11 @@
"id": "sanes.daily-transfer",
"version": "*",
"importance": "breaking"
},
{
"id": "undefined0.icon_ninja",
"version": "*",
"importance": "breaking"
}
]
}
14 changes: 6 additions & 8 deletions src/ui/hooks/CCDirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ class $modify(MyCCDirector, CCDirector){

bool replaceScene(CCScene *pScene){

if(!GlobalVars::getSharedInstance()->isInitialLaunch){
if (!GlobalVars::getSharedInstance()->isInitialLaunch){
return CCDirector::replaceScene(pScene);
}
else{
else {
CCScene* currentScene = CCScene::get();
CCLayer* child = typeinfo_cast<CCLayer*>(currentScene->getChildren()->objectAtIndex(0));

LoadingLayer* loadingLayer = typeinfo_cast<LoadingLayer*>(child);

if(loadingLayer){
if (loadingLayer) {
MyLoadingLayer* myLoadingLayer = static_cast<MyLoadingLayer*>(child);
if(myLoadingLayer->m_fields->didHook){
if(GlobalVars::getSharedInstance()->isInitialLaunch){
myLoadingLayer->scheduleOnce(schedule_selector(MyLoadingLayer::doFadeOut), 0.05f);
}
if (GlobalVars::getSharedInstance()->isInitialLaunch){
myLoadingLayer->scheduleOnce(schedule_selector(MyLoadingLayer::doFadeOut), 0.05f);
}
else{
else {
GlobalVars::getSharedInstance()->isInitialLaunch = false;
return CCDirector::replaceScene(pScene);
}
Expand Down
2 changes: 0 additions & 2 deletions src/ui/hooks/LoadingLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class $modify(MyLoadingLayer, LoadingLayer){
float loadingScaleX = 1.5;
float loadingScaleY = 1.4;
bool isInitialOpen = true;
bool didHook = false;
};

void doFadeOut(float dt){
Expand Down Expand Up @@ -72,7 +71,6 @@ class $modify(MyLoadingLayer, LoadingLayer){
}

MyLoadingLayer* myself = static_cast<MyLoadingLayer*>(this);
myself->m_fields->didHook = true;

#ifndef GEODE_IS_ANDROID

Expand Down
9 changes: 5 additions & 4 deletions src/ui/hooks/MenuLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ class $modify(MenuLayer){
if (!MenuLayer::init()) {
return false;
}
if(CCNode* bottomMenu = this->getChildByIDRecursive("bottom-menu")){
if (CCNode* bottomMenu = this->getChildByIDRecursive("bottom-menu")){
bottomMenu->getChildByIDRecursive("achievements-button")->setVisible(false);
bottomMenu->getChildByIDRecursive("settings-button")->setVisible(false);
bottomMenu->getChildByIDRecursive("stats-button")->setVisible(false);
bottomMenu->getChildByIDRecursive("newgrounds-button")->setVisible(false);
bottomMenu->getChildByIDRecursive("geode.loader/geode-button")->setVisible(false);
}
if(Loader::get()->isModLoaded("alphalaneous.pages_api")){
if (Loader::get()->isModLoaded("alphalaneous.vanilla_pages")){

Mod* mod = Loader::get()->getLoadedMod("alphalaneous.pages_api");
Mod* mod = Loader::get()->getLoadedMod("alphalaneous.vanilla_pages");

if(mod->getSettingValue<bool>("menulayer-right-menu")){
if(CCNode* rightSideMenu = this->getChildByIDRecursive("right-side-menu")){
Expand All @@ -53,7 +53,7 @@ class $modify(MyMenuLayer, MenuLayer) {
};

static void onModify(auto& self) {
(void) self.setHookPriority("MenuLayer::init", INT_MIN/2-1);
(void) self.setHookPriority("MenuLayer::init", -1000);
}

bool init() {
Expand Down Expand Up @@ -215,6 +215,7 @@ class $modify(MyMenuLayer, MenuLayer) {

setAllInvisible();
this->scheduleOnce(schedule_selector(MyMenuLayer::setAllVisible), 1.0f);
GlobalVars::getSharedInstance()->isInitialLaunch = false;
}


Expand Down
4 changes: 2 additions & 2 deletions src/ui/layers/ExtrasLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ bool ExtrasLayer::init() {
bool modifyBottomMenu = true;


if(Loader::get()->isModLoaded("alphalaneous.pages_api")){
if(Loader::get()->isModLoaded("alphalaneous.vanilla_pages")){

Mod* mod = Loader::get()->getLoadedMod("alphalaneous.pages_api");
Mod* mod = Loader::get()->getLoadedMod("alphalaneous.vanilla_pages");

if(mod->getSettingValue<bool>("menulayer-right-menu")){
modifyRightMenu = false;
Expand Down
1 change: 0 additions & 1 deletion src/ui/nodes/MCButtonChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ void MCButtonChild::doClick(){
doAndroidBypass = true;
#endif


if(this->isHovering || doAndroidBypass){

auto engine = FMODAudioEngine::sharedEngine();
Expand Down

0 comments on commit 29c3424

Please sign in to comment.