rianders commited on
Commit
6bfb8ae
·
1 Parent(s): b60db7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -14
app.py CHANGED
@@ -1,20 +1,38 @@
1
  import streamlit as st
 
2
 
3
- # Function to add a new option to the radio list
4
- def add_option(option):
5
- if option and option not in st.session_state.radio_options:
6
- st.session_state.radio_options.append(option)
 
 
 
7
 
8
- # Initialize the session state for radio options if not already done
9
- if 'radio_options' not in st.session_state:
10
- st.session_state.radio_options = []
11
 
12
- # Text input for new option
13
- new_option = st.text_input("Enter a new radio option")
14
 
15
- # Button to add the new option
16
- if st.button("Add Option"):
17
- add_option(new_option)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- # Display the radio buttons
20
- st.radio("Options List", st.session_state.radio_options)
 
1
  import streamlit as st
2
+ from your_character_module import CharacterSheet # Import your character model
3
 
4
+ # Sample characters - replace these with actual data
5
+ characters = {
6
+ "Venom": CharacterSheet(...),
7
+ "Rocket": CharacterSheet(...),
8
+ "Shadow": CharacterSheet(...),
9
+ "Agiee": CharacterSheet(...)
10
+ }
11
 
12
+ # Streamlit app starts here
13
+ st.title("Cyberpunk RPG Character Viewer")
 
14
 
15
+ # Dropdown to select a character
16
+ character_name = st.selectbox("Select a Character", options=list(characters.keys()))
17
 
18
+ # Display the selected character
19
+ character = characters[character_name]
20
+ st.write(f"**Name**: {character.name}")
21
+ st.write("**Aspects**")
22
+ for aspect in character.aspects:
23
+ st.write(f"- {aspect.description}")
24
+ st.write("**Skills**")
25
+ for skill in character.skills:
26
+ st.write(f"- {skill.name}: Level {skill.level}")
27
+ st.write("**Stunts**")
28
+ for stunt in character.stunts:
29
+ st.write(f"- {stunt.name}: {stunt.description}")
30
+ st.write(f"**Stress Level**: {character.stress.level}")
31
+ if character.consequences:
32
+ st.write("**Consequences**")
33
+ for consequence in character.consequences:
34
+ st.write(f"- {consequence.severity}: {consequence.description}")
35
+ else:
36
+ st.write("**Consequences**: None")
37
 
38
+ # Run this Streamlit app with: streamlit run character_viewer.py