Commit df269693 authored by nekrozar's avatar nekrozar

update

parent 641822c4
......@@ -51,6 +51,35 @@ void DeckManager::LoadLFListSingle(const char* path) {
}
void DeckManager::LoadLFList() {
LoadLFListSingle("expansions/lflist.conf");
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) {
do {
if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
LoadLFListSingle(fpath);
}
} while(FindNextFileW(fh, &fdataw));
FindClose(fh);
}
#else
DIR * dir;
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
LoadLFListSingle(filepath);
}
closedir(dir);
}
#endif
LoadLFListSingle("lflist.conf");
LFList nolimit;
myswprintf(nolimit.listName, L"N/A");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment