Commit 1508ad3d authored by fallenstardust's avatar fallenstardust

lflist添加N/A选项

封装LoadLFlist
parent edc4499e
......@@ -48,6 +48,15 @@ void DeckManager::LoadLFListSingle(const char* path) {
fclose(fp);
}
}
void DeckManager::LoadLFList(android::InitOptions *options) {
io::path workingDir = options->getWorkDir();
LoadLFListSingle((workingDir + path("/expansions/lflist.conf")).c_str());
LoadLFListSingle((workingDir + path("/lflist.conf")).c_str());
LFList nolimit;
nolimit.listName = L"N/A";
nolimit.hash = 0;
_lfList.push_back(nolimit);
}
const wchar_t* DeckManager::GetLFListName(int lfhash) {
auto lit = std::find_if(_lfList.begin(), _lfList.end(), [lfhash](const ygo::LFList& list) {
return list.hash == lfhash;
......
......@@ -36,6 +36,7 @@ public:
std::vector<LFList> _lfList;
void LoadLFListSingle(const char* path);
void LoadLFList(android::InitOptions *options);
const wchar_t* GetLFListName(int lfhash);
std::unordered_map<int, int>* GetLFListContent(int lfhash);
int CheckDeck(Deck& deck, int lfhash, int rule);
......
......@@ -192,8 +192,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
menuHandler.prev_sel = -1;
memset(&dInfo, 0, sizeof(DuelInfo));
memset(chatTiming, 0, sizeof(chatTiming));
deckManager.LoadLFListSingle((workingDir + path("/expansions/lflist.conf")).c_str());
deckManager.LoadLFListSingle((workingDir + path("/lflist.conf")).c_str());
deckManager.LoadLFList(options);
driver = device->getVideoDriver();
#ifdef _IRR_ANDROID_PLATFORM_
int quality = options->getCardQualityOp();
......
......@@ -134,8 +134,6 @@ public:
void stopBGM();
void playBGM();
bool Initialize(ANDROID_APP app, android::InitOptions *options);
#else
bool Initialize();
#endif
void MainLoop();
void RefreshTimeDisplay();
......
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