Commit 90a65de1 authored by Chen Bill's avatar Chen Bill

update DeckManager::LoadCurrentDeck

parent b5fff8d6
...@@ -300,10 +300,10 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) { ...@@ -300,10 +300,10 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
LoadDeck(current_deck, deckStream, is_packlist); LoadDeck(current_deck, deckStream, is_packlist);
return true; // the above LoadDeck has return value but we ignore it here for now return true; // the above LoadDeck has return value but we ignore it here for now
} }
bool DeckManager::LoadCurrentDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck) { bool DeckManager::LoadCurrentDeck(int category_index, const wchar_t* category_name, const wchar_t* deckname) {
wchar_t filepath[256]; wchar_t filepath[256];
GetDeckFile(filepath, cbCategory, cbDeck); GetDeckFile(filepath, category_index, category_name, deckname);
bool is_packlist = cbCategory->getSelected() == 0; bool is_packlist = (category_index == 0);
bool res = LoadCurrentDeck(filepath, is_packlist); bool res = LoadCurrentDeck(filepath, is_packlist);
if (res && mainGame->is_building) if (res && mainGame->is_building)
mainGame->deckBuilder.RefreshPackListScroll(); mainGame->deckBuilder.RefreshPackListScroll();
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
FILE* OpenDeckFile(const wchar_t* file, const char* mode); FILE* OpenDeckFile(const wchar_t* file, const char* mode);
irr::io::IReadFile* OpenDeckReader(const wchar_t* file); irr::io::IReadFile* OpenDeckReader(const wchar_t* file);
bool LoadCurrentDeck(const wchar_t* file, bool is_packlist = false); bool LoadCurrentDeck(const wchar_t* file, bool is_packlist = false);
bool LoadCurrentDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck); bool LoadCurrentDeck(int category_index, const wchar_t* category_name, const wchar_t* deckname);
bool SaveDeck(Deck& deck, const wchar_t* file); bool SaveDeck(Deck& deck, const wchar_t* file);
bool DeleteDeck(const wchar_t* file); bool DeleteDeck(const wchar_t* file);
bool CreateCategory(const wchar_t* name); bool CreateCategory(const wchar_t* name);
......
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