New level tag "ZONETITLE" can be set to replace the word "ZONE" in a level. "NOZONE" overrides it and forces no display at all.

This commit is contained in:
ZTsukei 2017-09-01 13:00:53 -04:00
parent 5d26588759
commit a1f2f5b675
8 changed files with 35 additions and 12 deletions

View File

@ -1117,6 +1117,11 @@ static void readlevelheader(MYFILE *f, INT32 num)
deh_strlcpy(mapheaderinfo[num-1]->lvlttl, word2,
sizeof(mapheaderinfo[num-1]->lvlttl), va("Level header %d: levelname", num));
}
else if (fastcmp(word, "ZONETITLE"))
{
deh_strlcpy(mapheaderinfo[num-1]->zonttl, word2,
sizeof(mapheaderinfo[num-1]->zonttl), va("Level header %d: zonetitle", num));
}
else if (fastcmp(word, "SCRIPTNAME"))
{
deh_strlcpy(mapheaderinfo[num-1]->scriptname, word2,

View File

@ -142,17 +142,17 @@ extern FILE *logstream;
#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
#ifdef DEVELOP
#define VERSION 103 // Game version
#define SUBVERSION 20 // more precise version number
#define VERSION 104 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "Development EXE"
#define VERSIONSTRINGW "v1.3.20"
#define VERSIONSTRINGW "v1.4.0"
// most interface strings are ignored in development mode.
// we use comprevision and compbranch instead.
#else
#define VERSION 103 // Game version
#define SUBVERSION 20 // more precise version number
#define VERSIONSTRING "DevEXE v1.3.20"
#define VERSIONSTRINGW L"v1.3.20"
#define VERSION 104 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "DevEXE v1.4.0"
#define VERSIONSTRINGW L"v1.4.0"
// Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates!
#endif

View File

@ -213,6 +213,7 @@ typedef struct
// The original eight, plus one.
char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway)
char subttl[33]; ///< Subtitle for level
char zonttl[22]; ///< "ZONE" replacement name
UINT8 actnum; ///< Act number or 0 for none.
UINT16 typeoflevel; ///< Combination of typeoflevel flags.
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.

View File

@ -3787,7 +3787,12 @@ char *G_BuildMapTitle(INT32 mapnum)
const INT32 actnum = mapheaderinfo[mapnum-1]->actnum;
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
if (strcmp(mapheaderinfo[mapnum-1]->zonttl, ""))
{
zonetext = M_GetText(mapheaderinfo[mapnum-1]->zonttl);
len += strlen(zonetext) + 1; // ' ' + zonetext
}
else if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE))
{
zonetext = M_GetText("ZONE");
len += strlen(zonetext) + 1; // ' ' + zonetext

View File

@ -1182,6 +1182,8 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushstring(L, header->lvlttl);
else if (fastcmp(field,"subttl"))
lua_pushstring(L, header->subttl);
else if (fastcmp(field,"zonttl"))
lua_pushstring(L, header->zonttl);
else if (fastcmp(field,"actnum"))
lua_pushinteger(L, header->actnum);
else if (fastcmp(field,"typeoflevel"))

View File

@ -680,7 +680,8 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
if (gamestate == GS_LEVEL && mapheaderinfo[gamemap-1]->lvlttl[0] != '\0')
snprintf(lvlttltext, 48, "%s%s%s",
mapheaderinfo[gamemap-1]->lvlttl,
(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE",
(strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? mapheaderinfo[gamemap-1]->zonttl : // SRB2kart
((mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE"),
(mapheaderinfo[gamemap-1]->actnum > 0) ? va(" %d",mapheaderinfo[gamemap-1]->actnum) : "");
else
snprintf(lvlttltext, 48, "Unknown");

View File

@ -174,6 +174,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
mapheaderinfo[num]->lvlttl[0] = '\0';
DEH_WriteUndoline("SUBTITLE", mapheaderinfo[num]->subttl, UNDO_NONE);
mapheaderinfo[num]->subttl[0] = '\0';
DEH_WriteUndoline("ZONETITLE", mapheaderinfo[num]->zonttl, UNDO_NONE); // SRB2kart
mapheaderinfo[num]->zonttl[0] = '\0';
DEH_WriteUndoline("ACT", va("%d", mapheaderinfo[num]->actnum), UNDO_NONE);
mapheaderinfo[num]->actnum = 0;
DEH_WriteUndoline("TYPEOFLEVEL", va("%d", mapheaderinfo[num]->typeoflevel), UNDO_NONE);
@ -2614,7 +2616,8 @@ boolean P_SetupLevel(boolean skipprecip)
V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to..."));
snprintf(tx, 63, "%s%s%s",
mapheaderinfo[gamemap-1]->lvlttl,
(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE",
(strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? mapheaderinfo[gamemap-1]->zonttl : // SRB2kart
((mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE"),
(mapheaderinfo[gamemap-1]->actnum > 0) ? va(", Act %d",mapheaderinfo[gamemap-1]->actnum) : "");
V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx);
I_UpdateNoVsync();

View File

@ -748,6 +748,7 @@ static void ST_drawLevelTitle(void)
{
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
char *subttl = mapheaderinfo[gamemap-1]->subttl;
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
INT32 actnum = mapheaderinfo[gamemap-1]->actnum;
INT32 lvlttlxpos;
INT32 subttlxpos = BASEVIDWIDTH/2;
@ -769,7 +770,10 @@ static void ST_drawLevelTitle(void)
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2));
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
if (zonttl)
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText(zonttl)); // SRB2kart
else
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
if (lvlttlxpos < 0)
lvlttlxpos = 0;
@ -798,7 +802,9 @@ static void ST_drawLevelTitle(void)
V_DrawLevelTitle(lvlttlxpos, lvlttly, 0, lvlttl);
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
if (zonttl)
V_DrawLevelTitle(zonexpos, zoney, 0, M_GetText(zonttl));
else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
V_DrawLevelTitle(zonexpos, zoney, 0, M_GetText("ZONE"));
if (lvlttly+48 < 200)