| 46 | } |
| 47 | |
| 48 | void ErrorWindow::SetText(const std::string& text, const std::string& log) |
| 49 | { |
| 50 | LogView->SetText(text, log); |
| 51 | |
| 52 | clipboardtext.clear(); |
| 53 | clipboardtext.reserve(log.size() + text.size() + 100); |
| 54 | |
| 55 | // Strip the color escapes from the log |
| 56 | const uint8_t* cptr = (const uint8_t*)log.data(); |
| 57 | while (int chr = GetCharFromString(cptr)) |
| 58 | { |
| 59 | if (chr != TEXTCOLOR_ESCAPE) |
| 60 | { |
| 61 | // The bar characters, most commonly used to indicate map changes |
| 62 | if (chr >= 0x1D && chr <= 0x1F) |
| 63 | { |
| 64 | chr = 0x2550; // Box Drawings Double Horizontal |
| 65 | } |
| 66 | clipboardtext += MakeUTF8(chr); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | clipboardtext += "\nExecution could not continue.\n"; |
| 71 | clipboardtext += text; |
| 72 | clipboardtext += "\n"; |
| 73 | } |
| 74 | |
| 75 | void ErrorWindow::OnClipboardButtonClicked() |
| 76 | { |
no test coverage detected