Skip to content

Commit

Permalink
Update some methods I forgot to update
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom committed Apr 19, 2024
1 parent 47b5b83 commit 5c53307
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/sfml/Emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ int Emulator::launch(const std::string &rom) {

// TODO: You can hold down the button and it will run at the next possible point
// fix this but make it a little easier to time because otherwise you need to time it perfectly which doesnt feel good
// ^ if the InputHandler was to be used anyway
// Handle keyboard inputs
if (event.type == sf::Event::KeyPressed) {
keyboard.handleKeyDown(event.key.code);
Expand Down
2 changes: 1 addition & 1 deletion src/sfml/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ MainMenu::MainMenu(std::unordered_map<std::string *, std::vector<std::string>>&
}
button.update(&this->inputHandler, pos);

if (button.isClicked()) {
if (button.isJustClicked()) {
nfdchar_t* outPath = nullptr;
nfdresult_t result = NFD_PickFolder(nullptr, &outPath);

Expand Down
2 changes: 1 addition & 1 deletion src/sfml/ui/TextButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void TextButton::update(InputHandler* inputHandler, sf::Vector2i pos) {
this->lastPressed = this->isPressed;
this->isHovered = this->button.getGlobalBounds().contains(pos.x, pos.y);

if (this->isHovered && inputHandler->isClicked(sf::Mouse::Left)) {
if (this->isHovered && inputHandler->isJustClicked(sf::Mouse::Left)) {
this->isPressed = true;
updateColour(this->activeColor);
} else if (this->isHovered && inputHandler->isPressed(sf::Keyboard::Key::LShift)) {
Expand Down

0 comments on commit 5c53307

Please sign in to comment.