MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / CheckDebugTextCommand

Function CheckDebugTextCommand

Source/debug.cpp:1146–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144}
1145
1146bool CheckDebugTextCommand(const string_view text)
1147{
1148 auto debugCmdIterator = std::find_if(DebugCmdList.begin(), DebugCmdList.end(), [&](const DebugCmdItem &elem) { return text.find(elem.text) == 0 && (text.length() == elem.text.length() || text[elem.text.length()] == ' '); });
1149 if (debugCmdIterator == DebugCmdList.end())
1150 return false;
1151
1152 auto &dbgCmd = *debugCmdIterator;
1153 string_view parameter = "";
1154 if (text.length() > (dbgCmd.text.length() + 1))
1155 parameter = text.substr(dbgCmd.text.length() + 1);
1156 const auto result = dbgCmd.actionProc(parameter);
1157 Log("DebugCmd: {} Result: {}", text, result);
1158 if (result != "")
1159 EventPlrMsg(result, UiFlags::ColorRed);
1160 return true;
1161}
1162
1163bool IsDebugGridTextNeeded()
1164{

Callers 3

RunGameLoopFunction · 0.85
ResetTalkMsgFunction · 0.85
DiabloHotkeyMsgFunction · 0.85

Calls 4

LogFunction · 0.85
EventPlrMsgFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected