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
56using namespace geode ::prelude;
67
78class $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