Omnibus commited on
Commit
01cf553
1 Parent(s): b206f41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -188,6 +188,7 @@ def save_game(name,score):
188
  return f'Error Saving Game: {e}'
189
  game_box=[]
190
  block2 = {'game_name': game,
 
191
  'timestamp': timestamp,
192
  'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
193
  'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
@@ -336,14 +337,14 @@ with gr.Blocks() as app:
336
  url_params = gr.JSON({}, visible=True, label="")
337
  acc=gr.Textbox()
338
 
339
- get_high_score_btn=gr.Button()
340
  def return_score(text):
341
  return text
342
 
343
  get_high_score_btn.click(get_high_score,None,score_html)
344
  get_score.click(return_score,score,[score],_js=score_js)
345
  save_btn.click(return_score,score,[score],_js=score_js).then(save_game,[game_name,score],message)
346
- update_game.click(game_fn,[out_sky_url,out_star_url,out_enemy_url],html_game)
347
  btn_sky.click(sky_fn,prompt_sky,[out_im_sky,out_sky_url])
348
  btn_star.click(star_fn,prompt_star,[out_im_star,out_star_url])
349
  btn_enemy.click(enemy_fn,prompt_enemy,[out_im_enemy,out_enemy_url])
 
188
  return f'Error Saving Game: {e}'
189
  game_box=[]
190
  block2 = {'game_name': game,
191
+ 'score':score,
192
  'timestamp': timestamp,
193
  'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
194
  'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
 
337
  url_params = gr.JSON({}, visible=True, label="")
338
  acc=gr.Textbox()
339
 
340
+ get_high_score_btn=gr.Button()
341
  def return_score(text):
342
  return text
343
 
344
  get_high_score_btn.click(get_high_score,None,score_html)
345
  get_score.click(return_score,score,[score],_js=score_js)
346
  save_btn.click(return_score,score,[score],_js=score_js).then(save_game,[game_name,score],message)
347
+ update_game.click(game_fn,[out_sky_url,out_star_url,out_enemy_url],html_game).then(get_high_score,None,score_html)
348
  btn_sky.click(sky_fn,prompt_sky,[out_im_sky,out_sky_url])
349
  btn_star.click(star_fn,prompt_star,[out_im_star,out_star_url])
350
  btn_enemy.click(enemy_fn,prompt_enemy,[out_im_enemy,out_enemy_url])