From 70d7785fea079e1979ee45ec80585ca8be8d634f Mon Sep 17 00:00:00 2001 From: Vatiken Date: Mon, 27 Feb 2012 01:04:09 +0000 Subject: [PATCH] Couple adjustments to the tab handling, added MXP here and there, and added a toggler '\t' to the improved editor to grant access to tabs. --- src/act.informative.c | 2 +- src/class.c | 8 ++++---- src/config.c | 12 ++++++------ src/constants.c | 1 + src/improved-edit.c | 13 +++++++++++++ src/improved-edit.h | 17 +++++++++-------- src/interpreter.c | 12 +++--------- src/lists.c | 2 +- src/lists.h | 1 - src/modify.c | 10 +++++++--- src/mud_event.h | 8 ++++---- 11 files changed, 49 insertions(+), 37 deletions(-) diff --git a/src/act.informative.c b/src/act.informative.c index 7ede884..e7eb59a 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -421,7 +421,7 @@ static void do_auto_exits(struct char_data *ch) else if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN)) send_to_char(ch, "%s%s%s ", CCWHT(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM)); else - send_to_char(ch, "%s ", autoexits[door]); + send_to_char(ch, "\t(%s\t) ", autoexits[door]); slen++; } diff --git a/src/class.c b/src/class.c index 75e9223..fa0fffa 100644 --- a/src/class.c +++ b/src/class.c @@ -48,10 +48,10 @@ const char *pc_class_types[] = { const char *class_menu = "\r\n" "Select a class:\r\n" -" [C]leric\r\n" -" [T]hief\r\n" -" [W]arrior\r\n" -" [M]agic-user\r\n"; +" [\t(C\t)]leric\r\n" +" [\t(T\t)]hief\r\n" +" [\t(W\t)]arrior\r\n" +" [\t(M\t)]agic-user\r\n"; /* The code to interpret a class letter -- used in interpreter.c when a new * character is selecting a class and by 'set class' in act.wizard.c. */ diff --git a/src/config.c b/src/config.c index 1bf1893..d6c7f67 100644 --- a/src/config.c +++ b/src/config.c @@ -264,12 +264,12 @@ int use_new_socials = YES; const char *MENU = "\r\n" "Welcome to tbaMUD!\r\n" -"0) Exit from tbaMUD.\r\n" -"1) Enter the game.\r\n" -"2) Enter description.\r\n" -"3) Read the background story.\r\n" -"4) Change password.\r\n" -"5) Delete this character.\r\n" +"\t(0\t)) Exit from tbaMUD.\r\n" +"\t(1\t)) Enter the game.\r\n" +"\t(2\t)) Enter description.\r\n" +"\t(3\t)) Read the background story.\r\n" +"\t(4\t)) Change password.\r\n" +"\t(5\t)) Delete this character.\r\n" "\r\n" " Make your choice: "; diff --git a/src/constants.c b/src/constants.c index 125792c..434f14d 100644 --- a/src/constants.c +++ b/src/constants.c @@ -96,6 +96,7 @@ const char *zone_bits[] = { "GRID", "NOBUILD", "!ASTRAL", + "WORLDMAP", "\n" }; diff --git a/src/improved-edit.c b/src/improved-edit.c index a0831d8..e0d5f65 100644 --- a/src/improved-edit.c +++ b/src/improved-edit.c @@ -85,6 +85,9 @@ int improved_editor_execute(struct descriptor_data *d, char *str) break; case 's': return STRINGADD_SAVE; + case 't': + parse_edit_action(PARSE_TOGGLE, actions, d); + break; default: write_to_output(d, "Invalid option.\r\n"); break; @@ -118,8 +121,18 @@ void parse_edit_action(int command, char *string, struct descriptor_data *d) "/r 'a' 'b' - replace 1st occurance of text in buffer with text \r\n" "/ra 'a' 'b'- replace all occurances of text within buffer with text \r\n" " usage: /r[a] 'pattern' 'replacement'\r\n" + "/t - toggles '@' and tabs\r\n" "/s - saves text\r\n"); break; + case PARSE_TOGGLE: + if (strchr(*d->str, '@')) { + parse_at(*d->str); + write_to_output(d, "Toggling (at) into (tab) Characters...\r\n"); + } else { + parse_tab(*d->str); + write_to_output(d, "Toggling (tab) into (at) Characters...\r\n"); + } + break; case PARSE_FORMAT: if (STATE(d) == CON_TRIGEDIT) { write_to_output(d, "Script %sformatted.\r\n", format_script(d) ? "": "not "); diff --git a/src/improved-edit.h b/src/improved-edit.h index 36d2a2b..bd80bc9 100644 --- a/src/improved-edit.h +++ b/src/improved-edit.h @@ -24,14 +24,15 @@ int replace_str(char **string, char *pattern, char *replacement, int rep_all, un void send_editor_help(struct descriptor_data *d); /* Action modes for parse_edit_action(). */ -#define PARSE_FORMAT 0 -#define PARSE_REPLACE 1 -#define PARSE_HELP 2 -#define PARSE_DELETE 3 -#define PARSE_INSERT 4 -#define PARSE_LIST_NORM 5 -#define PARSE_LIST_NUM 6 -#define PARSE_EDIT 7 +#define PARSE_FORMAT 0 +#define PARSE_REPLACE 1 +#define PARSE_HELP 2 +#define PARSE_DELETE 3 +#define PARSE_INSERT 4 +#define PARSE_LIST_NORM 5 +#define PARSE_LIST_NUM 6 +#define PARSE_EDIT 7 +#define PARSE_TOGGLE 8 /* Defines for the action variable. */ #define STRINGADD_OK 0 /* Just keep adding text. */ diff --git a/src/interpreter.c b/src/interpreter.c index 0e22740..9ce1d74 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -72,12 +72,6 @@ cpp_extern const struct command_info cmd_info[] = { { "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST }, { "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP }, { "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN }, - { "north" , "n" , POS_STANDING, do_move , 0, SCMD_NORTH }, - { "east" , "e" , POS_STANDING, do_move , 0, SCMD_EAST }, - { "south" , "s" , POS_STANDING, do_move , 0, SCMD_SOUTH }, - { "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST }, - { "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP }, - { "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN }, { "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW }, { "nw" , "nw" , POS_STANDING, do_move , 0, SCMD_NW }, { "northeast", "northe" , POS_STANDING, do_move , 0, SCMD_NE }, @@ -1408,7 +1402,7 @@ void nanny(struct descriptor_data *d, char *arg) CREATE(d->character->player.name, char, strlen(tmp_name) + 1); strcpy(d->character->player.name, CAP(tmp_name)); /* strcpy: OK (size checked above) */ GET_PFILEPOS(d->character) = player_i; - write_to_output(d, "Did I get that right, %s (Y/N)? ", tmp_name); + write_to_output(d, "Did I get that right, %s (\t(Y\t)/\t(N\t))? ", tmp_name); STATE(d) = CON_NAME_CNFRM; } else { /* undo it just in case they are set */ @@ -1433,7 +1427,7 @@ void nanny(struct descriptor_data *d, char *arg) CREATE(d->character->player.name, char, strlen(tmp_name) + 1); strcpy(d->character->player.name, CAP(tmp_name)); /* strcpy: OK (size checked above) */ - write_to_output(d, "Did I get that right, %s (Y/N)? ", tmp_name); + write_to_output(d, "Did I get that right, %s (\t(Y\t)/\t(N\t))? ", tmp_name); STATE(d) = CON_NAME_CNFRM; } } @@ -1578,7 +1572,7 @@ void nanny(struct descriptor_data *d, char *arg) echo_on(d); if (STATE(d) == CON_CNFPASSWD) { - write_to_output(d, "\r\nWhat is your sex (M/F)? "); + write_to_output(d, "\r\nWhat is your sex (\t(M\t)/\t(F\t))? "); STATE(d) = CON_QSEX; } else { save_char(d->character); diff --git a/src/lists.c b/src/lists.c index 55e356b..b10c7cb 100644 --- a/src/lists.c +++ b/src/lists.c @@ -52,7 +52,7 @@ struct item_data * create_item(void) void free_list(struct list_data * pList) { void * pContent; - + simple_list(NULL); if (pList->iSize) diff --git a/src/lists.h b/src/lists.h index b7fd7fb..e85f2f7 100644 --- a/src/lists.h +++ b/src/lists.h @@ -33,7 +33,6 @@ struct iterator_data { /* Externals */ extern struct list_data * global_lists; -extern struct list_data * ticker_list; /* Locals */ void add_to_list(void * pContent, struct list_data * pList); diff --git a/src/modify.c b/src/modify.c index 7c72457..691b521 100644 --- a/src/modify.c +++ b/src/modify.c @@ -81,15 +81,19 @@ void parse_at(char *str) { char *p = str; for (; *p; p++) - if (*p == '@') - *p = '\t'; + if (*p == '@') { + if (*(p+1) != '@') + *p = '\t'; + else + p++; + } } void parse_tab(char *str) { char *p = str; for (; *p; p++) - if (*p == '\t') + if (*p == '\t' && *(p+1) != '\t') *p = '@'; } diff --git a/src/mud_event.h b/src/mud_event.h index f2ac91d..611b0c6 100644 --- a/src/mud_event.h +++ b/src/mud_event.h @@ -20,14 +20,14 @@ #define EVENT_CHAR 2 typedef enum { - eNULL, - ePROTOCOLS, + eNULL, + ePROTOCOLS, } event_id; struct mud_event_list { const char * event_name; - EVENTFUNC(*func); - int iEvent_Type; + EVENTFUNC(*func); + int iEvent_Type; }; struct mud_event_data {