Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiLko authored Jan 22, 2024
1 parent f3b1c5b commit 9a6f3d0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/CCKeyboardDispatcher.hpp>
#include <Geode/modify/PlayLayer.hpp>

using namespace geode::prelude;

bool should_key_jump(int key) {
Expand All @@ -20,13 +19,13 @@ bool is_player1(int key) {
return p1_keys.find(key) != p1_keys.end();
}
class $modify(CCKeyboardDispatcher) {
public:
bool dispatchKeyboardMSG(cocos2d::enumKeyCodes enumKey, bool down, bool arr) {
int key = static_cast<int>(enumKey);
auto play_layer = PlayLayer::get();
if (play_layer && should_key_jump(key)) {
auto is_practice_mode = play_layer->m_isPracticeMode;
if (!is_practice_mode || (key != 'Z' && key != 'X')) {
auto is_platformer = play_layer->m_levelSettings->m_platformerMode;
if ((!is_practice_mode || (key != 'Z' && key != 'X')) && ((key != 'A' && key != 'D') || !is_platformer)) {
bool player1 = true;
if (key == 0x10) {
bool left_shift = GetAsyncKeyState(VK_LSHIFT) < 0;
Expand Down

0 comments on commit 9a6f3d0

Please sign in to comment.