You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Doom app: show list before starting, even if just one
This commit is contained in:
@@ -102,12 +102,6 @@ class Doom(Activity):
|
||||
print("No WAD files found")
|
||||
return
|
||||
|
||||
# If only one WAD file, auto-start it
|
||||
if len(all_wads) == 1:
|
||||
print(f"refresh_wad_list: Only one WAD file found, auto-starting: {all_wads[0]}")
|
||||
self.start_wad_file(all_wads[0])
|
||||
return
|
||||
|
||||
# Populate list with WAD files
|
||||
print(f"refresh_wad_list: Populating list with {len(all_wads)} WAD files")
|
||||
self.status_label.set_text(f"Listed files in: {self.bootfile_prefix + self.doomdir}")
|
||||
@@ -118,6 +112,12 @@ class Doom(Activity):
|
||||
button = self.wadlist.add_button(None, button_text)
|
||||
button.add_event_cb(lambda e, f=wad_file: self.start_wad_file(f), lv.EVENT.CLICKED, None)
|
||||
|
||||
# If only one WAD file, auto-start it
|
||||
if len(all_wads) == 1:
|
||||
print(f"refresh_wad_list: Only one WAD file found, auto-starting: {all_wads[0]}")
|
||||
self.start_wad_file(all_wads[0])
|
||||
return
|
||||
|
||||
def start_wad_file(self, wad_file):
|
||||
"""Start a WAD file (called from list selection or auto-start)"""
|
||||
print(f"start_wad_file: WAD file selected: {wad_file}")
|
||||
|
||||
Reference in New Issue
Block a user