@@ -330,27 +330,37 @@ def find_next_hint(self, x1, y1, x2, y2, s, box_name="hint_text"):
330330 fps_text = find_boxes_by_name (texts , re .compile (s , re .IGNORECASE ))
331331 if fps_text :
332332 return True
333-
333+
334334 def reset_and_transport (self ):
335335 self .open_in_mission_menu ()
336336 self .sleep (0.8 )
337- self .wait_until (lambda : self .find_next_hint (0.05 , 0.01 , 0.09 , 0.05 , r'设置' ),
338- post_action = self .click (0.73 , 0.92 , after_sleep = 0.5 ),
339- time_out = 2 )
340- self .wait_until (lambda : self .find_next_hint (0.06 , 0.29 , 0.12 , 0.33 , r'重置位置' ),
341- post_action = self .click (0.35 , 0.03 , after_sleep = 0.5 ),
342- time_out = 2 )
343- self .wait_until (lambda : self .find_next_hint (0.57 , 0.54 , 0.62 , 0.58 , r'确定' ),
344- post_action = lambda : (
345- self .move_mouse_to_safe_position (),
346- self .click (0.60 , 0.32 ),
347- self .move_back_from_safe_position (),
348- self .sleep (1 )
349- ),
350- time_out = 4 )
351- self .wait_until (self .in_team ,
352- post_action = self .click (0.59 , 0.56 , after_sleep = 0.5 ),
353- time_out = 2 )
337+ self .wait_until (
338+ condition = lambda : not self .find_esc_menu (),
339+ post_action = self .click (0.73 , 0.92 , after_sleep = 0.5 ),
340+ time_out = 2 ,
341+ )
342+ other_box = self .box_of_screen_scaled (2560 , 1440 , 849 , 16 , 952 , 79 , name = "other_section" , hcenter = True )
343+ self .wait_until (
344+ condition = lambda : self .calculate_color_percentage (setting_menu_selected_color , other_box ) > 0.12 ,
345+ post_action = self .click (0.35 , 0.03 , after_sleep = 0.5 ),
346+ time_out = 2 ,
347+ )
348+ confirm_box = self .box_of_screen_scaled (2560 , 1440 , 1298 , 776 , 1368 , 843 , name = "confirm_btn" , hcenter = True )
349+ self .wait_until (
350+ condition = lambda : self .find_start_btn (box = confirm_box ),
351+ post_action = lambda : (
352+ self .move_mouse_to_safe_position (),
353+ self .click (0.60 , 0.32 ),
354+ self .move_back_from_safe_position (),
355+ self .sleep (1 ),
356+ ),
357+ time_out = 4 ,
358+ )
359+ self .wait_until (
360+ condition = self .in_team ,
361+ post_action = self .click (0.59 , 0.56 , after_sleep = 0.5 ),
362+ time_out = 2 ,
363+ )
354364
355365
356366class QuickMoveTask :
@@ -371,3 +381,10 @@ def run(self):
371381 def reset (self ):
372382 if self .owner ._move_task :
373383 self .owner ._move_task .reset ()
384+
385+
386+ setting_menu_selected_color = {
387+ 'r' : (220 , 255 ), # Red range
388+ 'g' : (200 , 255 ), # Green range
389+ 'b' : (125 , 255 ) # Blue range
390+ }
0 commit comments