fargerm commited on
Commit
361a712
1 Parent(s): 4811e79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -26
app.py CHANGED
@@ -124,30 +124,31 @@ antagonist = st.sidebar.text_input(
124
  st.title("StoryForge")
125
  st.write("StoryForge is your tool for crafting comprehensive Game Design Documents. Enter your game's details, and StoryForge will generate a structured document to guide your development process.")
126
 
127
- # Generate the content when the user has filled in all fields
128
- if environment and protagonist and antagonist:
129
- # Generate content
130
- generated_environment = generate_game_environment(environment)
131
- generated_protagonist = generate_protagonist(protagonist)
132
- generated_antagonist = generate_antagonist(antagonist)
133
- generated_story = generate_game_story(generated_environment, generated_protagonist, generated_antagonist)
134
-
135
- # Columns for Outputs
136
- col1, col2 = st.columns(2)
137
-
138
- with col1:
139
- st.subheader("Game Environment")
140
- st.write(generated_environment)
141
-
142
- st.subheader("Protagonist")
143
- st.write(generated_protagonist)
144
-
145
- with col2:
146
- st.subheader("Game Story")
147
- st.write(generated_story)
148
-
149
- st.subheader("Antagonist")
150
- st.write(generated_antagonist)
151
- else:
152
- st.write("Please fill in all the fields in the sidebar to generate your Game Design Document.")
 
153
 
 
124
  st.title("StoryForge")
125
  st.write("StoryForge is your tool for crafting comprehensive Game Design Documents. Enter your game's details, and StoryForge will generate a structured document to guide your development process.")
126
 
127
+ # Add a Generate button
128
+ if st.button("Generate"):
129
+ if environment and protagonist and antagonist:
130
+ # Generate content
131
+ generated_environment = generate_game_environment(environment)
132
+ generated_protagonist = generate_protagonist(protagonist)
133
+ generated_antagonist = generate_antagonist(antagonist)
134
+ generated_story = generate_game_story(generated_environment, generated_protagonist, generated_antagonist)
135
+
136
+ # Columns for Outputs
137
+ col1, col2 = st.columns(2)
138
+
139
+ with col1:
140
+ st.subheader("Game Environment")
141
+ st.write(generated_environment)
142
+
143
+ st.subheader("Protagonist")
144
+ st.write(generated_protagonist)
145
+
146
+ with col2:
147
+ st.subheader("Game Story")
148
+ st.write(generated_story)
149
+
150
+ st.subheader("Antagonist")
151
+ st.write(generated_antagonist)
152
+ else:
153
+ st.write("Please fill in all the fields in the sidebar to generate your Game Design Document.")
154