mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Click to hide revealed cards; MultiMove function
This commit is contained in:
parent
f07bb38e4a
commit
9c527fb5aa
28 changed files with 424 additions and 284 deletions
|
|
@ -33,7 +33,7 @@ void ZoneViewZone::initializeCards(const QList<ServerInfo_Card *> &cardList)
|
|||
{
|
||||
if (!cardList.isEmpty()) {
|
||||
for (int i = 0; i < cardList.size(); ++i)
|
||||
addCard(new CardItem(player, cardList[i]->getName(), cardList[i]->getId(), this), false, i);
|
||||
addCard(new CardItem(player, cardList[i]->getName(), cardList[i]->getId(), revealZone, this), false, i);
|
||||
reorganizeCards();
|
||||
} else if (!origZone->contentsKnown()) {
|
||||
Command_DumpZone *command = new Command_DumpZone(-1, player->getId(), name, numberCards);
|
||||
|
|
@ -44,7 +44,7 @@ void ZoneViewZone::initializeCards(const QList<ServerInfo_Card *> &cardList)
|
|||
int number = numberCards == -1 ? c.size() : (numberCards < c.size() ? numberCards : c.size());
|
||||
for (int i = 0; i < number; i++) {
|
||||
CardItem *card = c.at(i);
|
||||
addCard(new CardItem(player, card->getName(), card->getId(), this), false, i);
|
||||
addCard(new CardItem(player, card->getName(), card->getId(), revealZone, this), false, i);
|
||||
}
|
||||
reorganizeCards();
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ void ZoneViewZone::zoneDumpReceived(ProtocolResponse *r)
|
|||
|
||||
const QList<ServerInfo_Card *> &respCardList = resp->getZone()->getCardList();
|
||||
for (int i = 0; i < respCardList.size(); i++) {
|
||||
CardItem *card = new CardItem(player, respCardList[i]->getName(), respCardList[i]->getId(), this);
|
||||
CardItem *card = new CardItem(player, respCardList[i]->getName(), respCardList[i]->getId(), revealZone, this);
|
||||
addCard(card, false, i);
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,6 @@ void ZoneViewZone::reorganizeCards()
|
|||
cols = 2;
|
||||
|
||||
qDebug() << "reorganizeCards: rows=" << rows << "cols=" << cols;
|
||||
qDebug() << "SORT BY NAME:" << sortByName << "SORT BY TYPE:" << sortByType;
|
||||
|
||||
CardList cardsToDisplay(cards);
|
||||
if (sortByName || sortByType)
|
||||
|
|
@ -125,9 +124,13 @@ void ZoneViewZone::addCardImpl(CardItem *card, int x, int /*y*/)
|
|||
card->update();
|
||||
}
|
||||
|
||||
void ZoneViewZone::handleDropEvent(CardDragItem *dragItem, CardZone *startZone, const QPoint &/*dropPoint*/, bool /*faceDown*/)
|
||||
void ZoneViewZone::handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &/*dropPoint*/, bool /*faceDown*/)
|
||||
{
|
||||
player->sendGameCommand(new Command_MoveCard(-1, startZone->getName(), dragItem->getId(), player->getId(), getName(), 0, 0, false));
|
||||
QList<CardId *> idList;
|
||||
for (int i = 0; i < dragItems.size(); ++i)
|
||||
idList.append(new CardId(dragItems[i]->getId()));
|
||||
|
||||
player->sendGameCommand(new Command_MoveCard(-1, startZone->getName(), idList, player->getId(), getName(), 0, 0, false));
|
||||
}
|
||||
|
||||
void ZoneViewZone::removeCard(int position)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue