Skip to content

Commit

Permalink
Revert "separate keybinds for different modes"
Browse files Browse the repository at this point in the history
This reverts commit f9d2700.
  • Loading branch information
Cvolton committed Sep 13, 2024
1 parent 322247a commit ef56b81
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 326 deletions.
4 changes: 0 additions & 4 deletions include/Keybinds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ namespace keybinds {
bool operator==(Category const&) const;

static constexpr auto PLAY { "Play" };
static constexpr auto PLAY_1P_CLASSIC { "Play/Classic 1P" };
static constexpr auto PLAY_1P_PLATFORMER { "Play/Platformer 1P" };
static constexpr auto PLAY_2P_CLASSIC { "Play/Classic 2P" };
static constexpr auto PLAY_2P_PLATFORMER { "Play/Platformer 2P" };
static constexpr auto PLAY_PAUSE { "Play/Pause" };
static constexpr auto EDITOR { "Editor" };
static constexpr auto GLOBAL { "Global" };
Expand Down
46 changes: 8 additions & 38 deletions src/EditorUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,64 +74,34 @@ struct $modify(EditorUI) {
return false;

Loader::get()->queueInMainThread([this, lel] {
this->defineKeybind("robtop.geometry-dash/jump", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && !lel->m_levelSettings->m_twoPlayerMode && !lel->m_isPlatformer) {
lel->queueButton(platformButton(), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/jump-p1", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode && !lel->m_isPlatformer) {
if (lel->m_playbackMode == PlaybackMode::Playing) {
lel->queueButton(platformButton(), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/jump-p2", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode && !lel->m_isPlatformer) {
lel->queueButton(platformButton(), down, true);
}
});
this->defineKeybind("robtop.geometry-dash/jump-plat", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && !lel->m_levelSettings->m_twoPlayerMode && lel->m_isPlatformer) {
lel->queueButton(platformButton(), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/jump-p1-plat", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode && lel->m_isPlatformer) {
lel->queueButton(platformButton(), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/jump-p2-plat", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode && lel->m_isPlatformer) {
if (lel->m_playbackMode == PlaybackMode::Playing) {
lel->queueButton(platformButton(), down, true);
}
});
this->defineKeybind("robtop.geometry-dash/move-left", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && !lel->m_levelSettings->m_twoPlayerMode) {
lel->queueButton(static_cast<int>(PlayerButton::Left), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/move-right", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && !lel->m_levelSettings->m_twoPlayerMode) {
lel->queueButton(static_cast<int>(PlayerButton::Right), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/move-left-p1", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode) {
if (lel->m_playbackMode == PlaybackMode::Playing) {
lel->queueButton(static_cast<int>(PlayerButton::Left), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/move-right-p1", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode) {
if (lel->m_playbackMode == PlaybackMode::Playing) {
lel->queueButton(static_cast<int>(PlayerButton::Right), down, false);
}
});
this->defineKeybind("robtop.geometry-dash/move-left-p2", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode) {
lel->queueButton(static_cast<int>(PlayerButton::Left), down, lel->m_player2);
if (lel->m_playbackMode == PlaybackMode::Playing) {
lel->queueButton(static_cast<int>(PlayerButton::Left), down, true);
}
});
this->defineKeybind("robtop.geometry-dash/move-right-p2", [lel](bool down) {
if (lel->m_playbackMode == PlaybackMode::Playing && lel->m_levelSettings->m_twoPlayerMode) {
lel->queueButton(static_cast<int>(PlayerButton::Right), down, lel->m_player2);
if (lel->m_playbackMode == PlaybackMode::Playing) {
lel->queueButton(static_cast<int>(PlayerButton::Right), down, true);
}
});
this->defineKeybind("robtop.geometry-dash/pause-level", [this](bool down) {
Expand Down
Loading

0 comments on commit ef56b81

Please sign in to comment.