- Adjusted configuration for reset after swipes to 10 seconds and added action to go back. - Updated flow control to skip back action if a recent reset was triggered within 5 seconds. - Implemented a mechanism to enable back navigation when consecutive misses reach a threshold. - Added GUI options to enable or disable back navigation on misses, ensuring consistency with user settings. - Introduced new diagnostic tools for runtime flag checks and screenshot diagnostics. - Created PowerShell scripts for restoring Start Menu shortcuts and performing system health checks. - Added tests for swipe operations and back navigation to validate new logic.
26 lines
925 B
Python
26 lines
925 B
Python
from douyin.handlers.douyin_swipe_handler import SwipeHandler
|
|
|
|
class DummyOp:
|
|
def click_back(self, device_id=None):
|
|
print('DummyOp.click_back called, device_id=', device_id)
|
|
def delay(self, s):
|
|
pass
|
|
|
|
class DummyAnalyser:
|
|
def __init__(self):
|
|
self.operation = DummyOp()
|
|
self.device_id = 'DUMMY'
|
|
self._swipe_times = 5
|
|
self.reset_after_swipes_enabled = True
|
|
self.reset_after_swipes = 5
|
|
self.reset_after_swipes_action = 'back'
|
|
self.resolution_ratio_x = 1080
|
|
self.resolution_ratio_y = 2400
|
|
self.room_pos = 3
|
|
|
|
if __name__ == '__main__':
|
|
a = DummyAnalyser()
|
|
print('Before maybe_reset, _swipe_times=', a._swipe_times, 'action=', a.reset_after_swipes_action)
|
|
SwipeHandler.maybe_reset_after_swipes(a)
|
|
print('After maybe_reset, _swipe_times=', getattr(a, '_swipe_times', None), 'room_pos=', getattr(a, 'room_pos', None))
|