1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 22:22:54 +08:00

Merge branch 'master' into signalr-proxy

This commit is contained in:
Bartłomiej Dach 2022-04-21 23:36:09 +02:00 committed by GitHub
commit dcda43eb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 703 additions and 439 deletions

View File

@ -2,6 +2,60 @@ on: [push, pull_request]
name: Continuous Integration
jobs:
inspect-code:
name: Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side.
# https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e
- name: Install .NET 3.1.x LTS
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.x"
- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"
- name: Restore Tools
run: dotnet tool restore
- name: Restore Packages
run: dotnet restore
- name: Restore inspectcode cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/inspectcode
key: inspectcode-${{ hashFiles('.config/dotnet-tools.json') }}-${{ hashFiles('.github/workflows/ci.yml' ) }}
- name: CodeFileSanity
run: |
# TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround.
# FIXME: Suppress warnings from templates project
exit_code=0
while read -r line; do
if [[ ! -z "$line" ]]; then
echo "::error::$line"
exit_code=1
fi
done <<< $(dotnet codefilesanity)
exit $exit_code
# Temporarily disabled due to test failures, but it won't work anyway until the tool is upgraded.
# - name: .NET Format (Dry Run)
# run: dotnet format --dry-run --check
- name: InspectCode
run: dotnet jb inspectcode $(pwd)/osu.Desktop.slnf --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
- name: NVika
run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors
test:
name: Test
runs-on: ${{matrix.os.fullname}}
@ -93,58 +147,4 @@ jobs:
# cannot accept .sln(f) files as arguments.
# Build just the main game for now.
- name: Build
run: msbuild osu.iOS/osu.iOS.csproj /restore /p:Configuration=Debug
inspect-code:
name: Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side.
# https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e
- name: Install .NET 3.1.x LTS
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.x"
- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"
- name: Restore Tools
run: dotnet tool restore
- name: Restore Packages
run: dotnet restore
- name: Restore inspectcode cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/inspectcode
key: inspectcode-${{ hashFiles('.config/dotnet-tools.json') }}-${{ hashFiles('.github/workflows/ci.yml' ) }}
- name: CodeFileSanity
run: |
# TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround.
# FIXME: Suppress warnings from templates project
exit_code=0
while read -r line; do
if [[ ! -z "$line" ]]; then
echo "::error::$line"
exit_code=1
fi
done <<< $(dotnet codefilesanity)
exit $exit_code
# Temporarily disabled due to test failures, but it won't work anyway until the tool is upgraded.
# - name: .NET Format (Dry Run)
# run: dotnet format --dry-run --check
- name: InspectCode
run: dotnet jb inspectcode $(pwd)/osu.Desktop.slnf --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
- name: NVika
run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors
run: msbuild osu.iOS/osu.iOS.csproj /restore /p:Configuration=Debug

View File

@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.417.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.419.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.421.0" />
</ItemGroup>
<ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -6,10 +6,10 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Graphics.Containers;
using osu.Game.Rulesets.Osu.UI;
using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
// Must be set to update IsHovered as it's used in relax mod to detect osu hit objects.
public override bool HandlePositionalInput => true;
protected override float SamplePlaybackPosition => HitObject.X / OsuPlayfield.BASE_SIZE.X;
protected override float SamplePlaybackPosition => CalculateDrawableRelativePosition(this);
/// <summary>
/// Whether this <see cref="DrawableOsuHitObject"/> can be hit, given a time value.
@ -89,6 +89,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
/// </summary>
public void MissForcefully() => ApplyResult(r => r.Type = r.Judgement.MinResult);
private RectangleF parentScreenSpaceRectangle => ((DrawableOsuHitObject)ParentHitObject)?.parentScreenSpaceRectangle ?? Parent.ScreenSpaceDrawQuad.AABBFloat;
/// <summary>
/// Calculates the position of the given <paramref name="drawable"/> relative to the playfield area.
/// </summary>
/// <param name="drawable">The drawable to calculate its relative position.</param>
protected float CalculateDrawableRelativePosition(Drawable drawable) => (drawable.ScreenSpaceDrawQuad.Centre.X - parentScreenSpaceRectangle.X) / parentScreenSpaceRectangle.Width;
protected override JudgementResult CreateResult(Judgement judgement) => new OsuJudgementResult(HitObject, judgement);
}
}

View File

@ -13,7 +13,6 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Skinning;
using osu.Game.Rulesets.Osu.Skinning.Default;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
using osuTK;
@ -208,7 +207,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
if (Tracking.Value && slidingSample != null)
// keep the sliding sample playing at the current tracking position
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(Ball.X / OsuPlayfield.BASE_SIZE.X);
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball));
double completionProgress = Math.Clamp((Time.Current - HitObject.StartTime) / HitObject.Duration, 0, 1);

View File

@ -359,9 +359,9 @@ namespace osu.Game.Tests.Visual.Background
protected override BackgroundScreen CreateBackground() =>
new FadeAccessibleBackground(Beatmap.Value);
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
ApplyToBackground(b => ReplacesBackground.BindTo(b.StoryboardReplacesBackground));
}

View File

@ -389,9 +389,9 @@ namespace osu.Game.Tests.Visual.Gameplay
public void ExitViaQuickExit() => PerformExit(false);
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
GameplayClockContainer.Stop();
}
}

View File

@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private TestSkinSourceContainer skinSource;
private PausableSkinnableSound skinnableSound;
[SetUp]
[SetUpSteps]
public void SetUpSteps()
{
AddStep("setup hierarchy", () =>

View File

@ -230,7 +230,7 @@ namespace osu.Game.Tests.Visual.Navigation
public int ExitAttempts { get; private set; }
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
ExitAttempts++;
@ -240,7 +240,7 @@ namespace osu.Game.Tests.Visual.Navigation
return true;
}
return base.OnExiting(next);
return base.OnExiting(e);
}
}
@ -257,7 +257,7 @@ namespace osu.Game.Tests.Visual.Navigation
SubScreenStack.Push(Blocker = new DialogBlockingScreen());
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (SubScreenStack.CurrentScreen != null)
{
@ -265,7 +265,7 @@ namespace osu.Game.Tests.Visual.Navigation
return true;
}
return base.OnExiting(next);
return base.OnExiting(e);
}
}
}

View File

@ -0,0 +1,188 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Framework.Utils;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Overlays;
using osu.Game.Overlays.Chat.ChannelList;
namespace osu.Game.Tests.Visual.Online
{
[TestFixture]
public class TestSceneChannelList : OsuTestScene
{
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);
[Cached]
private readonly Bindable<Channel> selected = new Bindable<Channel>();
private OsuSpriteText selectorText;
private OsuSpriteText selectedText;
private OsuSpriteText leaveText;
private ChannelList channelList;
[SetUp]
public void SetUp()
{
Schedule(() =>
{
Child = new GridContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Height = 0.7f,
RowDimensions = new[]
{
new Dimension(GridSizeMode.Absolute, 20),
new Dimension(GridSizeMode.Absolute, 20),
new Dimension(GridSizeMode.Absolute, 20),
new Dimension(),
},
Content = new[]
{
new Drawable[]
{
selectorText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
},
new Drawable[]
{
selectedText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
},
new Drawable[]
{
leaveText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
},
new Drawable[]
{
channelList = new ChannelList
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.Y,
Width = 190,
},
},
},
};
channelList.OnRequestSelect += channel =>
{
channelList.SelectorActive.Value = false;
selected.Value = channel;
};
channelList.OnRequestLeave += channel =>
{
leaveText.Text = $"OnRequestLeave: {channel.Name}";
leaveText.FadeOutFromOne(1000, Easing.InQuint);
selected.Value = null;
channelList.RemoveChannel(channel);
};
channelList.SelectorActive.BindValueChanged(change =>
{
selectorText.Text = $"Channel Selector Active: {change.NewValue}";
selected.Value = null;
}, true);
selected.BindValueChanged(change =>
{
selectedText.Text = $"Selected Channel: {change.NewValue?.Name ?? "[null]"}";
}, true);
});
}
[SetUpSteps]
public void SetUpSteps()
{
AddStep("Add Public Channels", () =>
{
for (int i = 0; i < 10; i++)
channelList.AddChannel(createRandomPublicChannel());
});
AddStep("Add Private Channels", () =>
{
for (int i = 0; i < 10; i++)
channelList.AddChannel(createRandomPrivateChannel());
});
}
[Test]
public void TestVisual()
{
AddStep("Unread Selected", () =>
{
if (selected.Value != null)
channelList.GetItem(selected.Value).Unread.Value = true;
});
AddStep("Read Selected", () =>
{
if (selected.Value != null)
channelList.GetItem(selected.Value).Unread.Value = false;
});
AddStep("Add Mention Selected", () =>
{
if (selected.Value != null)
channelList.GetItem(selected.Value).Mentions.Value++;
});
AddStep("Add 98 Mentions Selected", () =>
{
if (selected.Value != null)
channelList.GetItem(selected.Value).Mentions.Value += 98;
});
AddStep("Clear Mentions Selected", () =>
{
if (selected.Value != null)
channelList.GetItem(selected.Value).Mentions.Value = 0;
});
}
private Channel createRandomPublicChannel()
{
int id = RNG.Next(0, 10000);
return new Channel
{
Name = $"#channel-{id}",
Type = ChannelType.Public,
Id = id,
};
}
private Channel createRandomPrivateChannel()
{
int id = RNG.Next(0, 10000);
return new Channel(new APIUser
{
Id = id,
Username = $"test user {id}",
});
}
}
}

View File

@ -1,163 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Overlays;
using osu.Game.Overlays.Chat.ChannelList;
using osuTK;
namespace osu.Game.Tests.Visual.Online
{
[TestFixture]
public class TestSceneChannelListItem : OsuTestScene
{
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);
[Cached]
private readonly Bindable<Channel> selected = new Bindable<Channel>();
private static readonly List<Channel> channels = new List<Channel>
{
createPublicChannel("#public-channel"),
createPublicChannel("#public-channel-long-name"),
createPrivateChannel("test user", 2),
createPrivateChannel("test user long name", 3),
};
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
private FillFlowContainer flow;
private OsuSpriteText selectedText;
private OsuSpriteText leaveText;
[SetUp]
public void SetUp()
{
Schedule(() =>
{
foreach (var item in channelMap.Values)
item.Expire();
channelMap.Clear();
Child = new FillFlowContainer
{
Direction = FillDirection.Vertical,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(10),
Children = new Drawable[]
{
selectedText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
leaveText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Height = 16,
AlwaysPresent = true,
},
new Container
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
AutoSizeAxes = Axes.Y,
Width = 190,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background6,
},
flow = new FillFlowContainer
{
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},
},
},
},
};
selected.BindValueChanged(change =>
{
selectedText.Text = $"Selected Channel: {change.NewValue?.Name ?? "[null]"}";
}, true);
foreach (var channel in channels)
{
var item = new ChannelListItem(channel);
flow.Add(item);
channelMap.Add(channel, item);
item.OnRequestSelect += c => selected.Value = c;
item.OnRequestLeave += leaveChannel;
}
});
}
[Test]
public void TestVisual()
{
AddStep("Select second item", () => selected.Value = channels.Skip(1).First());
AddStep("Unread Selected", () =>
{
if (selected.Value != null)
channelMap[selected.Value].Unread.Value = true;
});
AddStep("Read Selected", () =>
{
if (selected.Value != null)
channelMap[selected.Value].Unread.Value = false;
});
AddStep("Add Mention Selected", () =>
{
if (selected.Value != null)
channelMap[selected.Value].Mentions.Value++;
});
AddStep("Add 98 Mentions Selected", () =>
{
if (selected.Value != null)
channelMap[selected.Value].Mentions.Value += 98;
});
AddStep("Clear Mentions Selected", () =>
{
if (selected.Value != null)
channelMap[selected.Value].Mentions.Value = 0;
});
}
private void leaveChannel(Channel channel)
{
leaveText.Text = $"OnRequestLeave: {channel.Name}";
leaveText.FadeOutFromOne(1000, Easing.InQuint);
}
private static Channel createPublicChannel(string name) =>
new Channel { Name = name, Type = ChannelType.Public, Id = 1234 };
private static Channel createPrivateChannel(string username, int id)
=> new Channel(new APIUser { Id = id, Username = username });
}
}

View File

@ -80,10 +80,10 @@ namespace osu.Game.Tests.Visual
public override bool OnBackButton() => (screenStack.CurrentScreen as OsuScreen)?.OnBackButton() ?? base.OnBackButton();
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (screenStack.CurrentScreen == null)
return base.OnExiting(next);
return base.OnExiting(e);
screenStack.Exit();
return true;

View File

@ -209,7 +209,7 @@ namespace osu.Game.Graphics.Containers
{
protected override bool AllowStoryboardBackground => false;
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
this.FadeInFromZero(4000, Easing.OutQuint);
}

View File

@ -8,21 +8,21 @@ namespace osu.Game.Overlays.AccountCreation
{
public abstract class AccountCreationScreen : Screen
{
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
this.FadeOut().Delay(200).FadeIn(200);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
this.FadeIn(200);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
this.FadeOut(200);
}
}

View File

@ -147,9 +147,9 @@ namespace osu.Game.Overlays.AccountCreation
d.Colour = password.Length == 0 ? Color4.White : Interpolation.ValueAt(password.Length, Color4.OrangeRed, Color4.YellowGreen, 0, 8, Easing.In);
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
loadingLayer.Hide();
if (host?.OnScreenKeyboardOverlapsGameWindow != true)

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays.AccountCreation
private const string help_centre_url = "/help/wiki/Help_Centre#login";
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
if (string.IsNullOrEmpty(api?.ProvidedUsername) || game?.UseDevelopmentServer == true)
{
@ -40,7 +40,7 @@ namespace osu.Game.Overlays.AccountCreation
return;
}
base.OnEntering(last);
base.OnEntering(e);
}
[BackgroundDependencyLoader(true)]

View File

@ -0,0 +1,135 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat;
namespace osu.Game.Overlays.Chat.ChannelList
{
public class ChannelList : Container
{
public Action<Channel>? OnRequestSelect;
public Action<Channel>? OnRequestLeave;
public readonly BindableBool SelectorActive = new BindableBool();
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
private ChannelListItemFlow publicChannelFlow = null!;
private ChannelListItemFlow privateChannelFlow = null!;
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background6,
},
new OsuScrollContainer
{
Padding = new MarginPadding { Vertical = 7 },
RelativeSizeAxes = Axes.Both,
ScrollbarAnchor = Anchor.TopRight,
ScrollDistance = 35f,
Child = new FillFlowContainer
{
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
publicChannelFlow = new ChannelListItemFlow("CHANNELS"),
new ChannelListSelector
{
Margin = new MarginPadding { Bottom = 10 },
SelectorActive = { BindTarget = SelectorActive },
},
privateChannelFlow = new ChannelListItemFlow("DIRECT MESSAGES"),
},
},
},
};
}
public void AddChannel(Channel channel)
{
if (channelMap.ContainsKey(channel))
return;
ChannelListItem item = new ChannelListItem(channel);
item.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan);
item.OnRequestLeave += chan => OnRequestLeave?.Invoke(chan);
item.SelectorActive.BindTarget = SelectorActive;
ChannelListItemFlow flow = getFlowForChannel(channel);
channelMap.Add(channel, item);
flow.Add(item);
}
public void RemoveChannel(Channel channel)
{
if (!channelMap.ContainsKey(channel))
return;
ChannelListItem item = channelMap[channel];
ChannelListItemFlow flow = getFlowForChannel(channel);
channelMap.Remove(channel);
flow.Remove(item);
}
public ChannelListItem GetItem(Channel channel)
{
if (!channelMap.ContainsKey(channel))
throw new ArgumentOutOfRangeException();
return channelMap[channel];
}
private ChannelListItemFlow getFlowForChannel(Channel channel)
{
switch (channel.Type)
{
case ChannelType.Public:
return publicChannelFlow;
case ChannelType.PM:
return privateChannelFlow;
default:
throw new ArgumentOutOfRangeException();
}
}
private class ChannelListItemFlow : FillFlowContainer
{
public ChannelListItemFlow(string label)
{
Direction = FillDirection.Vertical;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Add(new OsuSpriteText
{
Text = label,
Margin = new MarginPadding { Left = 18, Bottom = 5 },
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold),
});
}
}
}
}

View File

@ -29,12 +29,14 @@ namespace osu.Game.Overlays.Chat.ChannelList
public readonly BindableBool Unread = new BindableBool();
public readonly BindableBool SelectorActive = new BindableBool();
private readonly Channel channel;
private Box? hoverBox;
private Box? selectBox;
private OsuSpriteText? text;
private ChannelListItemCloseButton? close;
private Box hoverBox = null!;
private Box selectBox = null!;
private OsuSpriteText text = null!;
private ChannelListItemCloseButton close = null!;
[Resolved]
private Bindable<Channel> selectedChannel { get; set; } = null!;
@ -124,31 +126,26 @@ namespace osu.Game.Overlays.Chat.ChannelList
{
base.LoadComplete();
selectedChannel.BindValueChanged(change =>
{
if (change.NewValue == channel)
selectBox?.FadeIn(300, Easing.OutQuint);
else
selectBox?.FadeOut(200, Easing.OutQuint);
}, true);
selectedChannel.BindValueChanged(_ => updateSelectState(), true);
SelectorActive.BindValueChanged(_ => updateSelectState(), true);
Unread.BindValueChanged(change =>
{
text!.FadeColour(change.NewValue ? colourProvider.Content1 : colourProvider.Light3, 300, Easing.OutQuint);
text.FadeColour(change.NewValue ? colourProvider.Content1 : colourProvider.Light3, 300, Easing.OutQuint);
}, true);
}
protected override bool OnHover(HoverEvent e)
{
hoverBox?.FadeIn(300, Easing.OutQuint);
close?.FadeIn(300, Easing.OutQuint);
hoverBox.FadeIn(300, Easing.OutQuint);
close.FadeIn(300, Easing.OutQuint);
return base.OnHover(e);
}
protected override void OnHoverLost(HoverLostEvent e)
{
hoverBox?.FadeOut(200, Easing.OutQuint);
close?.FadeOut(200, Easing.OutQuint);
hoverBox.FadeOut(200, Easing.OutQuint);
close.FadeOut(200, Easing.OutQuint);
base.OnHoverLost(e);
}
@ -167,5 +164,13 @@ namespace osu.Game.Overlays.Chat.ChannelList
Masking = true,
};
}
private void updateSelectState()
{
if (selectedChannel.Value == channel && !SelectorActive.Value)
selectBox.FadeIn(300, Easing.OutQuint);
else
selectBox.FadeOut(200, Easing.OutQuint);
}
}
}

View File

@ -0,0 +1,91 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Chat.ChannelList
{
public class ChannelListSelector : OsuClickableContainer
{
public readonly BindableBool SelectorActive = new BindableBool();
private Box hoverBox = null!;
private Box selectBox = null!;
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
Height = 30;
RelativeSizeAxes = Axes.X;
Children = new Drawable[]
{
hoverBox = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background3,
Alpha = 0f,
},
selectBox = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4,
Alpha = 0f,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = 18, Right = 10 },
Child = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Text = "Add More Channels",
Font = OsuFont.Torus.With(size: 17, weight: FontWeight.SemiBold),
Colour = colourProvider.Light3,
Margin = new MarginPadding { Bottom = 2 },
RelativeSizeAxes = Axes.X,
Truncate = true,
},
},
};
}
protected override void LoadComplete()
{
base.LoadComplete();
SelectorActive.BindValueChanged(selector =>
{
if (selector.NewValue)
selectBox.FadeIn(300, Easing.OutQuint);
else
selectBox.FadeOut(200, Easing.OutQuint);
}, true);
Action = () => SelectorActive.Value = true;
}
protected override bool OnHover(HoverEvent e)
{
hoverBox.FadeIn(300, Easing.OutQuint);
return base.OnHover(e);
}
protected override void OnHoverLost(HoverLostEvent e)
{
hoverBox.FadeOut(200, Easing.OutQuint);
base.OnHoverLost(e);
}
}
}

View File

@ -14,7 +14,6 @@ using osu.Game.Database;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Spectator;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens;
using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Play;

View File

@ -124,9 +124,9 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
base.LoadComplete();
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
this.FadeOut(250);
}

View File

