mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 00:23:55 -07:00
minor fixes; added round clock
This commit is contained in:
parent
02f2fb9764
commit
5544de3213
9 changed files with 28 additions and 8 deletions
|
|
@ -67,9 +67,6 @@ void HandZone::reorganizeCards()
|
|||
qreal totalWidth = boundingRect().width() - 2 * xPadding;
|
||||
qreal cardWidth = cards.at(0)->boundingRect().width();
|
||||
|
||||
if (cardWidth * cardCount < totalWidth)
|
||||
cardWidth += 5;
|
||||
|
||||
for (int i = 0; i < cardCount; i++) {
|
||||
CardItem *c = cards.at(i);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ void SelectZone::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
selectionOrigin = event->pos();
|
||||
static_cast<GameScene *>(scene())->startRubberBand(event->scenePos());
|
||||
event->accept();
|
||||
}
|
||||
} else
|
||||
CardZone::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void SelectZone::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ TabGame::TabGame(QList<AbstractClient *> &_clients, int _gameId, const QString &
|
|||
cardInfo = new CardInfoWidget(CardInfoWidget::ModeGameTab);
|
||||
playerListWidget = new PlayerListWidget;
|
||||
playerListWidget->setFocusPolicy(Qt::NoFocus);
|
||||
timeElapsedLabel = new QLabel;
|
||||
timeElapsedLabel->setAlignment(Qt::AlignCenter);
|
||||
messageLog = new MessageLogWidget;
|
||||
connect(messageLog, SIGNAL(cardNameHovered(QString)), cardInfo, SLOT(setCard(QString)));
|
||||
connect(messageLog, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString)));
|
||||
|
|
@ -190,6 +192,7 @@ TabGame::TabGame(QList<AbstractClient *> &_clients, int _gameId, const QString &
|
|||
QVBoxLayout *verticalLayout = new QVBoxLayout;
|
||||
verticalLayout->addWidget(cardInfo);
|
||||
verticalLayout->addWidget(playerListWidget, 1);
|
||||
verticalLayout->addWidget(timeElapsedLabel);
|
||||
verticalLayout->addWidget(messageLog, 5);
|
||||
verticalLayout->addLayout(hLayout);
|
||||
|
||||
|
|
@ -651,6 +654,13 @@ void TabGame::eventPing(Event_Ping *event, GameEventContext * /*context*/)
|
|||
const QList<ServerInfo_PlayerPing *> &pingList = event->getPingList();
|
||||
for (int i = 0; i < pingList.size(); ++i)
|
||||
playerListWidget->updatePing(pingList[i]->getPlayerId(), pingList[i]->getPingTime());
|
||||
|
||||
int seconds = event->getSecondsElapsed();
|
||||
int minutes = seconds / 60;
|
||||
seconds -= minutes * 60;
|
||||
int hours = minutes / 60;
|
||||
minutes -= hours * 60;
|
||||
timeElapsedLabel->setText(QString::number(hours).rightJustified(2, '0') + ":" + QString::number(minutes).rightJustified(2, '0') + ":" + QString::number(seconds).rightJustified(2, '0'));
|
||||
}
|
||||
|
||||
void TabGame::newCardAdded(AbstractCardItem *card)
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ private:
|
|||
CardInfoWidget *infoPopup;
|
||||
CardInfoWidget *cardInfo;
|
||||
PlayerListWidget *playerListWidget;
|
||||
QLabel *timeElapsedLabel;
|
||||
MessageLogWidget *messageLog;
|
||||
QLabel *sayLabel;
|
||||
QLineEdit *sayEdit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue