mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-27 16:32:20 -07:00
[Game] Move formatElapsedTime helper out of public slots (#2202)
The message log needs the HH:MM:SS formatter used by the game timer, but it lives in GameState's public slots, tying a pure formatting helper to the signal-slot machinery. Move formatElapsedTime into a public section of GameState so the log can call it directly, and add the missing trailing newline to game_state.cpp.
This commit is contained in:
parent
9dac371ead
commit
bd7190f03c
2 changed files with 3 additions and 1 deletions
|
|
@ -42,4 +42,4 @@ QString GameState::formatElapsedTime(int _secondsElapsed)
|
||||||
|
|
||||||
return QString::number(hours).rightJustified(2, '0') + ":" + QString::number(minutes).rightJustified(2, '0') + ":" +
|
return QString::number(hours).rightJustified(2, '0') + ":" + QString::number(minutes).rightJustified(2, '0') + ":" +
|
||||||
QString::number(seconds).rightJustified(2, '0');
|
QString::number(seconds).rightJustified(2, '0');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,8 @@ signals:
|
||||||
public slots:
|
public slots:
|
||||||
void incrementGameTime();
|
void incrementGameTime();
|
||||||
void setGameTime(int _secondsElapsed);
|
void setGameTime(int _secondsElapsed);
|
||||||
|
|
||||||
|
public:
|
||||||
static QString formatElapsedTime(int _secondsElapsed);
|
static QString formatElapsedTime(int _secondsElapsed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue