Replace screen_tapped with screen_down

This commit is contained in:
NyakoFox 2024-04-11 19:55:03 -03:00
parent ec875587e5
commit 9e0c6ce76c
5 changed files with 12 additions and 12 deletions

View File

@ -2386,7 +2386,7 @@ void titleinput(void)
} }
} }
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) 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; game.press_action = true;
} }
@ -2642,7 +2642,7 @@ void gameinput(void)
game.press_action = false; game.press_action = false;
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) 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_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; game.press_action = true;
@ -3538,7 +3538,7 @@ void gamecompleteinput(void)
graphics.titlebg.bypos += graphics.titlebg.bscroll; graphics.titlebg.bypos += graphics.titlebg.bscroll;
game.oldcreditposition = game.creditposition; 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; game.creditposition -= 6;
if (game.creditposition <= -Credits::creditmaxposition) if (game.creditposition <= -Credits::creditmaxposition)
@ -3586,7 +3586,7 @@ void gamecompleteinput2(void)
//Do this here because input comes first //Do this here because input comes first
game.oldcreditposx = game.creditposx; 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.creditposx++;
game.oldcreditposx++; game.oldcreditposx++;

View File

@ -803,7 +803,7 @@ void scriptclass::run(void)
game.hascontrol = false; game.hascontrol = false;
game.pausescript = true; game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86) 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; game.backgroundtext = false;
@ -1829,7 +1829,7 @@ void scriptclass::run(void)
game.hascontrol = false; game.hascontrol = false;
game.pausescript = true; game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86) 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; game.backgroundtext = false;
} }
@ -1852,7 +1852,7 @@ void scriptclass::run(void)
game.hascontrol = false; game.hascontrol = false;
game.pausescript = true; game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86) 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; game.backgroundtext = false;
} }
@ -1873,7 +1873,7 @@ void scriptclass::run(void)
game.hascontrol = false; game.hascontrol = false;
game.pausescript = true; game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86) 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; game.backgroundtext = false;
} }

View File

@ -246,7 +246,7 @@ namespace touch
return false; return false;
} }
bool screen_tapped(void) bool screen_down(void)
{ {
for (int i = 0; i < fingers.size(); i++) for (int i = 0; i < fingers.size(); i++)
{ {
@ -255,7 +255,7 @@ namespace touch
continue; continue;
} }
return fingers[i].pressed; return true;
} }
return false; return false;
} }

View File

@ -57,7 +57,7 @@ namespace touch
bool button_tapped(TouchButtonID button); bool button_tapped(TouchButtonID button);
bool touching_right(void); bool touching_right(void);
bool screen_tapped(void); bool screen_down(void);
} }
#endif /* TOUCH_H */ #endif /* TOUCH_H */

View File

@ -24,7 +24,7 @@ void preloaderinput(void)
{ {
game.press_action = false; 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; game.press_action = true;
} }