mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
almost works
This commit is contained in:
parent
ec234e0499
commit
3e07d06825
3 changed files with 9 additions and 15 deletions
|
|
@ -151,7 +151,8 @@ void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoneViewWidget *item = new ZoneViewWidget(player, player->getZones().value(zoneName), numberCards, false, false, {}, isReversed);
|
ZoneViewWidget *item =
|
||||||
|
new ZoneViewWidget(player, player->getZones().value(zoneName), numberCards, false, false, {}, isReversed);
|
||||||
zoneViews.append(item);
|
zoneViews.append(item);
|
||||||
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
||||||
addItem(item);
|
addItem(item);
|
||||||
|
|
|
||||||
|
|
@ -121,34 +121,26 @@ void ZoneViewZone::updateCardIds(CardAction action, int index)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto startId = isReversed ? cards.first()->getId() : 0;
|
auto startId = 0;
|
||||||
|
|
||||||
if (isReversed) {
|
if (isReversed) {
|
||||||
if (cards.first()->getId() != firstCardId) {
|
startId = origZone->getCards().size() - cards.size();
|
||||||
startId -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << "TRACK" << "action" << action << "index" << index << "startId" << startId;
|
qDebug() << "TRACK" << "action" << action << "index" << index << "startId" << startId;
|
||||||
|
// these get called after this zone's card list updates but before parent zone's card list updates
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case INITIALIZE:
|
case INITIALIZE:
|
||||||
break;
|
break;
|
||||||
case ADD_CARD:
|
case ADD_CARD:
|
||||||
if (index > startId) {
|
if (index < cards.first()->getId()) {
|
||||||
startId += 1;
|
startId += 1;
|
||||||
}
|
}
|
||||||
|
startId += 1;
|
||||||
break;
|
break;
|
||||||
case REMOVE_CARD:
|
case REMOVE_CARD:
|
||||||
startId -= 1;
|
startId -= 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*if (cards.first()->getId() != firstCardId) {
|
|
||||||
startId -= 1;
|
|
||||||
}
|
|
||||||
if (origZone->getCards().size() != previousOrigSize) {
|
|
||||||
qDebug() << "TRACK origZoneSize changed" << "orig" << origZone->getCards().size() << "prev"
|
|
||||||
<< previousOrigSize;
|
|
||||||
previousOrigSize = origZone->getCards().size();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < cardCount; ++i) {
|
for (int i = 0; i < cardCount; ++i) {
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,8 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
|
||||||
|
|
||||||
vbox->addItem(zoneHBox);
|
vbox->addItem(zoneHBox);
|
||||||
|
|
||||||
zone = new ZoneViewZone(player, _origZone, numberCards, _revealZone, _writeableRevealZone, zoneContainer, _isReversed);
|
zone =
|
||||||
|
new ZoneViewZone(player, _origZone, numberCards, _revealZone, _writeableRevealZone, zoneContainer, _isReversed);
|
||||||
connect(zone, SIGNAL(wheelEventReceived(QGraphicsSceneWheelEvent *)), scrollBarProxy,
|
connect(zone, SIGNAL(wheelEventReceived(QGraphicsSceneWheelEvent *)), scrollBarProxy,
|
||||||
SLOT(recieveWheelEvent(QGraphicsSceneWheelEvent *)));
|
SLOT(recieveWheelEvent(QGraphicsSceneWheelEvent *)));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue