about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2010-09-12 13:15:59 +0200
committeroy <Tom_Adams@web.de>2010-09-16 12:28:10 +0200
commit582763bc2148138e7da310268b58fdde4e6a6c43 (patch)
tree2841e299e5f6c5a7b5ca14295b5fc79987afae72 /src/game/client
parentc52ee7baa9b4bf5845b2eeff63b4f6b713341c86 (diff)
downloadzcatch-582763bc2148138e7da310268b58fdde4e6a6c43.tar.gz
zcatch-582763bc2148138e7da310268b58fdde4e6a6c43.zip
made folders in editor (#80)
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/components/menus.h1
-rw-r--r--src/game/client/components/menus_demo.cpp21
2 files changed, 3 insertions, 19 deletions
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h
index 6998acfe..1d9591bd 100644
--- a/src/game/client/components/menus.h
+++ b/src/game/client/components/menus.h
@@ -169,7 +169,6 @@ class CMenus : public CComponent
 	void DemolistPopulate();
 	static void DemolistCountCallback(const char *pName, int IsDir, void *pUser);
 	static void DemolistFetchCallback(const char *pName, int IsDir, void *pUser);
-	void DemoSetParentDirectory();
 	
 	// found in menus.cpp
 	int Render();
diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp
index 2880da25..c5e6ee97 100644
--- a/src/game/client/components/menus_demo.cpp
+++ b/src/game/client/components/menus_demo.cpp
@@ -529,7 +529,9 @@ void CMenus::RenderDemoList(CUIRect MainView)
 		{
 			if(str_comp(m_lDemos[s_SelectedItem].m_aName, "..") == 0) //parent folder
 			{
-				DemoSetParentDirectory();
+				char aParentFolder[256];
+				fs_parent_dir(m_aCurrentDemoFolder, aParentFolder);
+				str_copy(m_aCurrentDemoFolder, aParentFolder, sizeof(m_aCurrentDemoFolder));
 				DemolistPopulate();
 				s_SelectedItem = m_lDemos.size() > 0 ? 0 : -1;
 			}
@@ -568,20 +570,3 @@ void CMenus::RenderDemoList(CUIRect MainView)
 		}
 	}
 }
-
-void CMenus::DemoSetParentDirectory()
-{
-	int Stop = 0;
-	for(int i = 0; i < 256; i++)
-	{
-		if(m_aCurrentDemoFolder[i] == '/')
-			Stop = i;
-	}
-	
-	//keeps chars which are before the last '/' and remove chars which are after
-	for(int i = 0; i < 256; i++)
-	{
-		if(i >= Stop)
-			m_aCurrentDemoFolder[i] = '\0';
-	}
-}