mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
* [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>
157 lines
4 KiB
C++
157 lines
4 KiB
C++
#include "chat_settings.h"
|
|
|
|
ChatSettings::ChatSettings(const QString &settingPath, QObject *parent)
|
|
: SettingsManager(settingPath + "chat.ini", "chat", QString(), parent)
|
|
{
|
|
}
|
|
|
|
bool ChatSettings::getChatMention() const
|
|
{
|
|
return getValue("mention", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
bool ChatSettings::getChatMentionCompleter() const
|
|
{
|
|
return getValue("mentionCompleter", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
QString ChatSettings::getChatMentionColor() const
|
|
{
|
|
return getValue("mentionColor", QString(), QString(), "A6120D").toString();
|
|
}
|
|
|
|
QString ChatSettings::getChatHighlightColor() const
|
|
{
|
|
return getValue("highlightColor", QString(), QString(), "A6120D").toString();
|
|
}
|
|
|
|
bool ChatSettings::getChatMentionForeground() const
|
|
{
|
|
return getValue("mentionForeground", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
bool ChatSettings::getChatHighlightForeground() const
|
|
{
|
|
return getValue("highlightForeground", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
bool ChatSettings::getIgnoreUnregisteredUsers() const
|
|
{
|
|
return getValue("ignoreUnregistered").toBool();
|
|
}
|
|
|
|
bool ChatSettings::getIgnoreUnregisteredUserMessages() const
|
|
{
|
|
return getValue("ignoreUnregisteredMessages").toBool();
|
|
}
|
|
|
|
bool ChatSettings::getIgnoreNonBuddyUserMessages() const
|
|
{
|
|
return getValue("ignoreNonBuddyMessages").toBool();
|
|
}
|
|
|
|
bool ChatSettings::getShowMessagePopup() const
|
|
{
|
|
return getValue("showMessagePopups", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
bool ChatSettings::getShowMentionPopup() const
|
|
{
|
|
return getValue("showMentionPopups", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
bool ChatSettings::getRoomHistory() const
|
|
{
|
|
return getValue("roomHistory", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
void ChatSettings::setChatMention(bool _chatMention)
|
|
{
|
|
setValue(_chatMention, "mention");
|
|
}
|
|
|
|
void ChatSettings::setChatMentionCompleter(bool _chatMentionCompleter)
|
|
{
|
|
setValue(_chatMentionCompleter, "mentionCompleter");
|
|
emit chatMentionCompleterChanged();
|
|
}
|
|
|
|
void ChatSettings::setChatMentionColor(const QString &_chatMentionColor)
|
|
{
|
|
setValue(_chatMentionColor, "mentionColor");
|
|
}
|
|
|
|
void ChatSettings::setChatHighlightColor(const QString &_chatHighlightColor)
|
|
{
|
|
setValue(_chatHighlightColor, "highlightColor");
|
|
}
|
|
|
|
void ChatSettings::setChatMentionForeground(bool _chatMentionForeground)
|
|
{
|
|
setValue(_chatMentionForeground, "mentionForeground");
|
|
}
|
|
|
|
void ChatSettings::setChatHighlightForeground(bool _chatHighlightForeground)
|
|
{
|
|
setValue(_chatHighlightForeground, "highlightForeground");
|
|
}
|
|
|
|
void ChatSettings::setIgnoreUnregisteredUsers(bool _ignoreUnregisteredUsers)
|
|
{
|
|
setValue(_ignoreUnregisteredUsers, "ignoreUnregistered");
|
|
}
|
|
|
|
void ChatSettings::setIgnoreUnregisteredUserMessages(bool _ignoreUnregisteredUserMessages)
|
|
{
|
|
setValue(_ignoreUnregisteredUserMessages, "ignoreUnregisteredMessages");
|
|
}
|
|
|
|
void ChatSettings::setIgnoreNonBuddyUserMessages(bool _ignoreNonBuddyUserMessages)
|
|
{
|
|
setValue(_ignoreNonBuddyUserMessages, "ignoreNonBuddyMessages");
|
|
}
|
|
|
|
void ChatSettings::setShowMessagePopups(bool _showMessagePopups)
|
|
{
|
|
setValue(_showMessagePopups, "showMessagePopups");
|
|
}
|
|
|
|
void ChatSettings::setShowMentionPopups(bool _showMentionPopups)
|
|
{
|
|
setValue(_showMentionPopups, "showMentionPopups");
|
|
}
|
|
|
|
void ChatSettings::setRoomHistory(bool _roomHistory)
|
|
{
|
|
setValue(_roomHistory, "roomHistory");
|
|
}
|
|
|
|
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");
|
|
}
|