MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / debugDisplayFatalErrorMsgBox

Function debugDisplayFatalErrorMsgBox

lib/framework/debug.cpp:496–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496static 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
541struct DebugGfxCallbackPersistentData
542{

Callers 2

_debugFromGfxCallbackFunction · 0.85
_debugFunction · 0.85

Calls 4

wzChangeWindowModeFunction · 0.85
wzDisplayDialogFunction · 0.85
wzDisplayDialogAdvancedFunction · 0.85
wzIsFullscreenFunction · 0.50

Tested by

no test coverage detected