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
a1a021c9
Commit
a1a021c9
authored
Jan 04, 2015
by
Matt Lowe
Browse files
Added timestamps to in game chat
+ added time stamps to the in game chat
parent
7476667b
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/chatview.cpp
View file @
a1a021c9
...
@@ -96,7 +96,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
...
@@ -96,7 +96,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
QTextCharFormat
timeFormat
;
QTextCharFormat
timeFormat
;
timeFormat
.
setForeground
(
Qt
::
black
);
timeFormat
.
setForeground
(
Qt
::
black
);
cursor
.
setCharFormat
(
timeFormat
);
cursor
.
setCharFormat
(
timeFormat
);
cursor
.
insertText
(
QDateTime
::
currentDateTime
().
toString
(
"[hh:mm] "
));
cursor
.
insertText
(
QDateTime
::
currentDateTime
().
toString
(
"[hh:mm
:ss
] "
));
}
}
QTextCharFormat
senderFormat
;
QTextCharFormat
senderFormat
;
...
...
cockatrice/src/messagelogwidget.cpp
View file @
a1a021c9
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include
"pb/context_move_card.pb.h"
#include
"pb/context_move_card.pb.h"
#include
"pb/context_mulligan.pb.h"
#include
"pb/context_mulligan.pb.h"
#include
<QScrollBar>
#include
<QScrollBar>
#include
<QDateTime>
QString
MessageLogWidget
::
sanitizeHtml
(
QString
dirty
)
const
QString
MessageLogWidget
::
sanitizeHtml
(
QString
dirty
)
const
{
{
...
@@ -797,7 +798,7 @@ void MessageLogWidget::logSetActivePlayer(Player *player)
...
@@ -797,7 +798,7 @@ void MessageLogWidget::logSetActivePlayer(Player *player)
str
=
tr
(
"It is now %1's turn."
,
"female"
);
str
=
tr
(
"It is now %1's turn."
,
"female"
);
else
else
str
=
tr
(
"It is now %1's turn."
,
"male"
);
str
=
tr
(
"It is now %1's turn."
,
"male"
);
appendHtml
(
"<br><font color=
\"
green
\"
><b>"
+
str
.
arg
(
player
->
getName
())
+
"</b></font><br>"
);
appendHtml
(
"<br><font color=
\"
green
\"
><b>"
+
QDateTime
::
currentDateTime
().
toString
(
"[hh:mm:ss] "
)
+
str
.
arg
(
player
->
getName
())
+
"</b></font><br>"
);
}
}
void
MessageLogWidget
::
logSetActivePhase
(
int
phase
)
void
MessageLogWidget
::
logSetActivePhase
(
int
phase
)
...
@@ -817,7 +818,7 @@ void MessageLogWidget::logSetActivePhase(int phase)
...
@@ -817,7 +818,7 @@ void MessageLogWidget::logSetActivePhase(int phase)
case
9
:
phaseName
=
tr
(
"second main phase"
);
break
;
case
9
:
phaseName
=
tr
(
"second main phase"
);
break
;
case
10
:
phaseName
=
tr
(
"ending phase"
);
break
;
case
10
:
phaseName
=
tr
(
"ending phase"
);
break
;
}
}
appendHtml
(
"<font color=
\"
green
\"
><b>"
+
tr
(
"It is now the %1."
).
arg
(
phaseName
)
+
"</b></font>"
);
appendHtml
(
"<font color=
\"
green
\"
><b>"
+
QDateTime
::
currentDateTime
().
toString
(
"[hh:mm:ss] "
)
+
tr
(
"It is now the %1."
).
arg
(
phaseName
)
+
"</b></font>"
);
}
}
void
MessageLogWidget
::
containerProcessingStarted
(
const
GameEventContext
&
_context
)
void
MessageLogWidget
::
containerProcessingStarted
(
const
GameEventContext
&
_context
)
...
@@ -876,6 +877,6 @@ void MessageLogWidget::connectToPlayer(Player *player)
...
@@ -876,6 +877,6 @@ void MessageLogWidget::connectToPlayer(Player *player)
}
}
MessageLogWidget
::
MessageLogWidget
(
const
TabSupervisor
*
_tabSupervisor
,
TabGame
*
_game
,
QWidget
*
parent
)
MessageLogWidget
::
MessageLogWidget
(
const
TabSupervisor
*
_tabSupervisor
,
TabGame
*
_game
,
QWidget
*
parent
)
:
ChatView
(
_tabSupervisor
,
_game
,
fals
e
,
parent
),
currentContext
(
MessageContext_None
)
:
ChatView
(
_tabSupervisor
,
_game
,
tru
e
,
parent
),
currentContext
(
MessageContext_None
)
{
{
}
}
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