Fix some logic bug of Directories Dialog.

This commit is contained in:
owomomo 2020-09-07 01:57:32 +08:00
parent 757c13e22a
commit a3a0e3e543
3 changed files with 19 additions and 21 deletions

View File

@ -114,8 +114,7 @@ static INT_PTR CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
case WM_CLOSE:
case WM_QUIT:
CloseDirectoriesDialog(hwndDlg);
CloseDirectoriesDialog(hwndDlg); //adelikat: Hacky but this fixes the directory overides bug (or at least some instances of it). This of course really just puts a band-aid on the real problem.
EndDialog(hwndDlg, 0);
break;
case WM_COMMAND:
@ -126,9 +125,7 @@ static INT_PTR CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
{
case CLOSE_BUTTON:
CloseDirectoriesDialog(hwndDlg);
break;
case BTN_CANCEL:
EndDialog(hwndDlg, 0);
CloseDirectoriesDialog(hwndDlg); //adelikat: Hacky but this fixes the directory overides bug (or at least some instances of it). This of course really just puts a band-aid on the real problem.
break;
default:
static char *helpert[14] = {

View File

@ -71,20 +71,21 @@ char *GetRomName(bool force = false); //Checks if rom is loaded, if so, outputs
char *GetRomPath(bool force = false); //Checks if rom is loaded, if so, outputs the Rom path only
///Contains the names of the default directories.
static const char *default_directory_names[13] = {
"", // roms
"sav", // nonvol
"fcs", // states
"", // fdsrom
"snaps", // snaps
"cheats", // cheats
"movies", // movies
"tools", // memwatch
"tools", // macro
"tools", // input presets
"tools", // lua scripts
"", // avi output
"" // adelikat - adding a dummy one here ( [13] but only 12 entries)
static const char *default_directory_names[14] = {
"", // roms
"sav", // novol
"fcs", // states
"", // fdsrom
"snaps", // snaps
"cheats", // cheats
"movies", // movies
"tools", // memwatch
"tools", // bot
"tools", // macro
"tools", // input presets
"luascripts", // lua scripts
"", // avi output
"" // adelikat - adding a dummy one here ( [14] but only 13 entries)
};
#define NUMBER_OF_DIRECTORIES sizeof(directory_names) / sizeof(*directory_names)

View File

@ -70,10 +70,10 @@ BEGIN
PUSHBUTTON "Browse...",BUTTON_MEMWATCH,239,152,56,14
LTEXT "&Input Presets",IDC_STATIC,10,172,42,8
EDITTEXT EDIT_PRESET,71,171,158,12,ES_AUTOHSCROLL
PUSHBUTTON "Browse...",210,239,170,56,14
PUSHBUTTON "Browse...",BUTTON_PRESET,239,170,56,14
LTEXT "&Lua Scripts",IDC_STATIC,10,190,36,8
EDITTEXT EDIT_LUA,71,189,158,12,ES_AUTOHSCROLL
PUSHBUTTON "Browse...",211,239,188,56,14
PUSHBUTTON "Browse...",BUTTON_LUA,239,188,56,14
LTEXT "A&vi Output",IDC_STATIC,10,208,34,8
EDITTEXT EDIT_AVI,71,207,158,12,ES_AUTOHSCROLL
PUSHBUTTON "Browse...",BUTTON_AVI,239,206,56,14