summaryrefslogtreecommitdiff
path: root/src/screen_gameType.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen_gameType.c')
-rw-r--r--src/screen_gameType.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/screen_gameType.c b/src/screen_gameType.c
index 3211d62..6a04da6 100644
--- a/src/screen_gameType.c
+++ b/src/screen_gameType.c
@@ -143,10 +143,23 @@ void initScreenGameType()
button_back = newWidgetButton("Back", 100, WINDOW_SIZE_Y-100, eventWidget);
button_play = newWidgetButton("Play", WINDOW_SIZE_X-200, WINDOW_SIZE_Y-100, eventWidget);
- check_none = newWidgetCheck(100, 150, TRUE, eventWidget);
+ check_none = newWidgetCheck(100, 150, FALSE, eventWidget);
check_server = newWidgetCheck(100, 200, FALSE, eventWidget);
check_client = newWidgetCheck(100, 250, FALSE, eventWidget);
+ if( isParamFlag("--server") )
+ {
+ check_server->status = TRUE;
+ }
+ else if( isParamFlag("--client") )
+ {
+ check_client->status = TRUE;
+ }
+ else
+ {
+ check_none->status = TRUE;
+ }
+
label_none = newWidgetLabel("none", 130, 145, WIDGET_LABEL_LEFT);
label_server = newWidgetLabel("server", 130, 195, WIDGET_LABEL_LEFT);
label_client = newWidgetLabel("client", 130, 245, WIDGET_LABEL_LEFT);
@@ -154,8 +167,8 @@ void initScreenGameType()
label_ip = newWidgetLabel("IP address :", 300, 145, WIDGET_LABEL_LEFT);
label_port = newWidgetLabel("net port :", 300, 245, WIDGET_LABEL_LEFT);
- textfield_ip = newWidgetTextfield("127.0.0.1", 300, 180);
- textfield_port = newWidgetTextfield("2200", 300, 280);
+ textfield_ip = newWidgetTextfield(getParamElse("--ip", "127.0.0.1"), 300, 180);
+ textfield_port = newWidgetTextfield(getParamElse("--port", "2200"), 300, 280);
registerScreen( newScreen("gameType", startScreenGameType, eventScreenGameType,
drawScreenGameType, stopScreenGameType) );