Skip to content

Commit b4d1254

Browse files
committed
finish tos option
1 parent 9cc3d52 commit b4d1254

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
"type": "int",
254254
"name": "Terms and Conditions Chance",
255255
"description": "<cc>Agree To Our Terms!</c> - Chance of the TOS pop-up appearing in a level.",
256-
"default": 50,
256+
"default": 75,
257257
"min": 0,
258258
"max": 100,
259259
"control": {

src/hooks/GJBaseGameLayer/TOS.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,22 @@ class $modify(TOSGJBaseGameLayer, GJBaseGameLayer) {
3737

3838
if (auto popup = TermsAndConditions::create(
3939
[this](bool accepted) {
40+
cursor::hide();
41+
4042
if (!accepted) {
41-
Notification::create("You declined the terms and conditions!", NotificationIcon::Error)->show();
43+
Notification::create("You declined our terms and conditions!", NotificationIcon::Error)->show();
44+
45+
updateTimeWarp(1.f);
46+
sfx::play(sfx::file::bad);
4247
if (auto pl = PlayLayer::get()) pl->resetLevelFromStart();
48+
} else {
49+
sfx::play(sfx::file::good);
4350
};
4451
})) {
4552
popup->show();
4653
f->currentTos = popup;
54+
55+
updateTimeWarp(0.125f);
4756
};
4857
};
4958
};

src/util/ui/src/TermsAndConditions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ bool TermsAndConditions::init(Callback&& cb) {
7171
m_mainLayer->addChildAtPosition(acceptButton, Anchor::Bottom, {-60.f, 25.f});
7272
m_mainLayer->addChildAtPosition(declineButton, Anchor::Bottom, {60.f, 25.f});
7373

74+
sfx::play(sfx::file::pop);
75+
7476
return true;
7577
};
7678

0 commit comments

Comments
 (0)