kwabs22 commited on
Commit
8d27f31
·
1 Parent(s): 2d211c9

Load game supports media now?

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -539,6 +539,7 @@ def load_game(custom_config=None, with_media=False):
539
  print("everything fine till here")
540
  if with_media:
541
  if all_states[starting_location][starting_state][media]:
 
542
  media = all_states[starting_location][starting_state][media]
543
  print("everything fine till here 2")
544
  for media_path in media:
@@ -565,9 +566,9 @@ def load_game(custom_config=None, with_media=False):
565
  error_message += f"{pointer}\n"
566
  error_message += f"Error details: {str(e)}"
567
 
568
- return gr.update(value=error_message), gr.update(), gr.update(), None, gr.update(value=custom_config), None, None
569
  except Exception as e:
570
- return gr.update(value=f"Error loading custom configuration: {str(e)}"), gr.update(), gr.update(), None, gr.update(value=custom_config), None, None
571
 
572
  # If no custom config, start with the default configuration
573
  starting_location = next(iter(all_states.keys()))
 
539
  print("everything fine till here")
540
  if with_media:
541
  if all_states[starting_location][starting_state][media]:
542
+ print(f"everything fine till here 4 - {all_states[starting_location][starting_state][media]}")
543
  media = all_states[starting_location][starting_state][media]
544
  print("everything fine till here 2")
545
  for media_path in media:
 
566
  error_message += f"{pointer}\n"
567
  error_message += f"Error details: {str(e)}"
568
 
569
+ return gr.update(value=error_message), gr.update(), gr.update(), None, gr.update(value=custom_config), game_session, gr.update(value=custom_config)
570
  except Exception as e:
571
+ return gr.update(value=f"Error loading custom configuration: {str(e)}"), gr.update(), gr.update(), None, gr.update(value=custom_config), game_session, gr.update(value=custom_config)
572
 
573
  # If no custom config, start with the default configuration
574
  starting_location = next(iter(all_states.keys()))