File tree Expand file tree Collapse file tree
osu.Game/Screens/OnlinePlay/Matchmaking/Queue Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -441,15 +441,20 @@ private void onMatchmakingLobbyStatusChanged(MatchmakingLobbyStatus status) => S
441441 loadRecentMatches ( status . RecentMatches . OfType < RankedPlayRoomState > ( ) . ToArray ( ) ) . FireAndForget ( ) ;
442442 } ) ;
443443
444+ private int historyInsertOrder ;
445+
444446 private async Task loadRecentMatches ( RankedPlayRoomState [ ] matches )
445447 {
448+ // matches initial API response.
449+ const int max_panels = 50 ;
450+
446451 await userLookupCache . GetUsersAsync ( matches . SelectMany ( m => m . Users . Keys ) . ToArray ( ) ) . ConfigureAwait ( false ) ;
447452
448453 Scheduler . Add ( ( ) =>
449454 {
450455 foreach ( var match in matches )
451456 {
452- resultPanelContainer . Insert ( - resultPanelContainer . Count , new RankedPlayMatchPanel ( match )
457+ resultPanelContainer . Insert ( historyInsertOrder -- , new RankedPlayMatchPanel ( match )
453458 {
454459 RelativeSizeAxes = Axes . X ,
455460 Width = 0.48f
@@ -461,6 +466,9 @@ private async Task loadRecentMatches(RankedPlayRoomState[] matches)
461466 resultPanelContainer . LayoutDuration = 400 ;
462467 resultPanelContainer . LayoutEasing = Easing . OutQuint ;
463468 }
469+
470+ while ( resultPanelContainer . Count > max_panels )
471+ resultPanelContainer . Children . First ( ) . RemoveAndDisposeImmediately ( ) ;
464472 } ) ;
465473 }
466474
You can’t perform that action at this time.
0 commit comments