Simplify SDL message boxes (#1249)

It has what we needs and needs less abstraction, overall simplifying the code
This commit is contained in:
Jan 2022-12-20 23:36:18 +01:00 committed by GitHub
parent 902539b97a
commit b584f1fe35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 12 deletions

View File

@ -500,19 +500,8 @@ static int f_show_fatal_error(lua_State *L) {
#ifdef _WIN32
MessageBox(0, msg, title, MB_OK | MB_ICONERROR);
#else
SDL_MessageBoxButtonData buttons[] = {
{ SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 0, "Ok" },
};
SDL_MessageBoxData data = {
.title = title,
.message = msg,
.numbuttons = 1,
.buttons = buttons,
};
int buttonid;
SDL_ShowMessageBox(&data, &buttonid);
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, msg, NULL);
#endif
return 0;
}