summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-25 20:37:21 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-25 20:37:21 +0000
commitc4373aa209b318a73d349b15d852446bfad150f9 (patch)
tree64359cdfde244765f238c902fb1d28e7f53600d7
parent27f9de8aa969209dcdb6b966d65ed2af8442d52f (diff)
downloadcrawl-ref-c4373aa209b318a73d349b15d852446bfad150f9.tar.gz
crawl-ref-c4373aa209b318a73d349b15d852446bfad150f9.zip
Implemented 1565223.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@115 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/shopping.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index dc621460d6..199e4cd392 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -127,18 +127,20 @@ char in_a_shop( char shoppy, id_arr id )
{
gotoxy(1, i);
- textcolor((i % 2) ? WHITE : LIGHTGREY);
-
- it_name(itty, DESC_NOCAP_A, st_pass);
- putch(i + 96);
- cprintf(" - ");
- cprintf(st_pass);
-
gp_value = greedy * item_value( mitm[itty], id );
gp_value /= 10;
if (gp_value <= 1)
gp_value = 1;
+ bool can_afford = (you.gold >= gp_value);
+ textcolor( can_afford ? GREEN : RED );
+ cprintf("%c - ", i+96);
+
+ textcolor((i % 2) ? WHITE : LIGHTGREY);
+
+ it_name(itty, DESC_NOCAP_A, st_pass);
+ cprintf(st_pass);
+
std::string desc;
if (is_dumpable_artifact(mitm[itty], Options.verbose_dump))
desc = munge_description(get_item_description(mitm[itty],
@@ -149,7 +151,7 @@ char in_a_shop( char shoppy, id_arr id )
# endif
gotoxy(60, i);
- // cdl - itoa(gp_value, st_pass, 10);
+ textcolor( can_afford ? GREEN : RED );
snprintf(st_pass, sizeof(st_pass), "%5d", gp_value);
cprintf(st_pass);
cprintf(" gold");