@@ -93,15 +93,21 @@ def refresh_wad_list(self):
9393 # Hide status label if we have files
9494 self .status_label .add_flag (lv .obj .FLAG .HIDDEN )
9595
96+ # If only one WAD file, auto-start it
97+ if len (all_wads ) == 1 :
98+ print (f"refresh_wad_list: Only one WAD file found, auto-starting: { all_wads [0 ]} " )
99+ self .start_wad_file (all_wads [0 ])
100+ return
101+
96102 # Populate list with WAD files
97103 print (f"refresh_wad_list: Populating list with { len (all_wads )} WAD files" )
98104 for wad_file in all_wads :
99105 button = self .wadlist .add_button (None , wad_file )
100- button .add_event_cb (lambda e , f = wad_file : self .wad_selected_cb (f ), lv .EVENT .CLICKED , None )
106+ button .add_event_cb (lambda e , f = wad_file : self .start_wad_file (f ), lv .EVENT .CLICKED , None )
101107
102- def wad_selected_cb (self , wad_file ):
103- """Handle WAD file selection from list"""
104- print (f"wad_selected_cb : WAD file selected: { wad_file } " )
108+ def start_wad_file (self , wad_file ):
109+ """Start a WAD file (called from list selection or auto-start) """
110+ print (f"start_wad_file : WAD file selected: { wad_file } " )
105111 wadfile_path = self .doomdir + '/' + wad_file
106112 # Do it in a separate task so the UI doesn't hang (shows progress, status_label) and the serial console keeps showing prints
107113 TaskManager .create_task (self .start_wad (self .bootfile_prefix , self .bootfile_to_write , wadfile_path ))
0 commit comments