diff options
| author | oy <Tom_Adams@web.de> | 2011-02-21 11:23:30 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-02-21 11:23:30 +0100 |
| commit | 088ec3e2f3ba0419612846db8f3687f5e2de1348 (patch) | |
| tree | f12d7d6a55a7ef668dcc58ee64d0869ea7434e21 /src/game/client/components | |
| parent | 4f91026a01436d95cb20b3a994e96dce5072544e (diff) | |
| download | zcatch-088ec3e2f3ba0419612846db8f3687f5e2de1348.tar.gz zcatch-088ec3e2f3ba0419612846db8f3687f5e2de1348.zip | |
made the client's map search work with sub folders. Closes #254
Diffstat (limited to 'src/game/client/components')
| -rw-r--r-- | src/game/client/components/menus.h | 2 | ||||
| -rw-r--r-- | src/game/client/components/menus_demo.cpp | 6 | ||||
| -rw-r--r-- | src/game/client/components/skins.cpp | 8 | ||||
| -rw-r--r-- | src/game/client/components/skins.h | 2 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 35a9918f..59b3f159 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -187,7 +187,7 @@ class CMenus : public CComponent void DemolistOnUpdate(bool Reset); void DemolistPopulate(); - static void DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser); + static int DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser); // 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 5663bd85..92dd381d 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -427,14 +427,14 @@ int CMenus::UiDoListboxEnd(float *pScrollValue, bool *pItemActivated) return gs_ListBoxNewSelected; } -void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser) +int CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser) { CMenus *pSelf = (CMenus *)pUser; int Length = str_length(pName); if((pName[0] == '.' && (pName[1] == 0 || (pName[1] == '.' && pName[2] == 0 && !str_comp(pSelf->m_aCurrentDemoFolder, "demos")))) || (!IsDir && (Length < 5 || str_comp(pName+Length-5, ".demo")))) - return; + return 0; CDemoItem Item; str_copy(Item.m_aFilename, pName, sizeof(Item.m_aFilename)); @@ -452,6 +452,8 @@ void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType Item.m_IsDir = IsDir != 0; Item.m_StorageType = StorageType; pSelf->m_lDemos.add(Item); + + return 0; } void CMenus::DemolistPopulate() diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp index d24e36f0..d27f34eb 100644 --- a/src/game/client/components/skins.cpp +++ b/src/game/client/components/skins.cpp @@ -11,12 +11,12 @@ #include "skins.h" -void CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) +int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) { CSkins *pSelf = (CSkins *)pUser; int l = str_length(pName); if(l < 4 || IsDir || str_comp(pName+l-4, ".png") != 0) - return; + return 0; char aBuf[512]; str_format(aBuf, sizeof(aBuf), "skins/%s", pName); @@ -25,7 +25,7 @@ void CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) { str_format(aBuf, sizeof(aBuf), "failed to load skin from %s", pName); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); - return; + return 0; } CSkin Skin; @@ -107,6 +107,8 @@ void CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) str_format(aBuf, sizeof(aBuf), "load skin %s", Skin.m_aName); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); pSelf->m_aSkins.add(Skin); + + return 0; } diff --git a/src/game/client/components/skins.h b/src/game/client/components/skins.h index 5305fa2b..d76ad85b 100644 --- a/src/game/client/components/skins.h +++ b/src/game/client/components/skins.h @@ -31,6 +31,6 @@ public: private: sorted_array<CSkin> m_aSkins; - static void SkinScan(const char *pName, int IsDir, int DirType, void *pUser); + static int SkinScan(const char *pName, int IsDir, int DirType, void *pUser); }; #endif |