Commit ff2b689d authored by salix5's avatar salix5

move shuffle button

parent f1a174f9
...@@ -454,6 +454,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -454,6 +454,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnBP->setVisible(false); mainGame->btnBP->setVisible(false);
mainGame->btnM2->setVisible(false); mainGame->btnM2->setVisible(false);
mainGame->btnEP->setVisible(false); mainGame->btnEP->setVisible(false);
mainGame->btnShuffle->setVisible(false);
mainGame->wChat->setVisible(true); mainGame->wChat->setVisible(true);
mainGame->imgCard->setImage(imageManager.tCover); mainGame->imgCard->setImage(imageManager.tCover);
mainGame->device->setEventReceiver(&mainGame->dField); mainGame->device->setEventReceiver(&mainGame->dField);
...@@ -1044,10 +1045,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1044,10 +1045,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnEP->setPressed(false); mainGame->btnEP->setPressed(false);
} }
if (BufferIO::ReadInt8(pbuf)) { if (BufferIO::ReadInt8(pbuf)) {
mainGame->canShuffle = true; mainGame->btnShuffle->setVisible(true);
} }
else { else {
mainGame->canShuffle = false; mainGame->btnShuffle->setVisible(false);
} }
return false; return false;
} }
...@@ -1817,6 +1818,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1817,6 +1818,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnBP->setVisible(false); mainGame->btnBP->setVisible(false);
mainGame->btnM2->setVisible(false); mainGame->btnM2->setVisible(false);
mainGame->btnEP->setVisible(false); mainGame->btnEP->setVisible(false);
mainGame->btnShuffle->setVisible(false);
mainGame->showcarddif = 30; mainGame->showcarddif = 30;
mainGame->showcardp = 0; mainGame->showcardp = 0;
switch (phase) { switch (phase) {
...@@ -3150,6 +3152,7 @@ void DuelClient::SendResponse() { ...@@ -3150,6 +3152,7 @@ void DuelClient::SendResponse() {
mainGame->dField.ClearCommandFlag(); mainGame->dField.ClearCommandFlag();
mainGame->btnBP->setVisible(false); mainGame->btnBP->setVisible(false);
mainGame->btnEP->setVisible(false); mainGame->btnEP->setVisible(false);
mainGame->btnShuffle->setVisible(false);
break; break;
} }
case MSG_SELECT_CARD: { case MSG_SELECT_CARD: {
......
...@@ -251,7 +251,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -251,7 +251,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CMD_SHUFFLE: { case BUTTON_CMD_SHUFFLE: {
mainGame->wCmdMenu->setVisible(false); mainGame->btnShuffle->setVisible(false);
DuelClient::SetResponseI(8); DuelClient::SetResponseI(8);
DuelClient::SendResponse(); DuelClient::SendResponse();
break; break;
...@@ -989,18 +989,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -989,18 +989,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
ShowMenu(command_flag, x, y); ShowMenu(command_flag, x, y);
break; break;
} }
case LOCATION_HAND: { case LOCATION_HAND:
if (!clicked_card)
break;
int command_flag = clicked_card->cmdFlag;
if (clicked_card->overlayed.size())
command_flag |= COMMAND_LIST;
list_command = 0;
if (mainGame->canShuffle && mainGame->dInfo.curMsg == MSG_SELECT_IDLECMD)
command_flag |= COMMAND_SHUFFLE;
ShowMenu(command_flag, x, y);
break;
}
case LOCATION_MZONE: case LOCATION_MZONE:
case LOCATION_SZONE: { case LOCATION_SZONE: {
if(!clicked_card) if(!clicked_card)
...@@ -1742,11 +1731,6 @@ void ClientField::ShowMenu(int flag, int x, int y) { ...@@ -1742,11 +1731,6 @@ void ClientField::ShowMenu(int flag, int x, int y) {
mainGame->btnShowList->setRelativePosition(position2di(1, height)); mainGame->btnShowList->setRelativePosition(position2di(1, height));
height += 21; height += 21;
} else mainGame->btnShowList->setVisible(false); } else mainGame->btnShowList->setVisible(false);
if(flag & COMMAND_SHUFFLE) {
mainGame->btnShuffle->setVisible(true);
mainGame->btnShuffle->setRelativePosition(position2di(1, height));
height += 21;
} else mainGame->btnShuffle->setVisible(false);
panel = mainGame->wCmdMenu; panel = mainGame->wCmdMenu;
mainGame->wCmdMenu->setVisible(true); mainGame->wCmdMenu->setVisible(true);
mainGame->wCmdMenu->setRelativePosition(irr::core::recti(x - 20 , y - 20 - height, x + 80, y - 20)); mainGame->wCmdMenu->setRelativePosition(irr::core::recti(x - 20 , y - 20 - height, x + 80, y - 20));
......
...@@ -196,6 +196,8 @@ bool Game::Initialize() { ...@@ -196,6 +196,8 @@ bool Game::Initialize() {
btnM2->setVisible(false); btnM2->setVisible(false);
btnEP = env->addButton(rect<s32>(325, 0, 375, 20), wPhase, BUTTON_EP, L"\xff25\xff30"); btnEP = env->addButton(rect<s32>(325, 0, 375, 20), wPhase, BUTTON_EP, L"\xff25\xff30");
btnEP->setVisible(false); btnEP->setVisible(false);
btnShuffle = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1307));
btnShuffle->setVisible(false);
//tab //tab
wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true); wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true);
wInfos->setVisible(false); wInfos->setVisible(false);
...@@ -355,7 +357,6 @@ bool Game::Initialize() { ...@@ -355,7 +357,6 @@ bool Game::Initialize() {
btnRepos = env->addButton(rect<s32>(1, 106, 99, 126), wCmdMenu, BUTTON_CMD_REPOS, dataManager.GetSysString(1154)); btnRepos = env->addButton(rect<s32>(1, 106, 99, 126), wCmdMenu, BUTTON_CMD_REPOS, dataManager.GetSysString(1154));
btnAttack = env->addButton(rect<s32>(1, 127, 99, 147), wCmdMenu, BUTTON_CMD_ATTACK, dataManager.GetSysString(1157)); 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)); btnShowList = env->addButton(rect<s32>(1, 148, 99, 168), wCmdMenu, BUTTON_CMD_SHOWLIST, dataManager.GetSysString(1158));
btnShuffle = env->addButton(rect<s32>(1, 169, 99, 189), wCmdMenu, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1307));
//deck edit //deck edit
wDeckEdit = env->addStaticText(L"", rect<s32>(309, 8, 605, 130), true, false, 0, -1, true); wDeckEdit = env->addStaticText(L"", rect<s32>(309, 8, 605, 130), true, false, 0, -1, true);
wDeckEdit->setVisible(false); wDeckEdit->setVisible(false);
......
...@@ -112,7 +112,6 @@ public: ...@@ -112,7 +112,6 @@ public:
std::vector<int> logParam; std::vector<int> logParam;
std::wstring chatMsg[8]; std::wstring chatMsg[8];
bool canShuffle;
int hideChatTimer; int hideChatTimer;
bool hideChat; bool hideChat;
int chatTiming[8]; int chatTiming[8];
...@@ -375,7 +374,6 @@ extern Game* mainGame; ...@@ -375,7 +374,6 @@ extern Game* mainGame;
#define COMMAND_REPOS 0x0020 #define COMMAND_REPOS 0x0020
#define COMMAND_ATTACK 0x0040 #define COMMAND_ATTACK 0x0040
#define COMMAND_LIST 0x0080 #define COMMAND_LIST 0x0080
#define COMMAND_SHUFFLE 0x0100
#define BUTTON_LAN_MODE 100 #define BUTTON_LAN_MODE 100
#define BUTTON_SINGLE_MODE 101 #define BUTTON_SINGLE_MODE 101
......
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