| 444 | } |
| 445 | |
| 446 | bool InvMenu::process_command(command_type cmd) |
| 447 | { |
| 448 | if (flags & MF_PAGED_INVENTORY) |
| 449 | { |
| 450 | if (cmd == CMD_MENU_ACCEPT_SELECTION) |
| 451 | { |
| 452 | get_selected(&sel); |
| 453 | return false; |
| 454 | } |
| 455 | else if (cmd == CMD_MENU_EXIT) |
| 456 | { |
| 457 | // Must clear offscreen selection or exiting the menu will still act |
| 458 | // upon those items. |
| 459 | for (size_t i = 0; i < ARRAYSZ(offscreen_sel); ++i) |
| 460 | offscreen_sel[i].clear(); |
| 461 | sel.clear(); |
| 462 | lastch = CK_ESCAPE; // XX is this correct? |
| 463 | return is_set(MF_UNCANCEL) && !crawl_state.seen_hups; |
| 464 | } |
| 465 | else if (cmd == CMD_MENU_LEFT) |
| 466 | { |
| 467 | cycle_page(-1); |
| 468 | return true; |
| 469 | } |
| 470 | else if (cmd == CMD_MENU_RIGHT) |
| 471 | { |
| 472 | cycle_page(1); |
| 473 | return true; |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | return Menu::process_command(cmd); |
| 478 | } |
| 479 | |
| 480 | void InvMenu::select_index(int index, int qty) |
| 481 | { |
nothing calls this directly
no test coverage detected