Commit 50bfa2bc authored by DailyShana's avatar DailyShana

update COMMAND_RESET

parent 1bffd36c
......@@ -38,6 +38,7 @@ public:
std::vector<ClientCard*> attackable_cards;
std::vector<ClientCard*> conti_cards;
std::vector<int> activatable_descs;
std::set<int> reset_descs;
std::vector<int> select_options;
std::vector<ChainInfo> chains;
int extra_p_count[2];
......
......@@ -1217,8 +1217,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} else {
pcard->chain_code = code;
pcard->is_selectable = true;
if(flag == 0x2)
if(flag == 0x2) {
pcard->cmdFlag |= COMMAND_RESET;
mainGame->dField.reset_descs.insert(desc);
}
else
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(l == LOCATION_GRAVE)
......
......@@ -282,13 +282,18 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
DuelClient::SendResponse();
break;
}
case BUTTON_CMD_ACTIVATE: {
case BUTTON_CMD_ACTIVATE:
case BUTTON_CMD_RESET: {
mainGame->wCmdMenu->setVisible(false);
if(!list_command) {
int index = -1;
select_options.clear();
for (size_t i = 0; i < activatable_cards.size(); ++i) {
if (activatable_cards[i] == clicked_card) {
if(reset_descs.find(activatable_descs[i]) != reset_descs.end())
if(id == BUTTON_CMD_ACTIVATE) continue;
else
if(id == BUTTON_CMD_RESET) continue;
select_options.push_back(activatable_descs[i]);
if (index == -1) index = i;
}
......
......@@ -385,7 +385,7 @@ bool Game::Initialize() {
btnAttack = env->addButton(rect<s32>(1, 127, 99, 147), wCmdMenu, BUTTON_CMD_ATTACK, dataManager.GetSysString(1157));
btnShowList = env->addButton(rect<s32>(1, 148, 99, 168), wCmdMenu, BUTTON_CMD_SHOWLIST, dataManager.GetSysString(1158));
btnOperation = env->addButton(rect<s32>(1, 169, 99, 189), wCmdMenu, BUTTON_CMD_ACTIVATE, dataManager.GetSysString(1161));
btnReset = env->addButton(rect<s32>(1, 190, 99, 210), wCmdMenu, BUTTON_CMD_ACTIVATE, dataManager.GetSysString(1162));
btnReset = env->addButton(rect<s32>(1, 190, 99, 210), wCmdMenu, BUTTON_CMD_RESET, dataManager.GetSysString(1162));
//deck edit
wDeckEdit = env->addStaticText(L"", rect<s32>(309, 5, 605, 130), true, false, 0, -1, true);
wDeckEdit->setVisible(false);
......
......@@ -472,6 +472,7 @@ extern Game* mainGame;
#define BUTTON_CMD_ATTACK 246
#define BUTTON_CMD_SHOWLIST 247
#define BUTTON_CMD_SHUFFLE 248
#define BUTTON_CMD_RESET 249
#define BUTTON_ANNUMBER_OK 250
#define BUTTON_ANCARD_OK 251
#define EDITBOX_ANCARD 252
......
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