| 1144 | } |
| 1145 | |
| 1146 | bool 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 | |
| 1163 | bool IsDebugGridTextNeeded() |
| 1164 | { |
no test coverage detected