fixed map listing

This commit is contained in:
oy 2010-09-24 13:48:23 +02:00
parent 7e0b37e06c
commit feb7e60bb2
2 changed files with 4 additions and 6 deletions

View file

@ -879,8 +879,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user)
/* add all the entries */
do
{
if(finddata.cFileName[0] != '.')
cb(finddata.cFileName, 0, type, user);
cb(finddata.cFileName, 0, type, user);
} while (FindNextFileA(handle, &finddata));
FindClose(handle);

View file

@ -2148,10 +2148,11 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
static void EditorListdirCallback(const char *pName, int IsDir, int DirType, void *pUser)
{
if(pName[0] == '.' && pName[1] == 0)
CEditor *pEditor = (CEditor*)pUser;
if(pName[0] == '.' && (pName[1] == 0 ||
(pName[1] == '.' && pName[2] == 0 && (!str_comp(pEditor->m_aFileDialogPath, "maps") || !str_comp(pEditor->m_aFileDialogPath, "mapres")))))
return;
CEditor *pEditor = (CEditor*)pUser;
pEditor->m_FileList.add(string(pName));
}
@ -2273,8 +2274,6 @@ void CEditor::RenderFileDialog()
void CEditor::FilelistPopulate()
{
m_FileList.clear();
if(str_comp(m_aFileDialogPath, "maps") != 0 && str_comp(m_aFileDialogPath, "mapres") != 0)
m_FileList.add(string(".."));
Storage()->ListDirectory(m_FileDialogDirTypes, m_aFileDialogPath, EditorListdirCallback, this);
}