mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Add ScreenStatus property to change the OsuScreen's status + Renamed old ScreenStatus property to InitialScreenStatus
This commit is contained in:
@ -275,6 +275,8 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
|
|
||||||
private class DummySongSelect : PlaySongSelect
|
private class DummySongSelect : PlaySongSelect
|
||||||
{
|
{
|
||||||
|
protected override UserStatusOnline InitialScreenStatus => null;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground()
|
protected override BackgroundScreen CreateBackground()
|
||||||
{
|
{
|
||||||
FadeAccessibleBackground background = new FadeAccessibleBackground(Beatmap.Value);
|
FadeAccessibleBackground background = new FadeAccessibleBackground(Beatmap.Value);
|
||||||
@ -318,7 +320,7 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
|
|
||||||
private class FadeAccessibleResults : SoloResults
|
private class FadeAccessibleResults : SoloResults
|
||||||
{
|
{
|
||||||
protected override UserStatus ScreenStatus => null;
|
protected override UserStatusOnline InitialScreenStatus => null;
|
||||||
|
|
||||||
public FadeAccessibleResults(ScoreInfo score)
|
public FadeAccessibleResults(ScoreInfo score)
|
||||||
: base(score)
|
: base(score)
|
||||||
@ -332,7 +334,7 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
|
|
||||||
private class TestPlayer : Player
|
private class TestPlayer : Player
|
||||||
{
|
{
|
||||||
protected override UserStatus ScreenStatus => null;
|
protected override UserStatusOnline InitialScreenStatus => null;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new FadeAccessibleBackground(Beatmap.Value);
|
protected override BackgroundScreen CreateBackground() => new FadeAccessibleBackground(Beatmap.Value);
|
||||||
|
|
||||||
@ -381,7 +383,7 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
public VisualSettings VisualSettingsPos => VisualSettings;
|
public VisualSettings VisualSettingsPos => VisualSettings;
|
||||||
public BackgroundScreen ScreenPos => Background;
|
public BackgroundScreen ScreenPos => Background;
|
||||||
|
|
||||||
protected override UserStatus ScreenStatus => null;
|
protected override UserStatusOnline InitialScreenStatus => null;
|
||||||
|
|
||||||
public TestPlayerLoader(Player player)
|
public TestPlayerLoader(Player player)
|
||||||
: base(() => player)
|
: base(() => player)
|
||||||
|
@ -193,7 +193,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
public new HUDOverlay HUDOverlay => base.HUDOverlay;
|
public new HUDOverlay HUDOverlay => base.HUDOverlay;
|
||||||
|
|
||||||
protected override UserStatus ScreenStatus => null;
|
protected override UserStatusOnline InitialScreenStatus => null;
|
||||||
|
|
||||||
public bool FailOverlayVisible => FailOverlay.State == Visibility.Visible;
|
public bool FailOverlayVisible => FailOverlay.State == Visibility.Visible;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
private DependencyContainer dependencies;
|
private DependencyContainer dependencies;
|
||||||
private GameHost host;
|
private GameHost host;
|
||||||
|
|
||||||
protected override UserStatus ScreenStatus => new UserStatusEditing(Beatmap.Value.BeatmapInfo);
|
protected override UserStatusOnline InitialScreenStatus => new UserStatusEditing(Beatmap.Value.BeatmapInfo);
|
||||||
|
|
||||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
@ -55,12 +55,29 @@ namespace osu.Game.Screens
|
|||||||
protected new OsuGameBase Game => base.Game as OsuGameBase;
|
protected new OsuGameBase Game => base.Game as OsuGameBase;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="UserStatus"/> to set the user's status automatically to when this screen is entered / resumed.
|
/// The <see cref="UserStatusOnline"/> to set the user's status automatically to when this screen is entered
|
||||||
/// Note that the user status won't be automatically set if :
|
|
||||||
/// <para>- <see cref="ScreenStatus"/> is overriden and returns null</para>
|
|
||||||
/// <para>- The current <see cref="UserStatus"/> is <see cref="UserStatusDoNotDisturb"/> or <see cref="UserStatusOffline"/></para>
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual UserStatus ScreenStatus => new UserStatusOnline();
|
protected virtual UserStatusOnline InitialScreenStatus => new UserStatusOnline();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The <see cref="UserStatusOnline"/> for this screen.
|
||||||
|
/// Note that the status won't be updated for the user if :
|
||||||
|
/// <para>- The <see cref="ScreenStatus"/> is set to null</para>
|
||||||
|
/// <para>- The current <see cref="UserStatus"/> of the user is <see cref="UserStatusDoNotDisturb"/> or <see cref="UserStatusOffline"/></para>
|
||||||
|
/// </summary>
|
||||||
|
protected UserStatusOnline ScreenStatus
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null) return;
|
||||||
|
|
||||||
|
status = value;
|
||||||
|
setUserStatus(value);
|
||||||
|
}
|
||||||
|
get => status;
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserStatusOnline status;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to disallow changes to game-wise Beatmap/Ruleset bindables for this screen (and all children).
|
/// Whether to disallow changes to game-wise Beatmap/Ruleset bindables for this screen (and all children).
|
||||||
@ -104,6 +121,8 @@ namespace osu.Game.Screens
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
status = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -136,7 +155,7 @@ namespace osu.Game.Screens
|
|||||||
if (api != null)
|
if (api != null)
|
||||||
api.LocalUser.Value.Status.ValueChanged += userStatusChanged;
|
api.LocalUser.Value.Status.ValueChanged += userStatusChanged;
|
||||||
|
|
||||||
setUserStatus(ScreenStatus);
|
ScreenStatus = ScreenStatus;
|
||||||
|
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
}
|
}
|
||||||
@ -167,7 +186,7 @@ namespace osu.Game.Screens
|
|||||||
if (api != null)
|
if (api != null)
|
||||||
api.LocalUser.Value.Status.ValueChanged += userStatusChanged;
|
api.LocalUser.Value.Status.ValueChanged += userStatusChanged;
|
||||||
|
|
||||||
setUserStatus(ScreenStatus);
|
ScreenStatus = InitialScreenStatus;
|
||||||
|
|
||||||
base.OnEntering(last);
|
base.OnEntering(last);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
protected override bool AllowBackButton => false; // handled by HoldForMenuButton
|
protected override bool AllowBackButton => false; // handled by HoldForMenuButton
|
||||||
|
|
||||||
protected override UserStatus ScreenStatus => new UserStatusSoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value);
|
protected override UserStatusOnline InitialScreenStatus => new UserStatusSoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value);
|
||||||
|
|
||||||
public override float BackgroundParallaxAmount => 0.1f;
|
public override float BackgroundParallaxAmount => 0.1f;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private bool hideOverlays;
|
private bool hideOverlays;
|
||||||
public override bool HideOverlaysOnEnter => hideOverlays;
|
public override bool HideOverlaysOnEnter => hideOverlays;
|
||||||
|
|
||||||
protected override UserStatus ScreenStatus => null; //shows the previous screen status
|
protected override UserStatusOnline InitialScreenStatus => null; //shows the previous screen status
|
||||||
|
|
||||||
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public override bool AllowExternalScreenChange => true;
|
public override bool AllowExternalScreenChange => true;
|
||||||
|
|
||||||
protected override UserStatus ScreenStatus => new UserStatusChoosingBeatmap();
|
protected override UserStatusOnline InitialScreenStatus => new UserStatusChoosingBeatmap();
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
|
Reference in New Issue
Block a user