inital change

This commit is contained in:
Lily 2025-03-11 15:32:23 -04:00
parent 5238087ddf
commit 70a35e1dab
No known key found for this signature in database
GPG key ID: D916CEDDF4F93CE7
4 changed files with 27 additions and 388 deletions

View file

@ -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)));

View file

@ -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;
}

View file

@ -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