Spaces:
Runtime error
Runtime error
fix draft team simulation
Browse files
app.py
CHANGED
@@ -273,21 +273,21 @@ if genre == ':rainbow[Heroes Explorer]':
|
|
273 |
## Program 2 "Team Simulation"
|
274 |
elif genre == "Team Simulation":
|
275 |
|
276 |
-
def choose_hero():
|
277 |
-
name_choice = st.selectbox(label='Hero Name:', options=all_name_extra, index=0)
|
278 |
costume_list = return_costume_list(df_extra, name_choice)
|
279 |
-
costume_choice = st.selectbox(label='Costume:', options=costume_list, index=0)
|
280 |
lb_list = ['None', 'LB1', 'LB2']
|
281 |
-
lb_choice = st.selectbox(label='Limit Break:', options=lb_list, index=0)
|
282 |
|
283 |
df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
|
284 |
return df_ret
|
285 |
|
286 |
col1, col2, col3, col4, col5 = st.columns(5)
|
287 |
with col1:
|
288 |
-
df_hero1 = choose_hero()
|
289 |
with col2:
|
290 |
-
df_hero2 = choose_hero()
|
291 |
|
292 |
df_hero_all5 = pd.concat([df_hero1, df_hero2])
|
293 |
display_heroes_from_df(df_hero_all5, display_cols=df_ret.columns[:-2], show_df=False) # display all except special-skill text
|
|
|
273 |
## Program 2 "Team Simulation"
|
274 |
elif genre == "Team Simulation":
|
275 |
|
276 |
+
def choose_hero(key="Hero1"):
|
277 |
+
name_choice = st.selectbox(label='Hero Name:', options=all_name_extra, index=0, key=key)
|
278 |
costume_list = return_costume_list(df_extra, name_choice)
|
279 |
+
costume_choice = st.selectbox(label='Costume:', options=costume_list, index=0, key=key)
|
280 |
lb_list = ['None', 'LB1', 'LB2']
|
281 |
+
lb_choice = st.selectbox(label='Limit Break:', options=lb_list, index=0, key=key)
|
282 |
|
283 |
df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
|
284 |
return df_ret
|
285 |
|
286 |
col1, col2, col3, col4, col5 = st.columns(5)
|
287 |
with col1:
|
288 |
+
df_hero1 = choose_hero(key="Hero1") # 'key' in st.selectbox to differentiate widgets
|
289 |
with col2:
|
290 |
+
df_hero2 = choose_hero(key="Hero2")
|
291 |
|
292 |
df_hero_all5 = pd.concat([df_hero1, df_hero2])
|
293 |
display_heroes_from_df(df_hero_all5, display_cols=df_ret.columns[:-2], show_df=False) # display all except special-skill text
|