mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
SoundEngine overhaul
This commit is contained in:
parent
311536d1aa
commit
d6398477ae
16 changed files with 128 additions and 81 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "pixmapgenerator.h"
|
||||
#include "settingscache.h"
|
||||
#include "tab_userlists.h"
|
||||
#include "soundengine.h"
|
||||
|
||||
const QColor DEFAULT_MENTION_COLOR = QColor(194, 31, 47);
|
||||
const QColor OTHER_USER_COLOR = QColor(0, 65, 255); // dark blue
|
||||
|
|
@ -276,6 +277,7 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
|
|||
if (userName.toLower() == fullMentionUpToSpaceOrEnd.toLower()) // Is this user you?
|
||||
{
|
||||
// You have received a valid mention!!
|
||||
soundEngine->playSound("chat_mention");
|
||||
mentionFormat.setBackground(QBrush(getCustomMentionColor()));
|
||||
mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white) : QBrush(Qt::black));
|
||||
cursor.insertText(mention, mentionFormat);
|
||||
|
|
@ -301,6 +303,7 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
|
|||
|
||||
if (isModeratorSendingGlobal(userLevel, fullMentionUpToSpaceOrEnd)) {
|
||||
// Moderator Sending Global Message
|
||||
soundEngine->playSound("all_mention");
|
||||
mentionFormat.setBackground(QBrush(getCustomMentionColor()));
|
||||
mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white) : QBrush(Qt::black));
|
||||
cursor.insertText("@" + fullMentionUpToSpaceOrEnd, mentionFormat);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue