MCPcopy Create free account
hub / github.com/crawl/crawl / process_command

Method process_command

crawl-ref/source/invent.cc:446–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446bool 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
480void InvMenu::select_index(int index, int qty)
481{

Callers

nothing calls this directly

Calls 2

process_commandFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected