-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
289 lines (275 loc) · 23.5 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<Window x:Class="zxeltor.StoCombat.Realtime.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:zxeltor.StoCombat.Realtime.Controls"
xmlns:properties="clr-namespace:zxeltor.StoCombat.Realtime.Properties"
xmlns:classes="clr-namespace:zxeltor.StoCombat.Realtime.Classes"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type={x:Type classes:RealtimeCombatLogMonitor}}"
Title="MainWindow" MinHeight="300" MinWidth="440" Height="700" Width="700" d:DesignHeight="600" Name="uiMainWindow" WindowStartupLocation="CenterScreen">
<Window.Resources>
<ResourceDictionary Source="Styles/StoCombatResourceDictionary.xaml"></ResourceDictionary>
</Window.Resources>
<Grid>
<TabControl>
<TabItem Header="Monitor">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Margin="4,4,4,4" Grid.Row="0" HorizontalAlignment="Left">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="6">
<TextBlock Text="Running:" Margin="0,0,4,0" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=IsRunning}" TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="6">
<TextBlock Text="Latest File:" Margin="0,0,4,0" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=LatestFileName}" TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"
Visibility="{Binding Path=IsTestMode, Converter={StaticResource typeToVisibilityConverterInverted}}"></TextBlock>
<TextBlock Text="Test Mode" Visibility="{Binding Path=IsTestMode, Converter={StaticResource typeToVisibilityConverter}}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="6"
Visibility="{Binding Path=IsTestMode, Converter={StaticResource typeToVisibilityConverterInverted}}">
<TextBlock Text="File Last Updated:" Margin="0,0,4,0" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=LatestFileUpdated, Converter={StaticResource dateTimeToExtendedDateStringConverter}}"
TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="6"
Visibility="{Binding Path=IsTestMode, Converter={StaticResource typeToVisibilityConverter}}">
<TextBlock Text="Last Test Elapsed:" Margin="0,0,4,0" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=LastTestElapsedTime}"
TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
</Grid>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="0" Margin="4,4,4,4">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Name="uiButtonStart" HorizontalAlignment="Left" Margin="16,0,0,0" Padding="2,2,2,2" VerticalAlignment="Top"
Height="18" ToolTip="Start the real-time parser" Click="UiButtonStart_OnClick">
<Image Source="Images/glyphicons-174-play.png"></Image>
</Button>
<Button Name="uiButtonEnd" HorizontalAlignment="Left" Margin="8,0,0,0" Padding="2,2,2,2" VerticalAlignment="Top"
Height="18" ToolTip="Stop the real-time parser" Click="UiButtonEnd_OnClick">
<Image Source="Images/glyphicons-176-stop.png"></Image>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,0">
<Button Name="uiButtonDisplayOverlay" Height="18" ToolTip="Show overlay"
Click="UiButtonDisplayOverlay_OnClick">
<Image Source="Images/glyphicons-87-display.png"></Image>
</Button>
<Button Name="uiButtonRefreshCombat" Height="18" Margin="8,0,0,0" ToolTip="Clear combat grid"
Click="UiButtonRefreshCombat_OnClick">
<Image Source="Images/glyphicons-82-refresh.png"></Image>
</Button>
</StackPanel>
</StackPanel>
<WrapPanel Orientation="Horizontal" Grid.Row="1" Margin="4,4,4,4"
Visibility="{Binding Source={x:Static classes:StoCombatRealtimeSettings.Instance}, Path=IsDisplayToolsTab, Converter={StaticResource typeToVisibilityConverter}}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Lines read: " Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=LinesLastReadCount}" TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="8,0,0,0">
<TextBlock Text="Events added: " Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=EventsLastAddCount}" TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="8,0,0,0">
<TextBlock Text="Parsing Errors: " Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=ErrorsCountSinceNewCombat}" TextWrapping="Wrap" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
</WrapPanel>
<FrameworkElement Name="frameworkElementMetricsOverlayWindowContext" Grid.Row="2" Visibility="Collapsed"
DataContext="{x:Static classes:StoCombatRealtimeSettings.Instance}"/>
<GroupBox Grid.Row="2">
<GroupBox.Header>
<WrapPanel Orientation="Horizontal">
<TextBlock Text="Combat Grid:" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<StackPanel Orientation="Horizontal" Margin="4,0,0,0"
Visibility="{Binding Path=CurrentRealtimeCombat, Converter={StaticResource typeToVisibilityConverter}}">
<TextBlock Text="Events=" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=CurrentRealtimeCombat.EventsCount}" Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0,0,0"
Visibility="{Binding Path=CurrentRealtimeCombat, Converter={StaticResource typeToVisibilityConverter}}">
<TextBlock Text="Start=" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=CurrentRealtimeCombat.CombatStart, Converter={StaticResource dateTimeToExtendedDateStringConverter}}"
Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0,0,0"
Visibility="{Binding Path=CurrentRealtimeCombat, Converter={StaticResource typeToVisibilityConverter}}">
<TextBlock Text="Duration=" Foreground="{StaticResource colorEventTypeMetricLabel}"></TextBlock>
<TextBlock Text="{Binding Path=CurrentRealtimeCombat.CombatDuration, ConverterParameter={StaticResource timeSpanMinSeconds}}"
Foreground="{StaticResource colorEventTypeMetricValue}"></TextBlock>
</StackPanel>
</WrapPanel>
</GroupBox.Header>
<DataGrid Margin="2,2,2,2" CanUserAddRows="False" IsReadOnly="True" CanUserDeleteRows="False"
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
ItemsSource="{Binding Path=CurrentRealtimeCombat.PlayerEntitiesOrderByName}"
CanUserResizeRows="False" CanUserReorderColumns="True" CanUserResizeColumns="True"
CanUserSortColumns="True" AutoGenerateColumns="False">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding IsInCombat}" Value="True">
<Setter Property="Foreground" Value="{StaticResource colorEventTypeMetricValue}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsInCombat}" Value="False">
<Setter Property="Foreground" Value="{StaticResource colorRejectedReason}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=OwnerDisplay}" IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Name" />
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityTotalMagnitude, Converter={StaticResource doubleToThousandsStringConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayDamage, Mode=TwoWay}"
ToolTip="Display Damage in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="Damage" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityMaxMagnitude, Converter={StaticResource doubleToThousandsStringConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayMaxDamage, Mode=TwoWay}"
ToolTip="Display MaxDamage in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="Max Damage" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityMagnitudePerSecond, Converter={StaticResource doubleToThousandsStringConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayDps, Mode=TwoWay}"
ToolTip="Display DPS in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="DPS" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityCombatAttacks}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayAttacks, Mode=TwoWay}"
ToolTip="Display Attacks in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="Attacks" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityCombatKills}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayKills, Mode=TwoWay}"
ToolTip="Display Kills in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="Kills" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityCombatStart, Converter={StaticResource dateTimeToHoursMinutesSecondsMilliSecondsConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayStart, Mode=TwoWay}"
ToolTip="Display StarTime in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="Start" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityCombatEnd, Converter={StaticResource dateTimeToHoursMinutesSecondsMilliSecondsConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext}, Path=DataContext.MetricsOverlayWindowContext.DisplayEnd, Mode=TwoWay}"
ToolTip="Display EndTime in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="End" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityCombatDuration, Converter={StaticResource combatTimeSpanToShortStringConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext},
Path=DataContext.MetricsOverlayWindowContext.DisplayDuration, Mode=TwoWay}"
ToolTip="Display Duration in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="Duration" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=EntityCombatInActive, Converter={StaticResource combatTimeSpanToShortStringConverter}}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Source={x:Reference frameworkElementMetricsOverlayWindowContext},
Path=DataContext.MetricsOverlayWindowContext.DisplayInActive, Mode=TwoWay}"
ToolTip="Display InActiveTime in the overlay grid" VerticalAlignment="Center" />
<TextBlock Text="InActive" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Notifications"></TextBlock>
<Image Margin="4,0,0,0" Height="14"
Visibility="{Binding ElementName=uiLogControl, Path=MyContext.HighestResultLevel, Converter={StaticResource typeToVisibilityConverter}}"
Source="{Binding ElementName=uiLogControl, Path=MyContext.HighestResultLevel, Converter={StaticResource resultLevelImageSourceConverter}}">
</Image>
<TextBlock Text="{Binding ElementName=uiLogControl, Path=MyContext.LogGridRows.Count}" Margin="4,0,0,0"
Visibility="{Binding ElementName=uiLogControl, Path=MyContext.HighestResultLevel, Converter={StaticResource typeToVisibilityConverter}}"></TextBlock>
</StackPanel>
</TabItem.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<controls:LogControl x:Name="uiLogControl" Grid.Row="1"></controls:LogControl>
</Grid>
</TabItem>
<TabItem Header="Settings">
<controls:SettingsControl></controls:SettingsControl>
</TabItem>
<TabItem Header="Tools" Visibility="{Binding Source={x:Static classes:StoCombatRealtimeSettings.Instance}, Path=IsDisplayToolsTab, Converter={StaticResource typeToVisibilityConverter}}">
<controls:TestControl></controls:TestControl>
</TabItem>
</TabControl>
</Grid>
</Window>