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.card().classes("w-full"):
|
||||||
with ui.row().classes("font-bold w-full"):
|
with ui.row().classes("font-bold w-full"):
|
||||||
ui.label("ID").classes("w-16")
|
ui.label("ID").classes("w-16")
|
||||||
ui.label("Nation").classes("w-40")
|
ui.label("Nation").classes("w-104")
|
||||||
ui.label("Title").classes("w-64")
|
|
||||||
ui.label("AI Level")
|
ui.label("AI Level")
|
||||||
ui.separator()
|
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():
|
for nation_id, nation in nations[str(era)].items():
|
||||||
nation_name, title = nation["name"]
|
nation_name, title = nation["name"]
|
||||||
|
|
||||||
with ui.row().classes("items-center w-full"):
|
with ui.row().classes("items-center w-full"):
|
||||||
ui.label(str(nation_id)).classes("w-16")
|
ui.label(str(nation_id)).classes("w-16")
|
||||||
ui.label(nation_name).classes("w-40")
|
ui.label(nation_name + ", " + title).classes("w-104")
|
||||||
ui.label(title).classes("w-64")
|
|
||||||
# TODO: Set all button
|
# TODO: Set all button
|
||||||
# TODO: Random nations?
|
# TODO: Random nations?
|
||||||
ui.select(
|
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(
|
on_change=lambda e, nid=nation_id: set_ai_level(
|
||||||
e.value, nid, ai_slots
|
e.value, nid, ai_slots
|
||||||
),
|
),
|
||||||
)
|
).bind_value(master_select)
|
||||||
|
|
||||||
|
|
||||||
def set_ai_level(value, nid, ai_slots):
|
def set_ai_level(value, nid, ai_slots):
|
||||||
|
|||||||
Reference in New Issue
Block a user