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

Method process_command

crawl-ref/source/directn.cc:2322–2421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2320}
2321
2322bool direction_chooser::process_command(command_type command)
2323{
2324 bool loop_done = false;
2325
2326 // Move flags are volatile, reset them to defaults before each command
2327 reinitialize_move_flags();
2328
2329 switch (command)
2330 {
2331 case CMD_TARGET_TOGGLE_BEAM:
2332 if (!just_looking)
2333 toggle_beam();
2334 break;
2335
2336 case CMD_TARGET_EXCLUDE:
2337 if (!just_looking)
2338 break;
2339
2340 if (!is_map_persistent())
2341 mpr("You cannot set exclusions on this level.");
2342 else
2343 {
2344 const bool was_excluded = is_exclude_root(target());
2345 cycle_exclude_radius(target());
2346 need_viewport_redraw = true;
2347 const bool is_excluded = is_exclude_root(target());
2348 if (!was_excluded && is_excluded)
2349 mpr("Placed new exclusion.");
2350 else if (was_excluded && !is_excluded)
2351 mpr("Removed exclusion.");
2352 else
2353 mpr("Reduced exclusion size to a single square.");
2354 }
2355
2356 need_cursor_redraw = true;
2357 break;
2358
2359 case CMD_TARGET_FIND_YOU: move_to_you(); break;
2360 case CMD_TARGET_FIND_TRAP: cycle_feature('^'); break;
2361 case CMD_TARGET_FIND_PORTAL: cycle_feature('\\'); break;
2362 case CMD_TARGET_FIND_ALTAR: cycle_feature('_'); break;
2363 case CMD_TARGET_FIND_UPSTAIR: cycle_feature('<'); break;
2364 case CMD_TARGET_FIND_DOWNSTAIR: cycle_feature('>'); break;
2365
2366 // some modifiers to the basic selection command
2367 case CMD_TARGET_SELECT: loop_done = select(false, false); break;
2368 case CMD_TARGET_SELECT_FORCE: loop_done = select(true, false); break;
2369 case CMD_TARGET_SELECT_ENDPOINT: loop_done = select(false, true); break;
2370 case CMD_TARGET_SELECT_FORCE_ENDPOINT: loop_done = select(true,true); break;
2371
2372#ifdef USE_TILE
2373 case CMD_TARGET_MOUSE_SELECT:
2374 if (tiles_update_target())
2375 loop_done = select(false, false);
2376 break;
2377
2378 case CMD_TARGET_MOUSE_MOVE: tiles_update_target(); break;
2379#endif

Callers 1

process_commandFunction · 0.45

Calls 8

is_map_persistentFunction · 0.85
mprFunction · 0.85
is_exclude_rootFunction · 0.85
cycle_exclude_radiusFunction · 0.85
selectFunction · 0.85
show_helpFunction · 0.85
handle_wizard_commandFunction · 0.85
targeter_handles_keyMethod · 0.45

Tested by

no test coverage detected