mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Turn on warnings, resolve issues (#4679)
Turn on warnings, resolve issues
This commit is contained in:
commit
4fade26543
@ -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 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();
|
||||
}
|
||||
|
||||
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 Texture GetTexture(string componentName) => throw new NotImplementedException();
|
||||
|
@ -4,7 +4,7 @@
|
||||
namespace osu.Game.Audio
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for objects that can own <see cref="IPreviewTrack"/>s.
|
||||
/// Interface for objects that can own <see cref="PreviewTrack"/>s.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="IPreviewTrackOwner"/>s can cancel the currently playing <see cref="PreviewTrack"/> through the
|
||||
|
@ -98,7 +98,7 @@ namespace osu.Game.Beatmaps
|
||||
protected abstract IEnumerable<Type> ValidConversionTypes { get; }
|
||||
|
||||
/// <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>
|
||||
protected virtual Beatmap<T> CreateBeatmap() => new Beatmap<T>();
|
||||
|
||||
|
@ -217,7 +217,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
request.Perform(api);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
// 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.
|
||||
/// </summary>
|
||||
/// <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>
|
||||
/// <returns>True if population was successful.</returns>
|
||||
private bool fetchAndPopulateOnlineValues(BeatmapInfo beatmap, bool force = false)
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
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.
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
public abstract BindableBeatmap GetBoundCopy();
|
||||
public new abstract BindableBeatmap GetBoundCopy();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Difficulty;
|
||||
@ -73,9 +74,18 @@ namespace osu.Game.Beatmaps
|
||||
private class DummyBeatmapConverter : IBeatmapConverter
|
||||
{
|
||||
public event Action<HitObject, IEnumerable<HitObject>> ObjectConverted;
|
||||
|
||||
public IBeatmap Beatmap { get; set; }
|
||||
|
||||
public bool CanConvert => true;
|
||||
public IBeatmap Convert() => Beatmap;
|
||||
|
||||
public IBeatmap Convert()
|
||||
{
|
||||
foreach (var obj in Beatmap.HitObjects)
|
||||
ObjectConverted?.Invoke(obj, obj.Yield());
|
||||
|
||||
return Beatmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
throw new InvalidOperationException(@"Color must be specified with 8-bit integer components");
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ namespace osu.Game.Beatmaps
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <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>
|
||||
/// <exception cref="BeatmapInvalidForRulesetException">If <see cref="Beatmap"/> could not be converted to <paramref name="ruleset"/>.</exception>
|
||||
public IBeatmap GetPlayableBeatmap(RulesetInfo ruleset, IReadOnlyList<Mod> mods)
|
||||
|
@ -563,7 +563,7 @@ namespace osu.Game.Database
|
||||
/// <summary>
|
||||
/// Check whether an existing model already exists for a new import item.
|
||||
/// </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>
|
||||
protected TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash);
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// 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 System.Linq;
|
||||
using System.Threading;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
@ -67,7 +66,7 @@ namespace osu.Game.Database
|
||||
context = threadContexts.Value;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
// retrieval of a context could trigger a fatal error.
|
||||
Monitor.Exit(writeLock);
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Database
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
connection.Close();
|
||||
throw;
|
||||
|
@ -103,7 +103,7 @@ namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
channelManager?.OpenChannel(linkArgument);
|
||||
}
|
||||
catch (ChannelNotFoundException e)
|
||||
catch (ChannelNotFoundException)
|
||||
{
|
||||
Logger.Log($"The requested channel \"{linkArgument}\" does not exist");
|
||||
}
|
||||
|
@ -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.
|
||||
/// </summary>
|
||||
/// <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="easing">The easing type of the initial transform.</param>
|
||||
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
|
||||
{
|
||||
public void SetSize(Vector2 size)
|
||||
public new void SetSize(Vector2 size)
|
||||
{
|
||||
base.SetSize(size);
|
||||
}
|
||||
|
@ -61,9 +61,9 @@ namespace osu.Game.Graphics
|
||||
/// <summary>
|
||||
/// Retrieves the string representation of a <see cref="FontWeight"/>.
|
||||
/// </summary>
|
||||
/// <param name="typeface">The <see cref="Typeface"/>.</param>
|
||||
/// <param name="family">The family string.</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)
|
||||
{
|
||||
string weightString = weight.ToString();
|
||||
@ -81,6 +81,7 @@ namespace osu.Game.Graphics
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="FontUsage"/> by applying adjustments to this <see cref="FontUsage"/>.
|
||||
/// </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="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>
|
||||
|
@ -8,7 +8,7 @@ using osu.Framework.Screens;
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
/// <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>
|
||||
public class ScreenBreadcrumbControl : BreadcrumbControl<IScreen>
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ namespace osu.Game.Online.API
|
||||
handleWebException(we);
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring.Legacy;
|
||||
using osu.Game.Users;
|
||||
|
||||
@ -71,7 +70,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
foreach (var kvp in value)
|
||||
{
|
||||
HitResult newKey;
|
||||
switch (kvp.Key)
|
||||
{
|
||||
case @"count_geki":
|
||||
|
@ -10,16 +10,16 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public class APIUserMostPlayedBeatmap
|
||||
{
|
||||
[JsonProperty("beatmap_id")]
|
||||
public int BeatmapID;
|
||||
public int BeatmapID { get; set; }
|
||||
|
||||
[JsonProperty("count")]
|
||||
public int PlayCount;
|
||||
public int PlayCount { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
private BeatmapInfo beatmap;
|
||||
private BeatmapInfo beatmap { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
private APIBeatmapSet beatmapSet;
|
||||
private APIBeatmapSet beatmapSet { get; set; }
|
||||
|
||||
public BeatmapInfo GetBeatmapInfo(RulesetStore rulesets)
|
||||
{
|
||||
|
@ -27,8 +27,6 @@ namespace osu.Game.Online.Chat
|
||||
|
||||
protected ChannelManager ChannelManager;
|
||||
|
||||
private ScrollContainer scroll;
|
||||
|
||||
private DrawableChannel drawableChannel;
|
||||
|
||||
private readonly bool postingTextbox;
|
||||
|
@ -272,7 +272,6 @@ namespace osu.Game
|
||||
/// Present a score's replay immediately.
|
||||
/// The user should have already requested this interactively.
|
||||
/// </summary>
|
||||
/// <param name="beatmap">The beatmap to select.</param>
|
||||
public void PresentScore(ScoreInfo score)
|
||||
{
|
||||
var databasedScore = ScoreManager.GetScore(score);
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private new void load(OsuColour colour)
|
||||
private void load(OsuColour colour)
|
||||
{
|
||||
BackgroundInactive = colour.Gray2;
|
||||
BackgroundActive = colour.Gray3;
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
@ -18,9 +17,6 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
{
|
||||
public class PrivateChannelTabItem : ChannelTabItem
|
||||
{
|
||||
private readonly OsuSpriteText username;
|
||||
private readonly Avatar avatarContainer;
|
||||
|
||||
protected override IconUsage DisplayIcon => FontAwesome.Solid.At;
|
||||
|
||||
public PrivateChannelTabItem(Channel value)
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
public abstract class HoldToConfirmOverlay : HoldToConfirmContainer
|
||||
{
|
||||
|
@ -50,7 +50,6 @@ namespace osu.Game.Overlays
|
||||
private BeatmapManager beatmaps;
|
||||
|
||||
private List<BeatmapSetInfo> beatmapSets;
|
||||
private BeatmapSetInfo currentSet;
|
||||
|
||||
private Container dragContainer;
|
||||
private Container playerContainer;
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Configuration;
|
||||
|
||||
@ -9,7 +10,7 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
public abstract class RulesetSettingsSubsection : SettingsSubsection
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
protected override OsuDropdown<T> CreateDropdown() => new DropdownControl();
|
||||
|
||||
protected class DropdownControl : OsuEnumDropdown<T>
|
||||
protected new class DropdownControl : OsuEnumDropdown<T>
|
||||
{
|
||||
public DropdownControl()
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
/// <summary>
|
||||
/// Creates the <see cref="Skill"/>s to calculate the difficulty of an <see cref="IBeatmap"/>.
|
||||
/// </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>
|
||||
protected abstract Skill[] CreateSkills(IBeatmap beatmap);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Screens.Edit.Compose;
|
||||
using osuTK;
|
||||
@ -108,7 +109,8 @@ namespace osu.Game.Rulesets.Edit
|
||||
}
|
||||
|
||||
/// <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>
|
||||
protected void ApplyDefaultsToHitObject() => HitObject.ApplyDefaults(beatmap.Value.Beatmap.ControlPointInfo, beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty);
|
||||
|
||||
|
@ -68,9 +68,11 @@ namespace osu.Game.Rulesets.Edit
|
||||
get => state;
|
||||
set
|
||||
{
|
||||
if (state == value) return;
|
||||
if (state == value)
|
||||
return;
|
||||
|
||||
state = value;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case SelectionState.Selected:
|
||||
@ -82,6 +84,8 @@ namespace osu.Game.Rulesets.Edit
|
||||
Deselected?.Invoke(this);
|
||||
break;
|
||||
}
|
||||
|
||||
StateChanged?.Invoke(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,12 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for a <see cref="Mod"/> that applies changes to a <see cref="BeatmapConverter{TObject}"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="TObject">The type of converted <see cref="HitObject"/>.</typeparam>
|
||||
public interface IApplicableToBeatmapConverter : IApplicableMod
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public interface IApplicableToHitObject : IApplicableMod
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies this <see cref="IApplicableToHitObject{TObject}"/> to a <see cref="HitObject"/>.
|
||||
/// Applies this <see cref="IApplicableToHitObject"/> to a <see cref="HitObject"/>.
|
||||
/// </summary>
|
||||
/// <param name="hitObject">The <see cref="HitObject"/> to apply to.</param>
|
||||
void ApplyToHitObject(HitObject hitObject);
|
||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.TypeExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Graphics;
|
||||
@ -58,7 +59,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
public bool AllJudged => Judged && NestedHitObjects.All(h => h.AllJudged);
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public bool IsHit => Result?.IsHit ?? false;
|
||||
@ -223,7 +224,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
|
||||
/// <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>
|
||||
internal void OnLifetimeEnd()
|
||||
{
|
||||
|
@ -53,8 +53,6 @@ namespace osu.Game.Rulesets.Objects
|
||||
[JsonIgnore]
|
||||
public bool Kiai { get; private set; }
|
||||
|
||||
private float overallDifficulty = BeatmapDifficulty.DEFAULT_DIFFICULTY;
|
||||
|
||||
/// <summary>
|
||||
/// The hit windows for this <see cref="HitObject"/>.
|
||||
/// </summary>
|
||||
@ -115,7 +113,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// 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"/>.
|
||||
/// <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>
|
||||
/// </summary>
|
||||
protected virtual HitWindows CreateHitWindows() => new HitWindows();
|
||||
|
@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
/// <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.
|
||||
/// 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>
|
||||
/// <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>
|
||||
|
@ -277,12 +277,5 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ namespace osu.Game.Rulesets
|
||||
/// Attempt to create a hit renderer for a beatmap
|
||||
/// </summary>
|
||||
/// <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>
|
||||
/// <returns></returns>
|
||||
public abstract DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods);
|
||||
|
@ -154,7 +154,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <summary>
|
||||
/// Notifies subscribers of <see cref="NewJudgement"/> that a new judgement has occurred.
|
||||
/// </summary>
|
||||
/// <param name="judgement">The judgement to notify subscribers of.</param>
|
||||
/// <param name="result">The judgement scoring result to notify subscribers of.</param>
|
||||
protected void NotifyNewJudgement(JudgementResult result)
|
||||
{
|
||||
@ -283,7 +282,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <summary>
|
||||
/// Reverts the score change of a <see cref="JudgementResult"/> that was applied to this <see cref="ScoreProcessor"/>.
|
||||
/// </summary>
|
||||
/// <param name="judgement">The judgement to remove.</param>
|
||||
/// <param name="result">The judgement scoring result.</param>
|
||||
private void revertResult(JudgementResult result)
|
||||
{
|
||||
@ -340,7 +338,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <summary>
|
||||
/// Reverts the score change of a <see cref="JudgementResult"/> that was applied to this <see cref="ScoreProcessor"/>.
|
||||
/// </summary>
|
||||
/// <param name="judgement">The judgement to remove.</param>
|
||||
/// <param name="result">The judgement scoring result.</param>
|
||||
protected virtual void RevertResult(JudgementResult result)
|
||||
{
|
||||
|
@ -93,6 +93,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
/// <param name="ruleset">The ruleset being represented.</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)
|
||||
: base(ruleset)
|
||||
{
|
||||
@ -275,7 +276,8 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <summary>
|
||||
/// Applies the active mods to this DrawableRuleset.
|
||||
/// </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)
|
||||
{
|
||||
if (mods == null)
|
||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.UI
|
||||
public class GameplayCursorContainer : CursorContainer
|
||||
{
|
||||
/// <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).
|
||||
///
|
||||
/// This holds the true visibility value.
|
||||
|
@ -100,7 +100,6 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// <returns>The cursor, or null if a cursor is not rqeuired.</returns>
|
||||
protected virtual GameplayCursorContainer CreateCursor() => null;
|
||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
|
||||
/// <param name="currentTime">The current time.</param>
|
||||
/// <param name="timeRange">The amount of visible time.</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);
|
||||
|
||||
/// <summary>
|
||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
protected virtual ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Sequential;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the player can change <see cref="VisibleTimeRange"/>.
|
||||
/// Whether the player can change <see cref="TimeRange"/>.
|
||||
/// </summary>
|
||||
protected virtual bool UserScrollSpeedAdjustment => true;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Screens
|
||||
|
||||
//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)
|
||||
return;
|
||||
|
@ -121,6 +121,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// Handle a blueprint requesting selection.
|
||||
/// </summary>
|
||||
/// <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)
|
||||
{
|
||||
if (state.Keyboard.ControlPressed)
|
||||
@ -166,8 +167,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
var topLeft = new Vector2(float.MaxValue, float.MaxValue);
|
||||
var bottomRight = new Vector2(float.MinValue, float.MinValue);
|
||||
|
||||
bool hasSelection = false;
|
||||
|
||||
foreach (var blueprint in selectedBlueprints)
|
||||
{
|
||||
topLeft = Vector2.ComponentMin(topLeft, ToLocalSpace(blueprint.SelectionQuad.TopLeft));
|
||||
|
@ -131,7 +131,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
private readonly float scrollOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Transforms <see cref="TimeTimelinem"/> to a new value.
|
||||
/// Transforms <see cref="ZoomableScrollContainer.currentZoom"/> to a new value.
|
||||
/// </summary>
|
||||
/// <param name="focusPoint">The focus point in absolute coordinates local to the content.</param>
|
||||
/// <param name="contentSize">The size of the content.</param>
|
||||
|
@ -65,9 +65,6 @@ namespace osu.Game.Screens.Edit
|
||||
dependencies.Cache(beatDivisor);
|
||||
|
||||
EditorMenuBar menuBar;
|
||||
TimeInfoContainer timeInfo;
|
||||
SummaryTimeline timeline;
|
||||
PlaybackControl playback;
|
||||
|
||||
var fileMenuItems = new List<MenuItem>();
|
||||
if (RuntimeInfo.IsDesktop)
|
||||
|
@ -60,14 +60,7 @@ namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
|
||||
set => label.Colour = value;
|
||||
}
|
||||
|
||||
public Color4 BackgroundColour
|
||||
{
|
||||
get => content.Colour;
|
||||
set => content.Colour = value;
|
||||
}
|
||||
|
||||
private readonly OsuTextBox textBox;
|
||||
private readonly Container content;
|
||||
private readonly OsuSpriteText label;
|
||||
|
||||
public LabelledTextBox()
|
||||
|
@ -13,15 +13,13 @@ namespace osu.Game.Screens.Multi.Components
|
||||
|
||||
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);
|
||||
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)
|
||||
: base(value)
|
||||
{
|
||||
|
@ -25,8 +25,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
OsuSpriteText summary;
|
||||
OsuSpriteText levelRangeHigher;
|
||||
OsuSpriteText levelRangeLower;
|
||||
Container flagContainer;
|
||||
LinkFlowContainer hostText;
|
||||
|
||||
@ -45,21 +43,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
Width = 22f,
|
||||
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
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
@ -101,13 +84,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
}, 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();
|
||||
});*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Font = OsuFont.GetFont(size: 30),
|
||||
Current = Name
|
||||
Current = RoomName
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
AddItem(new GameTypeTimeshift());
|
||||
}
|
||||
|
||||
private class GameTypePickerItem : DisableableTabItem<GameType>
|
||||
private class GameTypePickerItem : DisableableTabItem
|
||||
{
|
||||
private const float transition_duration = 200;
|
||||
|
||||
|
@ -30,7 +30,6 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
ReadyButton readyButton;
|
||||
ViewBeatmapButton viewBeatmapButton;
|
||||
HostInfo hostInfo;
|
||||
RoomStatusInfo statusInfo;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -63,7 +62,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 30),
|
||||
Current = Name
|
||||
Current = RoomName
|
||||
},
|
||||
new RoomStatusInfo(),
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
};
|
||||
|
||||
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);
|
||||
Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
|
||||
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
|
||||
@ -285,7 +285,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
hideError();
|
||||
|
||||
Name.Value = NameField.Text;
|
||||
RoomName.Value = NameField.Text;
|
||||
Availability.Value = AvailabilityPicker.Current.Value;
|
||||
Type.Value = TypePicker.Current.Value;
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
AddItem(RoomAvailability.InviteOnly);
|
||||
}
|
||||
|
||||
private class RoomAvailabilityPickerItem : DisableableTabItem<RoomAvailability>
|
||||
private class RoomAvailabilityPickerItem : DisableableTabItem
|
||||
{
|
||||
private const float transition_duration = 200;
|
||||
|
||||
|
@ -16,8 +16,8 @@ namespace osu.Game.Screens.Multi
|
||||
[Resolved(typeof(Room))]
|
||||
protected Bindable<int?> RoomID { get; private set; }
|
||||
|
||||
[Resolved(typeof(Room))]
|
||||
protected Bindable<string> Name { get; private set; }
|
||||
[Resolved(typeof(Room), nameof(Room.Name))]
|
||||
protected Bindable<string> RoomName { get; private set; }
|
||||
|
||||
[Resolved(typeof(Room))]
|
||||
protected Bindable<User> Host { get; private set; }
|
||||
|
@ -3,22 +3,17 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
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 virtual string ShortTitle => Title;
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
protected OsuGame Game { get; private set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
protected IRoomManager RoomManager { get; private set; }
|
||||
|
||||
@ -56,21 +51,6 @@ namespace osu.Game.Screens.Multi
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ namespace osu.Game.Screens.Multi
|
||||
/// <summary>
|
||||
/// Adds a <see cref="Room"/> to the list of available rooms.
|
||||
/// </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)
|
||||
{
|
||||
var existing = rooms.FirstOrDefault(e => e.RoomID.Value == room.RoomID.Value);
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// 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.
|
||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
[Cached]
|
||||
[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 showResults;
|
||||
|
@ -320,7 +320,6 @@ namespace osu.Game.Screens.Play
|
||||
private readonly Drawable facade;
|
||||
private LoadingAnimation loading;
|
||||
private Sprite backgroundSprite;
|
||||
private ModDisplay modDisplay;
|
||||
|
||||
public bool Loading
|
||||
{
|
||||
|
@ -31,8 +31,6 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
}
|
||||
}
|
||||
|
||||
private int creationOrder;
|
||||
|
||||
protected CarouselItem()
|
||||
{
|
||||
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);
|
||||
|
@ -388,8 +388,6 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Logger.Log($"updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ID.ToString() ?? "null"}");
|
||||
|
||||
bool preview = false;
|
||||
|
||||
if (ruleset?.Equals(decoupledRuleset.Value) == false)
|
||||
{
|
||||
Logger.Log($"ruleset changed from \"{decoupledRuleset.Value}\" to \"{ruleset}\"");
|
||||
|
24
osu.Game/Skinning/ISkin.cs
Normal file
24
osu.Game/Skinning/ISkin.cs
Normal 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;
|
||||
}
|
||||
}
|
@ -2,25 +2,14 @@
|
||||
// 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 ISkinSource
|
||||
public interface ISkinSource : ISkin
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -22,18 +22,18 @@ namespace osu.Game.Skinning
|
||||
private readonly Bindable<bool> beatmapSkins = new Bindable<bool>();
|
||||
private readonly Bindable<bool> beatmapHitsounds = new Bindable<bool>();
|
||||
|
||||
private readonly ISkinSource source;
|
||||
private readonly ISkin skin;
|
||||
private ISkinSource fallbackSource;
|
||||
|
||||
public LocalSkinOverrideContainer(ISkinSource source)
|
||||
public LocalSkinOverrideContainer(ISkin skin)
|
||||
{
|
||||
this.source = source;
|
||||
this.skin = skin;
|
||||
}
|
||||
|
||||
public Drawable GetDrawableComponent(string componentName)
|
||||
{
|
||||
Drawable sourceDrawable;
|
||||
if (beatmapSkins.Value && (sourceDrawable = source.GetDrawableComponent(componentName)) != null)
|
||||
if (beatmapSkins.Value && (sourceDrawable = skin.GetDrawableComponent(componentName)) != null)
|
||||
return sourceDrawable;
|
||||
|
||||
return fallbackSource?.GetDrawableComponent(componentName);
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Skinning
|
||||
public Texture GetTexture(string componentName)
|
||||
{
|
||||
Texture sourceTexture;
|
||||
if (beatmapSkins.Value && (sourceTexture = source.GetTexture(componentName)) != null)
|
||||
if (beatmapSkins.Value && (sourceTexture = skin.GetTexture(componentName)) != null)
|
||||
return sourceTexture;
|
||||
|
||||
return fallbackSource.GetTexture(componentName);
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Skinning
|
||||
public SampleChannel GetSample(string sampleName)
|
||||
{
|
||||
SampleChannel sourceChannel;
|
||||
if (beatmapHitsounds.Value && (sourceChannel = source.GetSample(sampleName)) != null)
|
||||
if (beatmapHitsounds.Value && (sourceChannel = skin.GetSample(sampleName)) != null)
|
||||
return sourceChannel;
|
||||
|
||||
return fallbackSource?.GetSample(sampleName);
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Skinning
|
||||
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
|
||||
{
|
||||
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)
|
||||
return val;
|
||||
|
||||
|
@ -8,14 +8,12 @@ using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public abstract class Skin : IDisposable, ISkinSource
|
||||
public abstract class Skin : IDisposable, ISkin
|
||||
{
|
||||
public readonly SkinInfo SkinInfo;
|
||||
|
||||
public virtual SkinConfiguration Configuration { get; protected set; }
|
||||
|
||||
public event Action SourceChanged;
|
||||
|
||||
public abstract Drawable GetDrawableComponent(string componentName);
|
||||
|
||||
public abstract SampleChannel GetSample(string sampleName);
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
Player p = null;
|
||||
AddStep(r.Name, () => p = loadPlayerFor(r));
|
||||
AddUntilStep(() =>
|
||||
AddUntilStep("player loaded", () =>
|
||||
{
|
||||
if (p?.IsLoaded == true)
|
||||
{
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual
|
||||
}
|
||||
|
||||
return false;
|
||||
}, "player loaded");
|
||||
});
|
||||
|
||||
AddCheckSteps();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual
|
||||
public abstract class EditorClockTestCase : OsuTestCase
|
||||
{
|
||||
protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor();
|
||||
protected readonly EditorClock Clock;
|
||||
protected new readonly EditorClock Clock;
|
||||
|
||||
protected EditorClockTestCase()
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Tests.Visual
|
||||
[Cached(Type = typeof(IBindable<IReadOnlyList<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;
|
||||
protected Storage LocalStorage => localStorage.Value;
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Tests.Visual
|
||||
public void SetUpSteps()
|
||||
{
|
||||
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);
|
||||
|
@ -5,7 +5,6 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<WarningLevel>0</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Service">
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
|
Loading…
Reference in New Issue
Block a user