diff options
| author | oy <Tom_Adams@web.de> | 2010-10-08 00:13:05 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-10-08 00:13:05 +0200 |
| commit | a0758893123cec707dc898bbf4b8f9721c6f827b (patch) | |
| tree | c1491876142b9c4c73d1469282897203f894f137 /src/game/client/components | |
| parent | 04234c109e753870d76098650dcf1efd530ef365 (diff) | |
| download | zcatch-a0758893123cec707dc898bbf4b8f9721c6f827b.tar.gz zcatch-a0758893123cec707dc898bbf4b8f9721c6f827b.zip | |
fixed a listing problem in the demo browser
Diffstat (limited to 'src/game/client/components')
| -rw-r--r-- | src/game/client/components/menus.h | 1 | ||||
| -rw-r--r-- | src/game/client/components/menus_demo.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index ea8be21f..7ab03b81 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -171,6 +171,7 @@ class CMenus : public CComponent bool m_DemolistDelEntry; int m_DemolistSelectedIndex; bool m_DemolistSelectedIsDir; + int m_DemolistStorageType; void DemolistOnUpdate(bool Reset); void DemolistPopulate(); diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index e960769a..9a8a7706 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -440,7 +440,9 @@ void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType void CMenus::DemolistPopulate() { m_lDemos.clear(); - Storage()->ListDirectory(IStorage::TYPE_ALL, m_aCurrentDemoFolder, DemolistFetchCallback, this); + if(!str_comp(m_aCurrentDemoFolder, "demos")) + m_DemolistStorageType = IStorage::TYPE_ALL; + Storage()->ListDirectory(m_DemolistStorageType, m_aCurrentDemoFolder, DemolistFetchCallback, this); } void CMenus::DemolistOnUpdate(bool Reset) @@ -520,6 +522,7 @@ void CMenus::RenderDemoList(CUIRect MainView) char aTemp[256]; str_copy(aTemp, m_aCurrentDemoFolder, sizeof(aTemp)); str_format(m_aCurrentDemoFolder, sizeof(m_aCurrentDemoFolder), "%s/%s", aTemp, m_lDemos[m_DemolistSelectedIndex].m_aFilename); + m_DemolistStorageType = m_lDemos[m_DemolistSelectedIndex].m_StorageType; } DemolistPopulate(); DemolistOnUpdate(true); |