- initialize the secret hint system for each level.

This commit is contained in:
Christoph Oelckers 2020-02-22 08:56:36 +01:00
parent 3a30e083ad
commit 9fab46b7d7
5 changed files with 14 additions and 3 deletions

View file

@ -73,6 +73,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "menu/menu.h" #include "menu/menu.h"
#include "sound/s_soundinternal.h" #include "sound/s_soundinternal.h"
#include "nnexts.h" #include "nnexts.h"
#include"secrets.h"
BEGIN_BLD_NS BEGIN_BLD_NS
@ -557,6 +558,7 @@ void StartLevel(GAMEOPTIONS *gameOptions)
} }
char levelName[BMAX_PATH]; char levelName[BMAX_PATH];
currentLevel = &mapList[gGameOptions.nEpisode * kMaxLevels + gGameOptions.nLevel]; currentLevel = &mapList[gGameOptions.nEpisode * kMaxLevels + gGameOptions.nLevel];
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(gameOptions->zLevelName); STAT_NewLevel(gameOptions->zLevelName);
G_LoadMapHack(levelName, gameOptions->zLevelName); G_LoadMapHack(levelName, gameOptions->zLevelName);
wsrand(gameOptions->uMapCRC); wsrand(gameOptions->uMapCRC);

View file

@ -161,6 +161,7 @@ bool SECRET_Load()
void SECRET_SetMapName(const char *filename, const char *_maptitle) void SECRET_SetMapName(const char *filename, const char *_maptitle)
{ {
discovered_secrets.Clear();
mapfile = filename; mapfile = filename;
maptitle = _maptitle; maptitle = _maptitle;
} }

View file

@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mapinfo.h" #include "mapinfo.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "v_2ddrawer.h" #include "v_2ddrawer.h"
#include "secrets.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS
@ -1779,6 +1780,7 @@ int G_EnterLevel(int gameMode)
userMapRecord.name = ""; userMapRecord.name = "";
userMapRecord.SetFileName(boardfilename); userMapRecord.SetFileName(boardfilename);
currentLevel = &userMapRecord; currentLevel = &userMapRecord;
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(boardfilename); STAT_NewLevel(boardfilename);
G_LoadMapHack(levelName, boardfilename); G_LoadMapHack(levelName, boardfilename);
@ -1792,7 +1794,8 @@ int G_EnterLevel(int gameMode)
else else
{ {
currentLevel = &mm; currentLevel = &mm;
STAT_NewLevel(mm.fileName); SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(mm.fileName);
G_LoadMapHack(levelName, mm.fileName); G_LoadMapHack(levelName, mm.fileName);
} }

View file

@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mapinfo.h" #include "mapinfo.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "v_2ddrawer.h" #include "v_2ddrawer.h"
#include "secrets.h"
BEGIN_RR_NS BEGIN_RR_NS
@ -2329,6 +2330,7 @@ int G_EnterLevel(int gameMode)
userMapRecord.name = ""; userMapRecord.name = "";
userMapRecord.SetFileName(boardfilename); userMapRecord.SetFileName(boardfilename);
currentLevel = &userMapRecord; currentLevel = &userMapRecord;
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(boardfilename); STAT_NewLevel(boardfilename);
G_LoadMapHack(levelName, boardfilename); G_LoadMapHack(levelName, boardfilename);
userMapRecord.music = G_SetupFilenameBasedMusic(boardfilename, !RR? "dethtoll.mid" : nullptr); userMapRecord.music = G_SetupFilenameBasedMusic(boardfilename, !RR? "dethtoll.mid" : nullptr);
@ -2341,7 +2343,8 @@ int G_EnterLevel(int gameMode)
else else
{ {
currentLevel = &mi; currentLevel = &mi;
STAT_NewLevel(mi.fileName); SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(mi.fileName);
G_LoadMapHack(levelName, mi.fileName); G_LoadMapHack(levelName, mi.fileName);
} }

View file

@ -98,6 +98,7 @@ Things required to make savegames work:
#include "mapinfo.h" #include "mapinfo.h"
#include "rendering/v_video.h" #include "rendering/v_video.h"
#include "sound/s_soundinternal.h" #include "sound/s_soundinternal.h"
#include "secrets.h"
#include "osdcmds.h" #include "osdcmds.h"
@ -622,7 +623,8 @@ bool LoadLevel(const char *filename)
return false; return false;
} }
currentLevel = &mapList[Level]; currentLevel = &mapList[Level];
STAT_NewLevel(currentLevel->labelName); SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(currentLevel->labelName);
return true; return true;
} }