Skip to content

Commit

Permalink
MAPINFO|libcommon: 'Map' definitions may now lookup a Text definition…
Browse files Browse the repository at this point in the history
… for the title

Support the ZDoom extension, whereby map titles can reference a Text
definition to use as the map title.
  • Loading branch information
danij-deng committed Jul 9, 2014
1 parent e0465ad commit b81e96d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion doomsday/plugins/common/src/mapinfo.cpp
Expand Up @@ -223,7 +223,19 @@ void MapInfoParser(ddstring_s const *path)
}

// Map title must follow the number.
info->set("title", Str_Text(lexer.readString()));
String title = Str_Text(lexer.readString());

// Lookup the title from a Text definition? (ZDoom)
if(!title.compareWithoutCase("lookup"))
{
title = Str_Text(lexer.readString());
char *found = 0;
if(Def_Get(DD_DEF_TEXT, title.toUtf8().constData(), &found) >= 0)
{
title = String(found);
}
}
info->set("title", title);

// Process optional tokens.
while(lexer.readToken())
Expand Down

0 comments on commit b81e96d

Please sign in to comment.