mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' of github.com:ppy/osu into better-clocks
# Conflicts: # osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs
This commit is contained in:
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Framework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
{
|
||||
@ -14,6 +15,10 @@ namespace osu.Game.GameModes.Play
|
||||
{
|
||||
public Action<HitObject> OnHit;
|
||||
public Action<HitObject> OnMiss;
|
||||
|
||||
protected Playfield Playfield;
|
||||
|
||||
public IEnumerable<DrawableHitObject> DrawableObjects => Playfield.Children.Cast<DrawableHitObject>();
|
||||
}
|
||||
|
||||
public abstract class HitRenderer<T> : HitRenderer
|
||||
@ -31,8 +36,6 @@ namespace osu.Game.GameModes.Play
|
||||
}
|
||||
}
|
||||
|
||||
private Playfield playfield;
|
||||
|
||||
protected abstract Playfield CreatePlayfield();
|
||||
|
||||
protected abstract HitObjectConverter<T> Converter { get; }
|
||||
@ -47,7 +50,7 @@ namespace osu.Game.GameModes.Play
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
playfield = CreatePlayfield()
|
||||
Playfield = CreatePlayfield()
|
||||
};
|
||||
|
||||
loadObjects();
|
||||
@ -65,7 +68,7 @@ namespace osu.Game.GameModes.Play
|
||||
drawableObject.OnHit = onHit;
|
||||
drawableObject.OnMiss = onMiss;
|
||||
|
||||
playfield.Add(drawableObject);
|
||||
Playfield.Add(drawableObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,26 +12,48 @@ namespace osu.Game.GameModes.Play.Osu
|
||||
{
|
||||
public class OsuPlayfield : Playfield
|
||||
{
|
||||
public OsuPlayfield()
|
||||
protected override Container Content => hitObjectContainer;
|
||||
|
||||
private Container hitObjectContainer;
|
||||
|
||||
public override Vector2 Size
|
||||
{
|
||||
Size = new Vector2(512, 384);
|
||||
Scale = new Vector2(1.6f);
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
get
|
||||
{
|
||||
var parentSize = Parent.DrawSize;
|
||||
var aspectSize = parentSize.X * 0.75f < parentSize.Y ? new Vector2(parentSize.X, parentSize.X * 0.75f) : new Vector2(parentSize.Y * 4f / 3f, parentSize.Y);
|
||||
|
||||
return new Vector2(aspectSize.X / parentSize.X, aspectSize.Y / parentSize.Y) * base.Size;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
public OsuPlayfield()
|
||||
{
|
||||
base.Load(game);
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Size = new Vector2(0.75f);
|
||||
|
||||
Add(new Box()
|
||||
AddInternal(new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.5f
|
||||
Alpha = 0.5f,
|
||||
});
|
||||
|
||||
AddInternal(hitObjectContainer = new HitObjectContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
});
|
||||
}
|
||||
|
||||
class HitObjectContainer : Container
|
||||
{
|
||||
protected override Vector2 ChildScale => new Vector2(0.625f);
|
||||
}
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.GameModes.Play.Catch;
|
||||
@ -12,13 +11,15 @@ using osu.Game.GameModes.Play.Taiko;
|
||||
using osu.Framework;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
{
|
||||
public class Player : OsuGameMode
|
||||
{
|
||||
const bool autoplay = false;
|
||||
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
||||
|
||||
public BeatmapInfo BeatmapInfo;
|
||||
@ -124,6 +125,9 @@ namespace osu.Game.GameModes.Play
|
||||
hitRenderer.OnHit += delegate (HitObject h) { scoreOverlay.OnHit(h); };
|
||||
hitRenderer.OnMiss += delegate (HitObject h) { scoreOverlay.OnMiss(h); };
|
||||
|
||||
if (autoplay)
|
||||
hitRenderer.Schedule(() => hitRenderer.DrawableObjects.ForEach(h => h.State = ArmedState.Armed));
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
hitRenderer,
|
||||
|
Reference in New Issue
Block a user