@ -124,20 +124,20 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
protected virtual bool PerformMigration() => game?.Migrate(destination.FullName) != false;
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
this.FadeOut().Delay(250).Then().FadeIn(250);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
// block until migration is finished
if (migrationTask?.IsCompleted == false)
return true;
return base.OnExiting(next);
return base.OnExiting(e);
}
}
}

View File

@ -30,10 +30,10 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
this.Exit();
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
taskCompletionSource.TrySetCanceled();
return base.OnExiting(next);
return base.OnExiting(e);
}
}
}

View File

@ -48,7 +48,7 @@ namespace osu.Game.Screens
Scale = new Vector2(1 + x_movement_amount / DrawSize.X * 2);
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
if (animateOnEnter)
{
@ -59,16 +59,16 @@ namespace osu.Game.Screens
this.MoveToX(0, TRANSITION_LENGTH, Easing.InOutQuart);
}
base.OnEntering(last);
base.OnEntering(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
this.MoveToX(-x_movement_amount, TRANSITION_LENGTH, Easing.InOutQuart);
base.OnSuspending(next);
base.OnSuspending(e);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (IsLoaded)
{
@ -76,14 +76,14 @@ namespace osu.Game.Screens
this.MoveToX(x_movement_amount, TRANSITION_LENGTH, Easing.OutExpo);
}
return base.OnExiting(next);
return base.OnExiting(e);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
if (IsLoaded)
this.MoveToX(0, TRANSITION_LENGTH, Easing.OutExpo);
base.OnResuming(last);
base.OnResuming(e);
}
}
}

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.Backgrounds
};
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
Show();
}

View File

@ -560,16 +560,16 @@ namespace osu.Game.Screens.Edit
{
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
dimBackground();
resetTrack(true);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
dimBackground();
}
@ -585,7 +585,7 @@ namespace osu.Game.Screens.Edit
});
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (!ExitConfirmed)
{
@ -613,12 +613,12 @@ namespace osu.Game.Screens.Edit
refetchBeatmap();
return base.OnExiting(next);
return base.OnExiting(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
clock.Stop();
refetchBeatmap();
}

View File

@ -44,9 +44,9 @@ namespace osu.Game.Screens.Edit.GameplayTest
protected override bool CheckModsAllowFailure() => false; // never fail.
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
// finish alpha transforms on entering to avoid gameplay starting in a half-hidden state.
// the finish calls are purposefully not propagated to children to avoid messing up their state.
@ -54,13 +54,13 @@ namespace osu.Game.Screens.Edit.GameplayTest
GameplayClockContainer.FinishTransforms(false, nameof(Alpha));
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
musicController.Stop();
editorState.Time = GameplayClockContainer.CurrentTime;
editor.RestoreState(editorState);
return base.OnExiting(next);
return base.OnExiting(e);
}
}
}

View File

@ -19,9 +19,9 @@ namespace osu.Game.Screens.Edit.GameplayTest
{
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
MetadataInfo.FinishTransforms(true);
}

View File

@ -118,20 +118,20 @@ namespace osu.Game.Screens.Import
fileSelector.CurrentPath.BindValueChanged(directoryChanged);
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
contentContainer.ScaleTo(0.95f).ScaleTo(1, duration, Easing.OutQuint);
this.FadeInFromZero(duration);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
contentContainer.ScaleTo(0.95f, duration, Easing.OutQuint);
this.FadeOut(duration, Easing.OutQuint);
return base.OnExiting(next);
return base.OnExiting(e);
}
private void directoryChanged(ValueChangedEvent<DirectoryInfo> _)

View File

@ -69,9 +69,9 @@ namespace osu.Game.Screens
private EFToRealmMigrator realmMigrator;
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
LoadComponentAsync(precompiler = CreateShaderPrecompiler(), AddInternal);

View File

@ -171,9 +171,9 @@ namespace osu.Game.Screens.Menu
((IBindable<APIUser>)currentUser).BindTo(api.LocalUser);
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
icon.RotateTo(10);
icon.FadeOut();

View File

@ -57,10 +57,10 @@ namespace osu.Game.Screens.Menu
}
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
this.FadeOut(300);
base.OnSuspending(next);
base.OnSuspending(e);
}
}
}

View File

@ -164,9 +164,9 @@ namespace osu.Game.Screens.Menu
}
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
ensureEventuallyArrivingAtMenu();
}
@ -194,7 +194,7 @@ namespace osu.Game.Screens.Menu
}, 5000);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
this.FadeIn(300);
@ -237,12 +237,12 @@ namespace osu.Game.Screens.Menu
//don't want to fade out completely else we will stop running updates.
Game.FadeTo(0.01f, fadeOutTime).OnComplete(_ => this.Exit());
base.OnResuming(last);
base.OnResuming(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
initialBeatmap = null;
}

View File

@ -89,9 +89,9 @@ namespace osu.Game.Screens.Menu
}
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
// ensure the background is shown, even if the TriangleIntroSequence failed to do so.
background.ApplyToBackground(b => b.Show());
@ -100,9 +100,9 @@ namespace osu.Game.Screens.Menu
intro.Expire();
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
background.FadeOut(100);
}

View File

@ -106,9 +106,9 @@ namespace osu.Game.Screens.Menu
}
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
background.FadeOut(100);
}

