diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index a8c9bd943..7978d6ad2 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -1448,9 +1448,9 @@ static MenuTextForm_t M_CHEATENTRY = { NULL, "Enter Cheat Code:", MAXCHEATLEN, 0 static MenuTextForm_t M_CHEAT_WARP = { NULL, "Enter Warp #:", 3, 0 }; static MenuTextForm_t M_CHEAT_SKILL = { NULL, "Enter Skill #:", 1, 0 }; -#define MAKE_MENUFILESELECT(a, b, c) { a, { &MMF_FileSelectLeft, &MMF_FileSelectRight }, { &MF_Minifont, &MF_Minifont }, b, c, { NULL, NULL }, { 0, 0 }, { 3<<16, 3<<16 }, FNLIST_INITIALIZER, 0 } +#define MAKE_MENUFILESELECT(a, dir, b, c) { a, { &MMF_FileSelectLeft, &MMF_FileSelectRight }, { &MF_Minifont, &MF_Minifont }, dir, b, c, { NULL, NULL }, { 0, 0 }, { 3<<16, 3<<16 }, FNLIST_INITIALIZER, 0 } -static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", "*.map", boardfilename ); +static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", "./usermaps/", "*.map", boardfilename ); // MUST be in ascending order of MenuID enum values due to binary search static Menu_t Menus[] = { @@ -3952,7 +3952,16 @@ static void Menu_FileSelectInit(MenuFileSelect_t *object) fnlist_clearnames(&object->fnlist); if (object->destination[0] == 0) - Bstrcpy(object->destination, "./"); + { + BDIR * usermaps = Bopendir(object->startdir); + if (usermaps) + { + Bclosedir(usermaps); + Bstrcpy(object->destination, object->startdir); + } + else + Bstrcpy(object->destination, "./"); + } Bcorrectfilename(object->destination, 1); fnlist_getnames(&object->fnlist, object->destination, object->pattern, 0, 0); diff --git a/source/duke3d/src/menus.h b/source/duke3d/src/menus.h index 66c38a16f..12b48377e 100644 --- a/source/duke3d/src/menus.h +++ b/source/duke3d/src/menus.h @@ -421,6 +421,7 @@ typedef struct MenuFileSelect_t MenuFont_t *font[2]; // traits + const char * startdir; const char *pattern; char *destination;