| 494 | } |
| 495 | |
| 496 | static void debugDisplayFatalErrorMsgBox(const char* outputLogLine) |
| 497 | { |
| 498 | if (wzIsFullscreen()) |
| 499 | { |
| 500 | wzChangeWindowMode(WINDOW_MODE::windowed, true); |
| 501 | } |
| 502 | #if defined(WZ_OS_WIN) |
| 503 | char wbuf[MAX_LEN_LOG_LINE+512]; |
| 504 | ssprintf(wbuf, "%s\n\nPlease check the file (%s) in your configuration directory for more details. \ |
| 505 | \nDo not forget to upload the %s file, WZdebuginfo.txt and the warzone2100.rpt files in your bug reports at https://github.com/Warzone2100/warzone2100/issues/new!", outputLogLine, WZ_DBGFile, WZ_DBGFile); |
| 506 | wzDisplayDialog(Dialog_Error, "Warzone has terminated unexpectedly", wbuf); |
| 507 | #elif defined(WZ_OS_MAC) |
| 508 | char wbuf[MAX_LEN_LOG_LINE+128]; |
| 509 | ssprintf(wbuf, "%s\n\nPlease check your logs and attach them along with a bug report. Thanks!", outputLogLine); |
| 510 | size_t clickedIndex = wzDisplayDialogAdvanced(Dialog_Error, "Warzone has quit unexpectedly.", wbuf, {"Show Log Files & Open Bug Reporter", "Ignore"}); |
| 511 | if (clickedIndex == 1) |
| 512 | { |
| 513 | if (!cocoaOpenURL("https://github.com/Warzone2100/warzone2100/issues/new")) |
| 514 | { |
| 515 | wzDisplayDialogAdvanced(Dialog_Error, |
| 516 | "Failed to open URL", |
| 517 | "Could not open URL: https://github.com/Warzone2100/warzone2100/issues/new\nPlease open this URL manually in your web browser.", {"Continue"}); |
| 518 | } |
| 519 | if (strnlen(WZ_DBGFile, sizeof(WZ_DBGFile)/sizeof(WZ_DBGFile[0])) <= 0) |
| 520 | { |
| 521 | wzDisplayDialogAdvanced(Dialog_Error, |
| 522 | "Unable to open debug log.", |
| 523 | "The debug log subsystem has not yet been initialised.", {"Continue"}); |
| 524 | } |
| 525 | else |
| 526 | { |
| 527 | if (!cocoaSelectFileInFinder(WZ_DBGFile)) |
| 528 | { |
| 529 | wzDisplayDialogAdvanced(Dialog_Error, |
| 530 | "Cannot Display Log File", |
| 531 | "The attempt to open a Finder window highlighting the log file from this run failed.", {"Continue"}); |
| 532 | } |
| 533 | } |
| 534 | cocoaOpenUserCrashReportFolder(); |
| 535 | } |
| 536 | #else |
| 537 | wzDisplayDialog(Dialog_Error, "Warzone has terminated unexpectedly", outputLogLine); |
| 538 | #endif |
| 539 | } |
| 540 | |
| 541 | struct DebugGfxCallbackPersistentData |
| 542 | { |
no test coverage detected