scouter/app.py

50 lines
1.2 KiB
Python
Raw Normal View History

2024-02-08 22:44:47 -05:00
import streamlit as st
2024-02-26 17:56:06 -05:00
import database as db
2024-02-08 22:44:47 -05:00
class Creature:
2024-02-08 22:58:17 -05:00
def __init__(self, name, nickname, power, max_spawns, hits_to_kill):
2024-02-08 22:44:47 -05:00
self.name = name
2024-02-08 22:58:17 -05:00
self.nickname = nickname
2024-02-08 22:44:47 -05:00
self.power = power
self.max_spawns = max_spawns
self.hits_to_kill = hits_to_kill
class Run:
def __init__(self, moon):
self.moon = moon
2024-02-09 18:00:04 -05:00
self.inside_power = moon.inside_max_power
self.outside_power = moon.outside_max_power
2024-02-08 22:44:47 -05:00
def main():
2024-02-14 17:23:02 -05:00
st.set_page_config("Lethal Company Scouter", "🛰️")
2024-02-08 22:44:47 -05:00
2024-02-27 16:28:08 -05:00
moon_name = st.selectbox(
2024-02-14 17:23:02 -05:00
"Moon",
2024-02-27 16:28:08 -05:00
db.get_moon_list(),
2024-02-14 17:23:02 -05:00
placeholder="Moon! Pick a moon!",
help="Pick your current moon.",
)
2024-02-27 16:28:08 -05:00
moon_id = db.get_moon_id_by_name(moon_name)
run = Run(db.get_moon_by_id(moon_id))
2024-02-27 16:28:08 -05:00
st.markdown(f"## {run.moon.name} ({run.moon.tier})")
2024-02-27 16:28:08 -05:00
st.info(f"Risk: {run.moon.risk_level} | Min scrap: {run.moon.min_scrap} "
f"| Max scrap: {run.moon.max_scrap} | Default layout: {run.moon.default_layout}")
2024-02-08 22:44:47 -05:00
2024-02-15 15:39:22 -05:00
# Begin column layout
left_column, right_column = st.columns(2)
with left_column:
2024-02-14 17:23:02 -05:00
st.markdown("### Outside")
2024-02-08 22:44:47 -05:00
2024-02-15 15:39:22 -05:00
with right_column:
2024-02-14 17:23:02 -05:00
st.markdown("### Inside")
2024-02-08 22:44:47 -05:00
2024-02-14 17:23:02 -05:00
if __name__ == "__main__":
2024-02-08 22:44:47 -05:00
main()