1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 02:32:59 +08:00

Nest all UserActivities into UserActivity

This commit is contained in:
Lucas A 2019-05-12 17:38:02 +02:00
parent 5ac6bd8204
commit 55663b3576
4 changed files with 47 additions and 46 deletions

View File

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

View File

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

View File

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

View File

@ -11,58 +11,59 @@ namespace osu.Game.Users
{
public abstract string Status { get; }
public virtual Color4 GetAppropriateColour(OsuColour colours) => colours.GreenDarker;
}
public class UserActivityModding : UserActivity
{
public override string Status => "Modding a map";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark;
}
public class UserActivityChoosingBeatmap : UserActivity
{
public override string Status => "Choosing a beatmap";
}
public class UserActivityMultiplayerGame : UserActivity
{
public override string Status => "Multiplaying";
}
public class UserActivityEditing : UserActivity
{
public UserActivityEditing(BeatmapInfo info)
public class UserActivityModding : UserActivity
{
Beatmap = info;
public override string Status => "Modding a map";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark;
}
public override string Status => @"Editing a beatmap";
public BeatmapInfo Beatmap { get; }
}
public class UserActivitySoloGame : UserActivity
{
public UserActivitySoloGame(BeatmapInfo info, Rulesets.RulesetInfo ruleset)
public class UserActivityChoosingBeatmap : UserActivity
{
Beatmap = info;
Ruleset = ruleset;
public override string Status => "Choosing a beatmap";
}
public override string Status => @"Solo Game";
public class UserActivityMultiplayerGame : UserActivity
{
public override string Status => "Multiplaying";
}
public BeatmapInfo Beatmap { get; }
public class UserActivityEditing : UserActivity
{
public UserActivityEditing(BeatmapInfo info)
{
Beatmap = info;
}
public Rulesets.RulesetInfo Ruleset { get; }
public override string Status => @"Editing a beatmap";
public BeatmapInfo Beatmap { get; }
}
public class UserActivitySoloGame : UserActivity
{
public UserActivitySoloGame(BeatmapInfo info, Rulesets.RulesetInfo ruleset)
{
Beatmap = info;
Ruleset = ruleset;
}
public override string Status => @"Solo Game";
public BeatmapInfo Beatmap { get; }
public Rulesets.RulesetInfo Ruleset { get; }
}
public class UserActivitySpectating : UserActivity
{
public override string Status => @"Spectating a game";
}
public class UserActivityInLobby : UserActivity
{
public override string Status => @"in Multiplayer Lobby";
}
}
public class UserActivitySpectating : UserActivity
{
public override string Status => @"Spectating a game";
}
public class UserActivityInLobby : UserActivity
{
public override string Status => @"in Multiplayer Lobby";
}
}