summary text for block messages (trunk only)

[Make use of recent message history changes.]

     Add support to makedefs and the core for including a line of summary
text with quest messages that don't use pline() delivery.  The multi-line
record structure of quest.txt begins each entry with %C and ends with %E.
makedefs now examines the %E lines looking for "[anything]" and adds that
to quest.dat where deliver_by_window() can find it.  The square brackets
are required in the input and intentionally carried along to the output.
putmsghistory() is used to put the summary text into the message history
buffer for use by ^P, without being displayed first.  (So this is a no-op
for interfaces which haven't implemented putmsghistory yet.  Maybe
genl_putmsghistory() should pass such text to pline() as a quick hack?)

     This adds a few summary lines to quest.txt so that the feature can
be tested.  Most of them were written by <Someone> nearly three years
ago.  I'm planning to add a couple of new control codes that'll allow some
of them to expand into shorter text.  (The one where the Archeologist
leader tells you that the nemesis stole the artifact so your mission is
to find the goal level, defeat the nemesis, and return with the artifact
ends up being roughly 160 characters long.)
This commit is contained in:
nethack.rankin
2009-04-06 02:50:41 +00:00
parent f468865494
commit a86187b398
5 changed files with 122 additions and 31 deletions

View File

@@ -9,11 +9,16 @@
/* (i.e., num roles + 1) */
#define LEN_HDR 3 /* Maximum length of a category name */
/* quest text message buffer sizes; used to be hardcoded as 80 and 128, but
have been expanded to allow some slop for block message summary lines */
#define QTEXT_IN_SIZ 100 /* used by both nethack and makedefs */
#define QTEXT_OUTSIZ 200 /* used only by nethack */
struct qtmsg {
int msgnum;
char delivery;
long offset,
size;
size, summary_size;
};
#ifdef MAKEDEFS_C /***** MAKEDEFS *****/
@@ -37,6 +42,10 @@ struct qthdr {
#define END_NOT_IN_MSG "End record encountered before message - line %d\n"
#define TEXT_NOT_IN_MSG "Text encountered outside message - line %d\n"
#define UNREC_CREC "Unrecognized Control record at line %d\n"
#define MAL_SUM "Malformed summary in End record - line %d\n"
#define DUMB_SUM "Summary for single line message is useless - line %d\n"
#define CTRL_TRUNC "Control record truncated at line %d\n"
#define TEXT_TRUNC "Text record truncated at line %d\n"
#define OUT_OF_HEADERS "Too many message types (line %d)\nAdjust N_HDR in qtext.h and recompile.\n"
#define OUT_OF_MESSAGES "Too many messages in class (line %d)\nAdjust N_MSG in qtext.h and recompile.\n"