diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-02 16:52:40 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-02 16:52:40 +0000 |
commit | 0a4efdf86b33220269f7439aeb5952a88d50efa7 (patch) | |
tree | fb0826c6072cd6f598ed9e905dea8faa4fd30601 /crawl-ref/source/food.cc | |
parent | b50eafe8de72cbcc4431813934695c22642cdd46 (diff) | |
download | crawl-ref-0a4efdf86b33220269f7439aeb5952a88d50efa7.tar.gz crawl-ref-0a4efdf86b33220269f7439aeb5952a88d50efa7.zip |
Fix a stupid bug I'd introduced when fixing another one.
Fix 1939901: Weapon listing not updated right away after being cursed.
Put the code to colour arbitrary substrings of a message according to
the menu_colour settings into a function of its own, and use it for
pick up and eating prompts (currently from floor only) as well as for
the "Things that are here" listing. Could be overly spammy, thus needs
testing. If all works well, we can remove the "msg =" settings in
food_colouring.txt that currently don't do anything anyway, or reuse
them for non-prompt messages like "You see here a green rat corpse."
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5436 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index c23724aa73..5283e0e9dc 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -387,13 +387,13 @@ static bool _have_corpses_in_pack(bool remind) if (remind) { - text << "You might want to also " << verb << " the " << noun - << " in your pack."; + mprf("You might want to also %s the %s in your pack.", verb.c_str(), + noun.c_str()); } else { - text << "If you dropped the " << noun << " in your pack " - << "then you could " << verb << " " << pronoun << "."; + mprf("If you dropped the %s in your pack you could %s %s.", + verb.c_str(), noun.c_str(), pronoun.c_str()); } mpr(text.str().c_str()); @@ -550,24 +550,11 @@ bool butchery(int which_corpse) // * Mummies can't eat // * Ghouls relish the bad things // * Vampires won't bottle bad corpses + // Also, don't bother colouring if it's only for sacrificing. if (!sacrifice && !you.is_undead) { - // Don't bother colouring if it's only for sacrificing. - std::string cprf = menu_colour_item_prefix(mitm[o]); - std::string colour = ""; - std::string colour_off = ""; - int col = menu_colour(corpse_name, cprf, "pickup"); - - if (col != LIGHTGRAY) - colour = colour_to_str( col ); - - if (!colour.empty()) - { - // Order is important here. - colour_off = "</" + colour + ">"; - colour = "<" + colour + ">"; - corpse_name = colour + corpse_name + colour_off; - } + corpse_name = get_menu_colour_prefix_tags(mitm[o], + DESC_NOCAP_A); } // Shall we butcher this corpse? |