+Fri Oct 9 13:22:37 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+ * Implemented "lazy mode" traversal - pressing the space bar will do
+ <N>ext messsage, <G>oto next room, or read <N>ew as appropriate.
+
Thu Oct 8 17:13:27 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* messages.c, citadel.rc: added the ability to display message numbers
in the header when reading messages. I think this is butt ugly, but
int rc_display_message_numbers;
char *gl_string;
+int next_lazy_cmd = 5;
struct citcmd *cmdlist = NULL;
FILE *ccfile;
char buf[256];
struct citcmd *cptr;
+ struct citcmd *lastcmd = NULL;
int a,d;
int b = 0;
++a;
}
- cptr->next = cmdlist;
- cmdlist = cptr;
-
+ cptr->next = NULL;
+ if (cmdlist == NULL) cmdlist = cptr;
+ else lastcmd->next = cptr;
+ lastcmd = cptr;
}
}
fclose(ccfile);
int ch;
int a;
int got;
+ int this_lazy_cmd;
struct citcmd *cptr;
/* if we're running in idiot mode, display a cute little menu */
ch = inkey();
ok_to_interrupt = 0;
+ /* Handle the backspace key, but only if there's something
+ * to backspace over...
+ */
if ( (ch == 8) && (cmdpos > 0) ) {
back(cmdspaces[cmdpos-1] + 1);
cmdbuf[cmdpos] = 0;
--cmdpos;
}
+ /* Spacebar invokes "lazy traversal" commands */
+ if ( (ch == 32) && (cmdpos == 0) ) {
+ this_lazy_cmd = next_lazy_cmd;
+ if (this_lazy_cmd == 13) next_lazy_cmd = 5;
+ if (this_lazy_cmd == 5) next_lazy_cmd = 13;
+ for (cptr = cmdlist; cptr != NULL; cptr = cptr->next) {
+ if (cptr->c_cmdnum == this_lazy_cmd) {
+ for (a=0; a<5; ++a)
+ if (cptr->c_keys[a][0] != 0)
+ printf("%s ", cmd_expand(
+ cptr->c_keys[a], 0));
+ printf("\n");
+ return(this_lazy_cmd);
+ }
+ }
+ printf("\n");
+ return(this_lazy_cmd);
+ }
+
+ /* Otherwise, process the command */
cmdbuf[cmdpos] = tolower(ch);
for (cptr = cmdlist; cptr != NULL; cptr = cptr->next) {
for (cptr = cmdlist; cptr != NULL; cptr = cptr->next) {
if (cmdmatch(cmdbuf,cptr,5)) {
+ /* We've found our command. */
if (requires_string(cptr,cmdpos)) {
getline(argbuf,32);
}
else {
printf("\n");
}
+
+ /* If this command is one that changes rooms,
+ * then the next lazy-command (space bar)
+ * should be "read new" instead of "goto"
+ */
+ if ((cptr->c_cmdnum==5)
+ ||(cptr->c_cmdnum==6)
+ ||(cptr->c_cmdnum==47)
+ ||(cptr->c_cmdnum==52)
+ ||(cptr->c_cmdnum==16)
+ ||(cptr->c_cmdnum==20))
+ next_lazy_cmd = 13;
+
return(cptr->c_cmdnum);
+
}
}
lines_printed = 2;
e=(inkey()&127); e=tolower(e);
/* return key same as <N> */ if (e==13) e='n';
+/* space key same as <N> */ if (e==32) e='n';
/* del/move for aides only */ if (!is_room_aide) if ((e=='d')||(e=='m')) e=0;
/* print only if available */ if ((e=='p')&&(strlen(printcmd)==0)) e=0;
/* can't move from Mail> */ if ((e=='m')&&(is_mail==1)) e=0;