mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Use generics everywhere.
This commit is contained in:
@ -13,6 +13,7 @@ using osu.Game.Modes.Osu.Objects.Drawables;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Game.Modes.Objects;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
@ -12,8 +12,8 @@ namespace osu.Game.Modes.Catch.UI
|
|||||||
{
|
{
|
||||||
protected override HitObjectConverter<CatchBaseHit> Converter => new CatchConverter();
|
protected override HitObjectConverter<CatchBaseHit> Converter => new CatchConverter();
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new CatchPlayfield();
|
protected override Playfield<CatchBaseHit> CreatePlayfield() => new CatchPlayfield();
|
||||||
|
|
||||||
protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) => null;// new DrawableFruit(h);
|
protected override DrawableHitObject<CatchBaseHit> GetVisualRepresentation(CatchBaseHit h) => null;// new DrawableFruit(h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,14 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Modes.Catch.Objects;
|
||||||
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Catch.UI
|
namespace osu.Game.Modes.Catch.UI
|
||||||
{
|
{
|
||||||
public class CatchPlayfield : Playfield
|
public class CatchPlayfield : Playfield<CatchBaseHit>
|
||||||
{
|
{
|
||||||
public CatchPlayfield()
|
public CatchPlayfield()
|
||||||
{
|
{
|
||||||
|
@ -19,9 +19,9 @@ namespace osu.Game.Modes.Mania.UI
|
|||||||
|
|
||||||
protected override HitObjectConverter<ManiaBaseHit> Converter => new ManiaConverter(columns);
|
protected override HitObjectConverter<ManiaBaseHit> Converter => new ManiaConverter(columns);
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new ManiaPlayfield(columns);
|
protected override Playfield<ManiaBaseHit> CreatePlayfield() => new ManiaPlayfield(columns);
|
||||||
|
|
||||||
protected override DrawableHitObject GetVisualRepresentation(ManiaBaseHit h)
|
protected override DrawableHitObject<ManiaBaseHit> GetVisualRepresentation(ManiaBaseHit h)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
//return new DrawableNote(h)
|
//return new DrawableNote(h)
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Modes.Mania.Objects;
|
||||||
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Mania.UI
|
namespace osu.Game.Modes.Mania.UI
|
||||||
{
|
{
|
||||||
public class ManiaPlayfield : Playfield
|
public class ManiaPlayfield : Playfield<ManiaBaseHit>
|
||||||
{
|
{
|
||||||
private readonly int columns;
|
private readonly int columns;
|
||||||
|
|
||||||
|
@ -85,13 +85,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
if (hitOffset < OsuHitObject.HIT_WINDOW_50)
|
if (hitOffset < OsuHitObject.HIT_WINDOW_50)
|
||||||
{
|
{
|
||||||
Judgement.Result = HitResult.Hit;
|
Judgement.Result = HitResult.Hit;
|
||||||
|
osuJudgement.Score = HitObject.ScoreResultForOffset(hitOffset);
|
||||||
if (hitOffset < OsuHitObject.HIT_WINDOW_300)
|
|
||||||
osuJudgement.Score = OsuScoreResult.Hit300;
|
|
||||||
else if (hitOffset < OsuHitObject.HIT_WINDOW_100)
|
|
||||||
osuJudgement.Score = OsuScoreResult.Hit100;
|
|
||||||
else if (hitOffset < OsuHitObject.HIT_WINDOW_50)
|
|
||||||
osuJudgement.Score = OsuScoreResult.Hit50;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Judgement.Result = HitResult.Miss;
|
Judgement.Result = HitResult.Miss;
|
||||||
|
@ -7,7 +7,7 @@ using osu.Game.Modes.Objects.Drawables;
|
|||||||
|
|
||||||
namespace osu.Game.Modes.Osu.Objects.Drawables
|
namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableOsuHitObject : DrawableHitObject
|
public class DrawableOsuHitObject : DrawableHitObject<OsuHitObject>
|
||||||
{
|
{
|
||||||
public const float TIME_PREEMPT = 600;
|
public const float TIME_PREEMPT = 600;
|
||||||
public const float TIME_FADEIN = 400;
|
public const float TIME_FADEIN = 400;
|
||||||
|
@ -48,6 +48,17 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OsuScoreResult ScoreResultForOffset(double offset)
|
||||||
|
{
|
||||||
|
if (offset < HitWindowFor(OsuScoreResult.Hit300))
|
||||||
|
return OsuScoreResult.Hit300;
|
||||||
|
if (offset < HitWindowFor(OsuScoreResult.Hit100))
|
||||||
|
return OsuScoreResult.Hit100;
|
||||||
|
if (offset < HitWindowFor(OsuScoreResult.Hit50))
|
||||||
|
return OsuScoreResult.Hit50;
|
||||||
|
return OsuScoreResult.Miss;
|
||||||
|
}
|
||||||
|
|
||||||
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
||||||
{
|
{
|
||||||
base.SetDefaultsFromBeatmap(beatmap);
|
base.SetDefaultsFromBeatmap(beatmap);
|
||||||
|
@ -13,9 +13,9 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
{
|
{
|
||||||
protected override HitObjectConverter<OsuHitObject> Converter => new OsuHitObjectConverter();
|
protected override HitObjectConverter<OsuHitObject> Converter => new OsuHitObjectConverter();
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
protected override Playfield<OsuHitObject> CreatePlayfield() => new OsuPlayfield();
|
||||||
|
|
||||||
protected override DrawableHitObject GetVisualRepresentation(OsuHitObject h)
|
protected override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)
|
||||||
{
|
{
|
||||||
if (h is HitCircle)
|
if (h is HitCircle)
|
||||||
return new DrawableHitCircle(h as HitCircle);
|
return new DrawableHitCircle(h as HitCircle);
|
||||||
|
@ -11,10 +11,11 @@ using osu.Game.Modes.Osu.Objects.Drawables.Connections;
|
|||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
|
using osu.Game.Modes.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.UI
|
namespace osu.Game.Modes.Osu.UI
|
||||||
{
|
{
|
||||||
public class OsuPlayfield : Playfield
|
public class OsuPlayfield : Playfield<OsuHitObject>
|
||||||
{
|
{
|
||||||
private Container approachCircles;
|
private Container approachCircles;
|
||||||
private Container judgementLayer;
|
private Container judgementLayer;
|
||||||
@ -59,7 +60,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject<OsuHitObject> h)
|
||||||
{
|
{
|
||||||
h.Depth = (float)h.HitObject.StartTime;
|
h.Depth = (float)h.HitObject.StartTime;
|
||||||
IDrawableHitObjectWithProxiedApproach c = h as IDrawableHitObjectWithProxiedApproach;
|
IDrawableHitObjectWithProxiedApproach c = h as IDrawableHitObjectWithProxiedApproach;
|
||||||
@ -80,9 +81,9 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
.OrderBy(h => h.StartTime);
|
.OrderBy(h => h.StartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void judgement(DrawableHitObject h, JudgementInfo j)
|
private void judgement(DrawableHitObject<OsuHitObject> h, JudgementInfo j)
|
||||||
{
|
{
|
||||||
HitExplosion explosion = new HitExplosion((OsuJudgementInfo)j, (OsuHitObject)h.HitObject);
|
HitExplosion explosion = new HitExplosion((OsuJudgementInfo)j, h.HitObject);
|
||||||
|
|
||||||
judgementLayer.Add(explosion);
|
judgementLayer.Add(explosion);
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
{
|
{
|
||||||
protected override HitObjectConverter<TaikoBaseHit> Converter => new TaikoConverter();
|
protected override HitObjectConverter<TaikoBaseHit> Converter => new TaikoConverter();
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new TaikoPlayfield();
|
protected override Playfield<TaikoBaseHit> CreatePlayfield() => new TaikoPlayfield();
|
||||||
|
|
||||||
protected override DrawableHitObject GetVisualRepresentation(TaikoBaseHit h) => null;// new DrawableTaikoHit(h);
|
protected override DrawableHitObject<TaikoBaseHit> GetVisualRepresentation(TaikoBaseHit h) => null;// new DrawableTaikoHit(h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,15 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
using osu.Game.Modes.Taiko.Objects;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.UI
|
namespace osu.Game.Modes.Taiko.UI
|
||||||
{
|
{
|
||||||
public class TaikoPlayfield : Playfield
|
public class TaikoPlayfield : Playfield<TaikoBaseHit>
|
||||||
{
|
{
|
||||||
public TaikoPlayfield()
|
public TaikoPlayfield()
|
||||||
{
|
{
|
||||||
|
@ -16,8 +16,6 @@ namespace osu.Game.Modes.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public abstract class DrawableHitObject : Container, IStateful<ArmedState>
|
public abstract class DrawableHitObject : Container, IStateful<ArmedState>
|
||||||
{
|
{
|
||||||
public event Action<DrawableHitObject, JudgementInfo> OnJudgement;
|
|
||||||
|
|
||||||
public override bool HandleInput => Interactive;
|
public override bool HandleInput => Interactive;
|
||||||
|
|
||||||
public bool Interactive = true;
|
public bool Interactive = true;
|
||||||
@ -26,12 +24,7 @@ namespace osu.Game.Modes.Objects.Drawables
|
|||||||
|
|
||||||
public abstract JudgementInfo CreateJudgementInfo();
|
public abstract JudgementInfo CreateJudgementInfo();
|
||||||
|
|
||||||
public HitObject HitObject;
|
protected abstract void UpdateState(ArmedState state);
|
||||||
|
|
||||||
public DrawableHitObject(HitObject hitObject)
|
|
||||||
{
|
|
||||||
HitObject = hitObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ArmedState state;
|
private ArmedState state;
|
||||||
public ArmedState State
|
public ArmedState State
|
||||||
@ -52,20 +45,11 @@ namespace osu.Game.Modes.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleChannel sample;
|
protected SampleChannel Sample;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(AudioManager audio)
|
|
||||||
{
|
|
||||||
string hitType = ((HitObject.Sample?.Type ?? SampleType.None) == SampleType.None ? SampleType.Normal : HitObject.Sample.Type).ToString().ToLower();
|
|
||||||
string sampleSet = (HitObject.Sample?.Set ?? SampleSet.Normal).ToString().ToLower();
|
|
||||||
|
|
||||||
sample = audio.Sample.Get($@"Gameplay/{sampleSet}-hit{hitType}");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void PlaySample()
|
protected virtual void PlaySample()
|
||||||
{
|
{
|
||||||
sample?.Play();
|
Sample?.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -81,18 +65,18 @@ namespace osu.Game.Modes.Objects.Drawables
|
|||||||
|
|
||||||
Expire(true);
|
Expire(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<DrawableHitObject> nestedHitObjects;
|
public abstract class DrawableHitObject<HitObjectType> : DrawableHitObject
|
||||||
|
where HitObjectType : HitObject
|
||||||
|
{
|
||||||
|
public event Action<DrawableHitObject<HitObjectType>, JudgementInfo> OnJudgement;
|
||||||
|
|
||||||
protected IEnumerable<DrawableHitObject> NestedHitObjects => nestedHitObjects;
|
public HitObjectType HitObject;
|
||||||
|
|
||||||
protected void AddNested(DrawableHitObject h)
|
public DrawableHitObject(HitObjectType hitObject)
|
||||||
{
|
{
|
||||||
if (nestedHitObjects == null)
|
HitObject = hitObject;
|
||||||
nestedHitObjects = new List<DrawableHitObject>();
|
|
||||||
|
|
||||||
h.OnJudgement += (d, j) => { OnJudgement?.Invoke(d, j); } ;
|
|
||||||
nestedHitObjects.Add(h);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -143,7 +127,27 @@ namespace osu.Game.Modes.Objects.Drawables
|
|||||||
UpdateJudgement(false);
|
UpdateJudgement(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void UpdateState(ArmedState state);
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(AudioManager audio)
|
||||||
|
{
|
||||||
|
string hitType = ((HitObject.Sample?.Type ?? SampleType.None) == SampleType.None ? SampleType.Normal : HitObject.Sample.Type).ToString().ToLower();
|
||||||
|
string sampleSet = (HitObject.Sample?.Set ?? SampleSet.Normal).ToString().ToLower();
|
||||||
|
|
||||||
|
Sample = audio.Sample.Get($@"Gameplay/{sampleSet}-hit{hitType}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DrawableHitObject<HitObjectType>> nestedHitObjects;
|
||||||
|
|
||||||
|
protected IEnumerable<DrawableHitObject<HitObjectType>> NestedHitObjects => nestedHitObjects;
|
||||||
|
|
||||||
|
protected void AddNested(DrawableHitObject<HitObjectType> h)
|
||||||
|
{
|
||||||
|
if (nestedHitObjects == null)
|
||||||
|
nestedHitObjects = new List<DrawableHitObject<HitObjectType>>();
|
||||||
|
|
||||||
|
h.OnJudgement += (d, j) => { OnJudgement?.Invoke(d, j); } ;
|
||||||
|
nestedHitObjects.Add(h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ArmedState
|
public enum ArmedState
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
public event Action OnAllJudged;
|
public event Action OnAllJudged;
|
||||||
|
|
||||||
public InputManager InputManager;
|
public abstract bool AllObjectsJudged { get; }
|
||||||
|
|
||||||
protected void TriggerOnJudgement(JudgementInfo j)
|
protected void TriggerOnJudgement(JudgementInfo j)
|
||||||
{
|
{
|
||||||
@ -28,18 +28,20 @@ namespace osu.Game.Modes.UI
|
|||||||
if (AllObjectsJudged)
|
if (AllObjectsJudged)
|
||||||
OnAllJudged?.Invoke();
|
OnAllJudged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Playfield Playfield;
|
|
||||||
|
|
||||||
public bool AllObjectsJudged => Playfield.HitObjects.Children.First()?.Judgement.Result != null; //reverse depth sort means First() instead of Last().
|
|
||||||
|
|
||||||
public IEnumerable<DrawableHitObject> DrawableObjects => Playfield.HitObjects.Children;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class HitRenderer<T> : HitRenderer
|
public abstract class HitRenderer<TObject> : HitRenderer
|
||||||
where T : HitObject
|
where TObject : HitObject
|
||||||
{
|
{
|
||||||
private List<T> objects;
|
private List<TObject> objects;
|
||||||
|
|
||||||
|
public InputManager InputManager;
|
||||||
|
|
||||||
|
protected Playfield<TObject> Playfield;
|
||||||
|
|
||||||
|
public override bool AllObjectsJudged => Playfield.HitObjects.Children.First()?.Judgement.Result != null; //reverse depth sort means First() instead of Last().
|
||||||
|
|
||||||
|
public IEnumerable<DrawableHitObject> DrawableObjects => Playfield.HitObjects.Children;
|
||||||
|
|
||||||
public Beatmap Beatmap
|
public Beatmap Beatmap
|
||||||
{
|
{
|
||||||
@ -51,11 +53,11 @@ namespace osu.Game.Modes.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Playfield CreatePlayfield();
|
protected abstract Playfield<TObject> CreatePlayfield();
|
||||||
|
|
||||||
protected abstract HitObjectConverter<T> Converter { get; }
|
protected abstract HitObjectConverter<TObject> Converter { get; }
|
||||||
|
|
||||||
protected virtual List<T> Convert(Beatmap beatmap) => Converter.Convert(beatmap);
|
protected virtual List<TObject> Convert(Beatmap beatmap) => Converter.Convert(beatmap);
|
||||||
|
|
||||||
public HitRenderer()
|
public HitRenderer()
|
||||||
{
|
{
|
||||||
@ -76,9 +78,9 @@ namespace osu.Game.Modes.UI
|
|||||||
private void loadObjects()
|
private void loadObjects()
|
||||||
{
|
{
|
||||||
if (objects == null) return;
|
if (objects == null) return;
|
||||||
foreach (T h in objects)
|
foreach (TObject h in objects)
|
||||||
{
|
{
|
||||||
var drawableObject = GetVisualRepresentation(h);
|
DrawableHitObject<TObject> drawableObject = GetVisualRepresentation(h);
|
||||||
|
|
||||||
if (drawableObject == null) continue;
|
if (drawableObject == null) continue;
|
||||||
|
|
||||||
@ -89,8 +91,8 @@ namespace osu.Game.Modes.UI
|
|||||||
Playfield.PostProcess();
|
Playfield.PostProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onJudgement(DrawableHitObject o, JudgementInfo j) => TriggerOnJudgement(j);
|
private void onJudgement(DrawableHitObject<TObject> o, JudgementInfo j) => TriggerOnJudgement(j);
|
||||||
|
|
||||||
protected abstract DrawableHitObject GetVisualRepresentation(T h);
|
protected abstract DrawableHitObject<TObject> GetVisualRepresentation(TObject h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,16 +6,25 @@ using OpenTK;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
public abstract class Playfield : Container
|
public abstract class Playfield<T> : Container
|
||||||
|
where T : HitObject
|
||||||
{
|
{
|
||||||
public HitObjectContainer HitObjects;
|
public HitObjectContainer<DrawableHitObject<T>> HitObjects;
|
||||||
private Container<Drawable> scaledContent;
|
|
||||||
|
|
||||||
public virtual void Add(DrawableHitObject h) => HitObjects.Add(h);
|
public virtual void Add(DrawableHitObject<T> h) => HitObjects.Add(h);
|
||||||
|
|
||||||
|
public class HitObjectContainer<U> : Container<U>
|
||||||
|
where U : Drawable
|
||||||
|
{
|
||||||
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Container<Drawable> scaledContent;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
@ -37,7 +46,7 @@ namespace osu.Game.Modes.UI
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(HitObjects = new HitObjectContainer
|
Add(HitObjects = new HitObjectContainer<DrawableHitObject<T>>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
});
|
});
|
||||||
|
@ -4,12 +4,10 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Modes;
|
using osu.Game.Modes;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@ -18,24 +16,18 @@ using osu.Game.Screens.Ranking;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Transforms;
|
using osu.Framework.Graphics.Transforms;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Input;
|
|
||||||
using osu.Framework.Input.Handlers;
|
|
||||||
using osu.Game.Graphics.Cursor;
|
|
||||||
using osu.Game.Input.Handlers;
|
using osu.Game.Input.Handlers;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
public class Player : OsuScreen
|
public class Player : OsuScreen
|
||||||
{
|
{
|
||||||
public bool Autoplay;
|
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
||||||
|
|
||||||
internal override bool ShowOverlays => false;
|
internal override bool ShowOverlays => false;
|
||||||
@ -148,9 +140,6 @@ namespace osu.Game.Screens.Play
|
|||||||
//bind ScoreProcessor to ourselves (for a fail situation)
|
//bind ScoreProcessor to ourselves (for a fail situation)
|
||||||
scoreProcessor.Failed += onFail;
|
scoreProcessor.Failed += onFail;
|
||||||
|
|
||||||
if (Autoplay)
|
|
||||||
hitRenderer.Schedule(() => hitRenderer.DrawableObjects.ForEach(h => h.State = ArmedState.Hit));
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
|
Reference in New Issue
Block a user