From c5b3664d5e525a33cd64910125f904f4efeae369 Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Thu, 11 Apr 2024 19:55:03 -0300 Subject: [PATCH] Replace screen_tapped with screen_down --- desktop_version/src/Input.cpp | 8 ++++---- desktop_version/src/Script.cpp | 8 ++++---- desktop_version/src/Touch.cpp | 4 ++-- desktop_version/src/Touch.h | 2 +- desktop_version/src/preloader.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 59dd3872..0ee8e4af 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -2392,7 +2392,7 @@ void titleinput(void) } } if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) - || (!game.menustart ? touch::screen_tapped() : touch::button_tapped(TOUCH_BUTTON_CONFIRM))) + || (!game.menustart ? touch::screen_down() : touch::button_tapped(TOUCH_BUTTON_CONFIRM))) { game.press_action = true; } @@ -2648,7 +2648,7 @@ void gameinput(void) game.press_action = false; if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || key.isDown(KEYBOARD_w) - || key.isDown(KEYBOARD_s) || key.isDown(game.controllerButton_flip) || touch::screen_tapped() + || key.isDown(KEYBOARD_s) || key.isDown(game.controllerButton_flip) || touch::screen_down() ) { game.press_action = true; @@ -3545,7 +3545,7 @@ void gamecompleteinput(void) graphics.titlebg.bypos += graphics.titlebg.bscroll; game.oldcreditposition = game.creditposition; - if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_tapped()) + if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_down()) { game.creditposition -= 6; if (game.creditposition <= -Credits::creditmaxposition) @@ -3593,7 +3593,7 @@ void gamecompleteinput2(void) //Do this here because input comes first game.oldcreditposx = game.creditposx; - if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_tapped()) + if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_down()) { game.creditposx++; game.oldcreditposx++; diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 28160faf..24b95e3d 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -803,7 +803,7 @@ void scriptclass::run(void) game.hascontrol = false; game.pausescript = true; if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true; + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true; } game.backgroundtext = false; @@ -1853,7 +1853,7 @@ void scriptclass::run(void) game.hascontrol = false; game.pausescript = true; if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true; + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true; } game.backgroundtext = false; } @@ -1876,7 +1876,7 @@ void scriptclass::run(void) game.hascontrol = false; game.pausescript = true; if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true; + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true; } game.backgroundtext = false; } @@ -1897,7 +1897,7 @@ void scriptclass::run(void) game.hascontrol = false; game.pausescript = true; if (key.isDown(90) || key.isDown(32) || key.isDown(86) - || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true; + || key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true; } game.backgroundtext = false; } diff --git a/desktop_version/src/Touch.cpp b/desktop_version/src/Touch.cpp index 939be707..52106a34 100644 --- a/desktop_version/src/Touch.cpp +++ b/desktop_version/src/Touch.cpp @@ -246,7 +246,7 @@ namespace touch return false; } - bool screen_tapped(void) + bool screen_down(void) { for (int i = 0; i < fingers.size(); i++) { @@ -255,7 +255,7 @@ namespace touch continue; } - return fingers[i].pressed; + return true; } return false; } diff --git a/desktop_version/src/Touch.h b/desktop_version/src/Touch.h index ea1bb427..614eb1a4 100644 --- a/desktop_version/src/Touch.h +++ b/desktop_version/src/Touch.h @@ -57,7 +57,7 @@ namespace touch bool button_tapped(TouchButtonID button); bool touching_right(void); - bool screen_tapped(void); + bool screen_down(void); } #endif /* TOUCH_H */ diff --git a/desktop_version/src/preloader.cpp b/desktop_version/src/preloader.cpp index 0e42cb94..239c346b 100644 --- a/desktop_version/src/preloader.cpp +++ b/desktop_version/src/preloader.cpp @@ -24,7 +24,7 @@ void preloaderinput(void) { game.press_action = false; - if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_tapped()) { + if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_down()) { game.press_action = true; }