Spaces:
Runtime error
Runtime error
kwabs22
commited on
Commit
·
39f526c
1
Parent(s):
f8bbf62
Merge game and edit interfaces
Browse files
app.py
CHANGED
|
@@ -819,37 +819,38 @@ with gr.Blocks() as demo:
|
|
| 819 |
gr.HTML("Placeholder for Config with 3D assets")
|
| 820 |
|
| 821 |
with gr.Tab("Edit config while playing game"):
|
| 822 |
-
gr.HTML("-- Incomplete -- Issue here is updating all variables")
|
| 823 |
with gr.Row():
|
| 824 |
with gr.Column(scale=1):
|
| 825 |
-
gr.
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
gr.
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
|
|
|
|
|
|
|
|
|
| 841 |
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
outputs=[ewpwadescription, ewpwachoices, ewpwagame_log, ewpwagame_session, ewpwamedia]
|
| 852 |
-
)
|
| 853 |
with gr.Column(scale=1):
|
| 854 |
gr.Markdown("# Debugging")
|
| 855 |
ewpwaerror_box = gr.Textbox(label="Path Errors", lines=4, value=path_errors)
|
|
|
|
| 819 |
gr.HTML("Placeholder for Config with 3D assets")
|
| 820 |
|
| 821 |
with gr.Tab("Edit config while playing game"):
|
| 822 |
+
gr.HTML("-- Incomplete -- Issue here is updating all variables <br> Current problem is passing values from rendered items to the config box <br>Generate Timline also makes config without mmedia key <br>Need a way have dropdowns for the filelist and transitions eg. changing transitions must auto update choices")
|
| 823 |
with gr.Row():
|
| 824 |
with gr.Column(scale=1):
|
| 825 |
+
with gr.Group():
|
| 826 |
+
gr.Markdown("# Text-based Adventure Game")
|
| 827 |
+
|
| 828 |
+
ewpwadescription = gr.Textbox(label="Current Situation", lines=4, value=initgameinfo[0])
|
| 829 |
+
ewpwamediabool = gr.State(value=True)
|
| 830 |
+
ewpwamedia = gr.State(["testmedia/Stable Audio - Raindrops, output.wav"])
|
| 831 |
+
|
| 832 |
+
@gr.render(inputs=ewpwamedia)
|
| 833 |
+
def dynamic_with_media(media_items):
|
| 834 |
+
print(media_items)
|
| 835 |
+
with gr.Group() as ewpwamediagrouping:
|
| 836 |
+
gr.HTML("Placeholder to load all media tests - still need to test clearing media on ")
|
| 837 |
+
if media_items == []:
|
| 838 |
+
gr.Markdown("No media items to display.")
|
| 839 |
+
else:
|
| 840 |
+
for item in media_items:
|
| 841 |
+
render = create_media_component(item)
|
| 842 |
+
|
| 843 |
+
return ewpwamediagrouping
|
| 844 |
|
| 845 |
+
ewpwachoices = gr.Radio(label="Your Choices", choices=initgameinfo[1])
|
| 846 |
+
ewpwasubmit_btn = gr.Button("Make Choice")
|
| 847 |
+
ewpwagame_log = gr.Textbox(label="Game Log", lines=20, value=initgameinfo[2])
|
| 848 |
+
ewpwagame_session = gr.State(value=initgameinfo[3])
|
| 849 |
+
ewpwasubmit_btn.click(
|
| 850 |
+
make_choice,
|
| 851 |
+
inputs=[ewpwachoices, ewpwagame_session, ewpwamediabool],
|
| 852 |
+
outputs=[ewpwadescription, ewpwachoices, ewpwagame_log, ewpwagame_session, ewpwamedia]
|
| 853 |
+
)
|
|
|
|
|
|
|
| 854 |
with gr.Column(scale=1):
|
| 855 |
gr.Markdown("# Debugging")
|
| 856 |
ewpwaerror_box = gr.Textbox(label="Path Errors", lines=4, value=path_errors)
|