1
1
using System . Linq ;
2
2
using System . Numerics ;
3
+ using Content . Client . _Sunrise . StatsBoard ;
3
4
using Content . Client . Message ;
5
+ using Content . Shared . _Sunrise . StatsBoard ;
4
6
using Content . Shared . GameTicking ;
5
7
using Robust . Client . UserInterface . Controls ;
6
8
using Robust . Client . UserInterface . CustomControls ;
9
+ using Robust . Shared . Player ;
7
10
using Robust . Shared . Utility ;
8
11
using static Robust . Client . UserInterface . Controls . BoxContainer ;
9
12
@@ -12,14 +15,16 @@ namespace Content.Client.RoundEnd
12
15
public sealed class RoundEndSummaryWindow : DefaultWindow
13
16
{
14
17
private readonly IEntityManager _entityManager ;
18
+ private readonly ISharedPlayerManager _playerManager ;
15
19
public int RoundId ;
16
20
17
21
public RoundEndSummaryWindow ( string gm , string roundEnd , TimeSpan roundTimeSpan , int roundId ,
18
- RoundEndMessageEvent . RoundEndPlayerInfo [ ] info , IEntityManager entityManager )
22
+ RoundEndMessageEvent . RoundEndPlayerInfo [ ] info , string roundEndStats , StatisticEntry [ ] statisticEntries , IEntityManager entityManager , ISharedPlayerManager playerManager ) // Sunrise-Edit
19
23
{
20
24
_entityManager = entityManager ;
25
+ _playerManager = playerManager ; // Sunrise-Edit
21
26
22
- MinSize = SetSize = new Vector2 ( 520 , 580 ) ;
27
+ MinSize = SetSize = new Vector2 ( 700 , 600 ) ; // Sunrise-Edit
23
28
24
29
Title = Loc . GetString ( "round-end-summary-window-title" ) ;
25
30
@@ -31,6 +36,8 @@ public RoundEndSummaryWindow(string gm, string roundEnd, TimeSpan roundTimeSpan,
31
36
32
37
RoundId = roundId ;
33
38
var roundEndTabs = new TabContainer ( ) ;
39
+ roundEndTabs . AddChild ( MakeRoundEndStatsTab ( roundEndStats ) ) ; // Sunrise-End
40
+ roundEndTabs . AddChild ( MakeRoundEndMyStatsTab ( statisticEntries ) ) ; // Sunrise-End
34
41
roundEndTabs . AddChild ( MakeRoundEndSummaryTab ( gm , roundEnd , roundTimeSpan , roundId ) ) ;
35
42
roundEndTabs . AddChild ( MakePlayerManifestTab ( info ) ) ;
36
43
@@ -166,6 +173,77 @@ private BoxContainer MakePlayerManifestTab(RoundEndMessageEvent.RoundEndPlayerIn
166
173
167
174
return playerManifestTab ;
168
175
}
176
+
177
+ // Sunrise-Start
178
+ private BoxContainer MakeRoundEndStatsTab ( string stats )
179
+ {
180
+ var roundEndSummaryTab = new BoxContainer
181
+ {
182
+ Orientation = LayoutOrientation . Vertical ,
183
+ Name = Loc . GetString ( "round-end-summary-window-stats-tab-title" )
184
+ } ;
185
+
186
+ var roundEndSummaryContainerScrollbox = new ScrollContainer
187
+ {
188
+ VerticalExpand = true ,
189
+ Margin = new Thickness ( 10 )
190
+ } ;
191
+ var roundEndSummaryContainer = new BoxContainer
192
+ {
193
+ Orientation = LayoutOrientation . Vertical
194
+ } ;
195
+
196
+ //Round end text
197
+ if ( ! string . IsNullOrEmpty ( stats ) )
198
+ {
199
+ var statsLabel = new RichTextLabel ( ) ;
200
+ statsLabel . SetMarkup ( stats ) ;
201
+ roundEndSummaryContainer . AddChild ( statsLabel ) ;
202
+ }
203
+
204
+ roundEndSummaryContainerScrollbox . AddChild ( roundEndSummaryContainer ) ;
205
+ roundEndSummaryTab . AddChild ( roundEndSummaryContainerScrollbox ) ;
206
+
207
+ return roundEndSummaryTab ;
208
+ }
209
+
210
+ private BoxContainer MakeRoundEndMyStatsTab ( StatisticEntry [ ] statisticEntries )
211
+ {
212
+ var roundEndSummaryTab = new BoxContainer
213
+ {
214
+ Orientation = LayoutOrientation . Vertical ,
215
+ Name = Loc . GetString ( "round-end-summary-window-my-stats-tab-title" )
216
+ } ;
217
+
218
+ var roundEndSummaryContainerScrollbox = new ScrollContainer
219
+ {
220
+ VerticalExpand = true ,
221
+ Margin = new Thickness ( 10 ) ,
222
+ } ;
223
+
224
+ var statsEntries = new StatsEntries ( ) ;
225
+ foreach ( var statisticEntry in statisticEntries )
226
+ {
227
+ if ( statisticEntry . FirstActor != _playerManager . LocalSession ! . UserId )
228
+ continue ;
229
+
230
+ var statsEntry = new StatsEntry ( statisticEntry . Name , statisticEntry . TotalTakeDamage ,
231
+ statisticEntry . TotalTakeHeal , statisticEntry . TotalInflictedDamage ,
232
+ statisticEntry . TotalInflictedHeal , statisticEntry . SlippedCount ,
233
+ statisticEntry . CreamedCount , statisticEntry . DoorEmagedCount , statisticEntry . ElectrocutedCount ,
234
+ statisticEntry . CuffedCount , statisticEntry . AbsorbedPuddleCount , statisticEntry . SpentTk ?? 0 ,
235
+ statisticEntry . DeadCount , statisticEntry . HumanoidKillCount , statisticEntry . KilledMouseCount ,
236
+ statisticEntry . CuffedTime , statisticEntry . SpaceTime , statisticEntry . SleepTime ,
237
+ statisticEntry . IsInteractedCaptainCard ? "Да" : "Нет" ) ;
238
+ statsEntries . AddEntry ( statsEntry ) ;
239
+ }
240
+
241
+ roundEndSummaryContainerScrollbox . AddChild ( statsEntries ) ;
242
+ roundEndSummaryTab . AddChild ( roundEndSummaryContainerScrollbox ) ;
243
+
244
+ return roundEndSummaryTab ;
245
+ }
246
+ // Sunrise-End
169
247
}
170
248
171
249
}
0 commit comments