| 259 | } // namespace |
| 260 | |
| 261 | void UiOkDialog(const char *text, const char *caption, bool error, UiItem *render_behind, std::size_t render_behind_size) |
| 262 | { |
| 263 | static bool inDialog = false; |
| 264 | |
| 265 | if (!gbActive || inDialog) { |
| 266 | if (SDL_ShowCursor(SDL_ENABLE) <= -1) { |
| 267 | SDL_Log(SDL_GetError()); |
| 268 | } |
| 269 | #ifndef RUN_TESTS |
| 270 | if (SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, text, caption, NULL) <= -1) { |
| 271 | SDL_Log(SDL_GetError()); |
| 272 | #else |
| 273 | { |
| 274 | #endif |
| 275 | SDL_Log(text); |
| 276 | SDL_Log(caption); |
| 277 | } |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | inDialog = true; |
| 282 | Init(text, caption, error, render_behind_size > 0); |
| 283 | DialogLoop(dialogItems, dialogItemsSize, render_behind, render_behind_size); |
| 284 | Deinit(); |
| 285 | inDialog = false; |
| 286 | } |
| 287 | |
| 288 | void UiErrorOkDialog(const char *text, const char *caption, UiItem *render_behind, std::size_t render_behind_size) |
| 289 | { |
| 290 | UiOkDialog(text, caption, /*error=*/true, render_behind, render_behind_size); |
| 291 | } |
| 292 | |
| 293 | void UiErrorOkDialog(const char *text, const char *caption, bool error) |
| 294 | { |
| 295 | UiOkDialog(text, caption, error, nullptr, 0); |
| 296 | } |
| 297 | |
| 298 | void UiErrorOkDialog(const char *text, UiItem *render_behind, std::size_t render_behind_size) |
| 299 | { |
| 300 | UiErrorOkDialog(text, nullptr, render_behind, render_behind_size); |
| 301 | } |
| 302 | |
| 303 | } // namespace dvl |
no test coverage detected