From 6b241ed6cdcfb481d40ea70678029e83f8a14bd6 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Wed, 17 Nov 2010 23:26:07 +0100 Subject: [PATCH 1/9] updated spanish translation --- cockatrice/translations/cockatrice_es.ts | 124 +++++++++++------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/cockatrice/translations/cockatrice_es.ts b/cockatrice/translations/cockatrice_es.ts index b7471b43..0457d2f2 100644 --- a/cockatrice/translations/cockatrice_es.ts +++ b/cockatrice/translations/cockatrice_es.ts @@ -16,7 +16,7 @@ Path to stack background: - + Ruta a la imagen de fondo de la pila: @@ -51,12 +51,12 @@ Economical layout - + Disposición Económica Invert vertical coordinate - + Invertir coordenada vertical Economic layout @@ -337,37 +337,37 @@ his hand nominative - su mano + su mano %1's hand nominative - mano &de %1 + mano de %1 of his hand genitive - de su mano + de su mano of %1's hand genitive - de la mano &de %1 + de la mano de %1 his hand accusative - su mano + su mano %1's hand accusative - mano &de %1 + mano de %1 his hand @@ -383,37 +383,37 @@ his library nominative - su biblioteca + su biblioteca %1's library nominative - biblioteca &de %1 + biblioteca de %1 of his library genitive - de su biblioteca + de su biblioteca of %1's library genitive - de la biblioteca &de %1 + de la biblioteca de %1 his library accusative - su biblioteca + su biblioteca %1's library accusative - biblioteca &de %1 + biblioteca de %1 his library @@ -429,37 +429,37 @@ his graveyard nominative - su cementerio + su cementerio %1's graveyard nominative - cementerio &de %1 + cementerio de %1 of his graveyard genitive - de su cementerio + de su cementerio of %1's graveyard genitive - del cementerio &de %1 + del cementerio de %1 his graveyard accusative - su cementerio + su cementerio %1's graveyard accusative - cementerio &de %1 + cementerio de %1 his graveyard @@ -475,37 +475,37 @@ his exile nominative - su exilio + su exilio %1's exile nominative - el exilio de %1 + el exilio de %1 of his exile genitive - de su exilio + de su exilio of %1's exile genitive - del exilio de %1 + del exilio de %1 his exile accusative - su exilio + su exilio %1's exile accusative - el exilio de %1 + el exilio de %1 his exile @@ -521,37 +521,37 @@ his sideboard nominative - su reserva + su reserva %1's sideboard nominative - la reserva de %1 + la reserva de %1 of his sideboard genitive - de su reserva + de su reserva of %1's sideboard genitive - de la reserva &de %1 + de la reserva de %1 his sideboard accusative - su reserva + su reserva %1's sideboard accusative - la reserva de %1 + la reserva de %1 his sideboard @@ -971,17 +971,17 @@ Your card database is invalid. Would you like to go back and set the correct path? - + Tu base de datos de cartas es invalida. ¿Deseas volver y seleccionar la ruta correcta? The path to your deck directory is invalid. Would you like to go back and set the correct path? - + La ruta a tu directorio de mazos es invalida. ¿Deseas volver y seleccionar la ruta correcta? The path to your card pictures directory is invalid. Would you like to go back and set the correct path? - + La ruta a tu directorio de imagenes de las cartas es invalida.¿Deseas volver y seleccionar la ruta correcta? @@ -1208,12 +1208,12 @@ About Cockatrice - + Acerca de Cockatrice <font size="8"><b>Cockatrice</b></font><br>Version %1<br><br><br><b>Authors:</b><br>Max-Wilhelm Bruker<br>Marcus Schütz<br>Marius van Zundert<br><br><b>Translators:</b><br>Spanish: Gocho<br>Portugese: Milton Gonçalves<br> - + @@ -1306,12 +1306,12 @@ &About Cockatrice - + &Acerca de Cockatrice &Help - + A&yuda @@ -1424,7 +1424,7 @@ from the stack - + de la pila @@ -1474,7 +1474,7 @@ %1 plays %2%3. - + %1 juega %2%3. @@ -1651,12 +1651,12 @@ %1 reveals %2 to %3. - + %1 revela %2 a %3. %1 reveals %2. - + %1 revela %2. @@ -1676,22 +1676,22 @@ %1 randomly reveals %2%3 to %4. - + %1 revela aleatoriamente %2%3 a %4. %1 randomly reveals %2%3. - + %1 revela aleatoriamente %2%3. %1 reveals %2%3 to %4. - + %1 revela %2%3 a %4. %1 reveals %2%3. - + %1 revela %2%3. @@ -1875,7 +1875,7 @@ Move to &graveyard - + Mover al &cementerio @@ -1885,17 +1885,17 @@ Reveal &library to - + Revelar &biblioteca a Reveal t&op card to - + Revelar la carta &superior de la biblioteca a Move top cards to &graveyard... - + Mover cartas de la parte s&uperior de la biblioteca al cementerio... @@ -2090,12 +2090,12 @@ &Reveal to - + &Revelar a Reveal r&andom card to - + Revelar carta &aleatoriamente a @@ -2105,7 +2105,7 @@ &All players - + &Todos los jugadores @@ -2488,12 +2488,12 @@ Por favor, introduzca un nombre: Location: - + Localización: User level: - + Nivel de usuario: @@ -2511,12 +2511,12 @@ Por favor, introduzca un nombre: Animation settings - + Opciones de animación &Tap/untap animation - + Animación de &girar/enderezar @@ -2642,7 +2642,7 @@ Por favor, introduzca un nombre: Add card to &sideboard - Añadir mazos a la &reserva + Añadir carta a la &reserva @@ -2698,8 +2698,8 @@ Por favor, introduzca un nombre: The decklist has been modified. Do you want to save the changes? - La lista del mazo ha sido modificada -¿Desea guardar los cambios? + La lista del mazo ha sido modificada +¿Deseas guardar los cambios? From ec602aefe11aefa51e7e8e396aa70fd01426ea3b Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Tue, 23 Nov 2010 02:07:56 +0100 Subject: [PATCH 2/9] server crash and inconsistency fix --- common/server_card.cpp | 4 ---- common/server_protocolhandler.cpp | 13 ++++++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/server_card.cpp b/common/server_card.cpp index 6c332b93..792ec0db 100644 --- a/common/server_card.cpp +++ b/common/server_card.cpp @@ -37,15 +37,11 @@ Server_Card::~Server_Card() void Server_Card::resetState() { - setCoords(0, 0); counters.clear(); setTapped(false); setAttacking(false); - setFaceDown(false); - setColor(QString()); setPT(QString()); setAnnotation(QString()); - setDestroyOnZoneChange(false); setDoesntUntap(false); } diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index bfa61080..a5533626 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -623,6 +623,8 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player * y = 0; if (x == -1) x = targetzone->cards.size(); + + card->resetState(); } else if (x == -1) x = targetzone->getFreeGridColumn(y); @@ -680,7 +682,7 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player * if (tapped) setCardAttrHelper(cont, game, player, targetzone->getName(), card->getId(), "tapped", "1"); - + return RespOk; } @@ -1197,11 +1199,12 @@ ResponseCode Server_ProtocolHandler::cmdRevealCards(Command_RevealCards *cmd, Co for (int i = 0; i < cardsToReveal.size(); ++i) { Server_Card *card = cardsToReveal[i]; - QList cardCounterList; + QList cardCounterListPrivate, cardCounterListOmniscient; QMapIterator cardCounterIterator(card->getCounters()); while (cardCounterIterator.hasNext()) { cardCounterIterator.next(); - cardCounterList.append(new ServerInfo_CardCounter(cardCounterIterator.key(), cardCounterIterator.value())); + cardCounterListPrivate.append(new ServerInfo_CardCounter(cardCounterIterator.key(), cardCounterIterator.value())); + cardCounterListOmniscient.append(new ServerInfo_CardCounter(cardCounterIterator.key(), cardCounterIterator.value())); } int attachPlayerId = -1; @@ -1214,8 +1217,8 @@ ResponseCode Server_ProtocolHandler::cmdRevealCards(Command_RevealCards *cmd, Co } if (cmd->getPlayerId() != -1) - respCardListPrivate.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterList, attachPlayerId, attachZone, attachCardId)); - respCardListOmniscient.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterList, attachPlayerId, attachZone, attachCardId)); + respCardListPrivate.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterListPrivate, attachPlayerId, attachZone, attachCardId)); + respCardListOmniscient.append(new ServerInfo_Card(card->getId(), card->getName(), card->getX(), card->getY(), card->getTapped(), card->getAttacking(), card->getColor(), card->getPT(), card->getAnnotation(), card->getDestroyOnZoneChange(), cardCounterListOmniscient, attachPlayerId, attachZone, attachCardId)); } if (cmd->getPlayerId() == -1) From 8bd8b6218eecf0dba6b2f372ffd2b2ebfbf33a4b Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Tue, 30 Nov 2010 23:01:01 +0100 Subject: [PATCH 3/9] settings dialog bug fix --- cockatrice/src/settingscache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/settingscache.cpp b/cockatrice/src/settingscache.cpp index 604766cd..3023d911 100644 --- a/cockatrice/src/settingscache.cpp +++ b/cockatrice/src/settingscache.cpp @@ -80,7 +80,7 @@ void SettingsCache::setTableBgPath(const QString &_tableBgPath) void SettingsCache::setPlayerBgPath(const QString &_playerBgPath) { playerBgPath = _playerBgPath; - settings->setValue("zonebg/player", playerBgPath); + settings->setValue("zonebg/playerarea", playerBgPath); emit playerBgPathChanged(); } From 6e567d5b2f5360b381f78b2894f758212c0512e0 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Wed, 1 Dec 2010 14:56:50 +0100 Subject: [PATCH 4/9] crash fix --- cockatrice/src/abstractcarditem.cpp | 15 ++------------- cockatrice/src/abstractcarditem.h | 2 -- cockatrice/src/carditem.cpp | 28 +++++++++++++++++++++++----- cockatrice/src/carditem.h | 3 +++ cockatrice/src/gamescene.cpp | 6 +++++- cockatrice/src/player.cpp | 6 +----- 6 files changed, 34 insertions(+), 26 deletions(-) diff --git a/cockatrice/src/abstractcarditem.cpp b/cockatrice/src/abstractcarditem.cpp index 22e0dade..ca7e22db 100644 --- a/cockatrice/src/abstractcarditem.cpp +++ b/cockatrice/src/abstractcarditem.cpp @@ -176,6 +176,8 @@ void AbstractCardItem::setHovered(bool _hovered) if (isHovered == _hovered) return; + if (_hovered) + processHoverEvent(); isHovered = _hovered; setZValue(_hovered ? 2000000004 : realZValue); update(); @@ -226,19 +228,6 @@ void AbstractCardItem::processHoverEvent() emit hovered(this); } -void AbstractCardItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) -{ - processHoverEvent(); - isHovered = true; - QGraphicsItem::hoverEnterEvent(event); -} - -void AbstractCardItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) -{ - isHovered = false; - QGraphicsItem::hoverLeaveEvent(event); -} - QVariant AbstractCardItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) { if (change == ItemSelectedHasChanged) { diff --git a/cockatrice/src/abstractcarditem.h b/cockatrice/src/abstractcarditem.h index e1ca65c8..0f592d31 100644 --- a/cockatrice/src/abstractcarditem.h +++ b/cockatrice/src/abstractcarditem.h @@ -55,8 +55,6 @@ protected: void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle); void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void hoverEnterEvent(QGraphicsSceneHoverEvent *event); - void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value); }; diff --git a/cockatrice/src/carditem.cpp b/cockatrice/src/carditem.cpp index d571f400..da5ddbf3 100644 --- a/cockatrice/src/carditem.cpp +++ b/cockatrice/src/carditem.cpp @@ -106,19 +106,35 @@ CardItem::CardItem(Player *_owner, const QString &_name, int _cardid, QGraphicsI CardItem::~CardItem() { - if (owner->getCardMenu() == cardMenu) - owner->setCardMenu(0); + prepareDelete(); + deleteDragItem(); +} + +void CardItem::prepareDelete() +{ + if (owner) { + if (owner->getCardMenu() == cardMenu) + owner->setCardMenu(0); + owner = 0; + } delete cardMenu; + cardMenu = 0; while (!attachedCards.isEmpty()) { attachedCards.first()->setZone(0); // so that it won't try to call reorganizeCards() attachedCards.first()->setAttachedTo(0); } - if (attachedTo) + if (attachedTo) { attachedTo->removeAttachedCard(this); + attachedTo = 0; + } +} - deleteDragItem(); +void CardItem::deleteLater() +{ + prepareDelete(); + AbstractCardItem::deleteLater(); } void CardItem::retranslateUi() @@ -236,10 +252,12 @@ void CardItem::setAttachedTo(CardItem *_attachedTo) gridPoint.setX(-1); attachedTo = _attachedTo; if (attachedTo) { + setParentItem(attachedTo->getZone()); attachedTo->addAttachedCard(this); if (zone != attachedTo->getZone()) attachedTo->getZone()->reorganizeCards(); - } + } else + setParentItem(zone); if (zone) zone->reorganizeCards(); diff --git a/cockatrice/src/carditem.h b/cockatrice/src/carditem.h index 586d2147..52642abb 100644 --- a/cockatrice/src/carditem.h +++ b/cockatrice/src/carditem.h @@ -35,6 +35,9 @@ private: QMenu *cardMenu, *moveMenu; void playCard(QGraphicsSceneMouseEvent *event); + void prepareDelete(); +public slots: + void deleteLater(); public: enum { Type = typeCard }; int type() const { return Type; } diff --git a/cockatrice/src/gamescene.cpp b/cockatrice/src/gamescene.cpp index 55b7079c..e92fb820 100644 --- a/cockatrice/src/gamescene.cpp +++ b/cockatrice/src/gamescene.cpp @@ -170,8 +170,12 @@ bool GameScene::event(QEvent *event) CardItem *card = qgraphicsitem_cast(itemList[i]); if (!card) continue; - if (card->getZone() != zone) + if (card->getAttachedTo()) { + if (card->getAttachedTo()->getZone() != zone) + continue; + } else if (card->getZone() != zone) continue; + if (card->getRealZValue() > maxZ) { maxZ = card->getRealZValue(); maxZCard = card; diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 7872c17a..c13c13bf 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -252,7 +252,7 @@ Player::Player(ServerInfo_User *info, int _id, bool _local, TabGame *_parent) Player::~Player() { - qDebug("Player destructor"); + qDebug() << "Player destructor:" << getName(); static_cast(scene())->removePlayer(this); @@ -889,10 +889,6 @@ void Player::eventAttachCard(Event_AttachCard *event) CardItem *oldParent = startCard->getAttachedTo(); - if (targetZone) - startCard->setParentItem(targetZone); - else - startCard->setParentItem(startZone); startCard->setAttachedTo(targetCard); startZone->reorganizeCards(); From 3f1177f65fe37b0bf430e65b7c0ce5e12a97a67d Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Wed, 1 Dec 2010 17:59:34 +0100 Subject: [PATCH 5/9] added norwegian flag --- cockatrice/resources/countries/no.svg | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 cockatrice/resources/countries/no.svg diff --git a/cockatrice/resources/countries/no.svg b/cockatrice/resources/countries/no.svg new file mode 100644 index 00000000..ec2bd8de --- /dev/null +++ b/cockatrice/resources/countries/no.svg @@ -0,0 +1,9 @@ + + + + + + + + + From 7bd85641f1fc98af767edab90f36ede074486d13 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Wed, 1 Dec 2010 18:00:03 +0100 Subject: [PATCH 6/9] added norwegian flag to resources --- cockatrice/cockatrice.qrc | 1 + 1 file changed, 1 insertion(+) diff --git a/cockatrice/cockatrice.qrc b/cockatrice/cockatrice.qrc index 9baff49d..1c30fade 100644 --- a/cockatrice/cockatrice.qrc +++ b/cockatrice/cockatrice.qrc @@ -62,6 +62,7 @@ resources/countries/jp.svg resources/countries/mx.svg resources/countries/nl.svg + resources/countries/no.svg resources/countries/pl.svg resources/countries/ru.svg resources/countries/se.svg From 2d8c58e682980dfef8ec22f72ec4c0d9732d43a9 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Wed, 1 Dec 2010 18:24:12 +0100 Subject: [PATCH 7/9] added portugese flag --- cockatrice/cockatrice.qrc | 1 + cockatrice/resources/countries/pt.svg | 859 ++++++++++++++++++++++++++ 2 files changed, 860 insertions(+) create mode 100644 cockatrice/resources/countries/pt.svg diff --git a/cockatrice/cockatrice.qrc b/cockatrice/cockatrice.qrc index 1c30fade..1391fc83 100644 --- a/cockatrice/cockatrice.qrc +++ b/cockatrice/cockatrice.qrc @@ -64,6 +64,7 @@ resources/countries/nl.svg resources/countries/no.svg resources/countries/pl.svg + resources/countries/pt.svg resources/countries/ru.svg resources/countries/se.svg resources/countries/tr.svg diff --git a/cockatrice/resources/countries/pt.svg b/cockatrice/resources/countries/pt.svg new file mode 100644 index 00000000..1286a1bf --- /dev/null +++ b/cockatrice/resources/countries/pt.svg @@ -0,0 +1,859 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From fe397cd7085099a0dd5e3403999e91dff7406ceb Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Thu, 2 Dec 2010 16:58:35 +0100 Subject: [PATCH 8/9] server spectator bug fix --- common/server_protocolhandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index a5533626..18c80565 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -945,6 +945,7 @@ ResponseCode Server_ProtocolHandler::setCardAttrHelper(CommandContainer *cont, S } cont->enqueueGameEventPrivate(new Event_SetCardAttr(player->getPlayerId(), zone->getName(), cardId, attrName, attrValue), game->getGameId()); cont->enqueueGameEventPublic(new Event_SetCardAttr(player->getPlayerId(), zone->getName(), cardId, attrName, attrValue), game->getGameId()); + cont->enqueueGameEventOmniscient(new Event_SetCardAttr(player->getPlayerId(), zone->getName(), cardId, attrName, attrValue), game->getGameId()); return RespOk; } From 9410ea133abc381c9847acb70c19048d1ab67eae Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Sat, 4 Dec 2010 21:01:59 +0100 Subject: [PATCH 9/9] crash fix --- cockatrice/src/carditem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/carditem.cpp b/cockatrice/src/carditem.cpp index da5ddbf3..c3da70d8 100644 --- a/cockatrice/src/carditem.cpp +++ b/cockatrice/src/carditem.cpp @@ -107,6 +107,10 @@ CardItem::CardItem(Player *_owner, const QString &_name, int _cardid, QGraphicsI CardItem::~CardItem() { prepareDelete(); + + delete cardMenu; + cardMenu = 0; + deleteDragItem(); } @@ -117,8 +121,6 @@ void CardItem::prepareDelete() owner->setCardMenu(0); owner = 0; } - delete cardMenu; - cardMenu = 0; while (!attachedCards.isEmpty()) { attachedCards.first()->setZone(0); // so that it won't try to call reorganizeCards()