View File

@ -176,12 +176,12 @@ namespace osu.Game.Screens.Menu
[Resolved]
private Storage storage { get; set; }
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
buttons.FadeInFromZero(500);
if (last is IntroScreen && musicController.TrackLoaded)
if (e.Last is IntroScreen && musicController.TrackLoaded)
{
var track = musicController.CurrentTrack;
@ -249,9 +249,9 @@ namespace osu.Game.Screens.Menu
seq.OnAbort(_ => buttons.SetOsuLogo(null));
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
buttons.State = ButtonSystemState.EnteringMode;
@ -261,9 +261,9 @@ namespace osu.Game.Screens.Menu
sideFlashes.FadeOut(64, Easing.OutQuint);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
ApplyToBackground(b => (b as BackgroundScreenDefault)?.Next());
@ -273,7 +273,7 @@ namespace osu.Game.Screens.Menu
musicController.EnsurePlayingSomething();
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (!exitConfirmed && dialogOverlay != null)
{
@ -291,7 +291,7 @@ namespace osu.Game.Screens.Menu
songTicker.Hide();
this.FadeOut(3000);
return base.OnExiting(next);
return base.OnExiting(e);
}
public void PresentBeatmap(WorkingBeatmap beatmap, RulesetInfo ruleset)

View File

@ -91,15 +91,15 @@ namespace osu.Game.Screens.OnlinePlay.Components
AddInternal(background = newBackground);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
this.MoveToX(0, TRANSITION_LENGTH);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
bool result = base.OnExiting(next);
bool result = base.OnExiting(e);
this.MoveToX(0);
return result;
}

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
playlist.Clear();
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
// This screen never exits.
return true;

View File

@ -238,15 +238,15 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
#endregion
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
onReturning();
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
Debug.Assert(selectionLease != null);
@ -261,16 +261,16 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
onReturning();
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
onLeaving();
return base.OnExiting(next);
return base.OnExiting(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
onLeaving();
base.OnSuspending(next);
base.OnSuspending(e);
}
protected override void OnFocus(FocusEvent e)

View File

@ -290,35 +290,35 @@ namespace osu.Game.Screens.OnlinePlay.Match
protected void ShowUserModSelect() => userModsSelectOverlay.Show();
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
beginHandlingTrack();
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
endHandlingTrack();
base.OnSuspending(next);
base.OnSuspending(e);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
updateWorkingBeatmap();
beginHandlingTrack();
Scheduler.AddOnce(UpdateMods);
Scheduler.AddOnce(updateRuleset);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
RoomManager?.PartRoom();
Mods.Value = Array.Empty<Mod>();
endHandlingTrack();
return base.OnExiting(next);
return base.OnExiting(e);
}
protected void StartPlay()

View File

@ -35,14 +35,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
transitionFromResults();
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
if (client.Room == null)
return;
if (!(last is MultiplayerPlayerLoader playerLoader))
if (!(e.Last is MultiplayerPlayerLoader playerLoader))
return;
// If gameplay wasn't finished, then we have a simple path back to the idle state by aborting gameplay.

View File

@ -25,13 +25,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
[Resolved]
private MultiplayerClient client { get; set; }
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
// Upon having left a room, we don't know whether we were the only participant, and whether the room is now closed as a result of leaving it.
// To work around this, temporarily remove the room and trigger an immediate listing poll.
if (last is MultiplayerMatchSubScreen match)
if (e.Last is MultiplayerMatchSubScreen match)
{
RoomManager.RemoveRoom(match.Room);
ListingPollingComponent.PollImmediately();

View File

@ -242,14 +242,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
private bool exitConfirmed;
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
// the room may not be left immediately after a disconnection due to async flow,
// so checking the IsConnected status is also required.
if (client.Room == null || !client.IsConnected.Value)
{
// room has not been created yet; exit immediately.
return base.OnExiting(next);
return base.OnExiting(e);
}
if (!exitConfirmed && dialogOverlay != null)
@ -268,7 +268,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
return true;
}
return base.OnExiting(next);
return base.OnExiting(e);
}
private ModSettingChangeTracker modSettingChangeTracker;

View File

@ -18,10 +18,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
player = (Player)next;
base.OnSuspending(e);
player = (Player)e.Next;
}
}
}

View File

@ -110,7 +110,7 @@ namespace osu.Game.Screens.OnlinePlay
}
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
this.FadeIn();
waves.Show();
@ -118,35 +118,35 @@ namespace osu.Game.Screens.OnlinePlay
Mods.SetDefault();
if (loungeSubScreen.IsCurrentScreen())
loungeSubScreen.OnEntering(last);
loungeSubScreen.OnEntering(e);
else
loungeSubScreen.MakeCurrent();
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
this.FadeIn(250);
this.ScaleTo(1, 250, Easing.OutSine);
Debug.Assert(screenStack.CurrentScreen != null);
screenStack.CurrentScreen.OnResuming(last);
screenStack.CurrentScreen.OnResuming(e);
base.OnResuming(last);
base.OnResuming(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
this.ScaleTo(1.1f, 250, Easing.InSine);
this.FadeOut(250);
Debug.Assert(screenStack.CurrentScreen != null);
screenStack.CurrentScreen.OnSuspending(next);
screenStack.CurrentScreen.OnSuspending(e);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
var subScreen = screenStack.CurrentScreen as Drawable;
if (subScreen?.IsLoaded == true && screenStack.CurrentScreen.OnExiting(next))
if (subScreen?.IsLoaded == true && screenStack.CurrentScreen.OnExiting(e))
return true;
RoomManager.PartRoom();
@ -155,7 +155,7 @@ namespace osu.Game.Screens.OnlinePlay
this.Delay(WaveContainer.DISAPPEAR_DURATION).FadeOut();
base.OnExiting(next);
base.OnExiting(e);
return false;
}

