1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 04:53:12 +08:00

Merge pull request #7430 from aspriddell/rpc

Add playing verb to Ruleset and use it for Discord RPC
This commit is contained in:
Dan Balasescu 2020-01-04 00:38:57 +09:00 committed by GitHub
commit c73512a51c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 4 deletions

View File

@ -135,6 +135,8 @@ namespace osu.Game.Rulesets.Catch
public override string ShortName => SHORT_NAME; public override string ShortName => SHORT_NAME;
public override string PlayingVerb => "Catching fruit";
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetCatch }; public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetCatch };
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new CatchDifficultyCalculator(this, beatmap); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new CatchDifficultyCalculator(this, beatmap);

View File

@ -179,6 +179,8 @@ namespace osu.Game.Rulesets.Mania
public override string ShortName => SHORT_NAME; public override string ShortName => SHORT_NAME;
public override string PlayingVerb => "Smashing keys";
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetMania }; public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetMania };
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new ManiaDifficultyCalculator(this, beatmap); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new ManiaDifficultyCalculator(this, beatmap);

View File

@ -175,6 +175,8 @@ namespace osu.Game.Rulesets.Osu
public override string ShortName => SHORT_NAME; public override string ShortName => SHORT_NAME;
public override string PlayingVerb => "Clicking circles";
public override RulesetSettingsSubsection CreateSettings() => new OsuSettingsSubsection(this); public override RulesetSettingsSubsection CreateSettings() => new OsuSettingsSubsection(this);
public override ISkin CreateLegacySkinProvider(ISkinSource source) => new OsuLegacySkinTransformer(source); public override ISkin CreateLegacySkinProvider(ISkinSource source) => new OsuLegacySkinTransformer(source);

View File

@ -139,6 +139,8 @@ namespace osu.Game.Rulesets.Taiko
public override string ShortName => SHORT_NAME; public override string ShortName => SHORT_NAME;
public override string PlayingVerb => "Bashing drums";
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetTaiko }; public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetTaiko };
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(this, beatmap); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(this, beatmap);

View File

@ -21,6 +21,7 @@ using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Skinning; using osu.Game.Skinning;
using osu.Game.Users;
namespace osu.Game.Rulesets namespace osu.Game.Rulesets
{ {
@ -57,7 +58,7 @@ namespace osu.Game.Rulesets
ShortName = ShortName, ShortName = ShortName,
ID = (this as ILegacyRuleset)?.LegacyID, ID = (this as ILegacyRuleset)?.LegacyID,
InstantiationInfo = GetType().AssemblyQualifiedName, InstantiationInfo = GetType().AssemblyQualifiedName,
Available = true Available = true,
}; };
} }
@ -121,6 +122,11 @@ namespace osu.Game.Rulesets
/// </summary> /// </summary>
public abstract string ShortName { get; } public abstract string ShortName { get; }
/// <summary>
/// The playing verb to be shown in the <see cref="UserActivity.SoloGame.Status"/>.
/// </summary>
public virtual string PlayingVerb => "Playing solo";
/// <summary> /// <summary>
/// A list of available variant ids. /// A list of available variant ids.
/// </summary> /// </summary>

View File

@ -3,6 +3,7 @@
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Users namespace osu.Game.Users
@ -44,15 +45,15 @@ namespace osu.Game.Users
{ {
public BeatmapInfo Beatmap { get; } public BeatmapInfo Beatmap { get; }
public Rulesets.RulesetInfo Ruleset { get; } public RulesetInfo Ruleset { get; }
public SoloGame(BeatmapInfo info, Rulesets.RulesetInfo ruleset) public SoloGame(BeatmapInfo info, RulesetInfo ruleset)
{ {
Beatmap = info; Beatmap = info;
Ruleset = ruleset; Ruleset = ruleset;
} }
public override string Status => @"Playing alone"; public override string Status => Ruleset.CreateInstance().PlayingVerb;
} }
public class Spectating : UserActivity public class Spectating : UserActivity