@@ -145,32 +145,14 @@ void(__thiscall* GJBaseGameLayer_pushButtonO)(gd::GJBaseGameLayer*, int, bool);
145145void __fastcall GJBaseGameLayer_pushButtonH (gd::GJBaseGameLayer* self, uintptr_t , int button, bool rightSide) {
146146 GJBaseGameLayer_pushButtonO (self, button, rightSide);
147147
148- auto bot = GatoBot::sharedState ();
149-
150- if (bot->status == Recording && !MBO (bool , self, 0x39C )) {
151- bool twoPlayer = MBO (bool , self->m_pLevelSettings , 0xFA );
152-
153- if (MBO (bool , self, 0x2A9 ) && !rightSide && twoPlayer)
154- bot->queuedBtnP2 = Pressed;
155-
156- else bot->queuedBtnP1 = Pressed;
157- }
148+ GatoBot::sharedState ()->handleClick (self, rightSide, Pressed);
158149}
159150
160151void (__thiscall* GJBaseGameLayer_releaseButtonO)(gd::GJBaseGameLayer*, int , bool );
161152void __fastcall GJBaseGameLayer_releaseButtonH (gd::GJBaseGameLayer* self, uintptr_t , int button, bool rightSide) {
162153 GJBaseGameLayer_releaseButtonO (self, button, rightSide);
163154
164- auto bot = GatoBot::sharedState ();
165-
166- if (bot->status == Recording && !MBO (bool , self, 0x39C )) {
167- bool twoPlayer = MBO (bool , self->m_pLevelSettings , 0xFA );
168-
169- if (MBO (bool , self, 0x2A9 ) && !rightSide && twoPlayer)
170- bot->queuedBtnP2 = Released;
171-
172- else bot->queuedBtnP1 = Released;
173- }
155+ GatoBot::sharedState ()->handleClick (self, rightSide, Released);
174156}
175157
176158void (__thiscall* UILayer_onCheckO)(gd::UILayer*, CCObject*);
@@ -239,6 +221,8 @@ void __fastcall PlayLayer_resetLevelH(gd::PlayLayer* self, uintptr_t) {
239221 }
240222
241223 // jump?
224+ // MBO(bool, self, 0x2A9) && !rightSide && twoPlayer
225+
242226 if (bot->levelFrames .back ().player1 .isHolding != MBO (bool , self->m_pPlayer1 , 0x611 )) {
243227 if (MBO (bool , self->m_pPlayer1 , 0x611 )) {
244228 bot->levelFrames .back ().player1 .action = Pressed;
@@ -250,7 +234,7 @@ void __fastcall PlayLayer_resetLevelH(gd::PlayLayer* self, uintptr_t) {
250234 }
251235 }
252236
253- if (bot->levelFrames .back ().player2 .isHolding != MBO (bool , self->m_pPlayer2 , 0x611 )) {
237+ if (bot->levelFrames .back ().player2 .isHolding != MBO (bool , self->m_pPlayer2 , 0x611 ) && ( MBO ( bool , self, 0x2A9 ) && ! MBO ( bool , self-> m_pPlayer2 , 0x611 ) && MBO ( bool , self-> m_pLevelSettings , 0xFA )) ) {
254238 if (MBO (bool , self->m_pPlayer2 , 0x611 )) {
255239 bot->levelFrames .back ().player2 .action = Pressed;
256240 bot->levelFrames .back ().player2 .isHolding = true ;
0 commit comments