View File

@ -141,7 +141,7 @@ namespace osu.Game.Screens.OnlinePlay
return base.OnBackButton();
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (!itemSelected)
{
@ -150,7 +150,7 @@ namespace osu.Game.Screens.OnlinePlay
Mods.Value = initialMods;
}
return base.OnExiting(next);
return base.OnExiting(e);
}
protected override ModSelectOverlay CreateModSelectOverlay() => new UserModSelectOverlay

View File

@ -27,28 +27,28 @@ namespace osu.Game.Screens.OnlinePlay
public const double DISAPPEAR_DURATION = 500;
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
this.FadeInFromZero(APPEAR_DURATION, Easing.OutQuint);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
base.OnExiting(next);
base.OnExiting(e);
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
return false;
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
this.FadeIn(APPEAR_DURATION, Easing.OutQuint);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
}

View File

@ -45,9 +45,9 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
throw new InvalidOperationException("Current Mods do not match PlaylistItem's RequiredMods");
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (base.OnExiting(next))
if (base.OnExiting(e))
return true;
Exited?.Invoke();

View File

@ -171,7 +171,7 @@ namespace osu.Game.Screens
background.ApplyToBackground(action);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
if (PlayResumeSound)
sampleExit?.Play();
@ -183,19 +183,19 @@ namespace osu.Game.Screens
if (trackAdjustmentStateAtSuspend != null)
musicController.AllowTrackAdjustments = trackAdjustmentStateAtSuspend.Value;
base.OnResuming(last);
base.OnResuming(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
trackAdjustmentStateAtSuspend = musicController.AllowTrackAdjustments;
onSuspendingLogo();
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
applyArrivingDefaults(false);
@ -210,15 +210,15 @@ namespace osu.Game.Screens
}
background = backgroundStack?.CurrentScreen as BackgroundScreen;
base.OnEntering(last);
base.OnEntering(e);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (ValidForResume && logo != null)
onExitingLogo();
if (base.OnExiting(next))
if (base.OnExiting(e))
return true;
if (ownedBackground != null && backgroundStack?.CurrentScreen == ownedBackground)

View File

@ -917,9 +917,9 @@ namespace osu.Game.Screens.Play
#region Screen Logic
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
if (!LoadedBeatmapSuccessfully)
return;
@ -985,15 +985,15 @@ namespace osu.Game.Screens.Play
GameplayClockContainer.Reset(true);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
screenSuspension?.RemoveAndDisposeImmediately();
fadeOut();
base.OnSuspending(next);
base.OnSuspending(e);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
screenSuspension?.RemoveAndDisposeImmediately();
failAnimationLayer?.RemoveFilters();
@ -1024,7 +1024,7 @@ namespace osu.Game.Screens.Play
musicController.ResetTrackAdjustments();
fadeOut();
return base.OnExiting(next);
return base.OnExiting(e);
}
/// <summary>

View File

@ -210,9 +210,9 @@ namespace osu.Game.Screens.Play
#region Screen handling
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
ApplyToBackground(b =>
{
@ -236,9 +236,9 @@ namespace osu.Game.Screens.Play
showBatteryWarningIfNeeded();
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
Debug.Assert(CurrentPlayer != null);
@ -254,9 +254,9 @@ namespace osu.Game.Screens.Play
contentIn();
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
BackgroundBrightnessReduction = false;
@ -268,7 +268,7 @@ namespace osu.Game.Screens.Play
highPassFilter.CutoffTo(0);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
cancelLoad();
ContentOut();
@ -284,7 +284,7 @@ namespace osu.Game.Screens.Play
BackgroundBrightnessReduction = false;
Beatmap.Value.Track.RemoveAdjustment(AdjustableProperty.Volume, volumeAdjustment);
return base.OnExiting(next);
return base.OnExiting(e);
}
protected override void LogoArriving(OsuLogo logo, bool resuming)

View File

@ -20,13 +20,13 @@ namespace osu.Game.Screens.Play
Score = score.ScoreInfo;
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
// these will be reverted thanks to PlayerLoader's lease.
Mods.Value = Score.Mods;
Ruleset.Value = Score.Ruleset;
base.OnEntering(last);
base.OnEntering(e);
}
}
}

View File

@ -249,10 +249,10 @@ namespace osu.Game.Screens.Play
beatmapDownloader.Download(beatmapSet);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
previewTrackManager.StopAnyPlaying(this);
return base.OnExiting(next);
return base.OnExiting(e);
}
}
}

View File

