Skip to content

Commit

Permalink
(v3.1.12c) Minors improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumitti committed Jun 28, 2024
1 parent b4810bc commit c476d0f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Empty file added DOCUMENTATION.md
Empty file.
27 changes: 16 additions & 11 deletions starwalkers_streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@

import logging

logging.basicConfig(
filename='streamlit_app.log',
level=logging.ERROR,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)

version = "Version 3.1.12c"


# Page redirection
def login():
Expand All @@ -36,6 +27,17 @@ def game():
st.session_state.page = "game"


# streamlit_app.log for error
logging.basicConfig(
filename='streamlit_app.log',
level=logging.ERROR,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)

# Version
version = "Version 3.1.12c"

# Database initialization
sql.init_db()

Expand Down Expand Up @@ -81,6 +83,7 @@ def game():
- Streamlit app and maintain by Jumitti: [https://github.com/Jumitti](https://github.com/Jumitti)
""")

# Audio settings
if "ambient_sound" not in st.session_state:
st.session_state.ambient_sound = False
st.session_state.effect_sound = False
Expand Down Expand Up @@ -180,10 +183,12 @@ def game():
elif st.session_state.page == "game":
if st.session_state.ambient_sound:
sound_effects.ambient()

# Sidebar
st.sidebar.divider()
if st.sidebar.button("🧹 Refresh"):
if st.sidebar.button("🧹 Refresh"): # For refresh manually
st.rerun()

# Sidebar delete account
if st.sidebar.toggle("🚮 Delete my account"):
password = st.sidebar.text_input("Entrez votre mot de passe", type="password", label_visibility="collapsed",
Expand Down Expand Up @@ -262,4 +267,4 @@ def game():
battle.battle(st.session_state.username, df)
except Exception as e:
col3.error(f"Problem with Battle: {e}")
logging.exception(f"Error: {e}")
logging.exception(f"Error: {e}")

0 comments on commit c476d0f

Please sign in to comment.