Skip to content

Commit

Permalink
Console|ResourceSystem: Improved "listmaps" command
Browse files Browse the repository at this point in the history
Now operates much like the other resource listing commands in that
one may now specify an optional id prefix to match when generating
the listing. For example, the command "listmaps E1" when executed
with Ultimate Doom loaded will output only those maps whose URI
path begins with "E1" (i.e., only the maps of episode one).
  • Loading branch information
danij-deng committed Jul 1, 2014
1 parent cdb3835 commit 645ea21
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 263 deletions.
15 changes: 15 additions & 0 deletions doomsday/client/include/resource/mapdef.h
Expand Up @@ -39,6 +39,21 @@ class MapDef : public de::PathTree::Node, public de::Record
: Node(args), Record()
{}

/**
* Returns a textual description of the map definition.
*
* @return Human-friendly description the map definition.
*/
de::String description(de::Uri::ComposeAsTextFlags uriCompositionFlags = de::Uri::DefaultComposeAsTextFlags) const {
de::String info = de::String("%1").arg(composeUri().compose(uriCompositionFlags | de::Uri::DecodePath),
( uriCompositionFlags.testFlag(de::Uri::OmitScheme)? -14 : -22 ) );
if(_sourceFile)
{
info += de::String(" " _E(C) "\"%1\"" _E(.)).arg(de::NativePath(sourceFile()->composePath()).pretty());
}
return info;
}

/**
* Returns the URI this resource will be known by.
*/
Expand Down

0 comments on commit 645ea21

Please sign in to comment.