mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 10:33:54 -07:00
Fix game phases not being translated in game log (#5798)
This commit is contained in:
parent
86418f1728
commit
7a493910d3
3 changed files with 18 additions and 6 deletions
|
|
@ -1,8 +1,16 @@
|
||||||
#include "phase.h"
|
#include "phase.h"
|
||||||
|
|
||||||
Phase::Phase(const char *_name, QString _color, QString _soundFileName) : color(_color), soundFileName(_soundFileName)
|
Phase::Phase(const QString &_name, const QString &_color, const QString &_soundFileName)
|
||||||
|
: name(_name), color(_color), soundFileName(_soundFileName)
|
||||||
{
|
{
|
||||||
name = tr(_name);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The translated name for the phase
|
||||||
|
*/
|
||||||
|
QString Phase::getName() const
|
||||||
|
{
|
||||||
|
return tr(name.toUtf8().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
Phase Phases::getPhase(int phase)
|
Phase Phases::getPhase(int phase)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
#ifndef PHASE_H
|
#ifndef PHASE_H
|
||||||
#define PHASE_H
|
#define PHASE_H
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtCore>
|
|
||||||
|
|
||||||
class Phase
|
class Phase
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(Phase)
|
Q_DECLARE_TR_FUNCTIONS(Phase)
|
||||||
|
|
||||||
|
QString name;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString name, color, soundFileName;
|
QString color, soundFileName;
|
||||||
Phase(const char *_name, QString _color, QString _soundFileName);
|
Phase(const QString &_name, const QString &_color, const QString &_soundFileName);
|
||||||
|
|
||||||
|
QString getName() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Phases
|
struct Phases
|
||||||
|
|
|
||||||
|
|
@ -616,7 +616,7 @@ void MessageLogWidget::logSetActivePhase(int phaseNumber)
|
||||||
soundEngine->playSound(phase.soundFileName);
|
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>");
|
phase.getName() + "</b></font>");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageLogWidget::logSetActivePlayer(Player *player)
|
void MessageLogWidget::logSetActivePlayer(Player *player)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue