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-24 13:10:35 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-24 13:10:35 +0000
commit47824cdfc7c6cba04b91336e2a91abaac8c558b8 (patch)
treebab422c56a682d6d3d817a6de802c3b9c16a2f87 /crawl-ref/source/libgui.cc
parentabe1935b440c1b521c125de7396e7b4b4760dcaf (diff)
downloadcrawl-ref-47824cdfc7c6cba04b91336e2a91abaac8c558b8.tar.gz
crawl-ref-47824cdfc7c6cba04b91336e2a91abaac8c558b8.zip
Add mouseclick handling for menus in tiles:
L-click will page down, R-click is treated like Escape. Change L-click on player from single turn search to (the more useful, I think) pickup, and add L-click to list of alternatives to call the pickup menu, so that clicking on the player icon twice will directly open the pickup menu. This is getting complicated: there are so few combinations of mouseclicks possible, but because they do different things under different circumstances this *really* needs to be documented somehow. Fix coloured hp/mp bars not updating during running. (During travel the map needs to be redrawn anyway, so also having to redraw the bars doesn't hurt any.) Also fix list_rotten to be readable from init.txt (and default to true). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3316 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libgui.cc')
-rw-r--r--crawl-ref/source/libgui.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index bf0b31b6c1..6f064957a4 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -1362,8 +1362,14 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
desc += "Remove (R)";
break;
case OBJ_MISSILES:
- desc += "Throw (t)";
+ {
+ const item_def *weapon = you.weapon();
+ if (weapon && you.inv[ix].launched_by(*weapon))
+ desc += "Fire (f)";
+ else
+ desc += "Throw (t)";
break;
+ }
case OBJ_WANDS:
desc += "Zap (z)";
break;
@@ -1455,9 +1461,10 @@ static int handle_mouse_motion(int mouse_x, int mouse_y, bool init)
desc += " (";
desc += get_species_abbrev(you.species);
desc += get_class_abbrev(you.char_class);
- desc += ")" EOL;
-
- desc += EOL "[L-Click] Search 1 turn";
+ desc += ")";
+
+ if (igrd[you.x_pos][you.y_pos] != NON_ITEM)
+ desc += EOL "[L-Click] Pick up items (g)";
if (grid_stair_direction( grd[gx][gy] ) != CMD_NO_CMD)
desc += EOL "[Shift-L-Click] use stairs (</>)";
@@ -1649,9 +1656,9 @@ static int handle_mouse_button(int mx, int my, int button,
{
if (button == 1 && cx == DCX && cy == DCY)
{
- // spend one turn resting/searching
+ // pick up items
if (!shift)
- return 's';
+ return 'g';
// else attempt to use stairs on square
const int gx = view2gridX(cx) + 1;
@@ -1837,9 +1844,11 @@ int getch()
int keyin = getch_ck();
if (keyin >= CK_UP && keyin <= CK_CTRL_PGDN)
- return ck_tr[ keyin - CK_UP ];
+ return ck_tr[ keyin - CK_UP ];
+
if (keyin == CK_DELETE)
- return '.';
+ return '.';
+
return keyin;
}