MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / addConsoleCommands

Function addConsoleCommands

source/modes/ConsoleCommands.cpp:492–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490namespace ConsoleCommands
491{
492void addConsoleCommands(ConsoleInterface& cl)
493{
494 cl.addCommand("ambientlight",
495 "The 'ambientlight' command sets the minimum light that every object in the scene is illuminated with. "
496 "It takes as it's argument and RGB triplet whose values for red, green, and blue range from 0.0 to 1.0.\n\nExample:\n"
497 "ambientlight 0.4 0.6 0.5\n\nThe above command sets the ambient light color to red=0.4, green=0.6, and blue = 0.5.",
498 cAmbientLight,
499 Command::cStubServer,
500 {AbstractModeManager::ModeType::GAME, AbstractModeManager::ModeType::EDITOR});
501 cl.addCommand("fps",
502 "'fps' (framespersecond) for short is a utility which displays or sets the maximum framerate at which the"
503 "rendering will attempt to update the screen.\n\nExample:\n"
504 "fps 35\n\nThe above command will set the current maximum framerate to 35 turns per second.",
505 cFPS,
506 Command::cStubServer,
507 {AbstractModeManager::ModeType::GAME, AbstractModeManager::ModeType::EDITOR});
508 cl.addCommand("nearclip",
509 "Sets the minimal viewpoint clipping distance. Objects nearer than that won't be rendered.\n\nE.g.: nearclip 3.0",
510 [](const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&) {
511 return cSetFrameListenerVar<float>(std::mem_fn(&ODFrameListener::getActiveCameraNearClipDistance),
512 std::mem_fn(&ODFrameListener::setActiveCameraNearClipDistance),
513 ODFrameListener::getSingleton(),
514 "near clip distance", args, c);
515 },
516 Command::cStubServer,
517 {AbstractModeManager::ModeType::GAME, AbstractModeManager::ModeType::EDITOR});
518 cl.addCommand("farclip",
519 "Sets the maximal viewpoint clipping distance. Objects farther than that won't be rendered.\n\nE.g.: farclip 30.0",
520 [](const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&) {
521 return cSetFrameListenerVar<float>(std::mem_fn(&ODFrameListener::getActiveCameraFarClipDistance),
522 std::mem_fn(&ODFrameListener::setActiveCameraFarClipDistance),
523 ODFrameListener::getSingleton(),
524 "far clip distance", args, c);
525 },
526 Command::cStubServer,
527 {AbstractModeManager::ModeType::GAME, AbstractModeManager::ModeType::EDITOR});
528 cl.addCommand("maxtime",
529 "Sets the max time (in seconds) a message will be displayed in the info text area.\n\nExample:\n"
530 "maxtime 5",
531 [](const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&) {
532 return cSetFrameListenerVar<float>(std::mem_fn(&ODFrameListener::getEventMaxTimeDisplay),
533 std::mem_fn(&ODFrameListener::setEventMaxTimeDisplay),
534 ODFrameListener::getSingleton(),
535 "event max time display", args, c);
536 },
537 Command::cStubServer,
538 {AbstractModeManager::ModeType::GAME, AbstractModeManager::ModeType::EDITOR});
539 cl.addCommand("addcreature",
540 "Adds a new creature according to following parameters",
541 cSendCmdToServer,
542 cSrvAddCreature,
543 {AbstractModeManager::ModeType::GAME, AbstractModeManager::ModeType::EDITOR});
544
545 std::string listDescription = "'list' (or 'ls' for short) is a utility which lists various types of information about the current game. "
546 "Running list without an argument will produce a list of the lists available. "
547 "Running list with an argument displays the contents of that list.\n\nExamples:\n"
548 "list creatures\tLists all the creatures currently in the game.\n"
549 "list classes\tLists all creature classes.\n"

Callers 2

ODServerMethod · 0.85
GameEditorModeConsoleMethod · 0.85

Calls 2

addCommandMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected