Commit e2f3bbec authored by fallenstardust's avatar fallenstardust

ygopro初步建立genesys切换

parent bfae57c0
...@@ -176,13 +176,26 @@ void DeckBuilder::Terminate() { ...@@ -176,13 +176,26 @@ void DeckBuilder::Terminate() {
void DeckBuilder::setLastLimit() { void DeckBuilder::setLastLimit() {
char linebuf[256]; char linebuf[256];
int lflistsel = mainGame->cbLFlist->getSelected(); if (mainGame->gameConf.use_lflist) {
if (lflistsel >= 0) { int lflistsel = mainGame->cbLFlist->getSelected();
BufferIO::CopyWideString(mainGame->cbLFlist->getItem(lflistsel), mainGame->gameConf.last_limit_list_name); if (lflistsel >= 0) {
BufferIO::EncodeUTF8(mainGame->cbLFlist->getItem(lflistsel), linebuf); BufferIO::CopyWideString(mainGame->cbLFlist->getItem(lflistsel), mainGame->gameConf.last_limit_list_name);
irr::android::setLastLimit(mainGame->appMain, linebuf); BufferIO::EncodeUTF8(mainGame->cbLFlist->getItem(lflistsel), linebuf);
ALOGD("cc: game: setLastLimit=%s", linebuf); irr::android::setLastLimit(mainGame->appMain, linebuf);
ALOGD("cc: game: setLastLimit=%s", linebuf);
}
}
if (mainGame->gameConf.use_genesys_lflist) {
int lflistsel = mainGame->cbGenesysLFlist->getSelected();
if (lflistsel >= 0) {
BufferIO::CopyWideString(mainGame->cbGenesysLFlist->getItem(lflistsel),
mainGame->gameConf.last_genesys_limit_list_name);
BufferIO::EncodeUTF8(mainGame->cbGenesysLFlist->getItem(lflistsel), linebuf);
irr::android::setLastGenesysLimit(mainGame->appMain, linebuf);
ALOGD("cc: game: setLastGenesysLimit=%s", linebuf);
}
} }
} }
bool DeckBuilder::OnEvent(const irr::SEvent& event) { bool DeckBuilder::OnEvent(const irr::SEvent& event) {
#ifdef _IRR_ANDROID_PLATFORM_ #ifdef _IRR_ANDROID_PLATFORM_
......
...@@ -58,6 +58,7 @@ class DeckManager { ...@@ -58,6 +58,7 @@ class DeckManager {
public: public:
Deck current_deck; Deck current_deck;
std::vector<LFList> _lfList; std::vector<LFList> _lfList;
std::vector<LFList> _genesys_lfList;
static constexpr int MAX_YDK_SIZE = 0x10000; static constexpr int MAX_YDK_SIZE = 0x10000;
......
...@@ -699,8 +699,11 @@ bool Game::Initialize(ANDROID_APP app, irr::android::InitOptions *options) { ...@@ -699,8 +699,11 @@ bool Game::Initialize(ANDROID_APP app, irr::android::InitOptions *options) {
posY += 40; posY += 40;
chkDefaultShowChain = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, -1, dataManager.GetSysString(1354)); chkDefaultShowChain = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, -1, dataManager.GetSysString(1354));
chkDefaultShowChain->setChecked(gameConf.chkDefaultShowChain != 0); chkDefaultShowChain->setChecked(gameConf.chkDefaultShowChain != 0);
posY += 40; posY += 40;
chkQuickAnimation = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, CHECKBOX_QUICK_ANIMATION, dataManager.GetSysString(1299)); chkHidePlayerName = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, CHECKBOX_HIDE_PLAYER_NAME, dataManager.GetSysString(1289));
chkHidePlayerName->setChecked(gameConf.hide_player_name != 0);
posY += 0;
chkQuickAnimation = env->addCheckBox(false, Resize(0, 0, 0, 0), wSettings, CHECKBOX_QUICK_ANIMATION, dataManager.GetSysString(1299));
chkQuickAnimation->setChecked(gameConf.quick_animation != 0); chkQuickAnimation->setChecked(gameConf.quick_animation != 0);
posY += 40; posY += 40;
chkDrawFieldSpell = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, CHECKBOX_DRAW_FIELD_SPELL, dataManager.GetSysString(1283)); chkDrawFieldSpell = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, CHECKBOX_DRAW_FIELD_SPELL, dataManager.GetSysString(1283));
...@@ -725,14 +728,25 @@ bool Game::Initialize(ANDROID_APP app, irr::android::InitOptions *options) { ...@@ -725,14 +728,25 @@ bool Game::Initialize(ANDROID_APP app, irr::android::InitOptions *options) {
cbLFlist->setEnabled(gameConf.use_lflist); cbLFlist->setEnabled(gameConf.use_lflist);
cbLFlist->setSelected(gameConf.use_lflist ? gameConf.default_lflist : cbLFlist->getItemCount() - 1); cbLFlist->setSelected(gameConf.use_lflist ? gameConf.default_lflist : cbLFlist->getItemCount() - 1);
posY += 40; posY += 40;
chkIgnore1 = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, CHECKBOX_DISABLE_CHAT, dataManager.GetSysString(1290)); // 勾选启用禁卡表
chkGenesysLFlist = env->addCheckBox(false, Resize(posX, posY, posX + 100, posY + 30), wSettings, CHECKBOX_LFLIST, dataManager.GetSysString(1288));
chkGenesysLFlist->setChecked(gameConf.use_genesys_lflist);
// 启用禁卡表的combobox
cbGenesysLFlist = irr::gui::CAndroidGUIComboBox::addAndroidComboBox(env, Resize(posX + 110, posY, posX + 230, posY + 30), wSettings, COMBOBOX_LFLIST);
cbGenesysLFlist->setMaxSelectionRows(6);
for(unsigned int i = 0; i < deckManager._genesys_lfList.size(); ++i) {
cbLFlist->addItem(deckManager._genesys_lfList[i].listName.c_str());
if(!wcscmp(deckManager._genesys_lfList[i].listName.c_str(), gameConf.last_genesys_limit_list_name)) {//找到名称相同时找到对应的index值作为默认值
gameConf.default_genesys_lflist = i;
}
}
posY += 0;
chkIgnore1 = env->addCheckBox(false, Resize(0, 0, 0, 0), wSettings, CHECKBOX_DISABLE_CHAT, dataManager.GetSysString(1290));
chkIgnore1->setChecked(gameConf.chkIgnore1 != 0); chkIgnore1->setChecked(gameConf.chkIgnore1 != 0);
posY += 40; posY += 40;
chkIgnore2 = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, -1, dataManager.GetSysString(1291)); chkIgnore2 = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, -1, dataManager.GetSysString(1291));
chkIgnore2->setChecked(gameConf.chkIgnore2 != 0); chkIgnore2->setChecked(gameConf.chkIgnore2 != 0);
posY += 40;
chkHidePlayerName = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, CHECKBOX_HIDE_PLAYER_NAME, dataManager.GetSysString(1289));
chkHidePlayerName->setChecked(gameConf.hide_player_name != 0);
posY += 40; posY += 40;
chkIgnoreDeckChanges = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, -1, dataManager.GetSysString(1357)); chkIgnoreDeckChanges = env->addCheckBox(false, Resize(posX, posY, posX + 260, posY + 30), wSettings, -1, dataManager.GetSysString(1357));
chkIgnoreDeckChanges->setChecked(gameConf.chkIgnoreDeckChanges != 0); chkIgnoreDeckChanges->setChecked(gameConf.chkIgnoreDeckChanges != 0);
......
...@@ -66,6 +66,7 @@ struct Config { ...@@ -66,6 +66,7 @@ struct Config {
wchar_t roompass[20]{}; wchar_t roompass[20]{};
//path //path
wchar_t last_limit_list_name[256]{}; wchar_t last_limit_list_name[256]{};
wchar_t last_genesys_limit_list_name[256]{};
wchar_t lastcategory[256]{}; wchar_t lastcategory[256]{};
wchar_t lastdeck[256]{}; wchar_t lastdeck[256]{};
wchar_t textfont[256]{}; wchar_t textfont[256]{};
...@@ -82,6 +83,8 @@ struct Config { ...@@ -82,6 +83,8 @@ struct Config {
int chkIgnore2{ 0 }; int chkIgnore2{ 0 };
int use_lflist{ 1 }; int use_lflist{ 1 };
int default_lflist{ 0 }; int default_lflist{ 0 };
int use_genesys_lflist{ 0 };
int default_genesys_lflist{ 0 };
int default_rule{ DEFAULT_DUEL_RULE }; int default_rule{ DEFAULT_DUEL_RULE };
int hide_setname{ 0 }; int hide_setname{ 0 };
int hide_hint_button{ 0 }; int hide_hint_button{ 0 };
...@@ -382,6 +385,8 @@ public: ...@@ -382,6 +385,8 @@ public:
irr::gui::IGUICheckBox* chkPreferExpansionScript; irr::gui::IGUICheckBox* chkPreferExpansionScript;
irr::gui::IGUICheckBox* chkLFlist; irr::gui::IGUICheckBox* chkLFlist;
irr::gui::IGUIComboBox* cbLFlist; irr::gui::IGUIComboBox* cbLFlist;
irr::gui::IGUICheckBox* chkGenesysLFlist;
irr::gui::IGUIComboBox* cbGenesysLFlist;
//sound //sound
irr::gui::IGUICheckBox* chkEnableSound; irr::gui::IGUICheckBox* chkEnableSound;
irr::gui::IGUICheckBox* chkEnableMusic; irr::gui::IGUICheckBox* chkEnableMusic;
......
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