From 3539c4f465f873ca6f815eca929d118f2255ddbf Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Thu, 18 Jun 2020 21:46:28 -0300 Subject: [PATCH] Fix and improve fullscreen exit notice (also introducing MBX_DONTASK for "don't show this message again") --- src/config.c | 2 +- src/include/86box/language.h | 4 +++- src/include/86box/ui.h | 1 + src/win/86Box.rc | 4 +++- src/win/win.c | 4 ++-- src/win/win_dialog.c | 8 ++++++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/config.c b/src/config.c index 5a089b8b8..d385c7ed2 100644 --- a/src/config.c +++ b/src/config.c @@ -451,7 +451,7 @@ load_general(void) video_fullscreen_scale = config_get_int(cat, "video_fullscreen_scale", 0); - video_fullscreen_first = config_get_int(cat, "video_fullscreen_first", 0); + video_fullscreen_first = config_get_int(cat, "video_fullscreen_first", 1); force_43 = !!config_get_int(cat, "force_43", 0); scale = config_get_int(cat, "scale", 1); diff --git a/src/include/86box/language.h b/src/include/86box/language.h index 4b793d75d..b8509e591 100644 --- a/src/include/86box/language.h +++ b/src/include/86box/language.h @@ -25,7 +25,7 @@ #define IDS_2049 2049 // "Error" #define IDS_2050 2050 // "Fatal error" #define IDS_2051 2051 // "Are you sure you want to save..." -#define IDS_2052 2052 // "Use CTRL+ALT+PAGE DOWN.." +#define IDS_2052 2052 // "Press CTRL+ALT+PAGE DOWN..." #define IDS_2053 2053 // "Speed" #define IDS_2054 2054 // "ZIP %i (%03i): %ls" #define IDS_2055 2055 // "ZIP images (*.IM?)\0*.IM..." @@ -107,6 +107,8 @@ #define IDS_2131 2131 // LIB_NAME_FREETYPE " is required..." #define IDS_2132 2132 // LIB_NAME_GS " is required for... #define IDS_2133 2133 // LIB_NAME_FLUIDSYNTH " is required..." +#define IDS_2134 2134 // "Entering fullscreen mode" +#define IDS_2135 2135 // "Don't show this message again" #define IDS_4096 4096 // "Hard disk (%s)" #define IDS_4097 4097 // "%01i:%01i" diff --git a/src/include/86box/ui.h b/src/include/86box/ui.h index ab250cb41..f497fb857 100644 --- a/src/include/86box/ui.h +++ b/src/include/86box/ui.h @@ -37,6 +37,7 @@ extern "C" { #define MBX_FATAL 0x20 #define MBX_ANSI 0x80 #define MBX_LINKS 0x100 +#define MBX_DONTASK 0x200 extern int ui_msgbox(int flags, void *message); extern int ui_msgbox_header(int flags, void *header, void *message); diff --git a/src/win/86Box.rc b/src/win/86Box.rc index 924dcb3e1..bdb823786 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -881,7 +881,7 @@ BEGIN IDS_2049 "Error" IDS_2050 "Fatal error" IDS_2051 "Are you sure you want to save the settings?" - IDS_2052 "Use CTRL+ALT+PAGE DOWN to return to windowed mode" + IDS_2052 "Press CTRL+ALT+PAGE DOWN to return to windowed mode." IDS_2053 "Speed" IDS_2054 "ZIP %03i %i (%s): %ls" IDS_2055 "ZIP images (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0" @@ -991,6 +991,8 @@ BEGIN #define LIB_NAME_FLUIDSYNTH "libfluidsynth" #endif IDS_2133 LIB_NAME_FLUIDSYNTH " is required for FluidSynth MIDI output." + IDS_2134 "Entering fullscreen mode" + IDS_2135 "Don't show this message again" END STRINGTABLE DISCARDABLE diff --git a/src/win/win.c b/src/win/win.c index 9bdb91a56..c109c9b8b 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -789,8 +789,8 @@ plat_setfullscreen(int on) if (on && video_fullscreen) return; if (on && video_fullscreen_first) { - video_fullscreen_first = 0; - ui_msgbox(MBX_INFO, (wchar_t *)IDS_2052); + if (ui_msgbox_header(MBX_INFO | MBX_DONTASK, (wchar_t *) IDS_2134, (wchar_t *) IDS_2052) == 10) + video_fullscreen_first = 0; } /* OK, claim the video. */ diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index 43ef4a779..bc8964f95 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -66,7 +66,7 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi tdb_no = {IDNO, STRING_OR_RESOURCE(btn2)}, tdb_cancel = {IDCANCEL, STRING_OR_RESOURCE(btn3)}, tdb_exit = {IDCLOSE, MAKEINTRESOURCE(IDS_2119)}; - int ret = 0; + int ret = 0, checked = 0; /* Configure the default OK button. */ tdconfig.cButtons = 0; @@ -133,15 +133,19 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi if (header) tdconfig.pszMainInstruction = STRING_OR_RESOURCE(header); tdconfig.pButtons = tdbuttons; + if (flags & MBX_DONTASK) + tdconfig.pszVerificationText = MAKEINTRESOURCE(IDS_2135); /* Run the TaskDialog. */ - TaskDialogIndirect(&tdconfig, &ret, NULL, NULL); + TaskDialogIndirect(&tdconfig, &ret, NULL, &checked); /* Convert return values to generic ones. */ if (ret == IDNO) ret = 1; else if (ret == IDCANCEL) ret = -1; else ret = 0; + if (checked) ret += 10; + return(ret); }