From 811db79a78d57a056981f56879af1dcc5e3c6eea Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 19 Apr 2008 11:19:35 +0000 Subject: Rename show_turns to show_gold_turns, and modify the documentation accordingly. Also, don't print that "bringing you to a total of ..." message if you previously had no gold, and change some ints to unsigned to quiet some compiler warnings. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4361 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/externs.h | 2 +- crawl-ref/source/initfile.cc | 6 +++--- crawl-ref/source/items.cc | 14 +++++++++++--- crawl-ref/source/output.cc | 16 +++++++++------- 4 files changed, 24 insertions(+), 14 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 21cc715d54..6ebfaff787 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1580,7 +1580,7 @@ public: bool autoprayer_on; bool show_more_prompt; - bool show_turns; // Show turns used in HUD. + bool show_gold_turns; // Show gold and turns in HUD. bool show_beam; // Show targeting beam by default. long autopickups; // items to autopickup diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index c5695b7577..8ce4243eca 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -629,8 +629,8 @@ void game_options::reset_options() autoprayer_on = false; show_more_prompt = true; - show_turns = false; - show_beam = false; + show_gold_turns = false; + show_beam = false; use_old_selection_order = false; prev_race = 0; @@ -1973,7 +1973,7 @@ void game_options::read_option_line(const std::string &str, bool runscript) save_dir = field; } #endif - else BOOL_OPTION(show_turns); + else BOOL_OPTION(show_gold_turns); else BOOL_OPTION(show_beam); #ifndef SAVE_DIR_PATH else if (key == "morgue_dir") diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 6cc75ce3bd..541b339301 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1475,9 +1475,17 @@ int move_item_to_player( int obj, int quant_got, bool quiet ) if (!quiet) { - mprf("You pick up %d gold piece%s, bringing you to a " - "total of %d gold pieces.", - quant_got, (quant_got > 1) ? "s" : "", you.gold ); + if (quant_got == you.gold) + { + mprf("You pick up %d gold piece%s.", + quant_got, (quant_got > 1) ? "s" : ""); + } + else + { + mprf("You pick up %d gold piece%s, bringing you to a " + "total of %d gold pieces.", + quant_got, (quant_got > 1) ? "s" : "", you.gold ); + } } you.turn_is_over = true; diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 87d35de6df..abf7887a6c 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -220,7 +220,7 @@ void update_turn_count() { // Don't update turn counter when running/resting/traveling to // prevent pointless screen updates. - if (!Options.show_turns + if (!Options.show_gold_turns || you.running > 0 || (you.running < 0 && Options.travel_delay == -1)) { @@ -859,9 +859,9 @@ void print_stats(void) you.redraw_experience = false; } - // If Options.show_turns, line 9 is Gold and Turns + // If Options.show_gold_turns, line 9 is Gold and Turns int yhack = 0; - if (Options.show_turns) + if (Options.show_gold_turns) { yhack = 1; cgotoxy(1+6, 9, GOTO_STAT); cprintf("%d", you.gold); @@ -944,19 +944,21 @@ void redraw_skill(const std::string &your_name, const std::string &class_name) { std::string title = your_name + " the " + class_name; - int in_len = title.length(); - const int WIDTH = crawl_view.hudsz.x; + unsigned int in_len = title.length(); + const unsigned int WIDTH = crawl_view.hudsz.x; if (in_len > WIDTH) { in_len -= 3; // what we're getting back from removing "the" - const int name_len = your_name.length(); + const unsigned int name_len = your_name.length(); std::string trimmed_name = your_name; // squeeze name if required, the "- 8" is to not squeeze too much if (in_len > WIDTH && (name_len - 8) > (in_len - WIDTH)) + { trimmed_name = trimmed_name.substr(0, name_len - (in_len - WIDTH) - 1); + } title = trimmed_name + ", " + class_name; } @@ -1006,7 +1008,7 @@ void draw_border(void) cgotoxy(19, 7, GOTO_STAT); cprintf("Ev:"); // Line 8 is exp pool, Level - if (Options.show_turns) + if (Options.show_gold_turns) { cgotoxy( 1, 9, GOTO_STAT); cprintf("Gold:"); cgotoxy(19, 9, GOTO_STAT); cprintf("Turn:"); -- cgit v1.2.3-54-g00ecf