mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed map listing
This commit is contained in:
parent
7e0b37e06c
commit
feb7e60bb2
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue