Commit 7ff3cb40 authored by fallenstardust's avatar fallenstardust

merge to master

revert deckmanager
parent 575898ff
This diff is collapsed.
...@@ -66,10 +66,12 @@ public: ...@@ -66,10 +66,12 @@ public:
size_t pre_extrac; size_t pre_extrac;
size_t pre_sidec; size_t pre_sidec;
code_pointer draging_pointer; code_pointer draging_pointer;
int prev_category;
int prev_deck; int prev_deck;
s32 prev_operation; s32 prev_operation;
int prev_sel; int prev_sel;
bool is_modified; bool is_modified;
bool readonly;
std::unordered_map<int, int>* filterList; std::unordered_map<int, int>* filterList;
std::vector<code_pointer> results; std::vector<code_pointer> results;
......
...@@ -8,7 +8,7 @@ namespace ygo { ...@@ -8,7 +8,7 @@ namespace ygo {
DeckManager deckManager; DeckManager deckManager;
void DeckManager::LoadLFList(const char* path, bool load_none) { void DeckManager::LoadLFListSingle(const char* path) {
LFList* cur = NULL; LFList* cur = NULL;
FILE* fp = fopen(path, "r"); FILE* fp = fopen(path, "r");
char linebuf[256]; char linebuf[256];
...@@ -24,7 +24,7 @@ void DeckManager::LoadLFList(const char* path, bool load_none) { ...@@ -24,7 +24,7 @@ void DeckManager::LoadLFList(const char* path, bool load_none) {
LFList newlist; LFList newlist;
_lfList.push_back(newlist); _lfList.push_back(newlist);
cur = &_lfList[_lfList.size() - 1]; cur = &_lfList[_lfList.size() - 1];
memcpy(cur->listName, (const void*)strBuffer, 40); memcpy(cur->listName, (const void*)strBuffer, 20 * sizeof(wchar_t));
cur->listName[sa] = 0; cur->listName[sa] = 0;
cur->content = new std::unordered_map<int, int>; cur->content = new std::unordered_map<int, int>;
cur->hash = 0x7dfcee6a; cur->hash = 0x7dfcee6a;
...@@ -48,31 +48,16 @@ void DeckManager::LoadLFList(const char* path, bool load_none) { ...@@ -48,31 +48,16 @@ void DeckManager::LoadLFList(const char* path, bool load_none) {
} }
fclose(fp); fclose(fp);
} }
if(!load_none) }
return; void DeckManager::LoadLFList() {
LoadLFListSingle("expansions/lflist.conf");
LoadLFListSingle("lflist.conf");
LFList nolimit; LFList nolimit;
myswprintf(nolimit.listName, L"N/A"); myswprintf(nolimit.listName, L"N/A");
nolimit.hash = 0; nolimit.hash = 0;
nolimit.content = new std::unordered_map<int, int>; nolimit.content = new std::unordered_map<int, int>;
_lfList.push_back(nolimit); _lfList.push_back(nolimit);
} }
bool DeckManager::RenameDeck(const wchar_t* oldname, const wchar_t* newname) {
wchar_t oldfname[256];
wchar_t newfname[256];
myswprintf(oldfname, L"./deck/%ls.ydk", oldname);
myswprintf(newfname, L"./deck/%ls.ydk", newname);
#ifdef WIN32
BOOL result = MoveFileW(oldfname, newfname);
return !!result;
#else
char oldfilefn[256];
char newfilefn[256];
BufferIO::EncodeUTF8(oldfname, oldfilefn);
BufferIO::EncodeUTF8(newfname, newfilefn);
int result = rename(oldfilefn, newfilefn);
return result == 0;
#endif
}
wchar_t* DeckManager::GetLFListName(int lfhash) { wchar_t* DeckManager::GetLFListName(int lfhash) {
for(size_t i = 0; i < _lfList.size(); ++i) { for(size_t i = 0; i < _lfList.size(); ++i) {
if(_lfList[i].hash == (unsigned int)lfhash) { if(_lfList[i].hash == (unsigned int)lfhash) {
...@@ -206,6 +191,37 @@ bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) { ...@@ -206,6 +191,37 @@ bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) {
deck = ndeck; deck = ndeck;
return true; return true;
} }
void DeckManager::GetCategoryPath(wchar_t* ret, int index, const wchar_t* text) {
wchar_t catepath[256];
switch(index) {
case 0:
myswprintf(catepath, L"./pack");
break;
case 1:
myswprintf(catepath, mainGame->gameConf.bot_deck_path);
break;
case -1:
case 2:
case 3:
myswprintf(catepath, L"./deck");
break;
default:
myswprintf(catepath, L"./deck/%ls", text);
}
BufferIO::CopyWStr(catepath, ret, 256);
}
void DeckManager::GetDeckFile(wchar_t* ret, irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck) {
wchar_t filepath[256];
wchar_t catepath[256];
GetCategoryPath(catepath, cbCategory->getSelected(), cbCategory->getText());
myswprintf(filepath, L"%ls/%ls.ydk", catepath, cbDeck->getItem(cbDeck->getSelected()));
BufferIO::CopyWStr(filepath, ret, 256);
}
bool DeckManager::LoadDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck) {
wchar_t filepath[256];
GetDeckFile(filepath, cbCategory, cbDeck);
return LoadDeck(filepath);
}
FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) { FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
#ifdef WIN32 #ifdef WIN32
FILE* fp = _wfopen(file, (wchar_t*)mode); FILE* fp = _wfopen(file, (wchar_t*)mode);
...@@ -218,11 +234,11 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) { ...@@ -218,11 +234,11 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
} }
bool DeckManager::LoadDeck(const wchar_t* file) { bool DeckManager::LoadDeck(const wchar_t* file) {
int sp = 0, ct = 0, mainc = 0, sidec = 0, code; int sp = 0, ct = 0, mainc = 0, sidec = 0, code;
wchar_t localfile[64]; FILE* fp = OpenDeckFile(file, "r");
myswprintf(localfile, L"./deck/%ls.ydk", file);
FILE* fp = OpenDeckFile(localfile, "r");
if(!fp) { if(!fp) {
fp = OpenDeckFile(file, "r"); wchar_t localfile[64];
myswprintf(localfile, L"./deck/%ls.ydk", file);
fp = OpenDeckFile(localfile, "r");
} }
if(!fp) if(!fp)
return false; return false;
...@@ -248,9 +264,9 @@ bool DeckManager::LoadDeck(const wchar_t* file) { ...@@ -248,9 +264,9 @@ bool DeckManager::LoadDeck(const wchar_t* file) {
LoadDeck(current_deck, cardlist, mainc, sidec); LoadDeck(current_deck, cardlist, mainc, sidec);
return true; return true;
} }
bool DeckManager::SaveDeck(Deck& deck, const wchar_t* name) { bool DeckManager::SaveDeck(Deck& deck, const wchar_t* file) {
wchar_t file[64]; if(!FileSystem::IsDirExists(L"./deck") && !FileSystem::MakeDir(L"./deck"))
myswprintf(file, L"./deck/%ls.ydk", name); return false;
FILE* fp = OpenDeckFile(file, "w"); FILE* fp = OpenDeckFile(file, "w");
if(!fp) if(!fp)
return false; return false;
...@@ -266,9 +282,7 @@ bool DeckManager::SaveDeck(Deck& deck, const wchar_t* name) { ...@@ -266,9 +282,7 @@ bool DeckManager::SaveDeck(Deck& deck, const wchar_t* name) {
fclose(fp); fclose(fp);
return true; return true;
} }
bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) { bool DeckManager::DeleteDeck(const wchar_t* file) {
wchar_t file[64];
myswprintf(file, L"./deck/%ls.ydk", name);
#ifdef WIN32 #ifdef WIN32
BOOL result = DeleteFileW(file); BOOL result = DeleteFileW(file);
return !!result; return !!result;
...@@ -279,13 +293,31 @@ bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) { ...@@ -279,13 +293,31 @@ bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) {
return result == 0; return result == 0;
#endif #endif
} }
int DeckManager::TypeCount(std::vector<code_pointer> list, unsigned int ctype) { bool DeckManager::CreateCategory(const wchar_t* name) {
int res = 0; if(!FileSystem::IsDirExists(L"./deck") && !FileSystem::MakeDir(L"./deck"))
for(size_t i = 0; i < list.size(); ++i) { return false;
code_pointer cur = list[i]; if(name[0] == 0)
if(cur->second.type & ctype) return false;
res++; wchar_t localname[256];
} myswprintf(localname, L"./deck/%ls", name);
return res; return FileSystem::MakeDir(localname);
}
bool DeckManager::RenameCategory(const wchar_t* oldname, const wchar_t* newname) {
if(!FileSystem::IsDirExists(L"./deck") && !FileSystem::MakeDir(L"./deck"))
return false;
if(newname[0] == 0)
return false;
wchar_t oldlocalname[256];
wchar_t newlocalname[256];
myswprintf(oldlocalname, L"./deck/%ls", oldname);
myswprintf(newlocalname, L"./deck/%ls", newname);
return FileSystem::Rename(oldlocalname, newlocalname);
}
bool DeckManager::DeleteCategory(const wchar_t* name) {
wchar_t localname[256];
myswprintf(localname, L"./deck/%ls", name);
if(!FileSystem::IsDirExists(localname))
return false;
return FileSystem::DeleteDir(localname);
} }
} }
...@@ -35,17 +35,22 @@ public: ...@@ -35,17 +35,22 @@ public:
Deck current_deck; Deck current_deck;
std::vector<LFList> _lfList; std::vector<LFList> _lfList;
void LoadLFList(const char* path, bool load_none); void LoadLFListSingle(const char* path);
void LoadLFList();
wchar_t* GetLFListName(int lfhash); wchar_t* GetLFListName(int lfhash);
int CheckDeck(Deck& deck, int lfhash, bool allow_ocg, bool allow_tcg); int CheckDeck(Deck& deck, int lfhash, bool allow_ocg, bool allow_tcg);
int LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec); int LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec);
bool LoadSide(Deck& deck, int* dbuf, int mainc, int sidec); bool LoadSide(Deck& deck, int* dbuf, int mainc, int sidec);
void GetCategoryPath(wchar_t* ret, int index, const wchar_t* text);
void GetDeckFile(wchar_t* ret, irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck);
bool LoadDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck);
FILE* OpenDeckFile(const wchar_t * file, const char * mode); FILE* OpenDeckFile(const wchar_t * file, const char * mode);
bool LoadDeck(const wchar_t* file); bool LoadDeck(const wchar_t* file);
bool SaveDeck(Deck& deck, const wchar_t* name); bool SaveDeck(Deck& deck, const wchar_t* file);
bool DeleteDeck(Deck& deck, const wchar_t* name); bool DeleteDeck(const wchar_t* file);
static bool RenameDeck(const wchar_t* oldname, const wchar_t* newname); bool CreateCategory(const wchar_t* name);
int TypeCount(std::vector<code_pointer> list, unsigned int ctype); bool RenameCategory(const wchar_t* oldname, const wchar_t* newname);
bool DeleteCategory(const wchar_t* name);
}; };
extern DeckManager deckManager; extern DeckManager deckManager;
......
...@@ -304,6 +304,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -304,6 +304,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
} }
} }
mainGame->env->addMessageBox(L"", msgbuf); mainGame->env->addMessageBox(L"", msgbuf);
mainGame->cbCategorySelect->setEnabled(true);
mainGame->cbDeckSelect->setEnabled(true); mainGame->cbDeckSelect->setEnabled(true);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
break; break;
...@@ -467,7 +468,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -467,7 +468,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->stHostPrepDuelist[3]->setText(L""); mainGame->stHostPrepDuelist[3]->setText(L"");
mainGame->stHostPrepOB->setText(L""); mainGame->stHostPrepOB->setText(L"");
mainGame->SetStaticText(mainGame->stHostPrepRule, 180 * mainGame->xScale, mainGame->guiFont, str.c_str()); mainGame->SetStaticText(mainGame->stHostPrepRule, 180 * mainGame->xScale, mainGame->guiFont, str.c_str());
mainGame->RefreshDeck(mainGame->cbDeckSelect); mainGame->RefreshCategoryDeck(mainGame->cbCategorySelect, mainGame->cbDeckSelect);
mainGame->cbCategorySelect->setEnabled(true);
mainGame->cbDeckSelect->setEnabled(true); mainGame->cbDeckSelect->setEnabled(true);
if(mainGame->wCreateHost->isVisible()) if(mainGame->wCreateHost->isVisible())
mainGame->HideElement(mainGame->wCreateHost); mainGame->HideElement(mainGame->wCreateHost);
......
This diff is collapsed.
...@@ -23,10 +23,12 @@ struct Config { ...@@ -23,10 +23,12 @@ struct Config {
wchar_t lastport[10]; wchar_t lastport[10];
wchar_t nickname[20]; wchar_t nickname[20];
wchar_t gamename[20]; wchar_t gamename[20];
wchar_t lastcategory[64];
wchar_t lastdeck[64]; wchar_t lastdeck[64];
wchar_t textfont[256]; wchar_t textfont[256];
wchar_t numfont[256]; wchar_t numfont[256];
wchar_t roompass[20]; wchar_t roompass[20];
wchar_t bot_deck_path[64];
//settings //settings
int chkMAutoPos; int chkMAutoPos;
int chkSTAutoPos; int chkSTAutoPos;
...@@ -119,7 +121,9 @@ public: ...@@ -119,7 +121,9 @@ public:
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text); void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
void SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, u32 pos = 0); void SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, u32 pos = 0);
void LoadExpansions(); void LoadExpansions();
void RefreshDeck(irr::gui::IGUIComboBox* cbDeck); void RefreshCategoryDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck, bool selectlastused = true);
void RefreshDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck);
void RefreshDeck(const wchar_t* deckpath, irr::gui::IGUIComboBox* cbDeck);
void RefreshReplay(); void RefreshReplay();
void RefreshSingleplay(); void RefreshSingleplay();
void RefreshBot(); void RefreshBot();
...@@ -251,12 +255,12 @@ public: ...@@ -251,12 +255,12 @@ public:
irr::gui::IGUICheckBox* chkRandomPos; irr::gui::IGUICheckBox* chkRandomPos;
irr::gui::IGUICheckBox* chkAutoChain; irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain; irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkQuickAnimation;
irr::gui::IGUICheckBox* chkAutoSaveReplay;
irr::gui::IGUIWindow* tabSystem; irr::gui::IGUIWindow* tabSystem;
irr::gui::IGUIElement* elmTabSystemLast; irr::gui::IGUIElement* elmTabSystemLast;
irr::gui::IGUIScrollBar* scrTabSystem; irr::gui::IGUIScrollBar* scrTabSystem;
irr::gui::IGUICheckBox* chkDrawFieldSpell; irr::gui::IGUICheckBox* chkDrawFieldSpell;
irr::gui::IGUICheckBox* chkQuickAnimation;
irr::gui::IGUICheckBox* chkAutoSaveReplay;
irr::gui::IGUICheckBox* chkIgnoreDeckChanges; irr::gui::IGUICheckBox* chkIgnoreDeckChanges;
irr::gui::IGUICheckBox* chkAutoSearch; irr::gui::IGUICheckBox* chkAutoSearch;
irr::gui::IGUICheckBox* chkMultiKeywords; irr::gui::IGUICheckBox* chkMultiKeywords;
...@@ -303,6 +307,7 @@ public: ...@@ -303,6 +307,7 @@ public:
irr::gui::IGUIStaticText* stHostPrepDuelist[4]; irr::gui::IGUIStaticText* stHostPrepDuelist[4];
irr::gui::IGUICheckBox* chkHostPrepReady[4]; irr::gui::IGUICheckBox* chkHostPrepReady[4];
irr::gui::IGUIButton* btnHostPrepKick[4]; irr::gui::IGUIButton* btnHostPrepKick[4];
irr::gui::IGUIComboBox* cbCategorySelect;
irr::gui::IGUIComboBox* cbDeckSelect; irr::gui::IGUIComboBox* cbDeckSelect;
irr::gui::IGUIStaticText* stHostPrepRule; irr::gui::IGUIStaticText* stHostPrepRule;
irr::gui::IGUIStaticText* stHostPrepOB; irr::gui::IGUIStaticText* stHostPrepOB;
...@@ -422,8 +427,9 @@ public: ...@@ -422,8 +427,9 @@ public:
irr::gui::IGUIButton* btnEP; irr::gui::IGUIButton* btnEP;
//deck edit //deck edit
irr::gui::IGUIStaticText* wDeckEdit; irr::gui::IGUIStaticText* wDeckEdit;
irr::gui::IGUIComboBox* cbDBLFList; irr::gui::IGUIComboBox* cbDBCategory;
irr::gui::IGUIComboBox* cbDBDecks; irr::gui::IGUIComboBox* cbDBDecks;
irr::gui::IGUIButton* btnManageDeck;
irr::gui::IGUIButton* btnClearDeck; irr::gui::IGUIButton* btnClearDeck;
irr::gui::IGUIButton* btnSortDeck; irr::gui::IGUIButton* btnSortDeck;
irr::gui::IGUIButton* btnShuffleDeck; irr::gui::IGUIButton* btnShuffleDeck;
...@@ -435,12 +441,37 @@ public: ...@@ -435,12 +441,37 @@ public:
irr::gui::IGUIButton* btnSideSort; irr::gui::IGUIButton* btnSideSort;
irr::gui::IGUIButton* btnSideReload; irr::gui::IGUIButton* btnSideReload;
irr::gui::IGUIEditBox* ebDeckname; irr::gui::IGUIEditBox* ebDeckname;
irr::gui::IGUIStaticText* stDBCategory;
irr::gui::IGUIStaticText* stDeck;
irr::gui::IGUIStaticText* stCategory;
irr::gui::IGUIStaticText* stLimit;
irr::gui::IGUIStaticText* stAttribute;
irr::gui::IGUIStaticText* stRace;
irr::gui::IGUIStaticText* stAttack;
irr::gui::IGUIStaticText* stDefense;
irr::gui::IGUIStaticText* stStar;
irr::gui::IGUIStaticText* stSearch;
irr::gui::IGUIStaticText* stScale;
//deck manage
irr::gui::IGUIWindow* wDeckManage;
irr::gui::IGUIListBox* lstCategories;
irr::gui::IGUIListBox* lstDecks;
irr::gui::IGUIButton* btnNewCategory;
irr::gui::IGUIButton* btnRenameCategory;
irr::gui::IGUIButton* btnDeleteCategory;
irr::gui::IGUIButton* btnNewDeck;
irr::gui::IGUIButton* btnRenameDeck; irr::gui::IGUIButton* btnRenameDeck;
//deck rename irr::gui::IGUIButton* btnDMDeleteDeck;
irr::gui::IGUIWindow* wRenameDeck; irr::gui::IGUIButton* btnMoveDeck;
irr::gui::IGUIEditBox* ebREName; irr::gui::IGUIButton* btnCopyDeck;
irr::gui::IGUIButton* btnREYes; irr::gui::IGUIWindow* wDMQuery;
irr::gui::IGUIButton* btnRENo; irr::gui::IGUIStaticText* stDMMessage;
irr::gui::IGUIStaticText* stDMMessage2;
irr::gui::IGUIEditBox* ebDMName;
irr::gui::IGUIComboBox* cbDMCategory;
irr::gui::IGUIButton* btnDMOK;
irr::gui::IGUIButton* btnDMCancel;
irr::gui::IGUIComboBox* cbLFList;
//filter //filter
irr::gui::IGUIStaticText* wFilter; irr::gui::IGUIStaticText* wFilter;
irr::gui::IGUIScrollBar* scrFilter; irr::gui::IGUIScrollBar* scrFilter;
...@@ -552,12 +583,28 @@ extern Game* mainGame; ...@@ -552,12 +583,28 @@ extern Game* mainGame;
#define CHECKBOX_HP_READY 125 #define CHECKBOX_HP_READY 125
#define BUTTON_HP_READY 126 #define BUTTON_HP_READY 126
#define BUTTON_HP_NOTREADY 127 #define BUTTON_HP_NOTREADY 127
#define COMBOBOX_HP_CATEGORY 128
#define LISTBOX_REPLAY_LIST 130 #define LISTBOX_REPLAY_LIST 130
#define BUTTON_LOAD_REPLAY 131 #define BUTTON_LOAD_REPLAY 131
#define BUTTON_CANCEL_REPLAY 132 #define BUTTON_CANCEL_REPLAY 132
#define BUTTON_DELETE_REPLAY 133 #define BUTTON_DELETE_REPLAY 133
#define BUTTON_RENAME_REPLAY 134 #define BUTTON_RENAME_REPLAY 134
#define EDITBOX_CHAT 140 #define BUTTON_REPLAY_START 140
#define BUTTON_REPLAY_PAUSE 141
#define BUTTON_REPLAY_STEP 142
#define BUTTON_REPLAY_UNDO 143
#define BUTTON_REPLAY_EXIT 144
#define BUTTON_REPLAY_SWAP 145
#define BUTTON_REPLAY_SAVE 146
#define BUTTON_REPLAY_CANCEL 147
#define LISTBOX_SINGLEPLAY_LIST 150
#define BUTTON_LOAD_SINGLEPLAY 151
#define BUTTON_CANCEL_SINGLEPLAY 152
#define LISTBOX_BOT_LIST 153
#define BUTTON_BOT_START 154
#define CHECKBOX_BOT_OLD_RULE 155
#define EDITBOX_CHAT 199
#define BUTTON_MSG_OK 200 #define BUTTON_MSG_OK 200
#define BUTTON_YES 201 #define BUTTON_YES 201
#define BUTTON_NO 202 #define BUTTON_NO 202
...@@ -622,8 +669,8 @@ extern Game* mainGame; ...@@ -622,8 +669,8 @@ extern Game* mainGame;
#define BUTTON_DISPLAY_4 294 #define BUTTON_DISPLAY_4 294
#define SCROLL_CARD_DISPLAY 295 #define SCROLL_CARD_DISPLAY 295
#define BUTTON_CARD_DISP_OK 296 #define BUTTON_CARD_DISP_OK 296
#define BUTTON_CATEGORY_OK 300 #define BUTTON_MANAGE_DECK 300
#define COMBOBOX_DBLFLIST 301 #define COMBOBOX_DBCATEGORY 301
#define COMBOBOX_DBDECKS 302 #define COMBOBOX_DBDECKS 302
#define BUTTON_CLEAR_DECK 303 #define BUTTON_CLEAR_DECK 303
#define BUTTON_SAVE_DECK 304 #define BUTTON_SAVE_DECK 304
...@@ -642,37 +689,37 @@ extern Game* mainGame; ...@@ -642,37 +689,37 @@ extern Game* mainGame;
#define BUTTON_CLEAR_FILTER 317 #define BUTTON_CLEAR_FILTER 317
#define COMBOBOX_ATTRIBUTE 318 #define COMBOBOX_ATTRIBUTE 318
#define COMBOBOX_RACE 319 #define COMBOBOX_RACE 319
#define BUTTON_REPLAY_START 320 #define COMBOBOX_LIMIT 320
#define BUTTON_REPLAY_PAUSE 321 #define BUTTON_CATEGORY_OK 321
#define BUTTON_REPLAY_STEP 322 #define BUTTON_MARKS_FILTER 322
#define BUTTON_REPLAY_UNDO 323 #define BUTTON_MARKERS_OK 323
#define BUTTON_REPLAY_EXIT 324 #define COMBOBOX_SORTTYPE 324
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SAVE 330 #define WINDOW_DECK_MANAGE 330
#define BUTTON_REPLAY_CANCEL 331 #define BUTTON_NEW_CATEGORY 331
#define BUTTON_BOT_START 340 #define BUTTON_RENAME_CATEGORY 332
#define LISTBOX_BOT_LIST 341 #define BUTTON_DELETE_CATEGORY 333
#define CHECKBOX_BOT_OLD_RULE 342 #define BUTTON_NEW_DECK 334
#define LISTBOX_SINGLEPLAY_LIST 343 #define BUTTON_RENAME_DECK 335
#define BUTTON_LOAD_SINGLEPLAY 344 #define BUTTON_DELETE_DECK_DM 336
#define BUTTON_CANCEL_SINGLEPLAY 345 #define BUTTON_MOVE_DECK 337
#define SCROLL_TAB_HELPER 350 #define BUTTON_COPY_DECK 338
#define SCROLL_TAB_SYSTEM 351 #define LISTBOX_CATEGORIES 339
#define LISTBOX_DECKS 340
#define BUTTON_DM_OK 341
#define BUTTON_DM_CANCEL 342
#define COMBOBOX_LFLIST 349
#define CHECKBOX_AUTO_SEARCH 360 #define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_MULTI_KEYWORDS 372 #define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_PREFER_EXPANSION 373 #define CHECKBOX_PREFER_EXPANSION 373
#define CHECKBOX_DISABLE_CHAT 364 #define CHECKBOX_DISABLE_CHAT 364
#define CHECKBOX_DRAW_FIELD_SPELL 368 #define CHECKBOX_DRAW_FIELD_SPELL 368
#define CHECKBOX_QUICK_ANIMATION 369 #define CHECKBOX_QUICK_ANIMATION 369
#define COMBOBOX_SORTTYPE 370 #define SCROLL_TAB_HELPER 370
#define COMBOBOX_LIMIT 371 #define SCROLL_TAB_SYSTEM 371
#define CHECKBOX_MULTI_KEYWORDS 372
#define BUTTON_MARKS_FILTER 380 #define CHECKBOX_PREFER_EXPANSION 373
#define BUTTON_MARKERS_OK 381
#define BUTTON_RENAME_DECK 386
#define BUTTON_RENAME_DECK_SAVE 387
#define BUTTON_RENAME_DECK_CANCEL 388
#define DEFAULT_DUEL_RULE 4 #define DEFAULT_DUEL_RULE 4
......
...@@ -50,6 +50,31 @@ public: ...@@ -50,6 +50,31 @@ public:
return MakeDir(wdir); return MakeDir(wdir);
} }
static bool Rename(const wchar_t* woldname, const wchar_t* wnewname) {
return MoveFileW(woldname, wnewname);
}
static bool Rename(const char* oldname, const char* newname) {
wchar_t woldname[1024];
wchar_t wnewname[1024];
BufferIO::DecodeUTF8(oldname, woldname);
BufferIO::DecodeUTF8(newname, wnewname);
return Rename(woldname, wnewname);
}
static bool DeleteDir(const wchar_t* wdir) {
wchar_t pdir[256];
BufferIO::CopyWStr(wdir, pdir, 256);
pdir[wcslen(wdir) + 1] = 0;
SHFILEOPSTRUCTW lpFileOp;
lpFileOp.hwnd = NULL;
lpFileOp.wFunc = FO_DELETE;
lpFileOp.pFrom = pdir;
lpFileOp.pTo = 0;
lpFileOp.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT;
return SHFileOperationW(&lpFileOp) == 0;
}
static void TraversalDir(const wchar_t* wpath, const std::function<void(const wchar_t*, bool)>& cb) { static void TraversalDir(const wchar_t* wpath, const std::function<void(const wchar_t*, bool)>& cb) {
wchar_t findstr[1024]; wchar_t findstr[1024];
wcscpy(findstr, wpath); wcscpy(findstr, wpath);
...@@ -59,7 +84,8 @@ public: ...@@ -59,7 +84,8 @@ public:
if(fh == INVALID_HANDLE_VALUE) if(fh == INVALID_HANDLE_VALUE)
return; return;
do { do {
cb(fdataw.cFileName, (fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); if(mywcsncasecmp(fdataw.cFileName, L".", 1) && mywcsncasecmp(fdataw.cFileName, L"..", 2))
cb(fdataw.cFileName, (fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY));
} while(FindNextFileW(fh, &fdataw)); } while(FindNextFileW(fh, &fdataw));
FindClose(fh); FindClose(fh);
} }
......
include "lzma/." include "lzma/."
include "spmemvfs/."
project "ygopro" project "ygopro"
kind "WindowedApp" kind "WindowedApp"
files { "**.cpp", "**.cc", "**.c", "**.h" } files { "**.cpp", "**.cc", "**.c", "**.h" }
excludes "lzma/**" excludes { "lzma/**", "spmemvfs/**" }
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "Irrlicht", "freetype", "sqlite3", "lua" , "event" } links { "ocgcore", "clzma", "cspmemvfs", "Irrlicht", "freetype", "sqlite3", "lua" , "event" }
configuration "windows" configuration "windows"
files "ygopro.rc" files "ygopro.rc"
......
...@@ -2229,12 +2229,14 @@ int32 card::remove_counter(uint16 countertype, uint16 count) { ...@@ -2229,12 +2229,14 @@ int32 card::remove_counter(uint16 countertype, uint16 count) {
} }
int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8 singly, uint32 loc) { int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8 singly, uint32 loc) {
effect_set eset; effect_set eset;
if(!pduel->game_field->is_player_can_place_counter(playerid, this, countertype, count)) if(count > 0) {
return FALSE; if(!pduel->game_field->is_player_can_place_counter(playerid, this, countertype, count))
if(!loc && (!(current.location & LOCATION_ONFIELD) || !is_position(POS_FACEUP))) return FALSE;
return FALSE; if(!loc && (!(current.location & LOCATION_ONFIELD) || !is_position(POS_FACEUP)))
if((countertype & COUNTER_NEED_ENABLE) && is_status(STATUS_DISABLED)) return FALSE;
return FALSE; if((countertype & COUNTER_NEED_ENABLE) && is_status(STATUS_DISABLED))
return FALSE;
}
uint32 check = countertype & COUNTER_WITHOUT_PERMIT; uint32 check = countertype & COUNTER_WITHOUT_PERMIT;
if(!check) { if(!check) {
filter_effect(EFFECT_COUNTER_PERMIT + (countertype & 0xffff), &eset); filter_effect(EFFECT_COUNTER_PERMIT + (countertype & 0xffff), &eset);
...@@ -2242,8 +2244,16 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count, ...@@ -2242,8 +2244,16 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count,
uint32 prange = eset[i]->get_value(); uint32 prange = eset[i]->get_value();
if(loc) if(loc)
check = loc & prange; check = loc & prange;
else else if(current.location & LOCATION_ONFIELD) {
check = current.is_location(prange) && is_position(POS_FACEUP); uint32 filter = TRUE;
if(eset[i]->target) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD);
filter = pduel->lua->check_condition(eset[i]->target, 2);
}
check = current.is_location(prange) && is_position(POS_FACEUP) && filter;
} else
check = TRUE;
if(check) if(check)
break; break;
} }
......
...@@ -2556,6 +2556,8 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) { ...@@ -2556,6 +2556,8 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) {
peffect->type = EFFECT_TYPE_SINGLE; peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_COUNTER_PERMIT | countertype; peffect->code = EFFECT_COUNTER_PERMIT | countertype;
peffect->value = prange; peffect->value = prange;
if(lua_gettop(L) > 3 && lua_isfunction(L, 4))
peffect->target = interpreter::get_function_handle(L, 4);
pcard->add_effect(peffect); pcard->add_effect(peffect);
return 0; return 0;
} }
...@@ -2587,11 +2589,13 @@ int32 scriptlib::card_is_can_turn_set(lua_State *L) { ...@@ -2587,11 +2589,13 @@ int32 scriptlib::card_is_can_turn_set(lua_State *L) {
return 1; return 1;
} }
int32 scriptlib::card_is_can_add_counter(lua_State *L) { int32 scriptlib::card_is_can_add_counter(lua_State *L) {
check_param_count(L, 3); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
uint32 countertype = lua_tointeger(L, 2); uint32 countertype = lua_tointeger(L, 2);
uint32 count = lua_tointeger(L, 3); uint32 count = 0;
if(lua_gettop(L) > 2)
count = lua_tointeger(L, 3);
uint8 singly = FALSE; uint8 singly = FALSE;
if(lua_gettop(L) > 3) if(lua_gettop(L) > 3)
singly = lua_toboolean(L, 4); singly = lua_toboolean(L, 4);
......
...@@ -1351,6 +1351,7 @@ int32 field::check_hint_timing(effect* peffect) { ...@@ -1351,6 +1351,7 @@ int32 field::check_hint_timing(effect* peffect) {
else else
return (peffect->hint_timing[0] & core.hint_timing[1]) || (peffect->hint_timing[1] & core.hint_timing[0]); return (peffect->hint_timing[0] & core.hint_timing[1]) || (peffect->hint_timing[1] & core.hint_timing[0]);
} }
// core.spe_effect[p]: # of optional trigger effects, activate/quick effect with hints
int32 field::process_phase_event(int16 step, int32 phase) { int32 field::process_phase_event(int16 step, int32 phase) {
switch(step) { switch(step) {
case 0: { case 0: {
...@@ -1645,6 +1646,7 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1645,6 +1646,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
} }
return TRUE; return TRUE;
} }
// core.tmp_chains: used in step 8 (obsolete ignition effect ruling)
int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_freechain, int32 skip_new) { int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_freechain, int32 skip_new) {
switch(step) { switch(step) {
case 0: { case 0: {
......
...@@ -7,7 +7,7 @@ buildscript { ...@@ -7,7 +7,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.3.2' classpath 'com.android.tools.build:gradle:3.4.0'
//classpath 'me.tatarka:gradle-retrolambda:3.2.5' //classpath 'me.tatarka:gradle-retrolambda:3.2.5'
} }
} }
......
#Tue Jan 15 19:19:32 CST 2019 #Mon Apr 29 12:47:40 CST 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
...@@ -10,22 +10,26 @@ ...@@ -10,22 +10,26 @@
<body style="font-family: Droid Sans;background-color:transparent;"> <body style="font-family: Droid Sans;background-color:transparent;">
<h3 style="color:#ffffff">敬告</h3> <h3 style="color:#ffffff">敬告</h3>
<pre> <pre>
本软件基于圆神开发组的电脑版源码,采用opnegl适配安卓+安卓客户端ui开发而成。 本软件基于圆神开发组的电脑版源码,采用OpenGL适配安卓+安卓客户端ui开发而成。
注意:如果您是通过付费购买或者付费获得下载渠道而获得本软件的话,您已经上当受骗。本软件——免费! 注意:如果您是通过付费购买或者付费获得下载渠道而获得本软件的话,您已经上当受骗。本软件——免费!
特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力. 特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力.
</pre> </pre>
<ul> <ul>
<li style="color:#ffff00">3.4.2</li> <li style="color:#ffff00">3.4.3</li>
</ul> </ul>
<pre> <pre>
更新: 更新:
1.更新ygo内核; 1.更新ygo内核;
2.新卡ST19+VB21+VJ; 2.新卡1009+VJ;
优化: 优化:
1.直接打开的ydk文件可以点击保存到deck文件夹; 1.排序录像卡组残局顺序;
2.攻击表示可以攻击的怪兽攻击力总和显示; 2.提高一定程度的显示速度;
3.完善部分安卓9的国内定制系统适配;
4.可设置不显示通知栏决斗助手;
修复:
1.部分场景闪退;
</pre> </pre>
</body> </body>
</html> </html>
\ No newline at end of file
This diff is collapsed.
...@@ -358,6 +358,7 @@ ...@@ -358,6 +358,7 @@
!system 1325 关键字: !system 1325 关键字:
!system 1326 效果 !system 1326 效果
!system 1327 搜索 !system 1327 搜索
!system 1328 管理
!system 1329 字段: !system 1329 字段:
!system 1330 主卡组: !system 1330 主卡组:
!system 1331 额外卡组: !system 1331 额外卡组:
...@@ -432,6 +433,27 @@ ...@@ -432,6 +433,27 @@
!system 1419 副卡组数量应不超过15张,当前卡组数量为%d张。 !system 1419 副卡组数量应不超过15张,当前卡组数量为%d张。
!system 1420 有额外卡组卡片存在于主卡组,可能是额外卡组数量超过15张。 !system 1420 有额外卡组卡片存在于主卡组,可能是额外卡组数量超过15张。
!system 1421 宣言的卡不符合条件,不存在于本主机卡池中。 !system 1421 宣言的卡不符合条件,不存在于本主机卡池中。
!system 1450 卡包展示
!system 1451 人机卡组
!system 1452 未分类卡组
!system 1453 --------
!system 1460 卡组管理
!system 1461 新建分类
!system 1462 重命名分类
!system 1463 删除分类
!system 1464 新建卡组
!system 1465 重命名卡组
!system 1466 删除卡组
!system 1467 移动到分类
!system 1468 复制到分类
!system 1469 请输入分类名:
!system 1470 确实要删除此分类和分类下全部卡组吗?
!system 1471 请输入卡组名:
!system 1472 请选择要移动到的分类:
!system 1473 请选择要复制到的分类:
!system 1474 已存在同名分类
!system 1475 已存在同名卡组
!system 1476 删除失败
!system 1500 决斗结束。 !system 1500 决斗结束。
!system 1501 录像结束。 !system 1501 录像结束。
!system 1502 连接已断开。 !system 1502 连接已断开。
......
#[2019.01 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1] #[2019.04 TCG][2019.01 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
!2019.4 TCG
#forbidden
55623480 0 --妖精伝姫-シラユキ
75732622 0 --トーチ・ゴーレム
22593417 0 --トポロジック・ガンブラー・ドラゴン
10389142 0 --No.42 スターシップ・ギャラクシー・トマホーク
63504681 0 --No.86 HC ロンゴミアント
54447022 0 --ソウル・チャージ
05043010 0 --ファイアウォール・ドラゴン
05592689 0 --サクリファイス・ロータス
39064822 0 --トロイメア・ゴブリン
04423206 0 --M.X-セイバー インヴォーカー
76794549 0 --アストログラフ・マジシャン
20663556 0 --イレカエル
44910027 0 --ヴィクトリー・ドラゴン
25862681 0 --エンシェント・フェアリー・ドラゴン
53804307 0 --焔征竜-ブラスター
07563579 0 --Emヒグルミ
40318957 0 --EMドクロバット・ジョーカー
17330916 0 --EMモンキーボード
79106360 0 --カオスポッド
90411554 0 --巌征竜-レドックス
08903700 0 --儀式魔人リリーサー
17412721 0 --旧神ノーデン
65536818 0 --源竜星-ボウテンコウ
49684352 0 --虹彩の魔術師
34124316 0 --サイバーポッド
88071625 0 --The tyrant NEPTUNE
61665245 0 --サモン・ソーサレス
48905153 0 --十二獣ドランシア
85115440 0 --十二獣ブルホーン
21593977 0 --処刑人-マキュラ
30539496 0 --真竜皇リトスアジムD
21377582 0 --真竜剣皇マスターP
81122844 0 --発条空母ゼンマイティ
23434538 0 --増殖するG
00581014 0 --ダイガスタ・エメラル
15341821 0 --ダンディライオン
18326736 0 --星守の騎士 プトレマイオス
33184167 0 --同族感染ウィルス
54719828 0 --No.16 色の支配者ショック·ルーラー
58820923 0 --No.95 ギャラクシーアイズ・ダークマター・ドラゴン
43387895 0 --覇王眷竜スターヴ・ヴェノム
26400609 0 --瀑征竜-タイダル
78706415 0 --ファイバーポッド
93369354 0 --フィッシュボーグ-ガンナー
23558733 0 --フェニキシアン・クラスター・アマリリス
09929398 0 --BF-朧影のゴウフウ
31178212 0 --マジェスペクター・ユニコーン
34206604 0 --魔導サイエンティスト
96782886 0 --メンタルマスター
03078576 0 --八汰烏
34086406 0 --ラヴァルバル·チェイン
89399912 0 --嵐征竜-テンペスト
57421866 0 --レベル・スティーラー
41482598 0 --悪夢の蜃気楼
44763025 0 --いたずら好きな双子悪魔
19613556 0 --大嵐
17375316 0 --押収
35059553 0 --カイザーコロシアム
74191942 0 --苦渋の選択
42829885 0 --強引な番兵
45986603 0 --強奪
55144522 0 --強欲な壺
04031928 0 --心変わり
23557835 0 --次元融合
57953380 0 --生還の宝札
60682203 0 --大寒波
67616300 0 --チキンレース
67169062 0 --貪欲な壺
27770341 0 --超再生能力
69243953 0 --蝶の短剣-エルマ
79571449 0 --天使の施し
11110587 0 --隣の芝刈り
42703248 0 --ハリケーン
18144506 0 --ハーピィの羽根帚
70828912 0 --早すぎた埋葬
34906152 0 --マスドライバー
46448938 0 --魔導書の神判
46411259 0 --突然変異
85602018 0 --遺言状
94220427 0 --RUM-アージェント・カオス・フォース
03298689 0 --RUM-幻影騎士団ラウンチ
27174286 0 --異次元からの帰還
93016201 0 --王宮の弾圧
05851097 0 --虚無空間
57585212 0 --自爆スイッチ
03280747 0 --第六感
64697231 0 --ダスト·シュート
35316708 0 --刻の封印
80604091 0 --血の代償
28566710 0 --ラストバトル!
#limit
82301904 1 --混沌帝龍 -終焉の使者-
69015963 1 --デビル·フランケン
14536035 1 --ダーク・グレファー
90307777 1 --影霊衣の術士 シュリット
20366274 1 --エルシャドール・ネフィリム
07394770 1 --ブリリアント・フュージョン
75500286 1 --封印の黄金櫃
71650854 1 --半魔導帯域
73915051 1 --スケープ・ゴート
71344451 1 --一撃必殺!居合いドロー
28985331 1 --終末の騎士
40044918 1 --E·HERO エアーマン
33508719 1 --メタモルポット
24094258 1 --ヘビーメタルフォーゼ・エレクトラム
74586817 1 --PSYフレームロード・Ω
08949584 1 --ヒーローアライブ
72892473 1 --手札抹殺
52340444 1 --閃刀機-ホーネットビット
64034255 1 --A·ジェネクス·バードマン
45222299 1 --イビリチュア·ガストクラーケ
11877465 1 --イビリチュア·マインドオーガス
99177923 1 --インフェルニティ·デーモン
68184115 1 --甲虫装機 ダンセル
27552504 1 --永遠の淑女 ベアトリーチェ
68819554 1 --Emダメージ・ジャグラー
65518099 1 --クリフォート・ツール
12958919 1 --幻銃士
39512984 1 --ジェムナイトマスター・ダイヤ
78872731 1 --十二獣モルモラット
78868119 1 --深海のディーヴァ
58984738 1 --真竜拳士ダイナマイトK
04474060 1 --SPYRAL GEAR-ドローン
78080961 1 --SPYRAL-ジーニアス
81275020 1 --SRベイゴマックス
48063985 1 --聖霊獣騎 カンナホーク
63288573 1 --閃刀姫-カガリ
65192027 1 --ダーク·アームド·ドラゴン
96570609 1 --天帝アイテール
16226786 1 --深淵の暗殺者
18239909 1 --爆竜剣士イグニスターP
57143342 1 --彼岸の悪鬼 ガトルホッグ
20758643 1 --彼岸の悪鬼 グラバースニッチ
70583986 1 --氷結界の虎王ドゥローレン
52687916 1 --氷結界の龍 トリシューラ
33396948 1 --封印されしエクゾディア
07902349 1 --封印されし者の左腕
70903634 1 --封印されし者の右腕
44519536 1 --封印されし者の左足
08124921 1 --封印されし者の右足
10802915 1 --魔界発現世行きデスガイド
89463537 1 --ユニコールの影霊衣
88264978 1 --レッドアイズ·ダークネスメタルドラゴン
16188701 1 --レディ・デバッガー
33782437 1 --一時休戦
66957584 1 --インフェルニティガン
72405967 1 --王家の生け贄
81439173 1 --おろかな埋葬
67723438 1 --緊急テレポート
45305419 1 --継承の印
12580477 1 --サンダー·ボルト
95308449 1 --終焉のカウントダウン
74845897 1 --真炎の爆発
35125879 1 --真竜皇の復活
54631665 1 --SPYRAL RESORT
32807846 1 --増援
14087893 1 --月の書
81674782 1 --次元の裂け目
83764718 1 --死者蘇生
91623717 1 --連鎖爆撃
70368879 1 --成金ゴブリン
22842126 1 --汎神の帝王
53129443 1 --ブラック·ホール
73468603 1 --盆回し
15854426 1 --霞の谷の神風
58577036 1 --名推理
43040603 1 --モンスターゲート
14733538 1 --竜呼相打つ
27970830 1 --六武の門
02295440 1 --ワン·フォー·ワン
61740673 1 --王宮の勅命
84749824 1 --神の警告
41420027 1 --神の宣告
82732705 1 --スキルドレイン
73599290 1 --ソウルドレイン
17078030 1 --光の護封壁
30241314 1 --マクロコスモス
32723153 1 --マジカル·エクスプロージョン
#semi limit
09411399 2 --DHERO ディアボリックガイ
73628505 2 --テラ・フォーミング
28297833 2 --ネクロフェイス
92746535 2 --竜剣士ラスターP
48130397 2 --超融合
!2019.1 TCG !2019.1 TCG
#forbidden #forbidden
55623480 0 --妖精伝姫-シラユキ 55623480 0 --妖精伝姫-シラユキ
......
...@@ -938,4 +938,7 @@ ...@@ -938,4 +938,7 @@
!setname 0x127 Infinitrack !setname 0x127 Infinitrack
!setname 0x128 Witchcrafter !setname 0x128 Witchcrafter
!setname 0x129 The Evil Eye !setname 0x129 The Evil Eye
!setname 0x12a Endymion !setname 0x12a Endymion
\ No newline at end of file !setname 0x12b Marincess
!setname 0x12c Tenyi
!setname 0x12d Simorgh
\ No newline at end of file
...@@ -944,4 +944,7 @@ ...@@ -944,4 +944,7 @@
!setname 0x127 무한기동 !setname 0x127 무한기동
!setname 0x128 위치크래프트 !setname 0x128 위치크래프트
!setname 0x129 주안 !setname 0x129 주안
!setname 0x12a 엔디미온 !setname 0x12a 엔디미온
\ No newline at end of file !setname 0x12b 마린세스
!setname 0x12c 천위
!setname 0x12d 시무룩그
\ No newline at end of file
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 28
versionCode 340300407 versionCode 340300422
versionName "3.4.3" versionName "3.4.3"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
...@@ -101,7 +101,7 @@ dependencies { ...@@ -101,7 +101,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
// //
implementation(name: 'paysdk-release-1.2.4', ext: 'aar') implementation(name: 'paysdk-release-1.2.4', ext: 'aar')
implementation 'com.pgyersdk:sdk:3.0.4' implementation "com.pgyersdk:sdk:3.0.4"
} }
...@@ -37,8 +37,11 @@ import org.greenrobot.eventbus.ThreadMode; ...@@ -37,8 +37,11 @@ import org.greenrobot.eventbus.ThreadMode;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.Collator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
...@@ -216,7 +219,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -216,7 +219,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
//endregion //endregion
//region init //region init
private void init(File ydk){ private void init(File ydk) {
DialogPlus dlg = DialogPlus.show(this, null, getString(R.string.loading)); DialogPlus dlg = DialogPlus.show(this, null, getString(R.string.loading));
VUiKit.defer().when(() -> { VUiKit.defer().when(() -> {
DataManager.get().load(false); DataManager.get().load(false);
...@@ -256,10 +259,11 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -256,10 +259,11 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
/** /**
* 设置当前卡组 * 设置当前卡组
*
* @param deckInfo * @param deckInfo
*/ */
private void setCurDeck(DeckInfo deckInfo) { private void setCurDeck(DeckInfo deckInfo) {
if(deckInfo == null){ if (deckInfo == null) {
deckInfo = new DeckInfo(); deckInfo = new DeckInfo();
} }
File file = deckInfo.source; File file = deckInfo.source;
...@@ -331,7 +335,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -331,7 +335,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
return; return;
} }
showDeckCard(view, pos); showDeckCard(view, pos);
} }
@Override @Override
public void onItemLongClick(View view, int pos) { public void onItemLongClick(View view, int pos) {
...@@ -580,10 +584,10 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -580,10 +584,10 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
shareDeck(); shareDeck();
break; break;
case R.id.action_save: case R.id.action_save:
if(mPreLoadFile != null && mPreLoadFile == mDeckAdapater.getYdkFile()){ if (mPreLoadFile != null && mPreLoadFile == mDeckAdapater.getYdkFile()) {
//需要保存到deck文件夹 //需要保存到deck文件夹
inputDeckName(mPreLoadFile, true); inputDeckName(mPreLoadFile, true);
}else { } else {
if (mDeckAdapater.getYdkFile() == null) { if (mDeckAdapater.getYdkFile() == null) {
inputDeckName(null, true); inputDeckName(null, true);
} else { } else {
...@@ -645,7 +649,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -645,7 +649,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
builder.setMessageGravity(Gravity.CENTER_HORIZONTAL); builder.setMessageGravity(Gravity.CENTER_HORIZONTAL);
builder.setLeftButtonListener((dlg, rs) -> { builder.setLeftButtonListener((dlg, rs) -> {
File ydk = mDeckAdapater.getYdkFile(); File ydk = mDeckAdapater.getYdkFile();
if(ydk == null){ if (ydk == null) {
return; return;
} }
FileUtils.deleteFile(ydk); FileUtils.deleteFile(ydk);
...@@ -767,6 +771,16 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -767,6 +771,16 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
List<File> files = getYdkFiles(); List<File> files = getYdkFiles();
List<SimpleSpinnerItem> items = new ArrayList<>(); List<SimpleSpinnerItem> items = new ArrayList<>();
String name = curYdk != null ? curYdk.getName() : null; String name = curYdk != null ? curYdk.getName() : null;
Collections.sort(files, new Comparator<File>() {
@Override
public int compare(File ydk1, File ydk2) {
if (ydk1.isDirectory() && ydk2.isFile())
return -1;
if (ydk1.isFile() && ydk2.isDirectory())
return 1;
return ydk1.getName().compareTo(ydk2.getName());
}
});
int index = -1; int index = -1;
if (files != null) { if (files != null) {
int i = 0; int i = 0;
...@@ -867,7 +881,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -867,7 +881,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
editText.setGravity(Gravity.TOP | Gravity.LEFT); editText.setGravity(Gravity.TOP | Gravity.LEFT);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
editText.setSingleLine(); editText.setSingleLine();
if(oldYdk != null) { if (oldYdk != null) {
editText.setText(oldYdk.getName()); editText.setText(oldYdk.getName());
} }
builder.setContentView(editText); builder.setContentView(editText);
...@@ -893,7 +907,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -893,7 +907,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
loadDeckFromFile(ydk); loadDeckFromFile(ydk);
} }
} else { } else {
if(oldYdk == mPreLoadFile){ if (oldYdk == mPreLoadFile) {
mPreLoadFile = null; mPreLoadFile = null;
} }
dlg.dismiss(); dlg.dismiss();
......
...@@ -3,10 +3,13 @@ package cn.garymb.ygomobile.ui.cards.deck; ...@@ -3,10 +3,13 @@ package cn.garymb.ygomobile.ui.cards.deck;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import cn.garymb.ygomobile.AppsSettings;
import cn.garymb.ygomobile.bean.Deck; import cn.garymb.ygomobile.bean.Deck;
import cn.garymb.ygomobile.bean.DeckInfo; import cn.garymb.ygomobile.bean.DeckInfo;
import cn.garymb.ygomobile.utils.IOUtils; import cn.garymb.ygomobile.utils.IOUtils;
...@@ -126,4 +129,21 @@ public class DeckUtils { ...@@ -126,4 +129,21 @@ public class DeckUtils {
} }
return true; return true;
} }
public static File save(String name,String deckMessage) throws IOException {
FileWriter fw = null;
//如果文件存在,则重写内容;如果文件不存在,则创建文件
File f = new File(AppsSettings.get().getDeckDir(),name+".ydk");
fw = new FileWriter(f, false);
PrintWriter pw = new PrintWriter(fw);
pw.println(deckMessage);
pw.flush();
fw.flush();
pw.close();
fw.close();
return f;
}
} }
...@@ -220,22 +220,22 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -220,22 +220,22 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
}; };
//x5内核初始化接口 //x5内核初始化接口
QbSdk.initX5Environment(this, cb); QbSdk.initX5Environment(this, cb);
//trpay //trpay
TrPay.getInstance(HomeActivity.this).initPaySdk("e1014da420ea4405898c01273d6731b6", "YGOMobile"); TrPay.getInstance(HomeActivity.this).initPaySdk("e1014da420ea4405898c01273d6731b6", "YGOMobile");
//autoupadte checking //autoupadte checking
checkPgyerUpdateSilent(getContext(), false, false, false); checkPgyerUpdateSilent(getContext(), false, false, false);
//ServiceDuelAssistant //ServiceDuelAssistant
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if(AppsSettings.get().isServiceDuelAssistant()) {
DialogPlus dialogPlus = PermissionUtil.isNotificationPermission(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (dialogPlus == null) DialogPlus dialogPlus = PermissionUtil.isNotificationPermission(this);
this.startForegroundService(new Intent(this, ServiceDuelAssistant.class)); if (dialogPlus == null)
else this.startForegroundService(new Intent(this, ServiceDuelAssistant.class));
dialogPlus.show(); else
} else { dialogPlus.show();
startService(new Intent(this, ServiceDuelAssistant.class)); } else {
startService(new Intent(this, ServiceDuelAssistant.class));
}
} }
//萌卡 //萌卡
StartMycard(); StartMycard();
checkNotch(); checkNotch();
......
...@@ -181,16 +181,17 @@ public class SettingFragment extends PreferenceFragmentPlus { ...@@ -181,16 +181,17 @@ public class SettingFragment extends PreferenceFragmentPlus {
if (preference instanceof CheckBoxPreference) { if (preference instanceof CheckBoxPreference) {
CheckBoxPreference checkBoxPreference = (CheckBoxPreference) preference; CheckBoxPreference checkBoxPreference = (CheckBoxPreference) preference;
mSharedPreferences.edit().putBoolean(preference.getKey(), checkBoxPreference.isChecked()).apply(); mSharedPreferences.edit().putBoolean(preference.getKey(), checkBoxPreference.isChecked()).apply();
//如果设置额外卡库的选项 //如果设置额外卡库的选项
if (preference.getKey().equals(PREF_READ_EX)) { if (preference.getKey().equals(PREF_READ_EX)) {
//设置使用额外卡库后重新加载卡片数据 //设置使用额外卡库后重新加载卡片数据
DataManager.get().load(true); DataManager.get().load(true);
} }
//开关决斗助手 //开关决斗助手
if (preference.getKey().equals(PREF_START_SERVICEDUELASSISTANT)) { if (preference.getKey().equals(PREF_START_SERVICEDUELASSISTANT)) {
getActivity().startService(new Intent(getContext(), ServiceDuelAssistant.class)); if (checkBoxPreference.isChecked()) {
if (!checkBoxPreference.isChecked()) { getActivity().startService(new Intent(getActivity(), ServiceDuelAssistant.class));
getActivity().stopService(new Intent(getContext(), ServiceDuelAssistant.class)); } else {
getActivity().stopService(new Intent(getActivity(), ServiceDuelAssistant.class));
} }
} }
//如果是音效开关 //如果是音效开关
......
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ListView
android:layout_width="100dp"
android:layout_height="wrap_content" />
<TextView
android:layout_width="10dp"
android:layout_height="wrap_content" />
<ListView
android:layout_width="150dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom">
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/blue" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/blue" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/blue" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/red" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/red" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/red" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/blue" />
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/blue" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<CheckBoxPreference <CheckBoxPreference
android:key="pref_key_start_serviceduelassistant" android:key="pref_key_start_serviceduelassistant"
android:persistent="true" android:persistent="true"
android:summary="快速卡查,加入决斗等"
android:title="@string/Start_ServiceDuelAssistant"/> android:title="@string/Start_ServiceDuelAssistant"/>
<CheckBoxPreference <CheckBoxPreference
android:key="pref_key_game_sound_effect" android:key="pref_key_game_sound_effect"
......
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