final changes for better touch function
This commit is contained in:
4
main.py
4
main.py
@@ -708,10 +708,10 @@ async def main():
|
|||||||
running = False
|
running = False
|
||||||
elif event.type == pygame.KEYDOWN or event.type == pygame.JOYBUTTONDOWN or event.type == pygame.JOYHATMOTION or event.type == pygame.FINGERDOWN or touch_start or (event.type == pygame.MOUSEBUTTONDOWN and event.button == 1):
|
elif event.type == pygame.KEYDOWN or event.type == pygame.JOYBUTTONDOWN or event.type == pygame.JOYHATMOTION or event.type == pygame.FINGERDOWN or touch_start or (event.type == pygame.MOUSEBUTTONDOWN and event.button == 1):
|
||||||
if state == 1: # PLAYING
|
if state == 1: # PLAYING
|
||||||
|
result = None
|
||||||
if pygame.FINGERUP and touch_start:
|
if pygame.FINGERUP and touch_start:
|
||||||
result = touch(event)
|
result = touch(event)
|
||||||
else:
|
|
||||||
result = None
|
|
||||||
if is_LEFT_event(event) or result == "ontop":
|
if is_LEFT_event(event) or result == "ontop":
|
||||||
can_tip = current_case.length_units * UNIT_HEIGHT <= TRAILER_HEIGHT
|
can_tip = current_case.length_units * UNIT_HEIGHT <= TRAILER_HEIGHT
|
||||||
if current_case and current_case.allow_snap and can_use_tilt and can_tip:
|
if current_case and current_case.allow_snap and can_use_tilt and can_tip:
|
||||||
|
|||||||
Reference in New Issue
Block a user