Merge remote-tracking branch 'origin/master' into feature/machine_and_kb

This commit is contained in:
OBattler
2021-10-16 16:43:35 +02:00
6 changed files with 48 additions and 15 deletions

View File

@@ -563,22 +563,48 @@ do_stop(void)
int ui_msgbox(int flags, void *message) int ui_msgbox(int flags, void *message)
{ {
return ui_msgbox_header(flags, message, NULL); return ui_msgbox_header(flags, NULL, message);
} }
int ui_msgbox_header(int flags, void *message, void* header) int ui_msgbox_header(int flags, void *header, void* message)
{ {
if (!header) header = L"86Box"; SDL_MessageBoxData msgdata;
SDL_MessageBoxButtonData msgbtn;
if (!header) header = (flags & MBX_ANSI) ? "86Box" : L"86Box";
if (header <= (void*)7168) header = plat_get_string(header);
if (message <= (void*)7168) message = plat_get_string(message);
msgbtn.buttonid = 1;
msgbtn.text = "OK";
msgbtn.flags = 0;
memset(&msgdata, 0, sizeof(SDL_MessageBoxData));
msgdata.numbuttons = 1;
msgdata.buttons = &msgbtn;
int msgflags = 0;
if (msgflags & MBX_FATAL) msgflags |= SDL_MESSAGEBOX_ERROR;
else if (msgflags & MBX_ERROR || msgflags & MBX_WARNING) msgflags |= SDL_MESSAGEBOX_WARNING;
else msgflags |= SDL_MESSAGEBOX_INFORMATION;
msgdata.flags = msgflags;
if (flags & MBX_ANSI) if (flags & MBX_ANSI)
{ {
fwprintf(stderr, L"%s\n", header); int button = 0;
fprintf(stderr, "==========================\n" msgdata.title = header;
"%s\n", message); msgdata.message = message;
return 0; SDL_ShowMessageBox(&msgdata, &button);
return button;
} }
fwprintf(stderr, L"%s\n", header); else
fwprintf(stderr, L"==========================\n" {
L"%s\n", plat_get_string(message)); int button = 0;
char *res = SDL_iconv_string("UTF-8", sizeof(wchar_t) == 2 ? "UTF-16LE" : "UTF-32LE", (char *)message, wcslen(message) * sizeof(wchar_t) + sizeof(wchar_t));
char *res2 = SDL_iconv_string("UTF-8", sizeof(wchar_t) == 2 ? "UTF-16LE" : "UTF-32LE", (char *)header, wcslen(header) * sizeof(wchar_t) + sizeof(wchar_t));
msgdata.message = res;
msgdata.title = res2;
SDL_ShowMessageBox(&msgdata, &button);
free(res);
free(res2);
return button;
}
return 0; return 0;
} }
@@ -973,7 +999,7 @@ int main(int argc, char** argv)
SDL_Init(0); SDL_Init(0);
pc_init(argc, argv); pc_init(argc, argv);
if (! pc_init_modules()) { if (! pc_init_modules()) {
fprintf(stderr, "No ROMs found.\n"); ui_msgbox_header(MBX_FATAL, L"No ROMs found.", L"86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.");
SDL_Quit(); SDL_Quit();
return 6; return 6;
} }

View File

@@ -825,12 +825,19 @@ END
// Icon with lowest ID value placed first to ensure application icon // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems. // remains consistent on all systems.
// defining the icons depending on the build status
#ifdef RELEASE_BUILD #ifdef RELEASE_BUILD
/* Icon by Devcore - https://commons.wikimedia.org/wiki/File:Icon_PC_256x256.png */ /* Icon by OBattler and laciba96 (green for release builds)*/
10 ICON DISCARDABLE ICON_PATH "icons/86Box-RB.ico" 10 ICON DISCARDABLE ICON_PATH "icons/86Box-green.ico"
#elif BETA_BUILD
/* Icon by OBattler and laciba96 (yellow for beta builds done by Jenkins)*/
10 ICON DISCARDABLE ICON_PATH "icons/86Box-yellow.ico"
#elif ALPHA_BUILD
/* Icon by OBattler and laciba96 (red for alpha builds done by Jenkins)*/
10 ICON DISCARDABLE ICON_PATH "icons/86Box-red.ico"
#else #else
/* Icon by Devcore - https://commons.wikimedia.org/wiki/File:Icon_PC2_256x256.png */ /* Icon by OBattler and laciba96 (gray for builds of branches and from the git master)*/
10 ICON DISCARDABLE ICON_PATH "icons/86Box.ico" 10 ICON DISCARDABLE ICON_PATH "icons/86Box-gray.ico"
#endif #endif
16 ICON DISCARDABLE ICON_PATH "icons/floppy_525.ico" 16 ICON DISCARDABLE ICON_PATH "icons/floppy_525.ico"
17 ICON DISCARDABLE ICON_PATH "icons/floppy_525_active.ico" 17 ICON DISCARDABLE ICON_PATH "icons/floppy_525_active.ico"

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
src/win/icons/86Box-red.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB