diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-03-08 14:12:08 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-03-08 17:49:54 +0100 |
commit | 877884e2f8165ac21e2a1d68d444048132e26de5 (patch) | |
tree | d286240c9556fe1497cee919f5dbc46a64d4fa20 /crawl-ref/source/database.cc | |
parent | 7028a21f96469a72c054b5e9a417661884dfbb82 (diff) | |
download | crawl-ref-877884e2f8165ac21e2a1d68d444048132e26de5.tar.gz crawl-ref-877884e2f8165ac21e2a1d68d444048132e26de5.zip |
Allow descriptions (dat/descript/*.txt) to be logically wrapped in the sources.
Without this, they had to be stored in enormous long lines, nigh impossible
to read and tedious to edit -- or pre-wrapped, which wastes space and looks
ugly on terminals wider than 80 columns.
They are unwrapped upon being displayed now, giving us the best of two
worlds. Existing descriptions (bugs aside) never used pre-wrapping,
although they often do consist of paragraphs separated by an empty line.
(Cards and "buggy god" descriptions are exceptions, but "usually found in"
parts should be autogenerated anyway, as we risk them becoming outdated.)
New formatting rules:
* regular text is re-wrapped
* an empty line separates paragraphs
* indented lines keep their breaks (used in most quotes)
* you can force a newline with literal "\n"
The last one is unused, merely a quirk of the conversion, and may be not the
best idea -- keeping it for now to allow you to force newlines if needed.
Diffstat (limited to 'crawl-ref/source/database.cc')
-rw-r--r-- | crawl-ref/source/database.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index acbd752436..9795b8db50 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -699,9 +699,10 @@ std::string getLongDescription(const std::string &key) if (!DescriptionDB.get()) return (""); - return _query_database(DescriptionDB.get(), key, true, true); + return unwrap_desc(_query_database(DescriptionDB.get(), key, true, true)); } +// god names only std::string getWeightedRandomisedDescription(const std::string &key) { return _query_weighted_randomised(DescriptionDB, key); |