This repository was archived by the owner on Jun 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +40
-14
lines changed Expand file tree Collapse file tree 9 files changed +40
-14
lines changed Original file line number Diff line number Diff line change 3
3
"gd" : {
4
4
"win" : " 2.204"
5
5
},
6
- "version" : " v2.2.7 " ,
6
+ "version" : " v2.2.9 " ,
7
7
"id" : " maxnu.gd_mega_overlay" ,
8
8
"name" : " GD Mega Overlay" ,
9
9
"developer" : " maxnu & SpaghettDev" ,
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ void Common::onAudioPitchChange()
140
140
AudioChannelControl::setPitch (enabled ? pitch : 1 .f );
141
141
}
142
142
143
- void Common::updateCheathing ()
143
+ void Common::updateCheating ()
144
144
{
145
145
auto checkPatchGroup = [&](JsonPatches::patch_group_type group)
146
146
{
@@ -152,10 +152,8 @@ void Common::updateCheathing()
152
152
return true ;
153
153
}
154
154
}
155
-
156
155
return false ;
157
156
};
158
-
159
157
if (checkPatchGroup (JsonPatches::bypass))
160
158
return ;
161
159
if (checkPatchGroup (JsonPatches::creator))
@@ -166,16 +164,13 @@ void Common::updateCheathing()
166
164
return ;
167
165
if (checkPatchGroup (JsonPatches::player))
168
166
return ;
169
-
170
167
float speedhack =
171
168
Settings::get<bool >(" general/speedhack/enabled" ) ? Settings::get<float >(" general/speedhack/value" ) : 1 .f ;
172
-
173
- if (speedhack != 1 .f )
169
+ if (speedhack != 1 .f || Macrobot::playerMode == 0 )
174
170
{
175
171
isCheating = true ;
176
172
return ;
177
173
}
178
-
179
174
isCheating = false ;
180
175
}
181
176
Original file line number Diff line number Diff line change @@ -21,5 +21,5 @@ namespace Common
21
21
void saveIcons ();
22
22
void loadIcons ();
23
23
24
- void updateCheathing ();
24
+ void updateCheating ();
25
25
};
Original file line number Diff line number Diff line change 13
13
#include " ConstData.h"
14
14
15
15
#include " Common.h"
16
+ #include " Hacks/SafeMode.h"
16
17
17
18
using namespace geode ::prelude;
18
19
@@ -43,7 +44,8 @@ class $modify(CCKeyboardDispatcher) {
43
44
GUI::draw ();
44
45
GUI::shortcutLoop = false ;
45
46
46
- Common::updateCheathing ();
47
+ Common::updateCheating ();
48
+ SafeMode::updateAuto ();
47
49
}
48
50
}
49
51
}
@@ -150,7 +152,8 @@ void GUI::toggle()
150
152
if (!canToggle)
151
153
return ;
152
154
153
- Common::updateCheathing ();
155
+ Common::updateCheating ();
156
+ SafeMode::updateAuto ();
154
157
155
158
isVisible = true ;
156
159
static bool toggle = false ;
Original file line number Diff line number Diff line change 3
3
#include " ../GUI/GUI.h"
4
4
#include " ../JsonPatches/JsonPatches.h"
5
5
#include " ../Settings.hpp"
6
+ #include " Hacks/SafeMode.h"
6
7
7
8
#include < Geode/modify/PlayLayer.hpp>
8
9
#include < Geode/modify/PlayerObject.hpp>
@@ -173,7 +174,8 @@ class $modify(PlayLayer)
173
174
174
175
void resetLevel ()
175
176
{
176
- Common::updateCheathing ();
177
+ Common::updateCheating ();
178
+ SafeMode::updateAuto ();
177
179
noclipDead = false ;
178
180
dead = false ;
179
181
totalClicks = 0 ;
Original file line number Diff line number Diff line change 10
10
#include " ../util.hpp"
11
11
#include " ../Settings.hpp"
12
12
13
+ #include " Common.h"
14
+
13
15
using namespace geode ::prelude;
14
16
using namespace SafeMode ;
15
17
@@ -58,6 +60,14 @@ class $modify(EndLevelLayer)
58
60
}
59
61
};
60
62
63
+ void SafeMode::updateAuto ()
64
+ {
65
+ if (Settings::get<bool >(" level/safe_mode/auto" , false ))
66
+ Mod::get ()->setSavedValue <bool >(" level/safe_mode/enabled" , Common::isCheating);
67
+
68
+ updateState ();
69
+ }
70
+
61
71
void SafeMode::updateState ()
62
72
{
63
73
for (auto & patch : patches)
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ namespace SafeMode
14
14
using opcode = std::pair<unsigned long , std::vector<uint8_t >>;
15
15
16
16
void updateState ();
17
+ void updateAuto ();
17
18
18
19
// move to JsonHacks
19
20
inline const std::array<opcode, PATCHES_SIZE> opcodes{
Original file line number Diff line number Diff line change 11
11
#include < Geode/modify/PlayLayer.hpp>
12
12
#include < Geode/modify/StartPosObject.hpp>
13
13
#include < Geode/modify/CCKeyboardDispatcher.hpp>
14
+ #include < Geode/modify/LevelEditorLayer.hpp>
14
15
15
16
#include " ConstData.h"
16
17
@@ -45,6 +46,17 @@ class $modify(StartPosObject)
45
46
}
46
47
};
47
48
49
+ class $modify(LevelEditorLayer)
50
+ {
51
+ bool init (GJGameLevel* level, bool unk)
52
+ {
53
+ startposObjects.clear ();
54
+
55
+ bool res = LevelEditorLayer::init (level, unk);
56
+ return res;
57
+ }
58
+ };
59
+
48
60
class $modify(PlayLayer)
49
61
{
50
62
void onQuit ()
@@ -55,6 +67,7 @@ class $modify(PlayLayer)
55
67
56
68
bool init (GJGameLevel* p0, bool p1, bool p2)
57
69
{
70
+ CC_SAFE_RELEASE_NULL (startPosLabel);
58
71
startposObjects.clear ();
59
72
bool res = PlayLayer::init (p0, p1, p2);
60
73
Original file line number Diff line number Diff line change @@ -36,14 +36,14 @@ void init()
36
36
DiscordRPCManager::init ();
37
37
Macrobot::getMacros ();
38
38
Clickpacks::init ();
39
- Common::updateCheathing ();
39
+ Common::updateCheating ();
40
40
41
41
GUI::setLateInit ([] {
42
42
Common::calculateFramerate ();
43
43
Common::setPriority ();
44
44
Common::onAudioSpeedChange ();
45
45
Common::loadIcons ();
46
- SafeMode::updateState ();
46
+ SafeMode::updateAuto ();
47
47
});
48
48
}
49
49
@@ -188,6 +188,8 @@ void initGUI()
188
188
189
189
GUI::checkbox (" Replay Last Checkpoint" , " level/replay_checkpoint" );
190
190
191
+ GUI::checkbox (" Auto Safe Mode" , " level/safe_mode/auto" );
192
+
191
193
if (GUI::checkbox (" Safe Mode" , " level/safe_mode/enabled" ))
192
194
SafeMode::updateState ();
193
195
GUI::checkbox (" Safe Mode Endscreen Label" , " level/safe_mode/endscreen_enabled" , true );
You can’t perform that action at this time.
0 commit comments