mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 05:21:16 +00:00
add missing 'author' and 'label' UMAPINFO fields.
This commit is contained in:
parent
d455f57346
commit
2decf10863
5 changed files with 37 additions and 1 deletions
|
@ -268,6 +268,7 @@ void level_info_t::Reset()
|
|||
Music = "";
|
||||
LevelName = "";
|
||||
AuthorName = "";
|
||||
MapLabel = "";
|
||||
FadeTable = "COLORMAP";
|
||||
CustomColorMap = "COLORMAP";
|
||||
WallHorizLight = -8;
|
||||
|
@ -1028,6 +1029,13 @@ DEFINE_MAP_OPTION(author, true)
|
|||
info->AuthorName = parse.sc.String;
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(label, true)
|
||||
{
|
||||
parse.ParseAssign();
|
||||
parse.sc.MustGetString();
|
||||
info->MapLabel = parse.sc.String;
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(secretnext, true)
|
||||
{
|
||||
parse.ParseAssign();
|
||||
|
|
|
@ -350,6 +350,7 @@ struct level_info_t
|
|||
FString LightningSound = "world/thunder";
|
||||
FString Music;
|
||||
FString LevelName;
|
||||
FString MapLabel;
|
||||
FString AuthorName;
|
||||
int8_t WallVertLight, WallHorizLight;
|
||||
int musicorder;
|
||||
|
|
|
@ -41,6 +41,8 @@ struct UMapEntry
|
|||
FString LevelName;
|
||||
FString InterText;
|
||||
FString InterTextSecret;
|
||||
FString author;
|
||||
FString label;
|
||||
TArray<FSpecialAction> BossActions;
|
||||
bool BossCleared = false;
|
||||
|
||||
|
@ -139,6 +141,16 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape, int *id24_l
|
|||
scanner.MustGetToken(TK_StringConst);
|
||||
mape->LevelName = scanner.String;
|
||||
}
|
||||
else if (!pname.CompareNoCase("author"))
|
||||
{
|
||||
scanner.MustGetToken(TK_StringConst);
|
||||
mape->author = scanner.String;
|
||||
}
|
||||
else if (!pname.CompareNoCase("label"))
|
||||
{
|
||||
scanner.MustGetToken(TK_StringConst);
|
||||
mape->label = scanner.String;
|
||||
}
|
||||
else if (!pname.CompareNoCase("next"))
|
||||
{
|
||||
ParseLumpName(scanner, mape->nextmap);
|
||||
|
@ -417,6 +429,14 @@ void CommitUMapinfo(level_info_t *defaultinfo)
|
|||
levelinfo->LevelName = map.LevelName;
|
||||
levelinfo->PName = ""; // clear the map name patch to force the string version to be shown - unless explicitly overridden right next.
|
||||
}
|
||||
if (map.author.IsNotEmpty())
|
||||
{
|
||||
levelinfo->AuthorName = map.author;
|
||||
}
|
||||
if (map.label.IsNotEmpty())
|
||||
{
|
||||
levelinfo->MapLabel = map.label;
|
||||
}
|
||||
if (map.levelpic[0]) levelinfo->PName = map.levelpic;
|
||||
if (map.nextmap[0]) levelinfo->NextMap = map.nextmap;
|
||||
else if (map.endpic[0])
|
||||
|
|
|
@ -2263,7 +2263,12 @@ void FormatMapName(FLevelLocals *self, int cr, FString *result)
|
|||
bool ishub = (cluster != nullptr && (cluster->flags & CLUSTER_HUB));
|
||||
|
||||
*result = "";
|
||||
if (am_showmaplabel == 1 || (am_showmaplabel == 2 && !ishub))
|
||||
// If a label is specified, use it uncontitionally here.
|
||||
if (self->info->MapLabel.IsNotEmpty())
|
||||
{
|
||||
*result << self->info->MapLabel << ": ";
|
||||
}
|
||||
else if (am_showmaplabel == 1 || (am_showmaplabel == 2 && !ishub))
|
||||
{
|
||||
*result << self->MapName << ": ";
|
||||
}
|
||||
|
@ -2767,6 +2772,7 @@ DEFINE_FIELD_X(LevelInfo, level_info_t, Music)
|
|||
DEFINE_FIELD_X(LevelInfo, level_info_t, LightningSound)
|
||||
DEFINE_FIELD_X(LevelInfo, level_info_t, LevelName)
|
||||
DEFINE_FIELD_X(LevelInfo, level_info_t, AuthorName)
|
||||
DEFINE_FIELD_X(LevelInfo, level_info_t, MapLabel)
|
||||
DEFINE_FIELD_X(LevelInfo, level_info_t, musicorder)
|
||||
DEFINE_FIELD_X(LevelInfo, level_info_t, skyspeed1)
|
||||
DEFINE_FIELD_X(LevelInfo, level_info_t, skyspeed2)
|
||||
|
|
|
@ -345,6 +345,7 @@ struct LevelInfo native
|
|||
native readonly String LightningSound;
|
||||
native readonly String Music;
|
||||
native readonly String LevelName;
|
||||
native readonly String MapLabel;
|
||||
native readonly String AuthorName;
|
||||
native readonly int musicorder;
|
||||
native readonly float skyspeed1;
|
||||
|
|
Loading…
Reference in a new issue