@@ -88,8 +88,8 @@ def get_file_size_warning(self, filepath):
8888 return ""
8989
9090 def refresh_wad_list (self ):
91- self .status_label .set_text (f"Listing files in: { self .bootfile_prefix + self .doomdir } " )
9291 """Scan for WAD files and populate the list"""
92+ self .status_label .set_text (f"Listing files in: { self .bootfile_prefix + self .doomdir } " )
9393 print ("refresh_wad_list: Clearing current list" )
9494 self .wadlist .clean ()
9595
@@ -107,7 +107,7 @@ def refresh_wad_list(self):
107107 self .status_label .set_text (f"Listed files in: { self .bootfile_prefix + self .doomdir } " )
108108 for wad_file in all_wads :
109109 # Get file size warning if applicable
110- warning = self .get_file_size_warning (self .doomdir + '/' + wad_file )
110+ warning = self .get_file_size_warning (self .bootfile_prefix + self . doomdir + '/' + wad_file )
111111 button_text = wad_file + warning
112112 button = self .wadlist .add_button (None , button_text )
113113 button .add_event_cb (lambda e , f = wad_file : self .start_wad_file (f ), lv .EVENT .CLICKED , None )
@@ -116,14 +116,17 @@ def refresh_wad_list(self):
116116 if len (all_wads ) == 1 :
117117 print (f"refresh_wad_list: Only one WAD file found, auto-starting: { all_wads [0 ]} " )
118118 self .start_wad_file (all_wads [0 ])
119- return
120119
121120 def start_wad_file (self , wad_file ):
122121 """Start a WAD file (called from list selection or auto-start)"""
123122 print (f"start_wad_file: WAD file selected: { wad_file } " )
124- wadfile_path = self .doomdir + '/' + wad_file
123+ wadfile_path = self .bootfile_prefix + self . doomdir + '/' + wad_file
125124 # Do it in a separate task so the UI doesn't hang (shows progress, status_label) and the serial console keeps showing prints
126- TaskManager .create_task (self .start_wad (self .bootfile_prefix , self .bootfile_to_write , wadfile_path ))
125+ TaskManager .create_task (self ._start_wad_task (self .bootfile_prefix , self .bootfile_to_write , wadfile_path ))
126+
127+ async def _start_wad_task (self , bootfile_prefix , bootfile_to_write , wadfile ):
128+ """Wrapper to ensure start_wad is called as a coroutine"""
129+ await self .start_wad (bootfile_prefix , bootfile_to_write , wadfile )
127130
128131 def mkdir (self , dirname ):
129132 # Would be better to only create it if it doesn't exist
0 commit comments