Skip to content

Commit 2fb7a1e

Browse files
committed
added UIPOptionsLayer, SecretLayer3, and IDListLayer
1 parent 5c957ca commit 2fb7a1e

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

mod.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@
129129
"type": "bool",
130130
"default": true
131131
},
132+
"show-basement": {
133+
"name": "Show in Basement",
134+
"description": "SecretLayer3",
135+
"type": "bool",
136+
"default": true
137+
},
132138
"show-chamber-of-time": {
133139
"name": "Show in Chamber of Time",
134140
"description": "SecretLayer4",

src/modify/SecretLayer3.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "../SwelvyBG.hpp"
2+
#include <Geode/Geode.hpp>
3+
#include <Geode/modify/SecretLayer3.hpp>
4+
5+
using namespace geode::prelude;
6+
7+
class $modify(MySecretLayer3, SecretLayer3) {
8+
bool init() {
9+
if (!SecretLayer3::init()) {
10+
return false;
11+
}
12+
if (Mod::get()->getSettingValue<bool>("show-basement")){
13+
if (auto bg = this->getChildByID("background")) {
14+
bg->setVisible(false);
15+
auto swelvyBG = SwelvyBG::create();
16+
swelvyBG->setZOrder(-3);
17+
swelvyBG->setID("swelvy-background");
18+
19+
this->addChild(swelvyBG);
20+
}
21+
}
22+
return true;
23+
}
24+
};

src/modify/UIPOptionsLayer.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "../SwelvyBG.hpp"
2+
#include <Geode/Geode.hpp>
3+
#include <Geode/modify/UIPOptionsLayer.hpp>
4+
5+
using namespace geode::prelude;
6+
7+
class $modify(MyUIPOptionsLayer, UIPOptionsLayer) {
8+
bool init() {
9+
if (!UIPOptionsLayer::init()) {
10+
return false;
11+
}
12+
if (Mod::get()->getSettingValue<bool>("show-control-settings")){
13+
this->setOpacity(0);
14+
auto swelvyBG = SwelvyBG::create();
15+
swelvyBG->setZOrder(-3);
16+
swelvyBG->setID("swelvy-background");
17+
18+
this->addChild(swelvyBG);
19+
}
20+
return true;
21+
}
22+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <Geode/Geode.hpp>
2+
#include "../../SwelvyBG.hpp"
3+
#include "../../Hooks/Hooker.hpp"
4+
class IDListLayer : public Betterhook::HookBetter {
5+
void init(CCNode* _This) override {
6+
if (auto bg = _This->getChildByType<CCSprite>(0)) {
7+
bg->setVisible(false);
8+
}
9+
SwelvyBG* swelvyBG = SwelvyBG::create();
10+
swelvyBG->setZOrder(-1);
11+
swelvyBG->setID("swelvy-background");
12+
_This->addChild(swelvyBG);
13+
}
14+
15+
const char* PutLayer() const override { return "IDListLayer"; }
16+
};
17+
18+
19+
REGISTER_HookBetter(IDListLayer);
20+

0 commit comments

Comments
 (0)