From b7f768e4b3453a0a5b90efc6a53d05528b689aed Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Mon, 31 Jan 2011 00:12:47 -0500 Subject: [PATCH] Moved console commands into own function. Added running script files so console commands can be run instantly. Added create command. element names work, from jacksonmj. --- includes/interface.h | 2 + src/interface.c | 19 ++ src/main.c | 569 ++++++++++++++++++++++++------------------- 3 files changed, 336 insertions(+), 254 deletions(-) diff --git a/includes/interface.h b/includes/interface.h index de1c95509..870e917e1 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -228,5 +228,7 @@ int report_ui(pixel *vid_buf, char *save_id); char *console_ui(pixel *vid_buf, char error[255]); +int console_get_type(char *element); + #endif diff --git a/src/interface.c b/src/interface.c index 8ec97fb46..65f340c1f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -3898,6 +3898,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show if(ci==-1) { strcpy(ed.str, ""); + ed.cursor = strlen(ed.str); } else { @@ -3916,6 +3917,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show { ci = -1; strcpy(ed.str, ""); + ed.cursor = strlen(ed.str); } } } @@ -3925,3 +3927,20 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show } +int console_get_type(char *element) +{ + int i; + char num[4]; + i = atoi(element); + sprintf(num,"%d",i); + if (i>=0 && i YRES || nx > XRES) + sprintf(console_error, "Invalid Coordinates", console2); + else + create_part(-1,nx,ny,j); + } + else if(strcmp(console2, "reset")==0 && console3) + { + if(strcmp(console3, "pressure")==0) + { + for (nx = 0; nx