Added string generation for testing.
This commit is contained in:
18
webui.py
18
webui.py
@@ -1,4 +1,5 @@
|
|||||||
from nicegui import ui
|
from nicegui import ui
|
||||||
|
from pandas.core.internals.blocks import external_values
|
||||||
from bot_instance import bot
|
from bot_instance import bot
|
||||||
from dom5game import Dom5game
|
from dom5game import Dom5game
|
||||||
import servermanager
|
import servermanager
|
||||||
@@ -45,7 +46,7 @@ def creator_page():
|
|||||||
os.path.isdir("games/" + value)
|
os.path.isdir("games/" + value)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
).value
|
)
|
||||||
# Port
|
# Port
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
port_min = int(os.getenv("PORT_MIN", 1024))
|
port_min = int(os.getenv("PORT_MIN", 1024))
|
||||||
@@ -65,13 +66,26 @@ def creator_page():
|
|||||||
era_container = ui.row()
|
era_container = ui.row()
|
||||||
table_container = ui.column()
|
table_container = ui.column()
|
||||||
with era_container:
|
with era_container:
|
||||||
era = ( # might not need the variable anymore
|
era = (
|
||||||
ui.radio({1: "Early Age", 2: "Middle Age", 3: "Late Age"})
|
ui.radio({1: "Early Age", 2: "Middle Age", 3: "Late Age"})
|
||||||
.props("inline")
|
.props("inline")
|
||||||
.on_value_change(
|
.on_value_change(
|
||||||
lambda e: create_ai_table(e.value, table_container, ai_slots)
|
lambda e: create_ai_table(e.value, table_container, ai_slots)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
# TODO: REMOVE THIS it is just for testing
|
||||||
|
ui.button(
|
||||||
|
"Generate String",
|
||||||
|
on_click=lambda: print(
|
||||||
|
servermanager.server_command_builder(
|
||||||
|
name=name.value,
|
||||||
|
port=int(port.value),
|
||||||
|
era=int(era.value),
|
||||||
|
ai_slots=ai_slots,
|
||||||
|
random_map=15,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_ai_table(era, table_container, ai_slots):
|
def create_ai_table(era, table_container, ai_slots):
|
||||||
|
|||||||
Reference in New Issue
Block a user