mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
Support viewing the bottom X cards of library (#5410)
* Get cardIds to update properly in bottom view (#5414) * Get bottom view to update properly when card is inserted into known portion (#5415) --------- Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
81b85e97df
commit
6078dd092a
17 changed files with 154 additions and 41 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "../player/player.h"
|
||||
#include "pb/command_move_card.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "pile_zone.h"
|
||||
#include "view_zone.h"
|
||||
|
||||
#include <QAction>
|
||||
|
|
@ -151,7 +152,7 @@ void CardZone::addCard(CardItem *card, const bool reorganize, const int x, const
|
|||
}
|
||||
|
||||
for (auto *view : views) {
|
||||
if ((x <= view->getCards().size()) || (view->getNumberCards() == -1)) {
|
||||
if (view->getIsReversed() || (x <= view->getCards().size()) || (view->getNumberCards() == -1)) {
|
||||
view->addCard(new CardItem(player, nullptr, card->getName(), card->getProviderId(), card->getId()),
|
||||
reorganize, x, y);
|
||||
}
|
||||
|
|
@ -199,12 +200,12 @@ CardItem *CardZone::takeCard(int position, int cardId, bool /*canResize*/)
|
|||
if (position >= cards.size())
|
||||
return nullptr;
|
||||
|
||||
CardItem *c = cards.takeAt(position);
|
||||
|
||||
for (auto *view : views) {
|
||||
view->removeCard(position);
|
||||
}
|
||||
|
||||
CardItem *c = cards.takeAt(position);
|
||||
|
||||
c->setId(cardId);
|
||||
|
||||
reorganizeCards();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue