summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-21 13:41:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-21 13:41:10 +0000
commitcbb457d13f09655c81aa5a0e942fbb34f4a76712 (patch)
tree33ae292819a64b31a12a0b2209aa0bbbf6ad036e /crawl-ref/source/libgui.cc
parentb30aacda1fd2b82ae1436f3ac24e3c588d8209d1 (diff)
downloadcrawl-ref-cbb457d13f09655c81aa5a0e942fbb34f4a76712.tar.gz
crawl-ref-cbb457d13f09655c81aa5a0e942fbb34f4a76712.zip
Tiles: allow direct selection of corpse to be butchered from floor
or to drink blood from for vampires git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3313 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libgui.cc')
-rw-r--r--crawl-ref/source/libgui.cc47
1 files changed, 38 insertions, 9 deletions
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index 153d48f47d..7291d4db16 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -1226,7 +1226,7 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
std::string desc;
if (ix != -1)
{
- bool display_actions = mode == REGION_INV1;
+ bool display_actions = (mode == REGION_INV1);
if (itemlist_iflag[cx] & TILEI_FLAG_FLOOR)
{
@@ -1238,6 +1238,22 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
desc += mitm[ix].name(DESC_NOCAP_A);
if (display_actions)
desc += EOL "[L-Click] Pick up (g)";
+
+ if (mitm[ix].base_type == OBJ_CORPSES
+ && you.inv[ix].sub_type != CORPSE_SKELETON
+ && !food_is_rotten(you.inv[ix]))
+ {
+ desc += EOL "[Shift-L-Click] Dissect (D)";
+
+ if (you.species == SP_VAMPIRE)
+ desc += EOL "[Shift-R-Click] Drink blood (e)";
+ }
+ else if (mitm[ix].base_type == OBJ_FOOD
+ && you.species != SP_VAMPIRE
+ && you.species != SP_MUMMY)
+ {
+ desc += EOL "[Shift-R-Click] Eat (e)";
+ }
}
else
{
@@ -1248,10 +1264,13 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
int type = you.inv[ix].base_type;
desc += EOL;
- if (type != OBJ_CORPSES
- || you.species == SP_VAMPIRE
- && you.inv[ix].sub_type != CORPSE_SKELETON
- && you.inv[ix].special >= 100)
+ if ((type != OBJ_CORPSES
+ || you.species == SP_VAMPIRE
+ && you.inv[ix].sub_type != CORPSE_SKELETON
+ && you.inv[ix].special >= 100)
+ && (you.species != SP_MUMMY
+ || you.inv[ix].base_type != OBJ_POTIONS
+ && you.inv[ix].base_type != OBJ_FOOD))
{
desc += "[L-Click] ";
@@ -1542,20 +1561,30 @@ static int handle_mouse_button(int mx, int my, int button,
{
// describe item
if (itemlist_iflag[cx] & TILEI_FLAG_FLOOR)
- gui_set_mouse_inv(-ix, INV_VIEW);
+ {
+ if (shift)
+ {
+ gui_set_mouse_inv(ix, INV_EAT_FLOOR);
+ return CK_MOUSE_B1ITEM;
+ }
+ else
+ gui_set_mouse_inv(-ix, INV_VIEW);
+ }
else
gui_set_mouse_inv(ix, INV_VIEW);
TileMoveInvCursor(-1);
return CK_MOUSE_B2ITEM;
}
- else if(button == 1)
+ else if (button == 1)
{
// Floor item
if (itemlist_iflag[cx] & TILEI_FLAG_FLOOR)
{
// try pick up one item
- if (button != 1) return 0;
- gui_set_mouse_inv(ix, INV_PICKUP);
+ if (!shift)
+ gui_set_mouse_inv(ix, INV_PICKUP);
+ else
+ gui_set_mouse_inv(ix, INV_USE_FLOOR);
return CK_MOUSE_B1ITEM;
}
// use item