about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-09-24 13:48:23 +0200
committeroy <Tom_Adams@web.de>2010-09-24 13:48:23 +0200
commitfeb7e60bb2a1ca85af8ecad15434f74caf2c8247 (patch)
tree942cac209474853574e4c80ddd68c362717f098f /src
parent7e0b37e06c71dc96d68f3352ecd2c799caaaf8ec (diff)
downloadzcatch-feb7e60bb2a1ca85af8ecad15434f74caf2c8247.tar.gz
zcatch-feb7e60bb2a1ca85af8ecad15434f74caf2c8247.zip
fixed map listing
Diffstat (limited to 'src')
-rw-r--r--src/base/system.c3
-rw-r--r--src/game/editor/ed_editor.cpp7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/base/system.c b/src/base/system.c
index 9788e625..6c74fb23 100644
--- a/src/base/system.c
+++ b/src/base/system.c
@@ -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);
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 4b1a10cc..b1dce3f9 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -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);
 }