Commit 7ceabb92 authored by salix5's avatar salix5

fix shuffle

parent 9b22d11c
...@@ -996,8 +996,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -996,8 +996,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if (clicked_card->overlayed.size()) if (clicked_card->overlayed.size())
command_flag |= COMMAND_LIST; command_flag |= COMMAND_LIST;
list_command = 0; list_command = 0;
if (hovered_location & LOCATION_HAND && mainGame->canShuffle if (mainGame->canShuffle && mainGame->dInfo.curMsg == MSG_SELECT_IDLECMD)
&& mainGame->dInfo.curMsg == MSG_SELECT_IDLECMD)
command_flag |= COMMAND_SHUFFLE; command_flag |= COMMAND_SHUFFLE;
ShowMenu(command_flag, x, y); ShowMenu(command_flag, x, y);
break; break;
...@@ -1693,12 +1692,6 @@ void ClientField::ShowMenu(int flag, int x, int y) { ...@@ -1693,12 +1692,6 @@ void ClientField::ShowMenu(int flag, int x, int y) {
return; return;
} }
int height = 1; int height = 1;
if (flag & COMMAND_SHUFFLE) {
mainGame->btnShuffle->setVisible(true);
mainGame->btnShuffle->setRelativePosition(position2di(1, height));
height += 21;
}
else mainGame->btnShuffle->setVisible(false);
if(flag & COMMAND_ACTIVATE) { if(flag & COMMAND_ACTIVATE) {
mainGame->btnActivate->setVisible(true); mainGame->btnActivate->setVisible(true);
mainGame->btnActivate->setRelativePosition(position2di(1, height)); mainGame->btnActivate->setRelativePosition(position2di(1, height));
...@@ -1749,6 +1742,11 @@ void ClientField::ShowMenu(int flag, int x, int y) { ...@@ -1749,6 +1742,11 @@ 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));
......
...@@ -375,6 +375,7 @@ extern Game* mainGame; ...@@ -375,6 +375,7 @@ 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