Skip to content

Commit

Permalink
I dont no
Browse files Browse the repository at this point in the history
  • Loading branch information
lcm7341 committed Sep 2, 2023
1 parent f96e751 commit 5eb38fe
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(Echo)
set(Echo_VERSION_MAJOR 1)
set(Echo_VERSION_MINOR 0)
set(Echo_VERSION_MINOR 05)

set(CMAKE_SHARED_LIBRARY_SUFFIX " v${Echo_VERSION_MAJOR}.${Echo_VERSION_MINOR}.dll")

Expand Down
2 changes: 1 addition & 1 deletion src/GUI/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ double evalExpression(const std::vector<std::string>& tokens, std::map<std::stri
return result;
}

std::string echo_version = "Echo v1.0";
std::string echo_version = "Echo v1.05 [BETA]";

int getRandomInt(int N) {
// Seed the random number generator with current time
Expand Down
92 changes: 87 additions & 5 deletions src/Hooks/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,28 @@ int __fastcall Hooks::PlayLayer::pushButton_h(gd::PlayLayer* self, int, int idk,
}

if (logic.is_playing() && !logic.clickbot_enabled) {
return pushButton(self, idk, button);
if (logic.is_playing() && logic.playback_clicking)
return pushButton(self, idk, button);
else if (logic.is_playing()) {
if (logic.ignore_actions_at_playback) {
if (!self->m_level->twoPlayerMode) {
if (button && !logic.record_player_2)
return 0;
if (!button && !logic.record_player_1)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
else {
if (button && !logic.record_player_1)
return 0;
if (!button && !logic.record_player_2)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
}
}
}

if (logic.clickbot_enabled && (!logic.is_playing() || logic.playback_clicking)) {
Expand Down Expand Up @@ -996,8 +1017,28 @@ int __fastcall Hooks::PlayLayer::pushButton_h(gd::PlayLayer* self, int, int idk,
}

button = oldButton;
if (logic.is_playing())
if (logic.is_playing() && logic.playback_clicking)
return pushButton(self, idk, button);
else if (logic.is_playing()) {
if (logic.ignore_actions_at_playback) {
if (!self->m_level->twoPlayerMode) {
if (button && !logic.record_player_2)
return 0;
if (!button && !logic.record_player_1)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
else {
if (button && !logic.record_player_1)
return 0;
if (!button && !logic.record_player_2)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
}
}
}

if (logic.playback_clicking) return 0;
Expand Down Expand Up @@ -1072,8 +1113,29 @@ int __fastcall Hooks::PlayLayer::releaseButton_h(gd::PlayLayer* self, int, int i

logic.currently_pressing = false;

if (logic.is_playing() && !logic.clickbot_enabled) {
return releaseButton(self, idk, button);
if (!logic.clickbot_enabled) {
if (logic.is_playing() && logic.playback_releasing)
return releaseButton(self, idk, button);
else if (logic.is_playing()) {
if (logic.ignore_actions_at_playback) {
if (!self->m_level->twoPlayerMode) {
if (button && !logic.record_player_2)
return 0;
if (!button && !logic.record_player_1)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
else {
if (button && !logic.record_player_1)
return 0;
if (!button && !logic.record_player_2)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
}
}
}

if ((logic.clickbot_enabled && !logic.is_playing()) || (logic.clickbot_enabled && logic.playback_releasing)) {
Expand Down Expand Up @@ -1175,8 +1237,28 @@ int __fastcall Hooks::PlayLayer::releaseButton_h(gd::PlayLayer* self, int, int i
}
Clickbot::system->update();
button = oldButton;
if (logic.is_playing())
if (logic.is_playing() && logic.playback_releasing)
return releaseButton(self, idk, button);
else if (logic.is_playing()) {
if (logic.ignore_actions_at_playback) {
if (!self->m_level->twoPlayerMode) {
if (button && !logic.record_player_2)
return 0;
if (!button && !logic.record_player_1)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
else {
if (button && !logic.record_player_1)
return 0;
if (!button && !logic.record_player_2)
return 0;
if (logic.play_player_1 && logic.play_player_2)
return 0;
}
}
}
}

if (logic.playback_releasing) return 0;
Expand Down
11 changes: 9 additions & 2 deletions src/Logic/logic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,17 +580,24 @@ class Logic {
if (last_input_itr != inputs.rend()) {
lastInput = *last_input_itr;
wasPressingDown = lastInput.pressingDown;
bool playerInverse = isPlayer2 ? click_inverse_p2 : click_inverse_p1;

// If the player is not currently pressing, but was pressing on the last input
if (!player->m_isHolding && wasPressingDown && !isDashing) {
if (lastInput.number != get_frame()) {
add_input({ get_frame(), false, isPlayer2 });
if (playerInverse && !wasPressingDown)
add_input({ get_frame(), false, isPlayer2 });
else if (!playerInverse)
add_input({ get_frame(), false, isPlayer2 });
}
}
// If the player is currently pressing, but was not pressing on the last input
else if (player->m_isHolding && !wasPressingDown && !isDashing) {
if (lastInput.number != get_frame()) {
add_input({ get_frame(), true, isPlayer2 });
if (playerInverse && wasPressingDown)
add_input({ get_frame(), true, isPlayer2 });
else if (!playerInverse)
add_input({ get_frame(), true, isPlayer2 });

// Handle Orb Checking
orbChecking(player->getPosition());
Expand Down

0 comments on commit 5eb38fe

Please sign in to comment.