mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 23:12:55 +08:00
Merge pull request #239 from Tom94/hitobject-improvements
Hitobject improvements
This commit is contained in:
commit
b93ebea5c1
@ -42,7 +42,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
objects.Add(new HitCircle()
|
objects.Add(new HitCircle()
|
||||||
{
|
{
|
||||||
StartTime = time,
|
StartTime = time,
|
||||||
Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384))
|
Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)),
|
||||||
|
Scale = RNG.NextSingle(0.5f, 1.0f),
|
||||||
});
|
});
|
||||||
|
|
||||||
time += RNG.Next(50, 500);
|
time += RNG.Next(50, 500);
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableHitCircle : DrawableOsuHitObject
|
public class DrawableHitCircle : DrawableOsuHitObject
|
||||||
{
|
{
|
||||||
private OsuHitObject osuObject;
|
private HitCircle osuObject;
|
||||||
|
|
||||||
public ApproachCircle ApproachCircle;
|
public ApproachCircle ApproachCircle;
|
||||||
private CirclePiece circle;
|
private CirclePiece circle;
|
||||||
@ -23,12 +23,13 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
private NumberPiece number;
|
private NumberPiece number;
|
||||||
private GlowPiece glow;
|
private GlowPiece glow;
|
||||||
|
|
||||||
public DrawableHitCircle(OsuHitObject h) : base(h)
|
public DrawableHitCircle(HitCircle h) : base(h)
|
||||||
{
|
{
|
||||||
osuObject = h;
|
osuObject = h;
|
||||||
|
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
Position = osuObject.Position;
|
Position = osuObject.Position;
|
||||||
|
Scale = new Vector2(osuObject.Scale);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -104,7 +105,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
ApproachCircle.Alpha = 0;
|
ApproachCircle.Alpha = 0;
|
||||||
ApproachCircle.Scale = new Vector2(2);
|
ApproachCircle.Scale = new Vector2(2);
|
||||||
explode.Alpha = 0;
|
explode.Alpha = 0;
|
||||||
Scale = new Vector2(0.5f); //this will probably need to be moved to DrawableHitObject at some point.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdatePreemptState()
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
|
||||||
|
@ -27,24 +27,32 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
|
|
||||||
slider = s;
|
slider = s;
|
||||||
|
|
||||||
Origin = Anchor.TopLeft;
|
|
||||||
Position = Vector2.Zero;
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
body = new SliderBody(s)
|
body = new SliderBody(s)
|
||||||
{
|
{
|
||||||
Position = s.Position,
|
Position = s.Position,
|
||||||
PathWidth = 36,
|
PathWidth = s.Scale * 72,
|
||||||
|
},
|
||||||
|
bouncer1 = new SliderBouncer(s, false)
|
||||||
|
{
|
||||||
|
Position = s.Curve.PositionAt(1),
|
||||||
|
Scale = new Vector2(s.Scale),
|
||||||
|
},
|
||||||
|
bouncer2 = new SliderBouncer(s, true)
|
||||||
|
{
|
||||||
|
Position = s.Position,
|
||||||
|
Scale = new Vector2(s.Scale),
|
||||||
|
},
|
||||||
|
ball = new SliderBall(s)
|
||||||
|
{
|
||||||
|
Scale = new Vector2(s.Scale),
|
||||||
},
|
},
|
||||||
bouncer1 = new SliderBouncer(slider, false) { Position = slider.Curve.PositionAt(1) },
|
|
||||||
bouncer2 = new SliderBouncer(slider, true) { Position = slider.Position },
|
|
||||||
ball = new SliderBall(slider),
|
|
||||||
initialCircle = new DrawableHitCircle(new HitCircle
|
initialCircle = new DrawableHitCircle(new HitCircle
|
||||||
{
|
{
|
||||||
StartTime = s.StartTime,
|
StartTime = s.StartTime,
|
||||||
Position = s.Position,
|
Position = s.Position,
|
||||||
|
Scale = s.Scale,
|
||||||
Colour = s.Colour,
|
Colour = s.Colour,
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
@ -58,6 +66,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
components.Add(bouncer2);
|
components.Add(bouncer2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since the DrawableSlider itself is just a container without a size we need to
|
||||||
|
// pass all input through.
|
||||||
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
private readonly Slider slider;
|
private readonly Slider slider;
|
||||||
private Box follow;
|
private Box follow;
|
||||||
|
|
||||||
const float width = 70;
|
const float width = 140;
|
||||||
|
|
||||||
public SliderBall(Slider slider)
|
public SliderBall(Slider slider)
|
||||||
{
|
{
|
||||||
@ -25,7 +25,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
BlendingMode = BlendingMode.Additive;
|
BlendingMode = BlendingMode.Additive;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
BorderThickness = 5;
|
BorderThickness = 10;
|
||||||
BorderColour = Color4.Orange;
|
BorderColour = Color4.Orange;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -45,7 +45,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
BorderThickness = 7,
|
BorderThickness = 14,
|
||||||
BorderColour = Color4.White,
|
BorderColour = Color4.White,
|
||||||
Alpha = 1,
|
Alpha = 1,
|
||||||
CornerRadius = width / 2,
|
CornerRadius = width / 2,
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
Icon = FontAwesome.fa_eercast,
|
Icon = FontAwesome.fa_eercast,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
TextSize = 24,
|
TextSize = 48,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using osu.Game.Beatmaps.Samples;
|
using osu.Game.Beatmaps.Samples;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.Objects
|
namespace osu.Game.Modes.Osu.Objects
|
||||||
{
|
{
|
||||||
@ -12,8 +13,17 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
{
|
{
|
||||||
public Vector2 Position { get; set; }
|
public Vector2 Position { get; set; }
|
||||||
|
|
||||||
|
public float Scale { get; set; } = 1;
|
||||||
|
|
||||||
public virtual Vector2 EndPosition => Position;
|
public virtual Vector2 EndPosition => Position;
|
||||||
|
|
||||||
|
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
||||||
|
{
|
||||||
|
base.SetDefaultsFromBeatmap(beatmap);
|
||||||
|
|
||||||
|
Scale = (1.0f - 0.7f * (beatmap.BeatmapInfo.BaseDifficulty.CircleSize - 5) / 5) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
internal enum HitObjectType
|
internal enum HitObjectType
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using System;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.Objects
|
namespace osu.Game.Modes.Osu.Objects
|
||||||
@ -18,6 +16,8 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
|
|
||||||
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
||||||
{
|
{
|
||||||
|
base.SetDefaultsFromBeatmap(beatmap);
|
||||||
|
|
||||||
Velocity = 100 / beatmap.BeatLengthAt(StartTime, true) * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
|
Velocity = 100 / beatmap.BeatLengthAt(StartTime, true) * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ namespace osu.Game.Modes.UI
|
|||||||
public class ScaledContainer : Container
|
public class ScaledContainer : Container
|
||||||
{
|
{
|
||||||
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
|
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
|
||||||
|
|
||||||
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class HitObjectContainer : Container<DrawableHitObject>
|
public class HitObjectContainer : Container<DrawableHitObject>
|
||||||
|
Loading…
Reference in New Issue
Block a user