diff --git a/Core/Core.csproj b/Core/Core.csproj
index e86e518b4..ef4e0de09 100644
--- a/Core/Core.csproj
+++ b/Core/Core.csproj
@@ -87,6 +87,7 @@
+
diff --git a/Core/Models/Demo.cs b/Core/Models/Demo.cs
index 737de0f30..34bcef24b 100644
--- a/Core/Models/Demo.cs
+++ b/Core/Models/Demo.cs
@@ -416,7 +416,7 @@ public class Demo : ObservableObject
///
/// Contains text messages from game chat
///
- private List _chatMessageList;
+ private List _chatMessages;
#endregion
@@ -539,7 +539,8 @@ public string Path
public int CheaterCount
{
get { return _cheaterCounter; }
- set {
+ set
+ {
Set(() => CheaterCount, ref _cheaterCounter, value);
RaisePropertyChanged(() => HasCheater);
}
@@ -1045,10 +1046,10 @@ public decimal AverageEseaRws
}
[JsonProperty("chat_messages")]
- public List ChatMessageList
+ public List ChatMessages
{
- get { return _chatMessageList; }
- set { Set(() => ChatMessageList, ref _chatMessageList, value); }
+ get { return _chatMessages; }
+ set { Set(() => ChatMessages, ref _chatMessages, value); }
}
#endregion
@@ -1069,7 +1070,7 @@ public Demo()
BombDefused = new Collection();
PlayerBlinded = new Collection();
Overtimes = new Collection();
- ChatMessageList = new List();
+ ChatMessages = new List();
_teamCt = new Team
{
@@ -1172,7 +1173,7 @@ public Demo Copy()
BombPlanted = new Collection(),
MolotovsFireStarted = new Collection(),
IncendiariesFireStarted = new Collection(),
- ChatMessageList = new List(),
+ ChatMessages = new List(),
PlayersHurted = new Collection(),
Kills = new Collection(),
PlayerBlinded = new Collection(),
@@ -1206,9 +1207,9 @@ public Demo Copy()
demo.BombExploded.Add(e);
}
- foreach (string msg in ChatMessageList)
+ foreach (ChatMessage msg in ChatMessages)
{
- demo.ChatMessageList.Add(msg);
+ demo.ChatMessages.Add(msg);
}
foreach (DecoyStartedEvent e in DecoyStarted)
@@ -1464,7 +1465,7 @@ public void ResetStats(bool resetTeams = true)
BombDefused.Clear();
BombExploded.Clear();
BombPlanted.Clear();
- ChatMessageList.Clear();
+ ChatMessages.Clear();
DecoyStarted.Clear();
IncendiariesFireStarted.Clear();
Kills.Clear();
diff --git a/Core/Models/Events/ChatMessage.cs b/Core/Models/Events/ChatMessage.cs
new file mode 100644
index 000000000..8171ca9fe
--- /dev/null
+++ b/Core/Models/Events/ChatMessage.cs
@@ -0,0 +1,30 @@
+using Core.Models.Serialization;
+using Newtonsoft.Json;
+
+namespace Core.Models.Events
+{
+ public class ChatMessage : BaseEvent
+ {
+ [JsonProperty("sender_steamid")]
+ [JsonConverter(typeof(LongToStringConverter))]
+ public long SenderSteamId { get; set; }
+
+ [JsonProperty("sender_name")]
+ public string SenderName { get; set; }
+
+ [JsonProperty("sender_side")]
+ public Side SenderSide { get; set; }
+
+ [JsonProperty("is_sender_alive")]
+ public bool IsSenderAlive { get; set; }
+
+ [JsonProperty("text")]
+ public string Text { get; set; }
+
+
+ public ChatMessage(int tick, float seconds)
+ : base(tick, seconds)
+ {
+ }
+ }
+}
diff --git a/Manager/Converters/SecondsToTimerConverter.cs b/Manager/Converters/SecondsToTimerConverter.cs
new file mode 100644
index 000000000..e906c2381
--- /dev/null
+++ b/Manager/Converters/SecondsToTimerConverter.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Manager.Converters
+{
+ public class SecondsToTimerConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ float totalSeconds = value as float? ?? 0;
+ double minutes = Math.Floor(totalSeconds / 60 % 60);
+ double seconds = Math.Floor(totalSeconds % 60);
+
+ return $"{FormatValue(minutes)}:{FormatValue(seconds)}";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+
+ private static string FormatValue(double value)
+ {
+ return value.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0');
+ }
+ }
+}
diff --git a/Manager/Internals/Navigation.cs b/Manager/Internals/Navigation.cs
index 1f919c30e..584d631a1 100644
--- a/Manager/Internals/Navigation.cs
+++ b/Manager/Internals/Navigation.cs
@@ -51,7 +51,7 @@ public static void ShowPlayerDetails(Demo demo, Player player)
public static void ShowDemoHeatmap(Demo demo)
{
new ViewModelLocator().DemoHeatmap.Demo = demo;
-
+
ShowPage(new DemoHeatmapView());
}
@@ -76,6 +76,13 @@ public static void ShowDemoDamages(Demo demo)
ShowPage(new DemoDamagesView());
}
+ public static void ShowDemoChat(Demo demo)
+ {
+ new ViewModelLocator().DemoChat.Demo = demo;
+
+ ShowPage(new DemoChatView());
+ }
+
public static void ShowDemoFlashbangs(Demo demo)
{
new ViewModelLocator().DemoFlashbangs.Demo = demo;
diff --git a/Manager/Manager.csproj b/Manager/Manager.csproj
index 46f12e29f..d7348ea05 100644
--- a/Manager/Manager.csproj
+++ b/Manager/Manager.csproj
@@ -178,6 +178,7 @@
+
@@ -231,6 +232,7 @@
+
@@ -241,6 +243,9 @@
+
+ DemoChatView.xaml
+
DemoFlashbangsView.xaml
@@ -332,6 +337,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/Manager/MultilingualResources/Manager.ar.xlf b/Manager/MultilingualResources/Manager.ar.xlf
index cb1084126..59748b3fc 100644
--- a/Manager/MultilingualResources/Manager.ar.xlf
+++ b/Manager/MultilingualResources/Manager.ar.xlf
@@ -3314,14 +3314,6 @@ Message Error :
Export chat
-
-
- Chat messages file has been created.
-
-
-
- No chat messages found. (It only works for demos coming from a server that has "tv_relaytextchat" set to a value different from "0" which is not the case for Valve matchmaking).
-
No {0} found for this selection.
@@ -4223,6 +4215,14 @@ Please update it by clicking on the "Update" button.
KAST
+
+
+ Chat
+
+
+
+ Chat
+