mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-18 08:10:13 +01:00
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.
This commit is contained in:
parent
bf26d79323
commit
70d7785fea
11 changed files with 49 additions and 37 deletions
|
|
@ -421,7 +421,7 @@ static void do_auto_exits(struct char_data *ch)
|
||||||
else if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN))
|
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));
|
send_to_char(ch, "%s%s%s ", CCWHT(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
|
||||||
else
|
else
|
||||||
send_to_char(ch, "%s ", autoexits[door]);
|
send_to_char(ch, "\t(%s\t) ", autoexits[door]);
|
||||||
slen++;
|
slen++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ const char *pc_class_types[] = {
|
||||||
const char *class_menu =
|
const char *class_menu =
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"Select a class:\r\n"
|
"Select a class:\r\n"
|
||||||
" [C]leric\r\n"
|
" [\t(C\t)]leric\r\n"
|
||||||
" [T]hief\r\n"
|
" [\t(T\t)]hief\r\n"
|
||||||
" [W]arrior\r\n"
|
" [\t(W\t)]arrior\r\n"
|
||||||
" [M]agic-user\r\n";
|
" [\t(M\t)]agic-user\r\n";
|
||||||
|
|
||||||
/* The code to interpret a class letter -- used in interpreter.c when a new
|
/* 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. */
|
* character is selecting a class and by 'set class' in act.wizard.c. */
|
||||||
|
|
|
||||||
12
src/config.c
12
src/config.c
|
|
@ -264,12 +264,12 @@ int use_new_socials = YES;
|
||||||
const char *MENU =
|
const char *MENU =
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"Welcome to tbaMUD!\r\n"
|
"Welcome to tbaMUD!\r\n"
|
||||||
"0) Exit from tbaMUD.\r\n"
|
"\t(0\t)) Exit from tbaMUD.\r\n"
|
||||||
"1) Enter the game.\r\n"
|
"\t(1\t)) Enter the game.\r\n"
|
||||||
"2) Enter description.\r\n"
|
"\t(2\t)) Enter description.\r\n"
|
||||||
"3) Read the background story.\r\n"
|
"\t(3\t)) Read the background story.\r\n"
|
||||||
"4) Change password.\r\n"
|
"\t(4\t)) Change password.\r\n"
|
||||||
"5) Delete this character.\r\n"
|
"\t(5\t)) Delete this character.\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
" Make your choice: ";
|
" Make your choice: ";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ const char *zone_bits[] = {
|
||||||
"GRID",
|
"GRID",
|
||||||
"NOBUILD",
|
"NOBUILD",
|
||||||
"!ASTRAL",
|
"!ASTRAL",
|
||||||
|
"WORLDMAP",
|
||||||
"\n"
|
"\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,9 @@ int improved_editor_execute(struct descriptor_data *d, char *str)
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
return STRINGADD_SAVE;
|
return STRINGADD_SAVE;
|
||||||
|
case 't':
|
||||||
|
parse_edit_action(PARSE_TOGGLE, actions, d);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
write_to_output(d, "Invalid option.\r\n");
|
write_to_output(d, "Invalid option.\r\n");
|
||||||
break;
|
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 <a> in buffer with text <b>\r\n"
|
"/r 'a' 'b' - replace 1st occurance of text <a> in buffer with text <b>\r\n"
|
||||||
"/ra 'a' 'b'- replace all occurances of text <a> within buffer with text <b>\r\n"
|
"/ra 'a' 'b'- replace all occurances of text <a> within buffer with text <b>\r\n"
|
||||||
" usage: /r[a] 'pattern' 'replacement'\r\n"
|
" usage: /r[a] 'pattern' 'replacement'\r\n"
|
||||||
|
"/t - toggles '@' and tabs\r\n"
|
||||||
"/s - saves text\r\n");
|
"/s - saves text\r\n");
|
||||||
break;
|
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:
|
case PARSE_FORMAT:
|
||||||
if (STATE(d) == CON_TRIGEDIT) {
|
if (STATE(d) == CON_TRIGEDIT) {
|
||||||
write_to_output(d, "Script %sformatted.\r\n", format_script(d) ? "": "not ");
|
write_to_output(d, "Script %sformatted.\r\n", format_script(d) ? "": "not ");
|
||||||
|
|
|
||||||
|
|
@ -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);
|
void send_editor_help(struct descriptor_data *d);
|
||||||
|
|
||||||
/* Action modes for parse_edit_action(). */
|
/* Action modes for parse_edit_action(). */
|
||||||
#define PARSE_FORMAT 0
|
#define PARSE_FORMAT 0
|
||||||
#define PARSE_REPLACE 1
|
#define PARSE_REPLACE 1
|
||||||
#define PARSE_HELP 2
|
#define PARSE_HELP 2
|
||||||
#define PARSE_DELETE 3
|
#define PARSE_DELETE 3
|
||||||
#define PARSE_INSERT 4
|
#define PARSE_INSERT 4
|
||||||
#define PARSE_LIST_NORM 5
|
#define PARSE_LIST_NORM 5
|
||||||
#define PARSE_LIST_NUM 6
|
#define PARSE_LIST_NUM 6
|
||||||
#define PARSE_EDIT 7
|
#define PARSE_EDIT 7
|
||||||
|
#define PARSE_TOGGLE 8
|
||||||
|
|
||||||
/* Defines for the action variable. */
|
/* Defines for the action variable. */
|
||||||
#define STRINGADD_OK 0 /* Just keep adding text. */
|
#define STRINGADD_OK 0 /* Just keep adding text. */
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,6 @@ cpp_extern const struct command_info cmd_info[] = {
|
||||||
{ "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST },
|
{ "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST },
|
||||||
{ "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP },
|
{ "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP },
|
||||||
{ "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN },
|
{ "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 },
|
{ "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW },
|
||||||
{ "nw" , "nw" , 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 },
|
{ "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);
|
CREATE(d->character->player.name, char, strlen(tmp_name) + 1);
|
||||||
strcpy(d->character->player.name, CAP(tmp_name)); /* strcpy: OK (size checked above) */
|
strcpy(d->character->player.name, CAP(tmp_name)); /* strcpy: OK (size checked above) */
|
||||||
GET_PFILEPOS(d->character) = player_i;
|
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;
|
STATE(d) = CON_NAME_CNFRM;
|
||||||
} else {
|
} else {
|
||||||
/* undo it just in case they are set */
|
/* 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);
|
CREATE(d->character->player.name, char, strlen(tmp_name) + 1);
|
||||||
strcpy(d->character->player.name, CAP(tmp_name)); /* strcpy: OK (size checked above) */
|
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;
|
STATE(d) = CON_NAME_CNFRM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1578,7 +1572,7 @@ void nanny(struct descriptor_data *d, char *arg)
|
||||||
echo_on(d);
|
echo_on(d);
|
||||||
|
|
||||||
if (STATE(d) == CON_CNFPASSWD) {
|
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;
|
STATE(d) = CON_QSEX;
|
||||||
} else {
|
} else {
|
||||||
save_char(d->character);
|
save_char(d->character);
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ struct item_data * create_item(void)
|
||||||
void free_list(struct list_data * pList)
|
void free_list(struct list_data * pList)
|
||||||
{
|
{
|
||||||
void * pContent;
|
void * pContent;
|
||||||
|
|
||||||
simple_list(NULL);
|
simple_list(NULL);
|
||||||
|
|
||||||
if (pList->iSize)
|
if (pList->iSize)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ struct iterator_data {
|
||||||
|
|
||||||
/* Externals */
|
/* Externals */
|
||||||
extern struct list_data * global_lists;
|
extern struct list_data * global_lists;
|
||||||
extern struct list_data * ticker_list;
|
|
||||||
|
|
||||||
/* Locals */
|
/* Locals */
|
||||||
void add_to_list(void * pContent, struct list_data * pList);
|
void add_to_list(void * pContent, struct list_data * pList);
|
||||||
|
|
|
||||||
10
src/modify.c
10
src/modify.c
|
|
@ -81,15 +81,19 @@ void parse_at(char *str)
|
||||||
{
|
{
|
||||||
char *p = str;
|
char *p = str;
|
||||||
for (; *p; p++)
|
for (; *p; p++)
|
||||||
if (*p == '@')
|
if (*p == '@') {
|
||||||
*p = '\t';
|
if (*(p+1) != '@')
|
||||||
|
*p = '\t';
|
||||||
|
else
|
||||||
|
p++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void parse_tab(char *str)
|
void parse_tab(char *str)
|
||||||
{
|
{
|
||||||
char *p = str;
|
char *p = str;
|
||||||
for (; *p; p++)
|
for (; *p; p++)
|
||||||
if (*p == '\t')
|
if (*p == '\t' && *(p+1) != '\t')
|
||||||
*p = '@';
|
*p = '@';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,14 @@
|
||||||
#define EVENT_CHAR 2
|
#define EVENT_CHAR 2
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
eNULL,
|
eNULL,
|
||||||
ePROTOCOLS,
|
ePROTOCOLS,
|
||||||
} event_id;
|
} event_id;
|
||||||
|
|
||||||
struct mud_event_list {
|
struct mud_event_list {
|
||||||
const char * event_name;
|
const char * event_name;
|
||||||
EVENTFUNC(*func);
|
EVENTFUNC(*func);
|
||||||
int iEvent_Type;
|
int iEvent_Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mud_event_data {
|
struct mud_event_data {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue