- renamed the level variables.
currentUILevel is now primaryLevel. For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed. This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer. The remaining global variables are not relevant for the level state. The static 'level' has been mostly removed from the code except some places that still need work.
This commit is contained in:
parent
6c006a5fbd
commit
45dc9a7b47
44 changed files with 266 additions and 264 deletions
|
|
@ -366,7 +366,7 @@ CCMD (changemap)
|
|||
if (argv.argc() > 1)
|
||||
{
|
||||
const char *mapname = argv[1];
|
||||
if (!strcmp(mapname, "*")) mapname = currentUILevel->MapName.GetChars();
|
||||
if (!strcmp(mapname, "*")) mapname = primaryLevel->MapName.GetChars();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -946,7 +946,7 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha
|
|||
}
|
||||
}
|
||||
// This only works on the primary level.
|
||||
auto it = currentUILevel->GetThinkerIterator<AActor>();
|
||||
auto it = primaryLevel->GetThinkerIterator<AActor>();
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
|
|
@ -1063,14 +1063,14 @@ CCMD(changesky)
|
|||
FTextureID newsky = TexMan.GetTextureID(sky1name, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
|
||||
if (newsky.Exists())
|
||||
{
|
||||
currentUILevel->skytexture1 = newsky;
|
||||
primaryLevel->skytexture1 = newsky;
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("changesky: Texture '%s' not found\n", sky1name);
|
||||
}
|
||||
}
|
||||
InitSkyMap (currentUILevel);
|
||||
InitSkyMap (primaryLevel);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1101,9 +1101,9 @@ CCMD(nextmap)
|
|||
return;
|
||||
}
|
||||
|
||||
if (currentUILevel->NextMap.Len() > 0 && currentUILevel->NextMap.Compare("enDSeQ", 6))
|
||||
if (primaryLevel->NextMap.Len() > 0 && primaryLevel->NextMap.Compare("enDSeQ", 6))
|
||||
{
|
||||
G_DeferedInitNew(currentUILevel->NextMap);
|
||||
G_DeferedInitNew(primaryLevel->NextMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1125,9 +1125,9 @@ CCMD(nextsecret)
|
|||
return;
|
||||
}
|
||||
|
||||
if (currentUILevel->NextSecretMap.Len() > 0 && currentUILevel->NextSecretMap.Compare("enDSeQ", 6))
|
||||
if (primaryLevel->NextSecretMap.Len() > 0 && primaryLevel->NextSecretMap.Compare("enDSeQ", 6))
|
||||
{
|
||||
G_DeferedInitNew(currentUILevel->NextSecretMap);
|
||||
G_DeferedInitNew(primaryLevel->NextSecretMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1172,10 +1172,10 @@ static void PrintSecretString(const char *string, bool thislevel)
|
|||
{
|
||||
auto secnum = (unsigned)strtoull(string+2, (char**)&string, 10);
|
||||
if (*string == ';') string++;
|
||||
if (thislevel && secnum < currentUILevel->sectors.Size())
|
||||
if (thislevel && secnum < primaryLevel->sectors.Size())
|
||||
{
|
||||
if (currentUILevel->sectors[secnum].isSecret()) colstr = TEXTCOLOR_RED;
|
||||
else if (currentUILevel->sectors[secnum].wasSecret()) colstr = TEXTCOLOR_GREEN;
|
||||
if (primaryLevel->sectors[secnum].isSecret()) colstr = TEXTCOLOR_RED;
|
||||
else if (primaryLevel->sectors[secnum].wasSecret()) colstr = TEXTCOLOR_GREEN;
|
||||
else colstr = TEXTCOLOR_ORANGE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1183,7 +1183,7 @@ static void PrintSecretString(const char *string, bool thislevel)
|
|||
{
|
||||
long tid = (long)strtoll(string+2, (char**)&string, 10);
|
||||
if (*string == ';') string++;
|
||||
auto it = currentUILevel->GetActorIterator(tid);
|
||||
auto it = primaryLevel->GetActorIterator(tid);
|
||||
AActor *actor;
|
||||
bool foundone = false;
|
||||
if (thislevel)
|
||||
|
|
@ -1216,8 +1216,8 @@ static void PrintSecretString(const char *string, bool thislevel)
|
|||
|
||||
CCMD(secret)
|
||||
{
|
||||
const char *mapname = argv.argc() < 2? currentUILevel->MapName.GetChars() : argv[1];
|
||||
bool thislevel = !stricmp(mapname, currentUILevel->MapName);
|
||||
const char *mapname = argv.argc() < 2? primaryLevel->MapName.GetChars() : argv[1];
|
||||
bool thislevel = !stricmp(mapname, primaryLevel->MapName);
|
||||
bool foundsome = false;
|
||||
|
||||
int lumpno=Wads.CheckNumForName("SECRETS");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue