-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTOS.cpp
More file actions
58 lines (42 loc) · 1.9 KB
/
Copy pathTOS.cpp
File metadata and controls
58 lines (42 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <Utils.h>
#include <Geode/Geode.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
using namespace geode::prelude;
using namespace horrible::prelude;
#define THIS_ID "terms_and_conditions"
static auto const o = Option::create(THIS_ID)
->setName("Agree To Our Terms!")
->setDescription("Whenever you try to jump, change gamemode, or interact with anything in the level, you must agree with the terms and conditions to continue playing.\n<cl>created by ArcticWoof</c>")
->setCategory(category::obstructive)
->setSillyTier(SillyTier::Medium)
->setCheating(true)
->autoRegister();
class $modify(TOSGJBaseGameLayer, GJBaseGameLayer) {
HORRIBLE_DELEGATE_HOOKS(THIS_ID);
struct Fields final {
uint8_t chance = options::getChance(THIS_ID);
Ref<TermsAndConditions> currentTos = nullptr;
};
void handleButton(bool down, int button, bool isPlayer1) {
GJBaseGameLayer::handleButton(down, button, isPlayer1);
if (!down || button != 1) return;
auto f = m_fields.self();
if (rng::fast() <= f->chance) {
cue::resetNode(f->currentTos);
if (auto popup = TermsAndConditions::create(
[this](bool accepted) {
cursor::hide();
updateTimeWarp(1.f);
if (!accepted) {
Notification::create("You declined our terms and conditions!", NotificationIcon::Error)->show();
if (auto pl = PlayLayer::get()) pl->resetLevelFromStart();
};
})) {
popup->show();
f->currentTos = popup;
cursor::show();
//updateTimeWarp(0.125f);
};
};
};
};