summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-28 18:05:48 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-28 18:05:48 +0000
commit0e02c4a6abc15d6cc0eb8eb690025cebb93410a7 (patch)
tree58d03e0c83f6d64e3126c9d40b0408ec75672e8c /crawl-ref/source/invent.cc
parentc7283223183d8208092f1e85d48dd9efe28c1ac9 (diff)
downloadcrawl-ref-0e02c4a6abc15d6cc0eb8eb690025cebb93410a7.tar.gz
crawl-ref-0e02c4a6abc15d6cc0eb8eb690025cebb93410a7.zip
Push item weights to the right of the inventory menu.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1683 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 8619660b83..a416f411c4 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -21,6 +21,7 @@
#include <string.h>
#include <ctype.h>
#include <sstream>
+#include <iomanip>
#ifdef DOS
#include <conio.h>
@@ -129,7 +130,9 @@ std::string InvEntry::get_text() const
if ( Options.show_inventory_weights )
{
const int mass = item_mass(*item);
- tstr << " [" << (mass/10) << '.' << (mass%10) << " aum]";
+ tstr << std::setw(get_number_of_cols() - tstr.str().length() - 1)
+ << std::right
+ << make_stringf("(%d.%d aum)", mass / 10, mass % 10);
}
return tstr.str();
}