Rename variables to remove redundant "screen" terminology

This commit is contained in:
Dean Herbert 2019-06-12 16:33:15 +09:00
parent a9c229b1ec
commit 20b43c20c8
6 changed files with 26 additions and 27 deletions

View File

@ -48,7 +48,7 @@ namespace osu.Game.Screens.Edit
private DependencyContainer dependencies;
private GameHost host;
protected override UserActivity InitialScreenActivity => new UserActivity.Editing(Beatmap.Value.BeatmapInfo);
protected override UserActivity InitialActivity => new UserActivity.Editing(Beatmap.Value.BeatmapInfo);
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));

View File

@ -56,25 +56,25 @@ namespace osu.Game.Screens
/// <summary>
/// The <see cref="UserActivity"/> to set the user's activity automatically to when this screen is entered
/// <para>This <see cref="ScreenActivity"/> will be automatically set to <see cref="InitialScreenActivity"/> for this screen on entering unless
/// <see cref="ScreenActivity"/> is manually set before.</para>
/// <para>This <see cref="Activity"/> will be automatically set to <see cref="InitialActivity"/> for this screen on entering unless
/// <see cref="Activity"/> is manually set before.</para>
/// </summary>
protected virtual UserActivity InitialScreenActivity => null;
protected virtual UserActivity InitialActivity => null;
private UserActivity screenActivity;
private UserActivity activity;
/// <summary>
/// The <see cref="UserActivity"/> for this screen.
/// The current <see cref="UserActivity"/> for this screen.
/// </summary>
protected UserActivity ScreenActivity
protected UserActivity Activity
{
get => screenActivity;
get => activity;
set
{
if (value == screenActivity) return;
if (value == activity) return;
screenActivity = value;
setUserActivity(screenActivity);
activity = value;
updateActivity();
}
}
@ -152,7 +152,7 @@ namespace osu.Game.Screens
sampleExit?.Play();
applyArrivingDefaults(true);
setUserActivity(screenActivity);
updateActivity();
base.OnResuming(last);
}
@ -170,8 +170,8 @@ namespace osu.Game.Screens
backgroundStack?.Push(localBackground = CreateBackground());
if (screenActivity == null)
ScreenActivity = InitialScreenActivity;
if (activity == null)
Activity = InitialActivity;
base.OnEntering(last);
}
@ -190,11 +190,10 @@ namespace osu.Game.Screens
return false;
}
private void setUserActivity(UserActivity activity)
private void updateActivity()
{
if (api == null) return;
api.LocalUser.Value.Activity.Value = activity;
if (api != null)
api.LocalUser.Value.Activity.Value = activity;
}
/// <summary>

View File

@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play
{
protected override bool AllowBackButton => false; // handled by HoldForMenuButton
protected override UserActivity InitialScreenActivity => new UserActivity.SoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value);
protected override UserActivity InitialActivity => new UserActivity.SoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value);
public override float BackgroundParallaxAmount => 0.1f;

View File

@ -43,7 +43,7 @@ namespace osu.Game.Screens.Play
private bool hideOverlays;
public override bool HideOverlaysOnEnter => hideOverlays;
protected override UserActivity InitialScreenActivity => null; //shows the previous screen status
protected override UserActivity InitialActivity => null; //shows the previous screen status
public override bool DisallowExternalBeatmapRulesetChanges => true;

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.Select
public override bool AllowExternalScreenChange => true;
protected override UserActivity InitialScreenActivity => new UserActivity.ChoosingBeatmap();
protected override UserActivity InitialActivity => new UserActivity.ChoosingBeatmap();
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -30,18 +30,22 @@ namespace osu.Game.Users
public class Editing : UserActivity
{
public BeatmapInfo Beatmap { get; }
public Editing(BeatmapInfo info)
{
Beatmap = info;
}
public override string Status => @"Editing a beatmap";
public BeatmapInfo Beatmap { get; }
}
public class SoloGame : UserActivity
{
public BeatmapInfo Beatmap { get; }
public Rulesets.RulesetInfo Ruleset { get; }
public SoloGame(BeatmapInfo info, Rulesets.RulesetInfo ruleset)
{
Beatmap = info;
@ -49,10 +53,6 @@ namespace osu.Game.Users
}
public override string Status => @"Playing alone";
public BeatmapInfo Beatmap { get; }
public Rulesets.RulesetInfo Ruleset { get; }
}
public class Spectating : UserActivity