Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
5df7f613
Commit
5df7f613
authored
Mar 06, 2015
by
Zach
Browse files
Merge pull request #800 from poixen/dice_roll
Changed color of server maessges in-game
parents
5f05c0be
71e794c0
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/chatview.cpp
View file @
5df7f613
...
...
@@ -15,6 +15,7 @@
const
QColor
DEFAULT_MENTION_COLOR
=
QColor
(
194
,
31
,
47
);
const
QColor
OTHER_USER_COLOR
=
QColor
(
0
,
65
,
255
);
// dark blue
const
QString
SERVER_MESSAGE_COLOR
=
"#851515"
;
ChatView
::
ChatView
(
const
TabSupervisor
*
_tabSupervisor
,
TabGame
*
_game
,
bool
_showTimestamps
,
QWidget
*
parent
)
:
QTextBrowser
(
parent
),
tabSupervisor
(
_tabSupervisor
),
game
(
_game
),
evenNumber
(
true
),
showTimestamps
(
_showTimestamps
),
hoveredItemType
(
HoveredNothing
)
...
...
@@ -73,6 +74,14 @@ void ChatView::appendHtml(const QString &html)
verticalScrollBar
()
->
setValue
(
verticalScrollBar
()
->
maximum
());
}
void
ChatView
::
appendHtmlServerMessage
(
const
QString
&
html
)
{
bool
atBottom
=
verticalScrollBar
()
->
value
()
>=
verticalScrollBar
()
->
maximum
();
prepareBlock
().
insertHtml
(
"<font color="
+
SERVER_MESSAGE_COLOR
+
">"
+
html
+
"</font>"
);
if
(
atBottom
)
verticalScrollBar
()
->
setValue
(
verticalScrollBar
()
->
maximum
());
}
void
ChatView
::
appendCardTag
(
QTextCursor
&
cursor
,
const
QString
&
cardName
)
{
QTextCharFormat
oldFormat
=
cursor
.
charFormat
();
...
...
cockatrice/src/chatview.h
View file @
5df7f613
...
...
@@ -44,6 +44,7 @@ public:
ChatView
(
const
TabSupervisor
*
_tabSupervisor
,
TabGame
*
_game
,
bool
_showTimestamps
,
QWidget
*
parent
=
0
);
void
retranslateUi
();
void
appendHtml
(
const
QString
&
html
);
void
appendHtmlServerMessage
(
const
QString
&
html
);
void
appendMessage
(
QString
message
,
QString
sender
=
QString
(),
UserLevelFlags
userLevel
=
UserLevelFlags
(),
bool
playerBold
=
false
);
void
clearChat
();
protected:
...
...
cockatrice/src/messagelogwidget.cpp
View file @
5df7f613
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment