summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2011-01-31 05:12:47 (GMT)
committer Cracker64 <cracker642@gmail.com>2011-01-31 05:12:47 (GMT)
commitb7f768e4b3453a0a5b90efc6a53d05528b689aed (patch)
tree7e9e55fa78ed89ac80a2701da123fece6206a68f /src/interface.c
parent6aaa9e78cd8ce2e11b6696f979a17d92e1c7fc40 (diff)
downloadpowder-b7f768e4b3453a0a5b90efc6a53d05528b689aed.zip
powder-b7f768e4b3453a0a5b90efc6a53d05528b689aed.tar.gz
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.
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c
index 8ec97fb..65f340c 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<PT_NUM && strcmp(element,num)==0)
+ return i;
+ if (strcasecmp(element,"C4")==0) return PT_PLEX;
+ if (strcasecmp(element,"C5")==0) return PT_C5;
+ if (strcasecmp(element,"NONE")==0) return PT_NONE;
+ for (i=0; i<PT_NUM; i++) {
+ if (strcasecmp(element,ptypes[i].name)==0)
+ return i;
+ }
+ return -1;
+} \ No newline at end of file