Skip to content

Commit

Permalink
fix keybinds going through when unpausing
Browse files Browse the repository at this point in the history
fixes #19
  • Loading branch information
matcool committed Feb 13, 2024
1 parent 9555d48 commit eb7b50c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/UILayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ struct $modify(UILayer) {
}

void pressKeyFallthrough(enumKeyCodes key, bool down) {
// amazing hack
if (this->isPaused())
return;
allowKeyDownThrough = true;
if (down) {
this->keyDown(key);
Expand Down Expand Up @@ -200,7 +203,6 @@ struct $modify(UILayer) {
}, id);
}

// silly hack for hitboxes..
static inline bool allowKeyDownThrough = false;
void keyDown(enumKeyCodes key) override {
if (key == enumKeyCodes::KEY_Escape || allowKeyDownThrough) {
Expand Down

0 comments on commit eb7b50c

Please sign in to comment.