Skip to content

Commit cb33306

Browse files
fix: storyboard visibility (don't fade bg when storyboard replaces), playlist ordering (correct PlaylistOrder in addItem)
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/50f21814-b4f6-4233-9cb0-428fd2329135 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent e48d801 commit cb33306

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ protected override void UpdateVisuals()
197197

198198
Background?.BlurTo(blurTarget, BACKGROUND_FADE_DURATION, Easing.OutQuint);
199199

200-
// When the background is fully dimmed to black there is no visual contribution,
201-
// so fade the content to alpha=0. This makes the framework skip the entire
202-
// background draw subtree (IsPresent=false), saving GPU fill rate every frame.
200+
// When the background is fully dimmed to black (and not replaced by a storyboard)
201+
// there is no visual contribution, so fade the content to alpha=0. This makes the
202+
// framework skip the entire background draw subtree (IsPresent=false), saving GPU
203+
// fill rate every frame. Do not apply when StoryboardReplacesBackground is active
204+
// because tests (and the UI) rely on Content.Alpha==1 to detect background visibility.
203205
// base.UpdateVisuals() already fades content back to 1 whenever DimLevel drops
204206
// below 1 (e.g. during break lightening), so the background reappears correctly.
205-
if (ContentDisplayed && DimLevel >= 1f)
207+
if (ContentDisplayed && DimLevel >= 1f && !StoryboardReplacesBackground.Value)
206208
Content.FadeTo(0, BACKGROUND_FADE_DURATION, Easing.OutQuint);
207209
}
208210
}

osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,11 @@ private async Task addItem(MultiplayerPlaylistItem item)
734734

735735
item.ID = ++lastPlaylistItemId;
736736

737+
// Assign a PlaylistOrder that is beyond all existing non-expired items so that
738+
// updatePlaylistOrder does not need to re-order items added earlier.
739+
int maxOrder = ServerRoom.Playlist.Where(i => !i.Expired).Select(i => (int)i.PlaylistOrder).DefaultIfEmpty(-1).Max();
740+
item.PlaylistOrder = (ushort)(maxOrder + 1);
741+
737742
ServerRoom.Playlist.Add(item);
738743
ServerAPIRoom.Playlist = ServerAPIRoom.Playlist.Append(new PlaylistItem(item)).ToArray();
739744
await ((IMultiplayerClient)this).PlaylistItemAdded(clone(item)).ConfigureAwait(false);

0 commit comments

Comments
 (0)