diff options
| author | oy <Tom_Adams@web.de> | 2010-09-29 00:53:53 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-09-29 00:53:53 +0200 |
| commit | aaf8e2bc8e02d37fb132c8acd7c2a8fe82c15117 (patch) | |
| tree | d8898339563b2dbbc4bc55f579c3b180cd1c435f /src/game/client/components/menus.h | |
| parent | c172c24fd1fbf6a430e1852e62e72f6e0cfeeb63 (diff) | |
| download | zcatch-aaf8e2bc8e02d37fb132c8acd7c2a8fe82c15117.tar.gz zcatch-aaf8e2bc8e02d37fb132c8acd7c2a8fe82c15117.zip | |
cleaned up demo listing and fixed its sorting. Closes #73
Diffstat (limited to 'src/game/client/components/menus.h')
| -rw-r--r-- | src/game/client/components/menus.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 2fb53d13..a1e75f61 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -156,16 +156,23 @@ class CMenus : public CComponent // demo struct CDemoItem { - char m_aFilename[512]; - char m_aName[256]; + char m_aFilename[128]; + char m_aName[128]; + bool m_IsDir; + int m_DirType; - bool operator<(const CDemoItem &Other) { return str_comp(m_aName, Other.m_aName) < 0; } + bool operator<(const CDemoItem &Other) { return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false : + m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false : + str_comp_filenames(m_aFilename, Other.m_aFilename) < 0; } }; sorted_array<CDemoItem> m_lDemos; char m_aCurrentDemoFolder[256]; bool m_DemolistDelEntry; + int m_DemolistSelectedIndex; + bool m_DemolistSelectedIsDir; + void DemolistOnUpdate(bool Reset); void DemolistPopulate(); static void DemolistFetchCallback(const char *pName, int IsDir, int DirType, void *pUser); |