Commit 1f987b40 authored by DailyShana's avatar DailyShana

Merge #1702

parents 3bbbe6ff c09c2d2f
......@@ -1100,12 +1100,17 @@ void ClientField::FadeCard(ClientCard * pcard, int alpha, int frame) {
pcard->is_fading = true;
pcard->aniFrame = frame;
}
void ClientField::ShowSelectSum(bool panelmode) {
bool ClientField::ShowSelectSum(bool panelmode) {
if(panelmode) {
if(CheckSelectSum()) {
if(selectsum_cards.size() == 0 || selectable_cards.size() == 0) {
SetResponseSelectedCards();
if(mainGame->wCardSelect->isVisible())
mainGame->HideElement(mainGame->wCardSelect, true);
else {
DuelClient::SendResponse();
return true;
}
} else {
select_ready = true;
mainGame->wCardSelect->setVisible(false);
......@@ -1121,6 +1126,7 @@ void ClientField::ShowSelectSum(bool panelmode) {
if(selectsum_cards.size() == 0 || selectable_cards.size() == 0) {
SetResponseSelectedCards();
DuelClient::SendResponse();
return true;
} else {
select_ready = true;
wchar_t wbuf[256], *pwbuf = wbuf;
......@@ -1133,6 +1139,7 @@ void ClientField::ShowSelectSum(bool panelmode) {
} else
select_ready = false;
}
return false;
}
bool ClientField::CheckSelectSum() {
std::set<ClientCard*> selable;
......
......@@ -96,7 +96,7 @@ public:
void GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, irr::core::vector3df* r, bool setTrans = false);
void MoveCard(ClientCard* pcard, int frame);
void FadeCard(ClientCard* pcard, int alpha, int frame);
void ShowSelectSum(bool panelmode);
bool ShowSelectSum(bool panelmode);
bool CheckSelectSum();
bool check_min(std::set<ClientCard*>& left, std::set<ClientCard*>::iterator index, int min, int max);
bool check_sel_sum_s(const std::set<ClientCard*>& left, int index, int acc);
......
......@@ -1470,8 +1470,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
}
mainGame->dField.ShowSelectSum(panelmode);
return false;
return mainGame->dField.ShowSelectSum(panelmode);
}
case MSG_SORT_CARD:
case MSG_SORT_CHAIN: {
......
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