MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / cmdMessagePanel

Function cmdMessagePanel

src/clientbase/clientCommands.cpp:517–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515
516
517static std::string cmdMessagePanel(const std::string&, const CmdArgList& args, bool*) {
518 if (controlPanel == NULL) {
519 return "";
520 }
521
522 if (args.size() != 1) {
523 return "usage: messagepanel {all|chat|server|misc|debug|prev|next}";
524 }
525 const std::string& tabName = args[0];
526
527 int tab = -1;
528
529 if (tabName == "prev") {
530 const int tabCount = controlPanel->getTabCount();
531 tab = controlPanel->getActiveTab();
532 tab = (tab - 1 + tabCount) % tabCount;
533 while (!controlPanel->isTabVisible(tab)) {
534 tab = (tab - 1 + tabCount) % tabCount;
535 }
536 }
537 else if (tabName == "next") {
538 const int tabCount = controlPanel->getTabCount();
539 tab = controlPanel->getActiveTab();
540 tab = (tab + 1) % tabCount;
541 while (!controlPanel->isTabVisible(tab)) {
542 tab = (tab + 1) % tabCount;
543 }
544 }
545 else {
546 tab = controlPanel->getTabID(tabName);
547 }
548
549 if (tab < 0) {
550 return "messagepanel, bad tab: '" + tabName + "'";
551 }
552
553 controlPanel->setActiveTab(tab);
554
555 if (!BZDB.isTrue("displayConsole")) {
556 BZDB.setBool("displayConsole", true);
557 }
558
559 return std::string();
560}
561
562
563static std::string cmdSend(const std::string&, const CmdArgList& args, bool*) {

Callers

nothing calls this directly

Calls 8

isTabVisibleMethod · 0.80
getTabIDMethod · 0.80
isTrueMethod · 0.80
setBoolMethod · 0.80
sizeMethod · 0.45
getTabCountMethod · 0.45
getActiveTabMethod · 0.45
setActiveTabMethod · 0.45

Tested by

no test coverage detected