diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-31 17:44:23 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-31 17:44:23 +0000 |
commit | 8d620e1509fe04db564a5f46e32046d0ed61d714 (patch) | |
tree | dafee486172262a4aeb69878e0f290df62cdad69 /crawl-ref/source/menu.h | |
parent | 84dcd8dbdcbdbbcb08794426c634dce42d98e935 (diff) | |
download | crawl-ref-8d620e1509fe04db564a5f46e32046d0ed61d714.tar.gz crawl-ref-8d620e1509fe04db564a5f46e32046d0ed61d714.zip |
Modify menu_colour_item_prefix() to also handle stuff like contaminated
or poisonous chunks.
Throw out all those special cases in food_colouring.txt and
replace them with logic. I sure hope I got all special cases, but if
not they should be easy enough to add. The functions are currently all
in food.cc but they could easily be moved over to clua.cc and adapted
accordingly if needed.
New prefix shortcuts:
* inedible (full herbi/carnivorousness, rotten food for non-saprovores)
* preferred (respects foovorousness, rotten for ghouls, royal jelly for
everyone)
* poisonous
* contaminated
* mutagenic
* rot-inducing
(I also added one-liners to the descriptions of chunks of those types.)
The changes apply to all menu types, but they don't handle messages.
This is problematic in that you'd have to check the pickup menu to see
which corpses are worth butchering, but I'm still against keeping all
those manual checks for (currently) poisonous/mutagenic/... corpses,
esp. as information like this can date quickly.
Instead the butchering interface should be improved to somehow handle
that, possibly by overriding the prompt colour with the specified
colour if necessary. I don't think there are any other cases where
this is important.
Also add a prefix for equipped items and artefacts, so they can be
easily checked for as well. I really think the identified/unidentified
prefix should become default (and the option removed) - this allows
for easy differentiation between identified and non-identified
artefacts. The "known" prefix (for known wand charges or enchantments)
is a bit less interesting but wouldn't hurt any (I think).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5373 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/menu.h')
-rw-r--r-- | crawl-ref/source/menu.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h index 652a68cd87..fdb1ff2ba2 100644 --- a/crawl-ref/source/menu.h +++ b/crawl-ref/source/menu.h @@ -74,7 +74,7 @@ struct MenuEntry MenuEntry( const std::string &txt = std::string(), MenuEntryLevel lev = MEL_ITEM, - int qty = 0, + int qty = 0, int hotk = 0 ) : text(txt), quantity(qty), selected_qty(0), colour(-1), hotkeys(), level(lev), data(NULL) @@ -105,7 +105,7 @@ struct MenuEntry bool is_primary_hotkey( int key ) const { - return hotkeys.size()? hotkeys[0] == key : false; + return (hotkeys.size()? hotkeys[0] == key : false); } virtual std::string get_text() const @@ -127,7 +127,7 @@ struct MenuEntry virtual bool selected() const { - return selected_qty > 0 && quantity; + return (selected_qty > 0 && quantity); } virtual void select( int qty = -1 ) @@ -135,7 +135,7 @@ struct MenuEntry if (selected()) selected_qty = 0; else if (quantity) - selected_qty = qty == -1? quantity : qty; + selected_qty = (qty == -1? quantity : qty); } }; |