- add level names to title bar (and by proxy, to RPC)

This commit is contained in:
Rachael Alexanderson 2022-03-18 04:56:55 -04:00
parent 4be214e33d
commit 735740e453
6 changed files with 15 additions and 2 deletions

View file

@ -1675,6 +1675,14 @@ void InitBuildTiles()
static FString LevelName;
void TITLE_InformName(const char* newname)
{
LevelName = newname;
if (newname[0] == '$')
LevelName = GStrings(newname + 1);
I_UpdateWindowTitle();
}
void I_UpdateWindowTitle()
{
FString titlestr;

View file

@ -46,6 +46,8 @@ void DeferredStartGame(MapRecord* map, int skill, bool nostopsound = false);
void ChangeLevel(MapRecord* map, int skill, bool bossexit = false);
void CompleteLevel(MapRecord* map);
void TITLE_InformName(const char* newname);
struct UserConfig
{
FString gamegrp;

View file

@ -253,6 +253,7 @@ void StartLevel(MapRecord* level, bool newgame)
startsector = &sector[startsectno];
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(currentLevel->fileName);
TITLE_InformName(currentLevel->name);
wsrand(dbReadMapCRC(currentLevel->LabelName()));
gKillMgr.Clear();
gSecretMgr.Clear();

View file

@ -973,7 +973,8 @@ static int LoadTheMap(MapRecord *mi, struct player_struct *p, int gamemode)
SECRET_SetMapName(mi->DisplayName(), mi->name);
STAT_NewLevel(mi->fileName);
TITLE_InformName(mi->name);
p->angle.ang = buildang(lbang);
gotpic.Zero();

View file

@ -127,7 +127,7 @@ void GameInterface::NextLevel(MapRecord *map, int skill)
}
STAT_NewLevel(currentLevel->labelName);
TITLE_InformName(currentLevel->name);
}
//---------------------------------------------------------------------------

View file

@ -406,6 +406,7 @@ void InitLevel(MapRecord *maprec)
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(currentLevel->fileName);
TITLE_InformName(currentLevel->name);
Player[0].angle.ang = buildang(ang);
auto vissect = &sector[0]; // hack alert!