From b81e96ddf430f9e1801747ae12e8aa483b3850e5 Mon Sep 17 00:00:00 2001 From: danij Date: Wed, 9 Jul 2014 17:50:54 +0100 Subject: [PATCH] MAPINFO|libcommon: 'Map' definitions may now lookup a Text definition for the title Support the ZDoom extension, whereby map titles can reference a Text definition to use as the map title. --- doomsday/plugins/common/src/mapinfo.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doomsday/plugins/common/src/mapinfo.cpp b/doomsday/plugins/common/src/mapinfo.cpp index d6f8a389cc..0940bc41c3 100644 --- a/doomsday/plugins/common/src/mapinfo.cpp +++ b/doomsday/plugins/common/src/mapinfo.cpp @@ -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())