@ -24,11 +24,11 @@ namespace osu.Game.Screens.Play
SpectatorClient.OnUserBeganPlaying += userBeganPlaying;
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
SpectatorClient.OnUserBeganPlaying -= userBeganPlaying;
return base.OnExiting(next);
return base.OnExiting(e);
}
private void userBeganPlaying(int userId, SpectatorState state)

View File

@ -91,11 +91,11 @@ namespace osu.Game.Screens.Play
DrawableRuleset?.SetReplayScore(score);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
SpectatorClient.OnNewFrames -= userSentFrames;
return base.OnExiting(next);
return base.OnExiting(e);
}
protected override void Dispose(bool isDisposing)

View File

@ -20,13 +20,13 @@ namespace osu.Game.Screens.Play
Score = score.ScoreInfo;
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
// these will be reverted thanks to PlayerLoader's lease.
Mods.Value = Score.Mods;
Ruleset.Value = Score.Ruleset;
base.OnEntering(last);
base.OnEntering(e);
}
}
}

View File

@ -115,9 +115,9 @@ namespace osu.Game.Screens.Play
await submitScore(score).ConfigureAwait(false);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
bool exiting = base.OnExiting(next);
bool exiting = base.OnExiting(e);
if (LoadedBeatmapSuccessfully)
submitScore(Score.DeepClone());

View File

@ -231,9 +231,9 @@ namespace osu.Game.Screens.Ranking
lastFetchCompleted = true;
});
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
ApplyToBackground(b =>
{
@ -244,9 +244,9 @@ namespace osu.Game.Screens.Ranking
bottomPanel.FadeTo(1, 250);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (base.OnExiting(next))
if (base.OnExiting(e))
return true;
this.FadeOut(100);

View File

@ -28,25 +28,25 @@ namespace osu.Game.Screens
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg2");
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
message.TextContainer.MoveTo(new Vector2(DrawSize.X / 16, 0), transition_time, Easing.OutExpo);
this.FadeOut(transition_time, Easing.OutExpo);
return base.OnExiting(next);
return base.OnExiting(e);
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(next);
base.OnSuspending(e);
message.TextContainer.MoveTo(new Vector2(-(DrawSize.X / 16), 0), transition_time, Easing.OutExpo);
this.FadeOut(transition_time, Easing.OutExpo);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
message.TextContainer.MoveTo(Vector2.Zero, transition_time, Easing.OutExpo);
this.FadeIn(transition_time, Easing.OutExpo);

View File

@ -109,9 +109,9 @@ namespace osu.Game.Screens.Select
}
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
if (playerLoader != null)
{

View File

@ -543,9 +543,9 @@ namespace osu.Game.Screens.Select
}
}
public override void OnEntering(IScreen last)
public override void OnEntering(ScreenTransitionEvent e)
{
base.OnEntering(last);
base.OnEntering(e);
this.FadeInFromZero(250);
FilterControl.Activate();
@ -591,9 +591,9 @@ namespace osu.Game.Screens.Select
logo.FadeOut(logo_transition / 2, Easing.Out);
}
public override void OnResuming(IScreen last)
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(last);
base.OnResuming(e);
// required due to https://github.com/ppy/osu-framework/issues/3218
ModSelect.SelectedMods.Disabled = false;
@ -622,7 +622,7 @@ namespace osu.Game.Screens.Select
FilterControl.Activate();
}
public override void OnSuspending(IScreen next)
public override void OnSuspending(ScreenTransitionEvent e)
{
// Handle the case where FinaliseSelection is never called (ie. when a screen is pushed externally).
// Without this, it's possible for a transfer to happen while we are not the current screen.
@ -640,12 +640,12 @@ namespace osu.Game.Screens.Select
this.FadeOut(250);
FilterControl.Deactivate();
base.OnSuspending(next);
base.OnSuspending(e);
}
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
if (base.OnExiting(next))
if (base.OnExiting(e))
return true;
beatmapInfoWedge.Hide();

View File

@ -146,8 +146,10 @@ namespace osu.Game.Skinning.Editor
{
anchorLine = new Box
{
Colour = Color4.Yellow,
Height = 2,
Origin = Anchor.CentreLeft,
Colour = Color4.Yellow,
EdgeSmoothness = Vector2.One
},
originBox = new Box
{

View File

@ -118,7 +118,7 @@ namespace osu.Game.Tests.Visual
public new bool HasUnsavedChanges => base.HasUnsavedChanges;
public override bool OnExiting(IScreen next)
public override bool OnExiting(ScreenExitEvent e)
{
// For testing purposes allow the screen to exit without saving on second attempt.
if (!ExitConfirmed && dialogOverlay?.CurrentDialog is PromptForSaveDialog saveDialog)
@ -127,7 +127,7 @@ namespace osu.Game.Tests.Visual
return true;
}
return base.OnExiting(next);
return base.OnExiting(e);
}
public TestEditor(EditorLoader loader = null)

View File

@ -35,7 +35,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="10.10.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.419.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.421.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.417.0" />
<PackageReference Include="Sentry" Version="3.14.1" />
<PackageReference Include="SharpCompress" Version="0.30.1" />

View File

@ -61,7 +61,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.419.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.421.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.417.0" />
</ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
@ -84,7 +84,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.419.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.421.0" />
<PackageReference Include="SharpCompress" Version="0.30.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />