Hugo - Move DOS hardcoded inventory strings to Hugo.dat

svn-id: r52226
This commit is contained in:
Arnaud Boutonné 2010-08-20 15:30:30 +00:00
parent dd1708a1f1
commit 0b4fef3aa7
6 changed files with 15 additions and 27 deletions

Binary file not shown.

View File

@ -33,7 +33,7 @@
#include "hugo/game.h"
#define HUGO_DAT_VER_MAJ 0 // 1 byte
#define HUGO_DAT_VER_MIN 16 // 1 byte
#define HUGO_DAT_VER_MIN 17 // 1 byte
#define DATAALIGNMENT 4
namespace Common {

View File

@ -678,8 +678,6 @@ bool Parser::isObjectVerb(object_t *obj, char *line, char *comment) {
void Parser::showDosInventory() {
// Show user all objects being carried in a variable width 2 column format
static const char *intro = "You are carrying:";
static const char *outro = "\nPress ESCAPE to continue";
static const char *blanks = " ";
uint16 index, len, len1 = 0, len2 = 0;
char buffer[XBYTES * NUM_ROWS] = "\0";
@ -695,11 +693,11 @@ char buffer[XBYTES * NUM_ROWS] = "\0";
}
len1 += 1; /* For gap between columns */
if (len1 + len2 < (uint16)strlen(outro))
len1 = strlen(outro);
if (len1 + len2 < (uint16)strlen(_vm._textParser[kTBOutro]))
len1 = strlen(_vm._textParser[kTBOutro]);
strncat (buffer, blanks, (len1 + len2 - strlen(intro)) / 2);
strcat (strcat (buffer, intro), "\n");
strncat (buffer, blanks, (len1 + len2 - strlen(_vm._textParser[kTBIntro])) / 2);
strcat (strcat (buffer, _vm._textParser[kTBIntro]), "\n");
index = 0;
for (int i = 0; i < _vm._numObj; i++) { /* Assign strings */
if (_vm._objects[i].carriedFl) {
@ -710,7 +708,7 @@ char buffer[XBYTES * NUM_ROWS] = "\0";
}
}
if (index & 1) strcat (buffer, "\n");
strcat (buffer, outro);
strcat (buffer, _vm._textParser[kTBOutro]);
Utils::Box(BOX_ANY, buffer);
}

View File

@ -35,22 +35,10 @@
namespace Hugo {
enum seqTextParser {
kTBExit = 0,
kTBMaze = 1,
kTBNoPoint = 2,
kTBNoun = 3,
kTBVerb = 4,
kTBEh = 5,
kTBUnusual = 6,
kTBHave = 7,
kTBNoUse = 8,
kTBDontHave = 9,
kTBNeed = 10,
kTBOk = 11,
kCmtAny1 = 12,
kCmtAny2 = 13,
kCmtAny3 = 14,
kCmtClose = 15
kTBExit = 0, kTBMaze, kTBNoPoint, kTBNoun, kTBVerb,
kTBEh, kTBUnusual, kTBHave, kTBNoUse, kTBDontHave,
kTBNeed, kTBOk, kCmtAny1, kCmtAny2, kCmtAny3,
kCmtClose, kTBIntro, kTBOutro
};
class Parser {

View File

@ -31,7 +31,7 @@
#define DATAALIGNMENT 4
#define HUGO_DAT_VER_MAJ 0 // 1 byte
#define HUGO_DAT_VER_MIN 16 // 1 byte
#define HUGO_DAT_VER_MIN 17 // 1 byte
typedef unsigned char uint8;
typedef unsigned char byte;

View File

@ -33,7 +33,7 @@
#ifndef STATICPARSER_H
#define STATICPARSER_H
#define NUM_PARSER_TEXT 16
#define NUM_PARSER_TEXT 18
const char *textParser[NUM_PARSER_TEXT] = {
"You should press ALT+F4 or click on Game/Exit.",
"You are in a maze of\ntwisty little paths,\nwhich are all alike!",
@ -50,7 +50,9 @@ const char *textParser[NUM_PARSER_TEXT] = {
"You don't have any!",
"There aren't any!",
"I don't see any here!",
"You're not close enough!"
"You're not close enough!",
"You are carrying:",
"\nPress ESCAPE to continue"
};
#endif //STATICPARSER_H