Okie here's the string editor thingy.
Files to change: merc.h comm.c
merc.h:
------
- Add the following 4 lines to merc.h:
/* string.c */
void string_edit args( ( CHAR_DATA *ch, char **pString ) );
void string_append args( ( CHAR_DATA *ch, char **pString ) );
void string_add args( ( CHAR_DATA *ch, char *argument ) );
- Done merc.h
comm.c
------
- In game_loop_*, after read_from_buffer and stop_indling, replace
if ( d->connected == CON_PLAYING )
if ( d->showstr_point )
show_string( d, d->incomm );
else
interpret( d->character, d->incomm );
else
nanny( d, d->incomm );
with:
> if ( d->pString )
> string_add( d->character, d->incomm );
! else if ( d->connected == CON_PLAYING )
if ( d->showstr_point )
show_string( d, d->incomm );
else
interpret( d->character, d->incomm );
else
nanny( d, d->incomm );
(do this in BOTH game loops, just because you're such a nice person ;)
- In process_output, right after
/*
* Bust a prompt.
*/
replace
if ( fPrompt && !merc_down && d->connected == CON_PLAYING )
if ( d->showstr_point )
write_to_buffer( d,
with
if ( fPrompt && !merc_down && d->connected == CON_PLAYING )
> if ( d->pString )
> write_to_buffer( d, "] ", 2 );
! else if ( d->showstr_point )
write_to_buffer( d,
- Done comm.c
Also, put the string.c file (included) in your src dir and add string.o
to O_FILES list in Makefile.
At this point you have made the necessary changges for SEditor to work.
And here is an example how it works:
void do_description( CHAR_DATA *ch, char *argument )
{
string_append( ch, &ch->description );
return;
}
The same way you can add a note edit command:
if ( !str_prefix( arg, "edit" ) )
{
note_attach( ch );
string_append( ch, &ch->pnote->text );
return;
}
P.S. I hope that I didn't leave anything out. Get a backup of the old
files before you try to apply this patch!