Commit 6f182844 authored by edo9300's avatar edo9300

Added support for the selection of cards in location 0 "limbo"

parent 6de51592
...@@ -60,6 +60,9 @@ void ClientField::Clear() { ...@@ -60,6 +60,9 @@ void ClientField::Clear() {
delete *cit; delete *cit;
extra[i].clear(); extra[i].clear();
} }
for(auto cit = limbo_temp.begin(); cit != limbo_temp.end(); ++cit)
delete *cit;
limbo_temp.clear();
for(auto sit = overlay_cards.begin(); sit != overlay_cards.end(); ++sit) for(auto sit = overlay_cards.begin(); sit != overlay_cards.end(); ++sit)
delete *sit; delete *sit;
overlay_cards.clear(); overlay_cards.clear();
...@@ -401,6 +404,8 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) { ...@@ -401,6 +404,8 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
myswprintf(formatBuffer, L"%ls[%d](%d)", myswprintf(formatBuffer, L"%ls[%d](%d)",
dataManager.FormatLocation(selectable_cards[i]->overlayTarget->location, selectable_cards[i]->overlayTarget->sequence), dataManager.FormatLocation(selectable_cards[i]->overlayTarget->location, selectable_cards[i]->overlayTarget->sequence),
selectable_cards[i]->overlayTarget->sequence + 1, selectable_cards[i]->sequence + 1); selectable_cards[i]->overlayTarget->sequence + 1, selectable_cards[i]->sequence + 1);
else if (selectable_cards[i]->location == 0)
myswprintf(formatBuffer, L"");
else else
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence), myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence),
selectable_cards[i]->sequence + 1); selectable_cards[i]->sequence + 1);
......
...@@ -30,6 +30,7 @@ public: ...@@ -30,6 +30,7 @@ public:
std::vector<ClientCard*> grave[2]; std::vector<ClientCard*> grave[2];
std::vector<ClientCard*> remove[2]; std::vector<ClientCard*> remove[2];
std::vector<ClientCard*> extra[2]; std::vector<ClientCard*> extra[2];
std::vector<ClientCard*> limbo_temp;
std::set<ClientCard*> overlay_cards; std::set<ClientCard*> overlay_cards;
std::vector<ClientCard*> summonable_cards; std::vector<ClientCard*> summonable_cards;
std::vector<ClientCard*> spsummonable_cards; std::vector<ClientCard*> spsummonable_cards;
......
...@@ -1371,7 +1371,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1371,7 +1371,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ss = BufferIO::ReadInt8(pbuf); ss = BufferIO::ReadInt8(pbuf);
if ((l & LOCATION_OVERLAY) > 0) if ((l & LOCATION_OVERLAY) > 0)
pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss]; pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss];
else else if (l == 0) {
pcard = new ClientCard();
mainGame->dField.limbo_temp.push_back(pcard);
panelmode = true;
} else
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s);
if (code != 0 && pcard->code != code) if (code != 0 && pcard->code != code)
pcard->SetCode(code); pcard->SetCode(code);
...@@ -1428,7 +1432,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1428,7 +1432,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ss = BufferIO::ReadInt8(pbuf); ss = BufferIO::ReadInt8(pbuf);
if ((l & LOCATION_OVERLAY) > 0) if ((l & LOCATION_OVERLAY) > 0)
pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss]; pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss];
else else if (l == 0) {
pcard = new ClientCard();
mainGame->dField.limbo_temp.push_back(pcard);
panelmode = true;
} else
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s);
if (code != 0 && pcard->code != code) if (code != 0 && pcard->code != code)
pcard->SetCode(code); pcard->SetCode(code);
...@@ -1448,7 +1456,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1448,7 +1456,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ss = BufferIO::ReadInt8(pbuf); ss = BufferIO::ReadInt8(pbuf);
if ((l & LOCATION_OVERLAY) > 0) if ((l & LOCATION_OVERLAY) > 0)
pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss]; pcard = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss];
else else if (l == 0) {
pcard = new ClientCard();
mainGame->dField.limbo_temp.push_back(pcard);
panelmode = true;
} else
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s);
if (code != 0 && pcard->code != code) if (code != 0 && pcard->code != code)
pcard->SetCode(code); pcard->SetCode(code);
...@@ -1905,7 +1917,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1905,7 +1917,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
l = BufferIO::ReadInt8(pbuf); l = BufferIO::ReadInt8(pbuf);
s = BufferIO::ReadInt8(pbuf); s = BufferIO::ReadInt8(pbuf);
pcard = mainGame->dField.GetCard(c, l, s); if (l == 0) {
pcard = new ClientCard();
mainGame->dField.limbo_temp.push_back(pcard);
} else
pcard = mainGame->dField.GetCard(c, l, s);
if (code != 0) if (code != 0)
pcard->SetCode(code); pcard->SetCode(code);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
...@@ -1913,8 +1929,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1913,8 +1929,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->lstLog->addItem(textBuffer); mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(code); mainGame->logParam.push_back(code);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
if (l & 0x41) { if (l & 0x41 || l == 0) {
if(count == 1) { if(count == 1 && l != 0) {
float shift = -0.15f; float shift = -0.15f;
if (c == 0 && l == 0x40) shift = 0.15f; if (c == 0 && l == 0x40) shift = 0.15f;
pcard->dPos = irr::core::vector3df(shift, 0, 0); pcard->dPos = irr::core::vector3df(shift, 0, 0);
...@@ -3676,6 +3692,9 @@ void DuelClient::SendResponse() { ...@@ -3676,6 +3692,9 @@ void DuelClient::SendResponse() {
case MSG_SELECT_CARD: case MSG_SELECT_CARD:
case MSG_SELECT_UNSELECT_CARD: { case MSG_SELECT_UNSELECT_CARD: {
mainGame->dField.ClearSelect(); mainGame->dField.ClearSelect();
for (auto cit = mainGame->dField.limbo_temp.begin(); cit != mainGame->dField.limbo_temp.end(); ++cit)
delete *cit;
mainGame->dField.limbo_temp.clear();
break; break;
} }
case MSG_SELECT_CHAIN: { case MSG_SELECT_CHAIN: {
...@@ -3700,6 +3719,12 @@ void DuelClient::SendResponse() { ...@@ -3700,6 +3719,12 @@ void DuelClient::SendResponse() {
} }
break; break;
} }
case MSG_CONFIRM_CARDS: {
for (auto cit = mainGame->dField.limbo_temp.begin(); cit != mainGame->dField.limbo_temp.end(); ++cit)
delete *cit;
mainGame->dField.limbo_temp.clear();
break;
}
} }
if(mainGame->dInfo.isSingleMode) { if(mainGame->dInfo.isSingleMode) {
SingleMode::SetResponse(response_buf); SingleMode::SetResponse(response_buf);
......
...@@ -979,6 +979,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -979,6 +979,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L"%ls[%d](%d)", myswprintf(formatBuffer, L"%ls[%d](%d)",
dataManager.FormatLocation(selectable_cards[i + pos]->overlayTarget->location, selectable_cards[i + pos]->overlayTarget->sequence), dataManager.FormatLocation(selectable_cards[i + pos]->overlayTarget->location, selectable_cards[i + pos]->overlayTarget->sequence),
selectable_cards[i + pos]->overlayTarget->sequence + 1, selectable_cards[i + pos]->sequence + 1); selectable_cards[i + pos]->overlayTarget->sequence + 1, selectable_cards[i + pos]->sequence + 1);
else if (selectable_cards[i]->location == 0)
myswprintf(formatBuffer, L"");
else else
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i + pos]->location, selectable_cards[i + pos]->sequence), myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i + pos]->location, selectable_cards[i + pos]->sequence),
selectable_cards[i + pos]->sequence + 1); selectable_cards[i + pos]->sequence + 1);
......
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