summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/command.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-27 16:31:47 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-27 16:31:47 +0000
commit865149aa81d5ca891c4bba5c3c347194e1b6cd80 (patch)
tree56fa0da01dab0fe7e876be0165c9f56d5a2cd8d9 /crawl-ref/source/command.cc
parentf3ea3473859e35a5d232c1a075af8af2646867a1 (diff)
downloadcrawl-ref-865149aa81d5ca891c4bba5c3c347194e1b6cd80.tar.gz
crawl-ref-865149aa81d5ca891c4bba5c3c347194e1b6cd80.zip
Oops, rings were getting doubled names, fixed.
The march towards ostringstream goes on. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1385 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r--crawl-ref/source/command.cc44
1 files changed, 23 insertions, 21 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 846e777c45..6a8e953b99 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <string.h>
+#include <sstream>
#include <ctype.h>
#include "externs.h"
@@ -1029,27 +1030,28 @@ void list_tutorial_help()
cols.set_pagesize(get_number_of_lines());
unsigned short ch, colour;
- std::string text =
- "<h>Item types (and common commands)\n"
- "<cyan>)</cyan> : hand weapons (<w>w</w>ield)\n"
- "<brown>(</brown> : missiles (<w>t</w>hrow or <w>f</w>ire)\n"
- "<cyan>[</cyan> : armour (<w>W</w>ear and <w>T</w>ake off)\n"
- "<brown>%</brown> : food and corpses (<w>e</w>at and <w>D</w>issect)\n"
- "<w>?</w> : scrolls (<w>r</w>ead)\n"
- "<magenta>!</magenta> : potions (<w>q</w>uaff)\n"
- "<blue>=</blue> : rings (<w>P</w>ut on and <w>R</w>emove)\n"
- "<red>\"</red> : amulets (<w>P</w>ut on and <w>R</w>emove)\n"
- "<darkgrey>/</darkgrey> : wands (<w>z</w>ap)\n"
- "<lightcyan>";
+
+ std::ostringstream text;
+ text <<
+ "<h>Item types (and common commands)\n"
+ "<cyan>)</cyan> : hand weapons (<w>w</w>ield)\n"
+ "<brown>(</brown> : missiles (<w>t</w>hrow or <w>f</w>ire)\n"
+ "<cyan>[</cyan> : armour (<w>W</w>ear and <w>T</w>ake off)\n"
+ "<brown>%</brown> : food and corpses (<w>e</w>at and <w>D</w>issect)\n"
+ "<w>?</w> : scrolls (<w>r</w>ead)\n"
+ "<magenta>!</magenta> : potions (<w>q</w>uaff)\n"
+ "<blue>=</blue> : rings (<w>P</w>ut on and <w>R</w>emove)\n"
+ "<red>\"</red> : amulets (<w>P</w>ut on and <w>R</w>emove)\n"
+ "<darkgrey>/</darkgrey> : wands (<w>z</w>ap)\n"
+ "<lightcyan>";
get_item_symbol(DNGN_ITEM_BOOK, &ch, &colour);
- snprintf(info, INFO_SIZE, "%c", ch);
- text += info;
- text += "</lightcyan> : books (<w>r</w>ead, <w>M</w>emorise and <w>Z</w>ap)\n"
- "<brown>";
+ text << static_cast<char>(ch);
+ text << "</lightcyan> : books (<w>r</w>ead, <w>M</w>emorise and "
+ "<w>Z</w>ap)\n"
+ "<brown>";
get_item_symbol(DNGN_ITEM_STAVE, &ch, &colour);
- snprintf(info, INFO_SIZE, "%c", ch);
- text += info;
- text += "</brown> : staves, rods (<w>w</w>ield and <w>E</w>voke)\n"
+ text << static_cast<char>(ch);
+ text << "</brown> : staves, rods (<w>w</w>ield and <w>E</w>voke)\n"
"\n"
"<h>Movement and attacking\n"
"Use the <w>numpad</w> for movement (try both\n"
@@ -1064,7 +1066,7 @@ void list_tutorial_help()
"<w>Z</w> to cast spells (<w>Z?</w> lists spells).\n",
cols.add_formatted(
- 0, text.c_str(),
+ 0, text.str().c_str(),
true, true, cmdhelp_textfilter);
cols.add_formatted(
@@ -1089,7 +1091,7 @@ void list_tutorial_help()
"If the previous target is still alive\n"
"and in sight, one of <w>f</w>, <w>p</w>, <w>t</w> fires\n"
"at it again (without selecting anything).\n",
- true, true, cmdhelp_textfilter,40);
+ true, true, cmdhelp_textfilter, 40);
show_keyhelp_menu(cols.formatted_lines(), false);
}