mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
Merge branch 'master' into update-edge-effect-fades
This commit is contained in:
commit
782ab81a88
@ -226,9 +226,21 @@ namespace osu.Game
|
|||||||
dependencies.Cache(notificationOverlay);
|
dependencies.Cache(notificationOverlay);
|
||||||
dependencies.Cache(dialogOverlay);
|
dependencies.Cache(dialogOverlay);
|
||||||
|
|
||||||
// ensure both overlays aren't presented at the same time
|
// ensure only one of these overlays are open at once.
|
||||||
chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State;
|
var singleDisplayOverlays = new OverlayContainer[] { chat, social, direct };
|
||||||
social.StateChanged += (container, state) => chat.State = state == Visibility.Visible ? Visibility.Hidden : chat.State;
|
foreach (var overlay in singleDisplayOverlays)
|
||||||
|
{
|
||||||
|
overlay.StateChanged += (container, state) =>
|
||||||
|
{
|
||||||
|
if (state == Visibility.Hidden) return;
|
||||||
|
|
||||||
|
foreach (var c in singleDisplayOverlays)
|
||||||
|
{
|
||||||
|
if (c == container) continue;
|
||||||
|
c.State = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
LoadComponentAsync(Toolbar = new Toolbar
|
LoadComponentAsync(Toolbar = new Toolbar
|
||||||
{
|
{
|
||||||
|
@ -152,14 +152,10 @@ namespace osu.Game
|
|||||||
|
|
||||||
Beatmap.ValueChanged += b =>
|
Beatmap.ValueChanged += b =>
|
||||||
{
|
{
|
||||||
// compare to last baetmap as sometimes the two may share a track representation (optimisation, see WorkingBeatmap.TransferTo)
|
// compare to last beatmap as sometimes the two may share a track representation (optimisation, see WorkingBeatmap.TransferTo)
|
||||||
if (lastBeatmap?.Track != b.Track)
|
if (lastBeatmap?.Track != b.Track)
|
||||||
{
|
{
|
||||||
// this disposal is done to stop the audio track.
|
lastBeatmap?.Track?.Dispose();
|
||||||
// it may not be exactly what we want for cases beatmaps are reused, as it will
|
|
||||||
// trigger a fresh load of contained resources.
|
|
||||||
lastBeatmap?.Dispose();
|
|
||||||
|
|
||||||
Audio.Track.AddItem(b.Track);
|
Audio.Track.AddItem(b.Track);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,23 +348,23 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
playerContainer.Add(new AsyncLoadWrapper(new Background(beatmap)
|
playerContainer.Add(new AsyncLoadWrapper(new Background(beatmap)
|
||||||
{
|
{
|
||||||
OnLoadComplete = d =>
|
OnLoadComplete = newBackground =>
|
||||||
{
|
{
|
||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
case TransformDirection.Next:
|
case TransformDirection.Next:
|
||||||
d.Position = new Vector2(400, 0);
|
newBackground.Position = new Vector2(400, 0);
|
||||||
d.MoveToX(0, 500, Easing.OutCubic);
|
newBackground.MoveToX(0, 500, Easing.OutCubic);
|
||||||
currentBackground.MoveToX(-400, 500, Easing.OutCubic);
|
currentBackground.MoveToX(-400, 500, Easing.OutCubic);
|
||||||
break;
|
break;
|
||||||
case TransformDirection.Prev:
|
case TransformDirection.Prev:
|
||||||
d.Position = new Vector2(-400, 0);
|
newBackground.Position = new Vector2(-400, 0);
|
||||||
d.MoveToX(0, 500, Easing.OutCubic);
|
newBackground.MoveToX(0, 500, Easing.OutCubic);
|
||||||
currentBackground.MoveToX(400, 500, Easing.OutCubic);
|
currentBackground.MoveToX(400, 500, Easing.OutCubic);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
currentBackground.Expire();
|
currentBackground.Expire();
|
||||||
currentBackground = d;
|
currentBackground = newBackground;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user