mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
inital change
This commit is contained in:
parent
5238087ddf
commit
70a35e1dab
4 changed files with 27 additions and 388 deletions
|
|
@ -1681,7 +1681,7 @@ void TabGame::createPlayerListDock(bool bReplay)
|
|||
|
||||
void TabGame::createMessageDock(bool bReplay)
|
||||
{
|
||||
messageLog = new MessageLogWidget(tabSupervisor, this);
|
||||
messageLog = new MessageLogWidget(tabSupervisor, this, &secondsElapsed);
|
||||
connect(messageLog, SIGNAL(cardNameHovered(QString)), cardInfoFrameWidget, SLOT(setCard(QString)));
|
||||
connect(messageLog, &MessageLogWidget::showCardInfoPopup, this, &TabGame::showCardInfoPopup);
|
||||
connect(messageLog, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString)));
|
||||
|
|
|
|||
|
|
@ -12,6 +12,18 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
const QString MessageLogWidget::getCurrentTime()
|
||||
{
|
||||
int seconds = *elapsedSeconds;
|
||||
int minutes = seconds / 60;
|
||||
seconds -= minutes * 60;
|
||||
int hours = minutes / 60;
|
||||
minutes -= hours * 60;
|
||||
return QString("[%1:%2:%3] ").arg(QString::number(hours).rightJustified(2, '0'))
|
||||
.arg(QString::number(minutes).rightJustified(2, '0'))
|
||||
.arg(QString::number(seconds).rightJustified(2, '0'));
|
||||
}
|
||||
|
||||
const QString &MessageLogWidget::tableConstant() const
|
||||
{
|
||||
static const QString constant("table");
|
||||
|
|
@ -615,13 +627,17 @@ void MessageLogWidget::logSetActivePhase(int phaseNumber)
|
|||
|
||||
soundEngine->playSound(phase.soundFileName);
|
||||
|
||||
appendHtml("<font color=\"" + phase.color + "\"><b>" + QDateTime::currentDateTime().toString("[hh:mm:ss] ") +
|
||||
//appendHtml("<font color=\"" + phase.color + "\"><b>" + QDateTime::currentDateTime().toString("[hh:mm:ss] ") +
|
||||
// phase.name + "</b></font>");
|
||||
appendHtml("<font color=\"" + phase.color + "\"><b>" + getCurrentTime() +
|
||||
phase.name + "</b></font>");
|
||||
}
|
||||
|
||||
void MessageLogWidget::logSetActivePlayer(Player *player)
|
||||
{
|
||||
appendHtml("<br><font color=\"green\"><b>" + QDateTime::currentDateTime().toString("[hh:mm:ss] ") +
|
||||
//appendHtml("<br><font color=\"green\"><b>" + QDateTime::currentDateTime().toString("[hh:mm:ss] ") +
|
||||
// QString(tr("%1's turn.")).arg(player->getName()) + "</b></font><br>");
|
||||
appendHtml("<br><font color=\"green\"><b>" + getCurrentTime() +
|
||||
QString(tr("%1's turn.")).arg(player->getName()) + "</b></font><br>");
|
||||
}
|
||||
|
||||
|
|
@ -858,7 +874,9 @@ void MessageLogWidget::connectToPlayer(Player *player)
|
|||
SLOT(logAlwaysLookAtTopCard(Player *, CardZone *, bool)));
|
||||
}
|
||||
|
||||
MessageLogWidget::MessageLogWidget(TabSupervisor *_tabSupervisor, TabGame *_game, QWidget *parent)
|
||||
: ChatView(_tabSupervisor, _game, true, parent), mulliganNumber(0), currentContext(MessageContext_None)
|
||||
MessageLogWidget::MessageLogWidget(TabSupervisor *_tabSupervisor, TabGame *_game, int *seconds, QWidget *parent)
|
||||
: ChatView(_tabSupervisor, _game, true,seconds, parent), mulliganNumber(0), currentContext(MessageContext_None)
|
||||
{
|
||||
elapsedSeconds = seconds;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ private:
|
|||
Player *mulliganPlayer;
|
||||
MessageContext currentContext;
|
||||
QString messagePrefix, messageSuffix;
|
||||
int *elapsedSeconds;
|
||||
|
||||
const QString getCurrentTime();
|
||||
const QString &tableConstant() const;
|
||||
const QString &graveyardConstant() const;
|
||||
const QString &exileConstant() const;
|
||||
|
|
@ -102,7 +104,7 @@ public slots:
|
|||
|
||||
public:
|
||||
void connectToPlayer(Player *player);
|
||||
MessageLogWidget(TabSupervisor *_tabSupervisor, TabGame *_game, QWidget *parent = nullptr);
|
||||
MessageLogWidget(TabSupervisor *_tabSupervisor, TabGame *_game, int* elapsedSeconds, QWidget *parent = nullptr);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue