summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-07 18:12:17 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-07 18:12:17 +0100
commit389bb3b9bce97d135307b650eb95d3ea1ad1e557 (patch)
tree5bacbfe485316a876cb6eb87d2a1ee983c39282a /crawl-ref
parent87da8db7d1e1a45d9aadaf6b4bc6f07ae5c822e0 (diff)
downloadcrawl-ref-389bb3b9bce97d135307b650eb95d3ea1ad1e557.tar.gz
crawl-ref-389bb3b9bce97d135307b650eb95d3ea1ad1e557.zip
Use proper newlines in the ?v version information.
I hope this isn't another one of those ascii/tiles or OS differences but for me at least the empty lines between sections weren't being displayed in the console version, either.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/command.cc26
-rw-r--r--crawl-ref/source/menu.cc5
-rw-r--r--crawl-ref/source/menu.h2
3 files changed, 19 insertions, 14 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 34f588d89e..272d34e6dc 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -149,7 +149,7 @@ static std::string _get_version_changes(void)
help = buf;
// Give up if you encounter an older version.
- if (help.find("Stone Soup 0.4") != std::string::npos)
+ if (help.find("Stone Soup 0.5") != std::string::npos)
break;
if (help.find("Highlights") != std::string::npos)
@@ -184,8 +184,7 @@ static std::string _get_version_changes(void)
{
result += EOL;
result += "For a more complete list of changes, see changelog.txt "
- "in the " EOL
- "/docs folder.";
+ "in the /docs folder.";
}
else
{
@@ -219,9 +218,9 @@ static void _print_version(void)
" Esc exits.]"));
#endif
- cmd_version.add_text(_get_version_information());
- cmd_version.add_text(_get_version_features());
- cmd_version.add_text(_get_version_changes());
+ cmd_version.add_text(_get_version_information(), true);
+ cmd_version.add_text(_get_version_features(), true);
+ cmd_version.add_text(_get_version_changes(), true);
std::string fname = "key_changes.txt";
// Read in information about changes in comparison to the latest version.
@@ -259,17 +258,20 @@ static void _print_version(void)
else
break;
}
+ std::string text;
if (first)
{
// Highlight the first line (title).
- std::string text = "<w>";
- text += buf;
- text += "</w>";
- cmd_version.add_text(text);
+ text = "<w>";
+ text += buf;
+ text += "</w>";
first = false;
}
else
- cmd_version.add_text(buf);
+ text = buf;
+
+ text += EOL;
+ cmd_version.add_text(text);
}
fclose(fp);
}
@@ -1706,7 +1708,7 @@ static bool _find_description(bool &again, std::string& error_inout)
std::sort(key_list.begin(), key_list.end());
// For tiles builds use a tiles menu to display monsters.
- const bool text_only =
+ const bool text_only =
#ifdef USE_TILE
!(doing_mons || doing_features || doing_spells);
#else
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 846f5fc0fa..10f865adc5 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -1716,12 +1716,15 @@ formatted_scroller::formatted_scroller(int _flags, const std::string& s) :
add_text(s);
}
-void formatted_scroller::add_text(const std::string& s)
+void formatted_scroller::add_text(const std::string& s, bool new_line)
{
std::vector<formatted_string> parts;
formatted_string::parse_string_to_multiple(s, parts);
for (unsigned int i = 0; i < parts.size(); ++i)
add_item_formatted_string(parts[i]);
+
+ if (new_line)
+ add_item_formatted_string(formatted_string::parse_string(EOL));
}
void formatted_scroller::add_item_formatted_string(const formatted_string& fs,
diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h
index fb822388ed..054ef2febe 100644
--- a/crawl-ref/source/menu.h
+++ b/crawl-ref/source/menu.h
@@ -534,7 +534,7 @@ public:
virtual void add_item_formatted_string(const formatted_string& s,
int hotkey = 0);
virtual void add_item_string(const std::string& s, int hotkey = 0);
- virtual void add_text(const std::string& s);
+ virtual void add_text(const std::string& s, bool new_line = false);
virtual bool jump_to_hotkey( int keyin );
virtual ~formatted_scroller();
protected: