Skip to content

Commit 0b70f7f

Browse files
committed
beta
1 parent 955f6c2 commit 0b70f7f

File tree

5 files changed

+46
-85
lines changed

5 files changed

+46
-85
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v2.0.2
1+
# v2.1.0-beta
22

33
- Added Layers: `teamtcm.geometry-dash-odyssey/OdysseyComicLayer`, `teamtcm.geometry-dash-odyssey/OdysseySelectLayer`, `gd/UIOptionsLayer`, `gd/UIPOptionsLayer`, `GJShopLayer` (currently all of them are together)
44

mod.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"win": "2.2074",
66
"mac": "2.2074"
77
},
8-
"version": "v2.0.2",
8+
"version": "v2.1.0-beta",
99
"id": "omgrod.geodify",
1010
"name": "Geodify",
1111
"developers": ["OmgRod", "Viper"],
@@ -435,6 +435,12 @@
435435
"type": "bool",
436436
"default": true
437437
},
438+
"teamtcm.geometry-dash-odyssey/GJShopLayer-Carp": {
439+
"name": "Carp Shop",
440+
"description": "GJShopLayer-Carp",
441+
"type": "bool",
442+
"default": true
443+
},
438444

439445
"other/enable-menu-icons": {
440446
"name": "Enable Menu Ground + Icons",
1010 KB
Loading

src/SwelvyBG.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,6 @@ class $nodeModify(my##layer, layer) {\
3232
}\
3333
}
3434

35-
36-
#define SET_SWELVY_SPRITE_NOBG(layer, setting) \
37-
class $nodeModify(my##layer, layer) { \
38-
void modify() { \
39-
int lowestZ = INT_MAX;\
40-
CCNode* node = nullptr;\
41-
CCObject* obj = nullptr; \
42-
CCARRAY_FOREACH(getChildren(), obj) { \
43-
if (node) { \
44-
lowestZ = std::min(lowestZ, node->getZOrder()); \
45-
} \
46-
} \
47-
\
48-
if (Mod::get()->getSettingValue<bool>(setting)) { \
49-
SwelvyBG* swelvyBG = SwelvyBG::create(); \
50-
swelvyBG->setZOrder(lowestZ - 1);\
51-
addChild(swelvyBG); \
52-
} \
53-
} \
54-
}
55-
5635
class SwelvyBG : public CCNode {
5736
protected:
5837
bool init(float widthmult, float heightmul, float minspeed, float maxspeed);

src/modify/gd/GJShopLayer.cpp

Lines changed: 38 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,51 @@
11
#include <Geode/Geode.hpp>
22
#include "../../SwelvyBG.hpp"
33
#include <Geode/modify/GJShopLayer.hpp>
4+
#include <alphalaneous.alphas_geode_utils/include/NodeModding.h>
45

56
using namespace geode::prelude;
67

78
class $modify(MyGJShopLayer, GJShopLayer) {
8-
bool init(ShopType p0) {
9-
if (!GJShopLayer::init(p0)) {
10-
return false;
11-
}
12-
if (static_cast<int>(p0) == 0) {
13-
if (Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Normal")){
14-
if (auto bg = this->getChildByID("background")) {
15-
bg->setVisible(false);
16-
}
17-
18-
auto swelvyBG = SwelvyBG::create();
19-
swelvyBG->setZOrder(-999);
20-
21-
22-
this->addChild(swelvyBG);
23-
}
24-
} else if (static_cast<int>(p0) == 1) {
25-
if (Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Secret")){
26-
if (auto bg = this->getChildByID("background")) {
27-
bg->setVisible(false);
28-
}
29-
30-
auto swelvyBG = SwelvyBG::create();
31-
swelvyBG->setZOrder(-999);
32-
33-
34-
this->addChild(swelvyBG);
35-
}
36-
} else if (static_cast<int>(p0) == 2) {
37-
if (Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Community")){
38-
if (auto bg = this->getChildByID("background")) {
39-
bg->setVisible(false);
40-
}
41-
42-
auto swelvyBG = SwelvyBG::create();
43-
swelvyBG->setZOrder(-999);
44-
45-
46-
this->addChild(swelvyBG);
47-
}
48-
} else if (static_cast<int>(p0) == 3) {
49-
if (Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Mechanic")){
50-
if (auto bg = this->getChildByID("background")) {
51-
bg->setVisible(false);
52-
}
53-
54-
auto swelvyBG = SwelvyBG::create();
55-
swelvyBG->setZOrder(-999);
56-
9+
bool init(ShopType p0) {
10+
if (!GJShopLayer::init(p0)) {
11+
return false;
12+
}
5713

58-
this->addChild(swelvyBG);
59-
}
60-
} else if (static_cast<int>(p0) == 4) {
61-
if (Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Diamond")){
62-
if (auto bg = this->getChildByID("background")) {
63-
bg->setVisible(false);
64-
}
14+
bool shouldReplaceBG = false;
15+
switch (p0) {
16+
case ShopType::Normal:
17+
shouldReplaceBG = Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Normal");
18+
break;
19+
case ShopType::Secret:
20+
shouldReplaceBG = Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Secret");
21+
break;
22+
case ShopType::Community:
23+
shouldReplaceBG = Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Community");
24+
break;
25+
case ShopType::Mechanic:
26+
shouldReplaceBG = Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Mechanic");
27+
break;
28+
case ShopType::Diamond:
29+
shouldReplaceBG = Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Diamond");
30+
break;
31+
default:
32+
break;
33+
}
6534

66-
auto swelvyBG = SwelvyBG::create();
67-
swelvyBG->setZOrder(-999);
68-
35+
if (static_cast<int>(p0) == 6) {
36+
shouldReplaceBG = Mod::get()->getSettingValue<bool>("teamtcm.geometry-dash-odyssey/GJShopLayer-Carp");
37+
}
6938

70-
this->addChild(swelvyBG);
39+
if (shouldReplaceBG) {
40+
if (auto bg = this->getChildByID("background")) {
41+
bg->setVisible(false);
7142
}
43+
this->getChildByType<CCSprite>(0)->setVisible(false);
44+
auto swelvyBG = SwelvyBG::create();
45+
swelvyBG->setZOrder(-999);
46+
this->addChild(swelvyBG);
7247
}
73-
return true;
74-
}
48+
49+
return true;
50+
}
7551
};

0 commit comments

Comments
 (0)