Skip to content

Commit 3537a0c

Browse files
committed
update
1 parent 52218c4 commit 3537a0c

File tree

4 files changed

+97
-5
lines changed

4 files changed

+97
-5
lines changed

mod.json

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,33 @@
215215
"type": "bool",
216216
"default": true
217217
},
218-
"gd/GJShopLayer": {
219-
"name": "Shops (Currently just all of them)",
220-
"description": "GJShopLayer",
218+
"gd/GJShopLayer-Normal": {
219+
"name": "Normal Shop",
220+
"description": "GJShopLayer-Normal",
221+
"type": "bool",
222+
"default": true
223+
},
224+
"gd/GJShopLayer-Secret": {
225+
"name": "Scratch Shop",
226+
"description": "GJShopLayer-Secret",
227+
"type": "bool",
228+
"default": true
229+
},
230+
"gd/GJShopLayer-Community": {
231+
"name": "Community Shop",
232+
"description": "GJShopLayer-Community",
233+
"type": "bool",
234+
"default": true
235+
},
236+
"gd/GJShopLayer-Mechanic": {
237+
"name": "Mechanic Shop",
238+
"description": "GJShopLayer-Mechanic",
239+
"type": "bool",
240+
"default": true
241+
},
242+
"gd/GJShopLayer-Diamond": {
243+
"name": "Diamond Shop",
244+
"description": "GJShopLayer-Diamond",
221245
"type": "bool",
222246
"default": true
223247
},

src/modify/gd/GJShopLayer.cpp

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,75 @@
11
#include <Geode/Geode.hpp>
22
#include "../../SwelvyBG.hpp"
3-
#include <alphalaneous.alphas_geode_utils/include/NodeModding.h>
3+
#include <Geode/modify/GJShopLayer.hpp>
44

55
using namespace geode::prelude;
66

7-
SET_SWELVY_SPRITE(GJShopLayer, "gd/GJShopLayer");
7+
class $modify(MyGJShopLayer, GJShopLayer) {
8+
bool init(ShopType p0) {
9+
if (!GJShopLayer::init(p0)) {
10+
return false;
11+
}
12+
if (p0 == ShopType::Normal) {
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 (p0 == ShopType::Secret) {
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 (p0 == ShopType::Community) {
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 (p0 == ShopType::Mechanic) {
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+
57+
58+
this->addChild(swelvyBG);
59+
}
60+
} else if (p0 == ShopType::Diamond) {
61+
if (Mod::get()->getSettingValue<bool>("gd/GJShopLayer-Diamond")){
62+
if (auto bg = this->getChildByID("background")) {
63+
bg->setVisible(false);
64+
}
65+
66+
auto swelvyBG = SwelvyBG::create();
67+
swelvyBG->setZOrder(-999);
68+
69+
70+
this->addChild(swelvyBG);
71+
}
72+
}
73+
return true;
74+
}
75+
};

0 commit comments

Comments
 (0)