[Client] Add option to use game time in game log timestamps (#7265)

* [Client] Add option to use game time in game log timestamps (#2202)

Game log timestamps showed the local clock time, which is meaningless in
a replay or in a log read after the fact — nobody can tell when a play
happened relative to the game.

Add a "Use game time instead of local time in game logs" setting. When
enabled, the message log stamps entries with the elapsed game time
(HH:MM:SS since the game started); regular chat views keep the local
clock.

* [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.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-02 17:30:48 +02:00 • committed by GitHub
parent ffcb9094ca
commit 750d5b3c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 68 additions and 12 deletions

View file

@ -70,6 +70,11 @@ bool ChatSettings::getIgnoreAllPrivateMessages() const
return getValue("ignoreAllPrivateMessages", QString(), QString(), false).toBool();
}
bool ChatSettings::getUseGameTime() const
{
return getValue("useGameTime", QString(), QString(), false).toBool();
}
QString ChatSettings::getHighlightWords() const
{
return getValue("highlightWords").toString();
@ -141,6 +146,11 @@ void ChatSettings::setIgnoreAllPrivateMessages(bool _ignoreAllPrivateMessages)
setValue(_ignoreAllPrivateMessages, "ignoreAllPrivateMessages");
}
void ChatSettings::setUseGameTime(bool _useGameTime)
{
setValue(_useGameTime, "useGameTime");
}
void ChatSettings::setHighlightWords(const QString &_highlightWords)
{
setValue(_highlightWords, "highlightWords");

View file

@ -24,6 +24,7 @@ public:
[[nodiscard]] bool getShowMentionPopup() const override;
[[nodiscard]] bool getRoomHistory() const override;
[[nodiscard]] bool getIgnoreAllPrivateMessages() const override;
[[nodiscard]] bool getUseGameTime() const override;
[[nodiscard]] QString getHighlightWords() const override;
void setChatMention(bool _chatMention);
@ -39,6 +40,7 @@ public:
void setShowMentionPopups(bool _showMentionPopups);
void setRoomHistory(bool _roomHistory);
void setIgnoreAllPrivateMessages(bool _ignoreAllPrivateMessages);
void setUseGameTime(bool _useGameTime);
void setHighlightWords(const QString &_highlightWords);
signals: