Changed table layout and added set all button for ai.
This commit is contained in:
16
webui.py
16
webui.py
@@ -131,17 +131,23 @@ def create_ai_table(era, table_container, ai_slots):
|
||||
with ui.card().classes("w-full"):
|
||||
with ui.row().classes("font-bold w-full"):
|
||||
ui.label("ID").classes("w-16")
|
||||
ui.label("Nation").classes("w-40")
|
||||
ui.label("Title").classes("w-64")
|
||||
ui.label("Nation").classes("w-104")
|
||||
ui.label("AI Level")
|
||||
ui.separator()
|
||||
ai_selectors = []
|
||||
with ui.row().classes("items-center, w-full"):
|
||||
ui.label("All").classes("w-124")
|
||||
master_select = ui.select(
|
||||
AI_LEVELS,
|
||||
value="Human",
|
||||
)
|
||||
|
||||
for nation_id, nation in nations[str(era)].items():
|
||||
nation_name, title = nation["name"]
|
||||
|
||||
with ui.row().classes("items-center w-full"):
|
||||
ui.label(str(nation_id)).classes("w-16")
|
||||
ui.label(nation_name).classes("w-40")
|
||||
ui.label(title).classes("w-64")
|
||||
ui.label(nation_name + ", " + title).classes("w-104")
|
||||
# TODO: Set all button
|
||||
# TODO: Random nations?
|
||||
ui.select(
|
||||
@@ -150,7 +156,7 @@ def create_ai_table(era, table_container, ai_slots):
|
||||
on_change=lambda e, nid=nation_id: set_ai_level(
|
||||
e.value, nid, ai_slots
|
||||
),
|
||||
)
|
||||
).bind_value(master_select)
|
||||
|
||||
|
||||
def set_ai_level(value, nid, ai_slots):
|
||||
|
||||
Reference in New Issue
Block a user