From 4bb492c640354a968b77a3d4f9bf0ebfd3a31ba1 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Wed, 23 Apr 2008 12:16:24 +0000 Subject: [1940326] Fixing bug where the mouse couldn't be used to select items on the inventory/menu/drop screen. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4528 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/libgui.cc | 13 +++++++++++-- crawl-ref/source/menu.cc | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc index 5e8895d515..c1c6a7ce6c 100644 --- a/crawl-ref/source/libgui.cc +++ b/crawl-ref/source/libgui.cc @@ -1720,11 +1720,20 @@ static int _handle_mouse_button(int mx, int my, int button, toggle_telescope = false; } - // item clicked - if (mode == REGION_INV1 || mode == REGION_INV2) + if (mode == REGION_INV2) { int ix = TileInvIdx(cx); + int key = itemlist_key[cx]; + if (ix != -1 && key) + return key; + else + return 0; + } + // item clicked + if (mode == REGION_INV1) + { + int ix = TileInvIdx(cx); if (ix != -1) { if (button == 2) diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 6d004e968d..a3d00595ed 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -212,6 +212,7 @@ void Menu::do_menu() { #ifdef USE_TILE TileRedrawInv(REGION_INV2); + mouse_control mc(MOUSE_MODE_COMMAND); #endif int keyin = getchm(c_getch); -- cgit v1.2.3-54-g00ecf