MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DisplayMessage

Function DisplayMessage

Source/Internal/error.cpp:263–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void DisplayMessage(const char* title,
264 const char* contents) {
265 display_error_mutex.lock();
266
267 if (config["no_dialogues"].toBool()) {
268 display_error_mutex.unlock();
269 return;
270 }
271
272 ErrorDisplay ed;
273
274 ed.title = title;
275 ed.contents = contents;
276 ed.type = _ok;
277
278 int error_id = PushDisplayError(ed);
279
280 ErrorResponse response;
281
282// On windows, showing this dialogue on the non-main window seems fine. (not sure i like it though, might wanna not do this, it's helpful for stacktraces in visual studio however).
283#if PLATFORM_WINDOWS
284 response = DisplayLastQueuedError();
285#else
286 if (IsMainThread()) {
287 response = DisplayLastQueuedError();
288 } else {
289 response = WaitResponseForDisplayError(error_id);
290 }
291#endif
292
293 display_error_mutex.unlock();
294}

Callers 6

CreateNavMeshMethod · 0.85
UndoMethod · 0.85
RedoMethod · 0.85
SaveLevelMethod · 0.85
DisplayFormatMessageFunction · 0.85

Calls 7

PushDisplayErrorFunction · 0.85
DisplayLastQueuedErrorFunction · 0.85
IsMainThreadFunction · 0.85
toBoolMethod · 0.80
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected