scouter/app.py

52 lines
1.3 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 Run:
2024-02-28 17:59:18 -05:00
def __init__(self, moon: db.Moon):
2024-02-28 17:55:22 -05:00
self.moon: db.Moon = moon
self.inside_power: int = moon.inside_max_power
self.outside_power: int = 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-28 16:56:44 -05:00
st.markdown("# :red[Lethal Company] Scouter")
st.markdown(":rainbow[What does the scouter say about this moon's power level?]")
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-28 18:02:29 -05:00
moon_id: int = db.get_moon_id_by_name(moon_name)
run: 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-28 16:56:44 -05:00
st.write(run)
st.write(run.moon)
2024-02-08 22:44:47 -05:00
2024-02-15 15:39:22 -05:00
# Begin column layout
2024-03-01 16:35:30 -05:00
creatures = db.get_spawnable_inside_creature_ids(run.moon.moon_id)
for creature in creatures:
st.write(db.get_creature_by_id(creature))
2024-02-08 22:44:47 -05:00
2024-02-28 16:56:44 -05:00
st.markdown('## Scrap Lookup')
scrap_name = st.selectbox(
2024-02-28 17:41:40 -05:00
'Scrap',
2024-02-28 16:56:44 -05:00
db.get_scrap_list(),
placeholder='Select a scrap name!'
)
2024-02-28 18:02:29 -05:00
scrap_id: int = db.get_scrap_id_by_name(scrap_name)
scrap: db.Scrap = db.get_scrap_by_id(scrap_id)
2024-02-28 16:56:44 -05:00
st.write(scrap)
2024-02-14 17:23:02 -05:00
if __name__ == "__main__":
2024-02-08 22:44:47 -05:00
main()