1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Turn on warnings, resolve issues

This commit is contained in:
smoogipoo 2019-04-25 17:36:17 +09:00
parent 8d8258c039
commit 0bd35ab7bb
71 changed files with 116 additions and 182 deletions

View File

@ -120,12 +120,8 @@ namespace osu.Game.Tests.Visual.Gameplay
} }
} }
private class SecondarySource : ISkinSource private class SecondarySource : ISkin
{ {
public event Action SourceChanged;
public void TriggerSourceChanged() => SourceChanged?.Invoke();
public Drawable GetDrawableComponent(string componentName) => new SecondarySourceBox(); public Drawable GetDrawableComponent(string componentName) => new SecondarySourceBox();
public Texture GetTexture(string componentName) => throw new NotImplementedException(); public Texture GetTexture(string componentName) => throw new NotImplementedException();
@ -135,12 +131,8 @@ namespace osu.Game.Tests.Visual.Gameplay
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration => throw new NotImplementedException(); public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration => throw new NotImplementedException();
} }
private class SkinSourceContainer : Container, ISkinSource private class SkinSourceContainer : Container, ISkin
{ {
public event Action SourceChanged;
public void TriggerSourceChanged() => SourceChanged?.Invoke();
public Drawable GetDrawableComponent(string componentName) => new BaseSourceBox(); public Drawable GetDrawableComponent(string componentName) => new BaseSourceBox();
public Texture GetTexture(string componentName) => throw new NotImplementedException(); public Texture GetTexture(string componentName) => throw new NotImplementedException();

View File

@ -4,7 +4,7 @@
namespace osu.Game.Audio namespace osu.Game.Audio
{ {
/// <summary> /// <summary>
/// Interface for objects that can own <see cref="IPreviewTrack"/>s. /// Interface for objects that can own <see cref="PreviewTrack"/>s.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// <see cref="IPreviewTrackOwner"/>s can cancel the currently playing <see cref="PreviewTrack"/> through the /// <see cref="IPreviewTrackOwner"/>s can cancel the currently playing <see cref="PreviewTrack"/> through the

View File

@ -98,7 +98,7 @@ namespace osu.Game.Beatmaps
protected abstract IEnumerable<Type> ValidConversionTypes { get; } protected abstract IEnumerable<Type> ValidConversionTypes { get; }
/// <summary> /// <summary>
/// Creates the <see cref="Beatmap{T}"/> that will be returned by this <see cref="BeatmapProcessor{T}"/>. /// Creates the <see cref="Beatmap{T}"/> that will be returned by this <see cref="BeatmapProcessor"/>.
/// </summary> /// </summary>
protected virtual Beatmap<T> CreateBeatmap() => new Beatmap<T>(); protected virtual Beatmap<T> CreateBeatmap() => new Beatmap<T>();

View File

@ -217,7 +217,7 @@ namespace osu.Game.Beatmaps
{ {
request.Perform(api); request.Perform(api);
} }
catch (Exception e) catch
{ {
// no need to handle here as exceptions will filter down to request.Failure above. // no need to handle here as exceptions will filter down to request.Failure above.
} }
@ -382,7 +382,6 @@ namespace osu.Game.Beatmaps
/// Query the API to populate missing values like OnlineBeatmapID / OnlineBeatmapSetID or (Rank-)Status. /// Query the API to populate missing values like OnlineBeatmapID / OnlineBeatmapSetID or (Rank-)Status.
/// </summary> /// </summary>
/// <param name="beatmap">The beatmap to populate.</param> /// <param name="beatmap">The beatmap to populate.</param>
/// <param name="otherBeatmaps">The other beatmaps contained within this set.</param>
/// <param name="force">Whether to re-query if the provided beatmap already has populated values.</param> /// <param name="force">Whether to re-query if the provided beatmap already has populated values.</param>
/// <returns>True if population was successful.</returns> /// <returns>True if population was successful.</returns>
private bool fetchAndPopulateOnlineValues(BeatmapInfo beatmap, bool force = false) private bool fetchAndPopulateOnlineValues(BeatmapInfo beatmap, bool force = false)

View File

@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
{ {
/// <summary> /// <summary>
/// A <see cref="Bindable{T}"/> for the <see cref="OsuGame"/> beatmap. /// A <see cref="Bindable{T}"/> for the <see cref="OsuGame"/> beatmap.
/// This should be used sparingly in-favour of <see cref="IBindable<WorkingBeatmap>"/>. /// This should be used sparingly in-favour of <see cref="IBindable{WorkingBeatmap}"/>.
/// </summary> /// </summary>
public abstract class BindableBeatmap : NonNullableBindable<WorkingBeatmap> public abstract class BindableBeatmap : NonNullableBindable<WorkingBeatmap>
{ {
@ -67,6 +67,6 @@ namespace osu.Game.Beatmaps
/// If you are further binding to events of the retrieved <see cref="BindableBeatmap"/>, ensure a local reference is held. /// If you are further binding to events of the retrieved <see cref="BindableBeatmap"/>, ensure a local reference is held.
/// </summary> /// </summary>
[NotNull] [NotNull]
public abstract BindableBeatmap GetBoundCopy(); public new abstract BindableBeatmap GetBoundCopy();
} }
} }

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Difficulty;
@ -73,9 +74,18 @@ namespace osu.Game.Beatmaps
private class DummyBeatmapConverter : IBeatmapConverter private class DummyBeatmapConverter : IBeatmapConverter
{ {
public event Action<HitObject, IEnumerable<HitObject>> ObjectConverted; public event Action<HitObject, IEnumerable<HitObject>> ObjectConverted;
public IBeatmap Beatmap { get; set; } public IBeatmap Beatmap { get; set; }
public bool CanConvert => true; public bool CanConvert => true;
public IBeatmap Convert() => Beatmap;
public IBeatmap Convert()
{
foreach (var obj in Beatmap.HitObjects)
ObjectConverted?.Invoke(obj, obj.Yield());
return Beatmap;
}
} }
} }
} }

View File

@ -95,7 +95,7 @@ namespace osu.Game.Beatmaps.Formats
{ {
colour = new Color4(byte.Parse(split[0]), byte.Parse(split[1]), byte.Parse(split[2]), split.Length == 4 ? byte.Parse(split[3]) : (byte)255); colour = new Color4(byte.Parse(split[0]), byte.Parse(split[1]), byte.Parse(split[2]), split.Length == 4 ? byte.Parse(split[3]) : (byte)255);
} }
catch (Exception e) catch
{ {
throw new InvalidOperationException(@"Color must be specified with 8-bit integer components"); throw new InvalidOperationException(@"Color must be specified with 8-bit integer components");
} }

View File

@ -73,6 +73,7 @@ namespace osu.Game.Beatmaps
/// </para> /// </para>
/// </summary> /// </summary>
/// <param name="ruleset">The <see cref="RulesetInfo"/> to create a playable <see cref="IBeatmap"/> for.</param> /// <param name="ruleset">The <see cref="RulesetInfo"/> to create a playable <see cref="IBeatmap"/> for.</param>
/// <param name="mods">The <see cref="Mod"/>s to apply to the <see cref="IBeatmap"/>.</param>
/// <returns>The converted <see cref="IBeatmap"/>.</returns> /// <returns>The converted <see cref="IBeatmap"/>.</returns>
/// <exception cref="BeatmapInvalidForRulesetException">If <see cref="Beatmap"/> could not be converted to <paramref name="ruleset"/>.</exception> /// <exception cref="BeatmapInvalidForRulesetException">If <see cref="Beatmap"/> could not be converted to <paramref name="ruleset"/>.</exception>
public IBeatmap GetPlayableBeatmap(RulesetInfo ruleset, IReadOnlyList<Mod> mods) public IBeatmap GetPlayableBeatmap(RulesetInfo ruleset, IReadOnlyList<Mod> mods)

View File

@ -563,7 +563,7 @@ namespace osu.Game.Database
/// <summary> /// <summary>
/// Check whether an existing model already exists for a new import item. /// Check whether an existing model already exists for a new import item.
/// </summary> /// </summary>
/// <param name="model">The new model proposed for import. /// <param name="model">The new model proposed for import.</param>
/// <returns>An existing model which matches the criteria to skip importing, else null.</returns> /// <returns>An existing model which matches the criteria to skip importing, else null.</returns>
protected TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash); protected TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash);

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage;
@ -67,7 +66,7 @@ namespace osu.Game.Database
context = threadContexts.Value; context = threadContexts.Value;
} }
} }
catch (Exception e) catch
{ {
// retrieval of a context could trigger a fatal error. // retrieval of a context could trigger a fatal error.
Monitor.Exit(writeLock); Monitor.Exit(writeLock);

View File

@ -70,7 +70,7 @@ namespace osu.Game.Database
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
} }
catch (Exception e) catch
{ {
connection.Close(); connection.Close();
throw; throw;

View File

@ -103,7 +103,7 @@ namespace osu.Game.Graphics.Containers
{ {
channelManager?.OpenChannel(linkArgument); channelManager?.OpenChannel(linkArgument);
} }
catch (ChannelNotFoundException e) catch (ChannelNotFoundException)
{ {
Logger.Log($"The requested channel \"{linkArgument}\" does not exist"); Logger.Log($"The requested channel \"{linkArgument}\" does not exist");
} }

View File

@ -30,7 +30,6 @@ namespace osu.Game.Graphics.Containers
/// Assign the logo that should track the facade's position, as well as how it should transform to its initial position. /// Assign the logo that should track the facade's position, as well as how it should transform to its initial position.
/// </summary> /// </summary>
/// <param name="logo">The instance of the logo to be used for tracking.</param> /// <param name="logo">The instance of the logo to be used for tracking.</param>
/// <param name="facadeScale">The scale of the facade. Does not actually affect the logo itself.</param>
/// <param name="duration">The duration of the initial transform. Default is instant.</param> /// <param name="duration">The duration of the initial transform. Default is instant.</param>
/// <param name="easing">The easing type of the initial transform.</param> /// <param name="easing">The easing type of the initial transform.</param>
public void StartTracking(OsuLogo logo, double duration = 0, Easing easing = Easing.None) public void StartTracking(OsuLogo logo, double duration = 0, Easing easing = Easing.None)
@ -132,7 +131,7 @@ namespace osu.Game.Graphics.Containers
private class InternalFacade : Facade private class InternalFacade : Facade
{ {
public void SetSize(Vector2 size) public new void SetSize(Vector2 size)
{ {
base.SetSize(size); base.SetSize(size);
} }

View File

@ -61,9 +61,9 @@ namespace osu.Game.Graphics
/// <summary> /// <summary>
/// Retrieves the string representation of a <see cref="FontWeight"/>. /// Retrieves the string representation of a <see cref="FontWeight"/>.
/// </summary> /// </summary>
/// <param name="typeface">The <see cref="Typeface"/>.</param> /// <param name="family">The family string.</param>
/// <param name="weight">The <see cref="FontWeight"/>.</param> /// <param name="weight">The <see cref="FontWeight"/>.</param>
/// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="typeface"/>.</returns> /// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="family"/>.</returns>
public static string GetWeightString(string family, FontWeight weight) public static string GetWeightString(string family, FontWeight weight)
{ {
string weightString = weight.ToString(); string weightString = weight.ToString();
@ -81,6 +81,7 @@ namespace osu.Game.Graphics
/// <summary> /// <summary>
/// Creates a new <see cref="FontUsage"/> by applying adjustments to this <see cref="FontUsage"/>. /// Creates a new <see cref="FontUsage"/> by applying adjustments to this <see cref="FontUsage"/>.
/// </summary> /// </summary>
/// <param name="usage">The base <see cref="FontUsage"/>.</param>
/// <param name="typeface">The font typeface. If null, the value is copied from this <see cref="FontUsage"/>.</param> /// <param name="typeface">The font typeface. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <param name="size">The text size. If null, the value is copied from this <see cref="FontUsage"/>.</param> /// <param name="size">The text size. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <param name="weight">The font weight. If null, the value is copied from this <see cref="FontUsage"/>.</param> /// <param name="weight">The font weight. If null, the value is copied from this <see cref="FontUsage"/>.</param>

View File

@ -8,7 +8,7 @@ using osu.Framework.Screens;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
/// <summary> /// <summary>
/// A <see cref="BreadcrumbControl"/> which follows the active screen (and allows navigation) in a <see cref="Screen"/> stack. /// A <see cref="BreadcrumbControl{IScreen}"/> which follows the active screen (and allows navigation) in a <see cref="Screen"/> stack.
/// </summary> /// </summary>
public class ScreenBreadcrumbControl : BreadcrumbControl<IScreen> public class ScreenBreadcrumbControl : BreadcrumbControl<IScreen>
{ {

View File

@ -253,7 +253,7 @@ namespace osu.Game.Online.API
handleWebException(we); handleWebException(we);
return false; return false;
} }
catch (Exception e) catch
{ {
return false; return false;
} }

View File

@ -7,7 +7,6 @@ using System.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring.Legacy; using osu.Game.Scoring.Legacy;
using osu.Game.Users; using osu.Game.Users;
@ -71,7 +70,6 @@ namespace osu.Game.Online.API.Requests.Responses
{ {
foreach (var kvp in value) foreach (var kvp in value)
{ {
HitResult newKey;
switch (kvp.Key) switch (kvp.Key)
{ {
case @"count_geki": case @"count_geki":

View File

@ -10,16 +10,16 @@ namespace osu.Game.Online.API.Requests.Responses
public class APIUserMostPlayedBeatmap public class APIUserMostPlayedBeatmap
{ {
[JsonProperty("beatmap_id")] [JsonProperty("beatmap_id")]
public int BeatmapID; public int BeatmapID { get; set; }
[JsonProperty("count")] [JsonProperty("count")]
public int PlayCount; public int PlayCount { get; set; }
[JsonProperty] [JsonProperty]
private BeatmapInfo beatmap; private BeatmapInfo beatmap { get; set; }
[JsonProperty] [JsonProperty]
private APIBeatmapSet beatmapSet; private APIBeatmapSet beatmapSet { get; set; }
public BeatmapInfo GetBeatmapInfo(RulesetStore rulesets) public BeatmapInfo GetBeatmapInfo(RulesetStore rulesets)
{ {

View File

@ -27,8 +27,6 @@ namespace osu.Game.Online.Chat
protected ChannelManager ChannelManager; protected ChannelManager ChannelManager;
private ScrollContainer scroll;
private DrawableChannel drawableChannel; private DrawableChannel drawableChannel;
private readonly bool postingTextbox; private readonly bool postingTextbox;

View File

@ -272,7 +272,6 @@ namespace osu.Game
/// Present a score's replay immediately. /// Present a score's replay immediately.
/// The user should have already requested this interactively. /// The user should have already requested this interactively.
/// </summary> /// </summary>
/// <param name="beatmap">The beatmap to select.</param>
public void PresentScore(ScoreInfo score) public void PresentScore(ScoreInfo score)
{ {
var databasedScore = ScoreManager.GetScore(score); var databasedScore = ScoreManager.GetScore(score);

View File

@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Chat.Tabs
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private new void load(OsuColour colour) private void load(OsuColour colour)
{ {
BackgroundInactive = colour.Gray2; BackgroundInactive = colour.Gray2;
BackgroundActive = colour.Gray3; BackgroundActive = colour.Gray3;

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;
@ -18,9 +17,6 @@ namespace osu.Game.Overlays.Chat.Tabs
{ {
public class PrivateChannelTabItem : ChannelTabItem public class PrivateChannelTabItem : ChannelTabItem
{ {
private readonly OsuSpriteText username;
private readonly Avatar avatarContainer;
protected override IconUsage DisplayIcon => FontAwesome.Solid.At; protected override IconUsage DisplayIcon => FontAwesome.Solid.At;
public PrivateChannelTabItem(Channel value) public PrivateChannelTabItem(Channel value)

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays
{ {
/// <summary> /// <summary>
/// An overlay which will display a black screen that dims over a period before confirming an exit action. /// An overlay which will display a black screen that dims over a period before confirming an exit action.
/// Action is BYO (derived class will need to call <see cref="BeginConfirm"/> and <see cref="AbortConfirm"/> from a user event). /// Action is BYO (derived class will need to call <see cref="HoldToConfirmContainer.BeginConfirm"/> and <see cref="HoldToConfirmContainer.AbortConfirm"/> from a user event).
/// </summary> /// </summary>
public abstract class HoldToConfirmOverlay : HoldToConfirmContainer public abstract class HoldToConfirmOverlay : HoldToConfirmContainer
{ {

View File

@ -50,7 +50,6 @@ namespace osu.Game.Overlays
private BeatmapManager beatmaps; private BeatmapManager beatmaps;
private List<BeatmapSetInfo> beatmapSets; private List<BeatmapSetInfo> beatmapSets;
private BeatmapSetInfo currentSet;
private Container dragContainer; private Container dragContainer;
private Container playerContainer; private Container playerContainer;

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Configuration;
@ -9,7 +10,7 @@ namespace osu.Game.Overlays.Settings
{ {
/// <summary> /// <summary>
/// A <see cref="SettingsSubsection"/> which provides subclasses with the <see cref="IRulesetConfigManager"/> /// A <see cref="SettingsSubsection"/> which provides subclasses with the <see cref="IRulesetConfigManager"/>
/// from the <see cref="Ruleset"/>'s <see cref="Ruleset.CreateConfig()"/>. /// from the <see cref="Ruleset"/>'s <see cref="Ruleset.CreateConfig(SettingsStore)"/>.
/// </summary> /// </summary>
public abstract class RulesetSettingsSubsection : SettingsSubsection public abstract class RulesetSettingsSubsection : SettingsSubsection
{ {

View File

@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Settings
{ {
protected override OsuDropdown<T> CreateDropdown() => new DropdownControl(); protected override OsuDropdown<T> CreateDropdown() => new DropdownControl();
protected class DropdownControl : OsuEnumDropdown<T> protected new class DropdownControl : OsuEnumDropdown<T>
{ {
public DropdownControl() public DropdownControl()
{ {

View File

@ -165,7 +165,7 @@ namespace osu.Game.Rulesets.Difficulty
/// <summary> /// <summary>
/// Creates the <see cref="Skill"/>s to calculate the difficulty of an <see cref="IBeatmap"/>. /// Creates the <see cref="Skill"/>s to calculate the difficulty of an <see cref="IBeatmap"/>.
/// </summary> /// </summary>
/// <param name="beatmap">The <see cref="IBeatmap"/> whose difficulty will be calculated.</param /// <param name="beatmap">The <see cref="IBeatmap"/> whose difficulty will be calculated.</param>
/// <returns>The <see cref="Skill"/>s.</returns> /// <returns>The <see cref="Skill"/>s.</returns>
protected abstract Skill[] CreateSkills(IBeatmap beatmap); protected abstract Skill[] CreateSkills(IBeatmap beatmap);
} }

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Timing; using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Compose; using osu.Game.Screens.Edit.Compose;
using osuTK; using osuTK;
@ -108,7 +109,8 @@ namespace osu.Game.Rulesets.Edit
} }
/// <summary> /// <summary>
/// Invokes <see cref="HitObject.ApplyDefaults"/>, refreshing <see cref="HitObject.NestedHitObjects"/> and parameters for the <see cref="HitObject"/>. /// Invokes <see cref="Objects.HitObject.ApplyDefaults(ControlPointInfo,BeatmapDifficulty)"/>,
/// refreshing <see cref="Objects.HitObject.NestedHitObjects"/> and parameters for the <see cref="HitObject"/>.
/// </summary> /// </summary>
protected void ApplyDefaultsToHitObject() => HitObject.ApplyDefaults(beatmap.Value.Beatmap.ControlPointInfo, beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty); protected void ApplyDefaultsToHitObject() => HitObject.ApplyDefaults(beatmap.Value.Beatmap.ControlPointInfo, beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty);

View File

@ -68,9 +68,11 @@ namespace osu.Game.Rulesets.Edit
get => state; get => state;
set set
{ {
if (state == value) return; if (state == value)
return;
state = value; state = value;
switch (state) switch (state)
{ {
case SelectionState.Selected: case SelectionState.Selected:
@ -82,6 +84,8 @@ namespace osu.Game.Rulesets.Edit
Deselected?.Invoke(this); Deselected?.Invoke(this);
break; break;
} }
StateChanged?.Invoke(state);
} }
} }

View File

@ -2,14 +2,12 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
/// <summary> /// <summary>
/// Interface for a <see cref="Mod"/> that applies changes to a <see cref="BeatmapConverter{TObject}"/>. /// Interface for a <see cref="Mod"/> that applies changes to a <see cref="BeatmapConverter{TObject}"/>.
/// </summary> /// </summary>
/// <typeparam name="TObject">The type of converted <see cref="HitObject"/>.</typeparam>
public interface IApplicableToBeatmapConverter : IApplicableMod public interface IApplicableToBeatmapConverter : IApplicableMod
{ {
/// <summary> /// <summary>

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods
public interface IApplicableToHitObject : IApplicableMod public interface IApplicableToHitObject : IApplicableMod
{ {
/// <summary> /// <summary>
/// Applies this <see cref="IApplicableToHitObject{TObject}"/> to a <see cref="HitObject"/>. /// Applies this <see cref="IApplicableToHitObject"/> to a <see cref="HitObject"/>.
/// </summary> /// </summary>
/// <param name="hitObject">The <see cref="HitObject"/> to apply to.</param> /// <param name="hitObject">The <see cref="HitObject"/> to apply to.</param>
void ApplyToHitObject(HitObject hitObject); void ApplyToHitObject(HitObject hitObject);

View File

@ -7,6 +7,7 @@ using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Game.Audio; using osu.Game.Audio;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -58,7 +59,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
public bool AllJudged => Judged && NestedHitObjects.All(h => h.AllJudged); public bool AllJudged => Judged && NestedHitObjects.All(h => h.AllJudged);
/// <summary> /// <summary>
/// Whether this <see cref="DrawableHitObject"/> has been hit. This occurs if <see cref="Result.IsHit"/> is <see cref="true"/>. /// Whether this <see cref="DrawableHitObject"/> has been hit. This occurs if <see cref="Result"/> is hit.
/// Note: This does NOT include nested hitobjects. /// Note: This does NOT include nested hitobjects.
/// </summary> /// </summary>
public bool IsHit => Result?.IsHit ?? false; public bool IsHit => Result?.IsHit ?? false;
@ -223,7 +224,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
} }
/// <summary> /// <summary>
/// Will called at least once after the <see cref="LifetimeEnd"/> of this <see cref="DrawableHitObject"/> has been passed. /// Will called at least once after the <see cref="Drawable.LifetimeEnd"/> of this <see cref="DrawableHitObject"/> has been passed.
/// </summary> /// </summary>
internal void OnLifetimeEnd() internal void OnLifetimeEnd()
{ {

View File

@ -53,8 +53,6 @@ namespace osu.Game.Rulesets.Objects
[JsonIgnore] [JsonIgnore]
public bool Kiai { get; private set; } public bool Kiai { get; private set; }
private float overallDifficulty = BeatmapDifficulty.DEFAULT_DIFFICULTY;
/// <summary> /// <summary>
/// The hit windows for this <see cref="HitObject"/>. /// The hit windows for this <see cref="HitObject"/>.
/// </summary> /// </summary>
@ -115,7 +113,7 @@ namespace osu.Game.Rulesets.Objects
/// Creates the <see cref="HitWindows"/> for this <see cref="HitObject"/>. /// Creates the <see cref="HitWindows"/> for this <see cref="HitObject"/>.
/// This can be null to indicate that the <see cref="HitObject"/> has no <see cref="HitWindows"/>. /// This can be null to indicate that the <see cref="HitObject"/> has no <see cref="HitWindows"/>.
/// <para> /// <para>
/// This will only be invoked if <see cref="HitWindows"/> hasn't been set externally (e.g. from a <see cref="BeatmapConverter"/>. /// This will only be invoked if <see cref="HitWindows"/> hasn't been set externally (e.g. from a <see cref="BeatmapConverter{T}"/>.
/// </para> /// </para>
/// </summary> /// </summary>
protected virtual HitWindows CreateHitWindows() => new HitWindows(); protected virtual HitWindows CreateHitWindows() => new HitWindows();

View File

@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Objects
/// <summary> /// <summary>
/// Given a time offset, whether the <see cref="HitObject"/> can ever be hit in the future with a non-<see cref="HitResult.Miss"/> result. /// Given a time offset, whether the <see cref="HitObject"/> can ever be hit in the future with a non-<see cref="HitResult.Miss"/> result.
/// This happens if <paramref name="timeOffset"/> is less than what is required for a <see cref="SuccessfulHitWindow"/> result. /// This happens if <paramref name="timeOffset"/> is less than what is required for <see cref="LowestSuccessfulHitResult"/>.
/// </summary> /// </summary>
/// <param name="timeOffset">The time offset.</param> /// <param name="timeOffset">The time offset.</param>
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns> /// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>

View File

@ -277,12 +277,5 @@ namespace osu.Game.Rulesets.Objects
return ControlPoints.SequenceEqual(other.ControlPoints) && ExpectedDistance.Equals(other.ExpectedDistance) && Type == other.Type; return ControlPoints.SequenceEqual(other.ControlPoints) && ExpectedDistance.Equals(other.ExpectedDistance) && Type == other.Type;
} }
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
return obj is SliderPath other && Equals(other);
}
} }
} }

View File

@ -53,6 +53,7 @@ namespace osu.Game.Rulesets
/// Attempt to create a hit renderer for a beatmap /// Attempt to create a hit renderer for a beatmap
/// </summary> /// </summary>
/// <param name="beatmap">The beatmap to create the hit renderer for.</param> /// <param name="beatmap">The beatmap to create the hit renderer for.</param>
/// <param name="mods">The <see cref="Mod"/>s to apply.</param>
/// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception> /// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception>
/// <returns></returns> /// <returns></returns>
public abstract DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods); public abstract DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods);

View File

@ -154,7 +154,6 @@ namespace osu.Game.Rulesets.Scoring
/// <summary> /// <summary>
/// Notifies subscribers of <see cref="NewJudgement"/> that a new judgement has occurred. /// Notifies subscribers of <see cref="NewJudgement"/> that a new judgement has occurred.
/// </summary> /// </summary>
/// <param name="judgement">The judgement to notify subscribers of.</param>
/// <param name="result">The judgement scoring result to notify subscribers of.</param> /// <param name="result">The judgement scoring result to notify subscribers of.</param>
protected void NotifyNewJudgement(JudgementResult result) protected void NotifyNewJudgement(JudgementResult result)
{ {
@ -283,7 +282,6 @@ namespace osu.Game.Rulesets.Scoring
/// <summary> /// <summary>
/// Reverts the score change of a <see cref="JudgementResult"/> that was applied to this <see cref="ScoreProcessor"/>. /// Reverts the score change of a <see cref="JudgementResult"/> that was applied to this <see cref="ScoreProcessor"/>.
/// </summary> /// </summary>
/// <param name="judgement">The judgement to remove.</param>
/// <param name="result">The judgement scoring result.</param> /// <param name="result">The judgement scoring result.</param>
private void revertResult(JudgementResult result) private void revertResult(JudgementResult result)
{ {
@ -340,7 +338,6 @@ namespace osu.Game.Rulesets.Scoring
/// <summary> /// <summary>
/// Reverts the score change of a <see cref="JudgementResult"/> that was applied to this <see cref="ScoreProcessor"/>. /// Reverts the score change of a <see cref="JudgementResult"/> that was applied to this <see cref="ScoreProcessor"/>.
/// </summary> /// </summary>
/// <param name="judgement">The judgement to remove.</param>
/// <param name="result">The judgement scoring result.</param> /// <param name="result">The judgement scoring result.</param>
protected virtual void RevertResult(JudgementResult result) protected virtual void RevertResult(JudgementResult result)
{ {

View File

@ -93,6 +93,7 @@ namespace osu.Game.Rulesets.UI
/// </summary> /// </summary>
/// <param name="ruleset">The ruleset being represented.</param> /// <param name="ruleset">The ruleset being represented.</param>
/// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param> /// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param>
/// <param name="mods">The <see cref="Mod"/>s to apply.</param>
protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap, IReadOnlyList<Mod> mods) protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap, IReadOnlyList<Mod> mods)
: base(ruleset) : base(ruleset)
{ {
@ -275,7 +276,8 @@ namespace osu.Game.Rulesets.UI
/// <summary> /// <summary>
/// Applies the active mods to this DrawableRuleset. /// Applies the active mods to this DrawableRuleset.
/// </summary> /// </summary>
/// <param name="mods"></param> /// <param name="mods">The <see cref="Mod"/>s to apply.</param>
/// <param name="config">The <see cref="OsuConfigManager"/> to apply.</param>
private void applyRulesetMods(IReadOnlyList<Mod> mods, OsuConfigManager config) private void applyRulesetMods(IReadOnlyList<Mod> mods, OsuConfigManager config)
{ {
if (mods == null) if (mods == null)

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.UI
public class GameplayCursorContainer : CursorContainer public class GameplayCursorContainer : CursorContainer
{ {
/// <summary> /// <summary>
/// Because Show/Hide are executed by a parent, <see cref="State"/> is updated immediately even if the cursor /// Because Show/Hide are executed by a parent, <see cref="VisibilityContainer.State"/> is updated immediately even if the cursor
/// is in a non-updating state (via <see cref="FrameStabilityContainer"/> limitations). /// is in a non-updating state (via <see cref="FrameStabilityContainer"/> limitations).
/// ///
/// This holds the true visibility value. /// This holds the true visibility value.

View File

@ -100,7 +100,6 @@ namespace osu.Game.Rulesets.UI
/// <summary> /// <summary>
/// Provide an optional cursor which is to be used for gameplay. /// Provide an optional cursor which is to be used for gameplay.
/// If providing a cursor, <see cref="CursorTargetContainer"/> must also point to a valid target container.
/// </summary> /// </summary>
/// <returns>The cursor, or null if a cursor is not rqeuired.</returns> /// <returns>The cursor, or null if a cursor is not rqeuired.</returns>
protected virtual GameplayCursorContainer CreateCursor() => null; protected virtual GameplayCursorContainer CreateCursor() => null;

View File

@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
/// <param name="currentTime">The current time.</param> /// <param name="currentTime">The current time.</param>
/// <param name="timeRange">The amount of visible time.</param> /// <param name="timeRange">The amount of visible time.</param>
/// <param name="scrollLength">The absolute spatial length through <see cref="timeRange"/>.</param> /// <param name="scrollLength">The absolute spatial length through <see cref="timeRange"/>.</param>
/// <returns>The time at which <see cref="PositionAt(t)"/> == <paramref name="position"/>.</returns> /// <returns>The time at which <see cref="PositionAt(double,double,double,float)"/> == <paramref name="position"/>.</returns>
double TimeAt(float position, double currentTime, double timeRange, float scrollLength); double TimeAt(float position, double currentTime, double timeRange, float scrollLength);
/// <summary> /// <summary>

View File

@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
protected virtual ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Sequential; protected virtual ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Sequential;
/// <summary> /// <summary>
/// Whether the player can change <see cref="VisibleTimeRange"/>. /// Whether the player can change <see cref="TimeRange"/>.
/// </summary> /// </summary>
protected virtual bool UserScrollSpeedAdjustment => true; protected virtual bool UserScrollSpeedAdjustment => true;

View File

@ -21,7 +21,7 @@ namespace osu.Game.Screens
//public float ParallaxAmount { set => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * value; } //public float ParallaxAmount { set => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * value; }
public new void Push(BackgroundScreen screen) public void Push(BackgroundScreen screen)
{ {
if (screen == null) if (screen == null)
return; return;

View File

@ -121,6 +121,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// Handle a blueprint requesting selection. /// Handle a blueprint requesting selection.
/// </summary> /// </summary>
/// <param name="blueprint">The blueprint.</param> /// <param name="blueprint">The blueprint.</param>
/// <param name="state">The input state at the point of selection.</param>
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state) internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
{ {
if (state.Keyboard.ControlPressed) if (state.Keyboard.ControlPressed)
@ -166,8 +167,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
var topLeft = new Vector2(float.MaxValue, float.MaxValue); var topLeft = new Vector2(float.MaxValue, float.MaxValue);
var bottomRight = new Vector2(float.MinValue, float.MinValue); var bottomRight = new Vector2(float.MinValue, float.MinValue);
bool hasSelection = false;
foreach (var blueprint in selectedBlueprints) foreach (var blueprint in selectedBlueprints)
{ {
topLeft = Vector2.ComponentMin(topLeft, ToLocalSpace(blueprint.SelectionQuad.TopLeft)); topLeft = Vector2.ComponentMin(topLeft, ToLocalSpace(blueprint.SelectionQuad.TopLeft));

View File

@ -131,7 +131,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private readonly float scrollOffset; private readonly float scrollOffset;
/// <summary> /// <summary>
/// Transforms <see cref="TimeTimelinem"/> to a new value. /// Transforms <see cref="ZoomableScrollContainer.currentZoom"/> to a new value.
/// </summary> /// </summary>
/// <param name="focusPoint">The focus point in absolute coordinates local to the content.</param> /// <param name="focusPoint">The focus point in absolute coordinates local to the content.</param>
/// <param name="contentSize">The size of the content.</param> /// <param name="contentSize">The size of the content.</param>

View File

@ -65,9 +65,6 @@ namespace osu.Game.Screens.Edit
dependencies.Cache(beatDivisor); dependencies.Cache(beatDivisor);
EditorMenuBar menuBar; EditorMenuBar menuBar;
TimeInfoContainer timeInfo;
SummaryTimeline timeline;
PlaybackControl playback;
var fileMenuItems = new List<MenuItem>(); var fileMenuItems = new List<MenuItem>();
if (RuntimeInfo.IsDesktop) if (RuntimeInfo.IsDesktop)

View File

@ -60,14 +60,7 @@ namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
set => label.Colour = value; set => label.Colour = value;
} }
public Color4 BackgroundColour
{
get => content.Colour;
set => content.Colour = value;
}
private readonly OsuTextBox textBox; private readonly OsuTextBox textBox;
private readonly Container content;
private readonly OsuSpriteText label; private readonly OsuSpriteText label;
public LabelledTextBox() public LabelledTextBox()

View File

@ -13,15 +13,13 @@ namespace osu.Game.Screens.Multi.Components
protected override void AddTabItem(TabItem<T> tab, bool addToDropdown = true) protected override void AddTabItem(TabItem<T> tab, bool addToDropdown = true)
{ {
if (tab is DisableableTabItem<T> disableable) if (tab is DisableableTabItem disableable)
disableable.Enabled.BindTo(Enabled); disableable.Enabled.BindTo(Enabled);
base.AddTabItem(tab, addToDropdown); base.AddTabItem(tab, addToDropdown);
} }
protected abstract class DisableableTabItem<T> : TabItem<T> protected abstract class DisableableTabItem : TabItem<T>
{ {
public readonly BindableBool Enabled = new BindableBool();
protected DisableableTabItem(T value) protected DisableableTabItem(T value)
: base(value) : base(value)
{ {

View File

@ -25,8 +25,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
OsuSpriteText summary; OsuSpriteText summary;
OsuSpriteText levelRangeHigher;
OsuSpriteText levelRangeLower;
Container flagContainer; Container flagContainer;
LinkFlowContainer hostText; LinkFlowContainer hostText;
@ -45,21 +43,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
Width = 22f, Width = 22f,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
}, },
/*new Container //todo: team banners
{
Width = 38f,
RelativeSizeAxes = Axes.Y,
CornerRadius = 2f,
Masking = true,
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"ad387e"),
},
},
},*/
hostText = new LinkFlowContainer hostText = new LinkFlowContainer
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
@ -101,13 +84,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
}, true); }, true);
ParticipantCount.BindValueChanged(count => summary.Text = "participant".ToQuantity(count.NewValue), true); ParticipantCount.BindValueChanged(count => summary.Text = "participant".ToQuantity(count.NewValue), true);
/*Participants.BindValueChanged(e =>
{
var ranks = v.Select(u => u.Statistics.Ranks.Global);
levelRangeLower.Text = ranks.Min().ToString();
levelRangeHigher.Text = ranks.Max().ToString();
});*/
} }
} }
} }

View File

@ -97,7 +97,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Font = OsuFont.GetFont(size: 30), Font = OsuFont.GetFont(size: 30),
Current = Name Current = RoomName
}, },
}, },
}, },

View File

@ -36,7 +36,7 @@ namespace osu.Game.Screens.Multi.Match.Components
AddItem(new GameTypeTimeshift()); AddItem(new GameTypeTimeshift());
} }
private class GameTypePickerItem : DisableableTabItem<GameType> private class GameTypePickerItem : DisableableTabItem
{ {
private const float transition_duration = 200; private const float transition_duration = 200;

View File

@ -30,7 +30,6 @@ namespace osu.Game.Screens.Multi.Match.Components
ReadyButton readyButton; ReadyButton readyButton;
ViewBeatmapButton viewBeatmapButton; ViewBeatmapButton viewBeatmapButton;
HostInfo hostInfo; HostInfo hostInfo;
RoomStatusInfo statusInfo;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
@ -63,7 +62,7 @@ namespace osu.Game.Screens.Multi.Match.Components
new OsuSpriteText new OsuSpriteText
{ {
Font = OsuFont.GetFont(size: 30), Font = OsuFont.GetFont(size: 30),
Current = Name Current = RoomName
}, },
new RoomStatusInfo(), new RoomStatusInfo(),
} }

View File

@ -265,7 +265,7 @@ namespace osu.Game.Screens.Multi.Match.Components
}; };
TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue?.Name ?? string.Empty, true); TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue?.Name ?? string.Empty, true);
Name.BindValueChanged(name => NameField.Text = name.NewValue, true); RoomName.BindValueChanged(name => NameField.Text = name.NewValue, true);
Availability.BindValueChanged(availability => AvailabilityPicker.Current.Value = availability.NewValue, true); Availability.BindValueChanged(availability => AvailabilityPicker.Current.Value = availability.NewValue, true);
Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true); Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true); MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
@ -285,7 +285,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{ {
hideError(); hideError();
Name.Value = NameField.Text; RoomName.Value = NameField.Text;
Availability.Value = AvailabilityPicker.Current.Value; Availability.Value = AvailabilityPicker.Current.Value;
Type.Value = TypePicker.Current.Value; Type.Value = TypePicker.Current.Value;

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Multi.Match.Components
AddItem(RoomAvailability.InviteOnly); AddItem(RoomAvailability.InviteOnly);
} }
private class RoomAvailabilityPickerItem : DisableableTabItem<RoomAvailability> private class RoomAvailabilityPickerItem : DisableableTabItem
{ {
private const float transition_duration = 200; private const float transition_duration = 200;

View File

@ -16,8 +16,8 @@ namespace osu.Game.Screens.Multi
[Resolved(typeof(Room))] [Resolved(typeof(Room))]
protected Bindable<int?> RoomID { get; private set; } protected Bindable<int?> RoomID { get; private set; }
[Resolved(typeof(Room))] [Resolved(typeof(Room), nameof(Room.Name))]
protected Bindable<string> Name { get; private set; } protected Bindable<string> RoomName { get; private set; }
[Resolved(typeof(Room))] [Resolved(typeof(Room))]
protected Bindable<User> Host { get; private set; } protected Bindable<User> Host { get; private set; }

View File

@ -3,22 +3,17 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Input.Bindings;
namespace osu.Game.Screens.Multi namespace osu.Game.Screens.Multi
{ {
public abstract class MultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen, IKeyBindingHandler<GlobalAction> public abstract class MultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen
{ {
public override bool DisallowExternalBeatmapRulesetChanges => false; public override bool DisallowExternalBeatmapRulesetChanges => false;
public virtual string ShortTitle => Title; public virtual string ShortTitle => Title;
[Resolved(CanBeNull = true)]
protected OsuGame Game { get; private set; }
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
protected IRoomManager RoomManager { get; private set; } protected IRoomManager RoomManager { get; private set; }
@ -56,21 +51,6 @@ namespace osu.Game.Screens.Multi
this.MoveToX(-200, WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint); this.MoveToX(-200, WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint);
} }
public override bool OnPressed(GlobalAction action)
{
if (!this.IsCurrentScreen()) return false;
if (action == GlobalAction.Back)
{
this.Exit();
return true;
}
return false;
}
public bool OnReleased(GlobalAction action) => action == GlobalAction.Back;
public override string ToString() => Title; public override string ToString() => Title;
} }
} }

View File

@ -171,7 +171,7 @@ namespace osu.Game.Screens.Multi
/// <summary> /// <summary>
/// Adds a <see cref="Room"/> to the list of available rooms. /// Adds a <see cref="Room"/> to the list of available rooms.
/// </summary> /// </summary>
/// <param name="room">The <see cref="Room"/> to add.<</param> /// <param name="room">The <see cref="Room"/> to add.</param>
private void addRoom(Room room) private void addRoom(Room room)
{ {
var existing = rooms.FirstOrDefault(e => e.RoomID.Value == room.RoomID.Value); var existing = rooms.FirstOrDefault(e => e.RoomID.Value == room.RoomID.Value);

View File

@ -8,7 +8,7 @@ namespace osu.Game.Screens.Play
{ {
/// <summary> /// <summary>
/// A clock which is used for gameplay elements that need to follow audio time 1:1. /// A clock which is used for gameplay elements that need to follow audio time 1:1.
/// Exposed via DI by <see cref="PausableGameplayContainer"/>. /// Exposed via DI by <see cref="GameplayClockContainer"/>.
/// <remarks> /// <remarks>
/// The main purpose of this clock is to stop components using it from accidentally processing the main /// The main purpose of this clock is to stop components using it from accidentally processing the main
/// <see cref="IFrameBasedClock"/>, as this should only be done once to ensure accuracy. /// <see cref="IFrameBasedClock"/>, as this should only be done once to ensure accuracy.

View File

@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
[Cached] [Cached]
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))] [Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
protected readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>()); protected new readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
private readonly bool allowPause; private readonly bool allowPause;
private readonly bool showResults; private readonly bool showResults;

View File

@ -320,7 +320,6 @@ namespace osu.Game.Screens.Play
private readonly Drawable facade; private readonly Drawable facade;
private LoadingAnimation loading; private LoadingAnimation loading;
private Sprite backgroundSprite; private Sprite backgroundSprite;
private ModDisplay modDisplay;
public bool Loading public bool Loading
{ {

View File

@ -31,8 +31,6 @@ namespace osu.Game.Screens.Select.Carousel
} }
} }
private int creationOrder;
protected CarouselItem() protected CarouselItem()
{ {
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation); DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);

View File

@ -388,8 +388,6 @@ namespace osu.Game.Screens.Select
{ {
Logger.Log($"updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ID.ToString() ?? "null"}"); Logger.Log($"updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ID.ToString() ?? "null"}");
bool preview = false;
if (ruleset?.Equals(decoupledRuleset.Value) == false) if (ruleset?.Equals(decoupledRuleset.Value) == false)
{ {
Logger.Log($"ruleset changed from \"{decoupledRuleset.Value}\" to \"{ruleset}\""); Logger.Log($"ruleset changed from \"{decoupledRuleset.Value}\" to \"{ruleset}\"");

View File

@ -0,0 +1,24 @@
// 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 System;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
namespace osu.Game.Skinning
{
/// <summary>
/// Provides access to skinnable elements.
/// </summary>
public interface ISkin
{
Drawable GetDrawableComponent(string componentName);
Texture GetTexture(string componentName);
SampleChannel GetSample(string sampleName);
TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration;
}
}

View File

@ -2,25 +2,14 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
namespace osu.Game.Skinning namespace osu.Game.Skinning
{ {
/// <summary> /// <summary>
/// Provides access to skinnable elements. /// Provides access to skinnable elements.
/// </summary> /// </summary>
public interface ISkinSource public interface ISkinSource : ISkin
{ {
event Action SourceChanged; event Action SourceChanged;
Drawable GetDrawableComponent(string componentName);
Texture GetTexture(string componentName);
SampleChannel GetSample(string sampleName);
TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration;
} }
} }

View File

@ -22,18 +22,18 @@ namespace osu.Game.Skinning
private readonly Bindable<bool> beatmapSkins = new Bindable<bool>(); private readonly Bindable<bool> beatmapSkins = new Bindable<bool>();
private readonly Bindable<bool> beatmapHitsounds = new Bindable<bool>(); private readonly Bindable<bool> beatmapHitsounds = new Bindable<bool>();
private readonly ISkinSource source; private readonly ISkin skin;
private ISkinSource fallbackSource; private ISkinSource fallbackSource;
public LocalSkinOverrideContainer(ISkinSource source) public LocalSkinOverrideContainer(ISkin skin)
{ {
this.source = source; this.skin = skin;
} }
public Drawable GetDrawableComponent(string componentName) public Drawable GetDrawableComponent(string componentName)
{ {
Drawable sourceDrawable; Drawable sourceDrawable;
if (beatmapSkins.Value && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) if (beatmapSkins.Value && (sourceDrawable = skin.GetDrawableComponent(componentName)) != null)
return sourceDrawable; return sourceDrawable;
return fallbackSource?.GetDrawableComponent(componentName); return fallbackSource?.GetDrawableComponent(componentName);
@ -42,7 +42,7 @@ namespace osu.Game.Skinning
public Texture GetTexture(string componentName) public Texture GetTexture(string componentName)
{ {
Texture sourceTexture; Texture sourceTexture;
if (beatmapSkins.Value && (sourceTexture = source.GetTexture(componentName)) != null) if (beatmapSkins.Value && (sourceTexture = skin.GetTexture(componentName)) != null)
return sourceTexture; return sourceTexture;
return fallbackSource.GetTexture(componentName); return fallbackSource.GetTexture(componentName);
@ -51,7 +51,7 @@ namespace osu.Game.Skinning
public SampleChannel GetSample(string sampleName) public SampleChannel GetSample(string sampleName)
{ {
SampleChannel sourceChannel; SampleChannel sourceChannel;
if (beatmapHitsounds.Value && (sourceChannel = source.GetSample(sampleName)) != null) if (beatmapHitsounds.Value && (sourceChannel = skin.GetSample(sampleName)) != null)
return sourceChannel; return sourceChannel;
return fallbackSource?.GetSample(sampleName); return fallbackSource?.GetSample(sampleName);
@ -60,7 +60,7 @@ namespace osu.Game.Skinning
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
{ {
TValue val; TValue val;
if ((source as Skin)?.Configuration is TConfiguration conf) if ((skin as Skin)?.Configuration is TConfiguration conf)
if (beatmapSkins.Value && (val = query.Invoke(conf)) != null) if (beatmapSkins.Value && (val = query.Invoke(conf)) != null)
return val; return val;

View File

@ -8,14 +8,12 @@ using osu.Framework.Graphics.Textures;
namespace osu.Game.Skinning namespace osu.Game.Skinning
{ {
public abstract class Skin : IDisposable, ISkinSource public abstract class Skin : IDisposable, ISkin
{ {
public readonly SkinInfo SkinInfo; public readonly SkinInfo SkinInfo;
public virtual SkinConfiguration Configuration { get; protected set; } public virtual SkinConfiguration Configuration { get; protected set; }
public event Action SourceChanged;
public abstract Drawable GetDrawableComponent(string componentName); public abstract Drawable GetDrawableComponent(string componentName);
public abstract SampleChannel GetSample(string sampleName); public abstract SampleChannel GetSample(string sampleName);

View File

@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual
{ {
Player p = null; Player p = null;
AddStep(r.Name, () => p = loadPlayerFor(r)); AddStep(r.Name, () => p = loadPlayerFor(r));
AddUntilStep(() => AddUntilStep("player loaded", () =>
{ {
if (p?.IsLoaded == true) if (p?.IsLoaded == true)
{ {
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual
} }
return false; return false;
}, "player loaded"); });
AddCheckSteps(); AddCheckSteps();
} }

View File

@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual
public abstract class EditorClockTestCase : OsuTestCase public abstract class EditorClockTestCase : OsuTestCase
{ {
protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor(); protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor();
protected readonly EditorClock Clock; protected new readonly EditorClock Clock;
protected EditorClockTestCase() protected EditorClockTestCase()
{ {

View File

@ -31,7 +31,7 @@ namespace osu.Game.Tests.Visual
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))] [Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]
protected readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>()); protected readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
protected DependencyContainer Dependencies { get; private set; } protected new DependencyContainer Dependencies { get; private set; }
private readonly Lazy<Storage> localStorage; private readonly Lazy<Storage> localStorage;
protected Storage LocalStorage => localStorage.Value; protected Storage LocalStorage => localStorage.Value;

View File

@ -26,7 +26,7 @@ namespace osu.Game.Tests.Visual
public void SetUpSteps() public void SetUpSteps()
{ {
AddStep(ruleset.RulesetInfo.Name, loadPlayer); AddStep(ruleset.RulesetInfo.Name, loadPlayer);
AddUntilStep(() => Player.IsLoaded && Player.Alpha == 1, "player loaded"); AddUntilStep("player loaded", () => Player.IsLoaded && Player.Alpha == 1);
} }
protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo); protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo);

View File

@ -5,7 +5,6 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WarningLevel>0</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup Label="Service"> <ItemGroup Label="Service">
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />