megacd: some improvements in navigation. Remove old CD while mounting new one.
This commit is contained in:
35
menu.cpp
35
menu.cpp
@@ -1534,7 +1534,16 @@ void HandleUI(void)
|
||||
if (p[1] >= '0' && p[1] <= '3') drive_num = p[1] - '0';
|
||||
substrcpy(ext, p, 1);
|
||||
while (strlen(ext) % 3) strcat(ext, " ");
|
||||
SelectFile(ext, SCANO_DIR | SCANO_UMOUNT, MENU_8BIT_MAIN_IMAGE_SELECTED, MENU_8BIT_MAIN1);
|
||||
if (is_megacd_core())
|
||||
{
|
||||
int len = strlen(SelectedPath);
|
||||
if (len > 4 && !strcasecmp(SelectedPath + len - 4, ".cue"))
|
||||
{
|
||||
char *p = strrchr(SelectedPath, '/');
|
||||
if (p) *p = 0;
|
||||
}
|
||||
}
|
||||
SelectFile(ext, SCANO_DIR | SCANO_UMOUNT | (is_megacd_core() ? SCANO_NOENTER : 0), MENU_8BIT_MAIN_IMAGE_SELECTED, MENU_8BIT_MAIN1);
|
||||
}
|
||||
else if ((p[0] == 'O') || (p[0] == 'o'))
|
||||
{
|
||||
@@ -3265,9 +3274,27 @@ void HandleUI(void)
|
||||
|
||||
if (select)
|
||||
{
|
||||
if (flist_SelectedItem()->de.d_type == DT_DIR)
|
||||
static char name[256];
|
||||
char type = flist_SelectedItem()->de.d_type;
|
||||
memcpy(name, flist_SelectedItem()->de.d_name, sizeof(name));
|
||||
|
||||
if (is_megacd_core() && type == DT_DIR && strcmp(flist_SelectedItem()->de.d_name, ".."))
|
||||
{
|
||||
changeDir(flist_SelectedItem()->de.d_name);
|
||||
int len = strlen(SelectedPath);
|
||||
strcat(SelectedPath, "/");
|
||||
strcat(SelectedPath, name);
|
||||
int num = ScanDirectory(SelectedPath, SCANF_INIT, fs_pFileExt, 0);
|
||||
if (!num) SelectedPath[len] = 0;
|
||||
else
|
||||
{
|
||||
type = flist_SelectedItem()->de.d_type;
|
||||
memcpy(name, flist_SelectedItem()->de.d_name, sizeof(name));
|
||||
}
|
||||
}
|
||||
|
||||
if (type == DT_DIR)
|
||||
{
|
||||
changeDir(name);
|
||||
menustate = MENU_FILE_SELECT1;
|
||||
}
|
||||
else
|
||||
@@ -3281,7 +3308,7 @@ void HandleUI(void)
|
||||
strcat(SelectedPath, "/");
|
||||
}
|
||||
|
||||
strcat(SelectedPath, flist_SelectedItem()->de.d_name);
|
||||
strcat(SelectedPath, name);
|
||||
menustate = fs_MenuSelect;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user