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

Method outputMessage

src/bzadmin/CursesUI.cpp:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78void CursesUI::outputMessage(const std::string& msg, ColorCode color) {
79 // add message to the message buffer, remove the oldest message if it's full
80 if (msgBuffer.size() == maxBufferSize) {
81 msgBuffer.erase(msgBuffer.begin());
82 }
83 std::pair<std::string, ColorCode> p(msg, color);
84 msgBuffer.push_back(p);
85
86 // if we have scrolled away from the bottom, don't show the new message
87 if (scrollOffset == 0) {
88 wattron(mainWin, COLOR_PAIR(color));
89 waddstr(mainWin, (msg + "\n").c_str());
90 wattroff(mainWin, COLOR_PAIR(color));
91 wrefresh(mainWin);
92 }
93}
94
95
96void CursesUI::handleNewPacket(uint16_t code) {

Callers 4

checkMessageMethod · 0.45
outputServerListMethod · 0.45
runLoopMethod · 0.45
listSetVarsMethod · 0.45

Calls 4

c_strMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected